|
| 1 | +# RUN: rm -rf %t && split-file %s %t && cd %t |
| 2 | + |
| 3 | +# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+m,+f,+d,+v noncanonicalized_arch.s -o noncanonicalized_arch.o |
| 4 | +# RUN: not llvm-objdump -d noncanonicalized_arch.o 2>&1 | FileCheck %s -DFILE=noncanonicalized_arch.o --check-prefix=NONCANON |
| 5 | + |
| 6 | +# RUN: llvm-mc -filetype=obj -triple=riscv64 invalid_arch.s -o invalid_arch.o |
| 7 | +# RUN: not llvm-objdump -d invalid_arch.o 2>&1 | FileCheck %s -DFILE=invalid_arch.o --check-prefix=INVALID |
| 8 | + |
| 9 | +# RUN: llvm-mc -filetype=obj -triple=riscv32 unknown_i_version.s -o unknown_i_version.o |
| 10 | +# RUN: llvm-objdump -d unknown_i_version.o 2>&1 | FileCheck %s --check-prefix=UNKNOWN-I-VERSION |
| 11 | + |
| 12 | +# RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+zicbom unknown_ext_version.s -o unknown_ext_version.o |
| 13 | +# RUN: llvm-objdump -d unknown_ext_version.o 2>&1 | FileCheck %s --check-prefix=UNKNOWN-EXT-VERSION |
| 14 | + |
| 15 | +# RUN: llvm-mc -filetype=obj -triple=riscv64 unknown_ext_name.s -o unknown_ext_name.o |
| 16 | +# RUN: llvm-objdump -d unknown_ext_name.o 2>&1 | FileCheck %s --check-prefix=UNKNOWN-EXT-NAME |
| 17 | + |
| 18 | +#--- noncanonicalized_arch.s |
| 19 | +# NONCANON: error: '[[FILE]]': arch string must begin with valid base ISA |
| 20 | +# NONCANON-NOT: {{.}} |
| 21 | +vsetvli a3, a2, e8, m8, tu, mu |
| 22 | + |
| 23 | +.section .riscv.attributes,"",@0x70000003 |
| 24 | +.byte 0x41 |
| 25 | +.long .Lend-.riscv.attributes-1 |
| 26 | +.asciz "riscv" # vendor |
| 27 | +.Lbegin: |
| 28 | +.byte 1 # Tag_File |
| 29 | +.long .Lend-.Lbegin |
| 30 | +.byte 5 # Tag_RISCV_arch |
| 31 | +.asciz "rv64gcv" |
| 32 | +.Lend: |
| 33 | + |
| 34 | +#--- invalid_arch.s |
| 35 | +# INVALID: error: '[[FILE]]': arch string must begin with valid base ISA |
| 36 | +# INVALID-NOT: {{.}} |
| 37 | +nop |
| 38 | + |
| 39 | +.section .riscv.attributes,"",@0x70000003 |
| 40 | +.byte 0x41 |
| 41 | +.long .Lend-.riscv.attributes-1 |
| 42 | +.asciz "riscv" # vendor |
| 43 | +.Lbegin: |
| 44 | +.byte 1 # Tag_File |
| 45 | +.long .Lend-.Lbegin |
| 46 | +.byte 5 # Tag_RISCV_arch |
| 47 | +.asciz "nonsense" |
| 48 | +.Lend: |
| 49 | + |
| 50 | +#--- unknown_i_version.s |
| 51 | +# UNKNOWN-I-VERSION: nop |
| 52 | +nop |
| 53 | + |
| 54 | +.section .riscv.attributes,"",@0x70000003 |
| 55 | +.byte 0x41 |
| 56 | +.long .Lend-.riscv.attributes-1 |
| 57 | +.asciz "riscv" # vendor |
| 58 | +.Lbegin: |
| 59 | +.byte 1 # Tag_File |
| 60 | +.long .Lend-.Lbegin |
| 61 | +.byte 5 # Tag_RISCV_arch |
| 62 | +.asciz "rv32i99p99" |
| 63 | +.Lend: |
| 64 | + |
| 65 | +#--- unknown_ext_version.s |
| 66 | +# UNKNOWN-EXT-VERSION: cbo.clean (t0) |
| 67 | +cbo.clean (t0) |
| 68 | + |
| 69 | +.section .riscv.attributes,"",@0x70000003 |
| 70 | +.byte 0x41 |
| 71 | +.long .Lend-.riscv.attributes-1 |
| 72 | +.asciz "riscv" # vendor |
| 73 | +.Lbegin: |
| 74 | +.byte 1 # Tag_File |
| 75 | +.long .Lend-.Lbegin |
| 76 | +.byte 5 # Tag_RISCV_arch |
| 77 | +.asciz "rv32i2p0_zicbom0p1" |
| 78 | +.Lend: |
| 79 | + |
| 80 | +#--- unknown_ext_name.s |
| 81 | +# UNKNOWN-EXT-NAME: nop |
| 82 | +nop |
| 83 | + |
| 84 | +.section .riscv.attributes,"",@0x70000003 |
| 85 | +.byte 0x41 |
| 86 | +.long .Lend-.riscv.attributes-1 |
| 87 | +.asciz "riscv" # vendor |
| 88 | +.Lbegin: |
| 89 | +.byte 1 # Tag_File |
| 90 | +.long .Lend-.Lbegin |
| 91 | +.byte 5 # Tag_RISCV_arch |
| 92 | +.asciz "rv32i2p0_zmadeup1p0_smadeup1p0_xmadeup1p0_sxmadeup1p0" |
| 93 | +.Lend: |
0 commit comments