File: attribute-with-option.s

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (21 lines) | stat: -rw-r--r-- 849 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
## When a user specifies an architecture extension which conflicts with an
## architecture attribute, we use the architecture attribute instead of the
## command line option.
##
## This test uses option '-mattr=+e' to specify the "e" extension. However,
## there is an architecture attribute in the file to specify rv32i. We will
## use rv32i to assemble the file instead of rv32e.

# RUN: llvm-mc %s -triple=riscv32 -mattr=+e -filetype=obj -o - \
# RUN:   | llvm-readobj -A - | FileCheck %s

.attribute arch, "rv32i2p1"
## Invalid operand for RV32E, because x16 is an invalid register for RV32E.
## Use RV32I to assemble, since it will not trigger an assembly error.
lui x16, 1

## Check that the architecture attribute is not overridden by the command line
## option.
# CHECK:      Tag: 5
# CHECK-NEXT: TagName: arch
# CHECK-NEXT: Value: rv32i2p1