| 1 |
|
| 2 |
// RUN: %clang --target=riscv32-unknown-elf -### %s -fsyntax-only 2>&1 | FileCheck %s |
| 3 |
// RUN: %clang --target=riscv64-unknown-elf -### %s -fsyntax-only 2>&1 | FileCheck %s |
| 4 |
// RUN: %clang --target=riscv64-linux-android -### %s -fsyntax-only 2>&1 | FileCheck %s -check-prefixes=ANDROID,DEFAULT,FAST-SCALAR-UNALIGNED-ACCESS,FAST-VECTOR-UNALIGNED-ACCESS |
| 5 |
// RUN: %clang -mabi=lp64d --target=riscv64-linux-android -### %s -fsyntax-only 2>&1 | FileCheck %s -check-prefixes=ANDROID,DEFAULT,FAST-SCALAR-UNALIGNED-ACCESS,FAST-VECTOR-UNALIGNED-ACCESS |
| 6 |
// RUN: %clang -mabi=lp64d --target=riscv64-linux-android -mstrict-align -mvector-strict-align -### %s -fsyntax-only 2>&1 | FileCheck %s -check-prefixes=NO-FAST-SCALAR-UNALIGNED-ACCESS,NO-FAST-VECTOR-UNALIGNED-ACCESS |
| 7 |
|
| 8 |
|
| 9 |
// CHECK: fno-signed-char |
| 10 |
|
| 11 |
// RUN: %clang --target=riscv32-unknown-elf -### %s 2>&1 | FileCheck %s -check-prefix=DEFAULT |
| 12 |
|
| 13 |
// RUN: %clang --target=riscv32-unknown-elf -### %s -mrelax 2>&1 | FileCheck %s -check-prefix=RELAX |
| 14 |
// RUN: %clang --target=riscv32-unknown-elf -### %s -mno-relax 2>&1 | FileCheck %s -check-prefix=NO-RELAX |
| 15 |
|
| 16 |
// ANDROID: "-target-feature" "+v" |
| 17 |
// ANDROID: "-target-feature" "+zba" |
| 18 |
// ANDROID: "-target-feature" "+zbb" |
| 19 |
// ANDROID: "-target-feature" "+zbs" |
| 20 |
// RELAX: "-target-feature" "+relax" |
| 21 |
// NO-RELAX: "-target-feature" "-relax" |
| 22 |
// DEFAULT: "-target-feature" "+relax" |
| 23 |
// DEFAULT-NOT: "-target-feature" "-relax" |
| 24 |
|
| 25 |
// RUN: %clang --target=riscv32-unknown-elf -### %s -msave-restore 2>&1 | FileCheck %s -check-prefix=SAVE-RESTORE |
| 26 |
// RUN: %clang --target=riscv32-unknown-elf -### %s -mno-save-restore 2>&1 | FileCheck %s -check-prefix=NO-SAVE-RESTORE |
| 27 |
|
| 28 |
// SAVE-RESTORE: "-target-feature" "+save-restore" |
| 29 |
// NO-SAVE-RESTORE: "-target-feature" "-save-restore" |
| 30 |
// DEFAULT-NOT: "-target-feature" "-save-restore" |
| 31 |
// DEFAULT-NOT: "-target-feature" "+save-restore" |
| 32 |
|
| 33 |
// RUN: %clang --target=riscv32-unknown-elf -### %s -mno-strict-align 2>&1 | FileCheck %s -check-prefixes=FAST-SCALAR-UNALIGNED-ACCESS,FAST-VECTOR-UNALIGNED-ACCESS |
| 34 |
// RUN: %clang --target=riscv32-unknown-elf -### %s -mstrict-align 2>&1 | FileCheck %s -check-prefixes=NO-FAST-SCALAR-UNALIGNED-ACCESS,NO-FAST-VECTOR-UNALIGNED-ACCESS |
| 35 |
// RUN: %clang --target=riscv32-unknown-elf -### %s -mno-scalar-strict-align 2>&1 | FileCheck %s -check-prefix=FAST-SCALAR-UNALIGNED-ACCESS |
| 36 |
// RUN: %clang --target=riscv32-unknown-elf -### %s -mscalar-strict-align 2>&1 | FileCheck %s -check-prefix=NO-FAST-SCALAR-UNALIGNED-ACCESS |
| 37 |
// RUN: %clang --target=riscv32-unknown-elf -### %s -mno-scalar-strict-align -mstrict-align 2>&1 | FileCheck %s -check-prefixes=NO-FAST-SCALAR-UNALIGNED-ACCESS,NO-FAST-VECTOR-UNALIGNED-ACCESS |
| 38 |
// RUN: touch %t.o |
| 39 |
// RUN: %clang --target=riscv32-unknown-elf -### %t.o -mno-strict-align -mstrict-align |
| 40 |
|
| 41 |
// FAST-SCALAR-UNALIGNED-ACCESS: "-target-feature" "+unaligned-scalar-mem" |
| 42 |
// NO-FAST-SCALAR-UNALIGNED-ACCESS: "-target-feature" "-unaligned-scalar-mem" |
| 43 |
|
| 44 |
// RUN: %clang --target=riscv32-unknown-elf -### %s -mno-vector-strict-align 2>&1 | FileCheck %s -check-prefix=FAST-VECTOR-UNALIGNED-ACCESS |
| 45 |
// RUN: %clang --target=riscv32-unknown-elf -### %s -mvector-strict-align 2>&1 | FileCheck %s -check-prefix=NO-FAST-VECTOR-UNALIGNED-ACCESS |
| 46 |
// RUN: %clang --target=riscv32-unknown-elf -### %s -mno-vector-strict-align -mstrict-align 2>&1 | FileCheck %s -check-prefix=NO-FAST-VECTOR-UNALIGNED-ACCESS |
| 47 |
// RUN: %clang --target=riscv32-unknown-elf -### %s -mno-strict-align -mvector-strict-align 2>&1 | FileCheck %s -check-prefix=NO-FAST-VECTOR-UNALIGNED-ACCESS |
| 48 |
// FAST-VECTOR-UNALIGNED-ACCESS: "-target-feature" "+unaligned-vector-mem" |
| 49 |
// NO-FAST-VECTOR-UNALIGNED-ACCESS: "-target-feature" "-unaligned-vector-mem" |
| 50 |
|
| 51 |
// RUN: %clang --target=riscv32-unknown-elf -### %s 2>&1 | FileCheck %s -check-prefix=NOUWTABLE |
| 52 |
// RUN: %clang --target=riscv32-unknown-elf -fasynchronous-unwind-tables -### %s 2>&1 | FileCheck %s -check-prefix=UWTABLE |
| 53 |
// RUN: %clang --target=riscv64-unknown-elf -### %s 2>&1 | FileCheck %s -check-prefix=NOUWTABLE |
| 54 |
// RUN: %clang --target=riscv64-unknown-elf -fasynchronous-unwind-tables -### %s 2>&1 | FileCheck %s -check-prefix=UWTABLE |
| 55 |
// |
| 56 |
// UWTABLE: "-funwind-tables=2" |
| 57 |
// NOUWTABLE-NOT: "-funwind-tables=2" |
| 58 |
|
| 59 |
// RUN: %clang --target=riscv32-linux -### %s -fsyntax-only 2>&1 \ |
| 60 |
// RUN: | FileCheck %s -check-prefix=DEFAULT-LINUX |
| 61 |
// RUN: %clang --target=riscv64-linux -### %s -fsyntax-only 2>&1 \ |
| 62 |
// RUN: | FileCheck %s -check-prefix=DEFAULT-LINUX |
| 63 |
|
| 64 |
// DEFAULT-LINUX: "-funwind-tables=2" |
| 65 |
// DEFAULT-LINUX-SAME: "-target-feature" "+m" |
| 66 |
// DEFAULT-LINUX-SAME: "-target-feature" "+a" |
| 67 |
// DEFAULT-LINUX-SAME: "-target-feature" "+f" |
| 68 |
// DEFAULT-LINUX-SAME: "-target-feature" "+d" |
| 69 |
// DEFAULT-LINUX-SAME: "-target-feature" "+c" |
| 70 |
|
| 71 |
// RUN: %clang -mabi=lp64d --target=riscv64-unknown-fuchsia -### %s -fsyntax-only 2>&1 | FileCheck %s -check-prefixes=FUCHSIA |
| 72 |
// FUCHSIA: "-target-feature" "+m" |
| 73 |
// FUCHSIA-SAME: "-target-feature" "+a" |
| 74 |
// FUCHSIA-SAME: "-target-feature" "+f" |
| 75 |
// FUCHSIA-SAME: "-target-feature" "+d" |
| 76 |
// FUCHSIA-SAME: "-target-feature" "+c" |
| 77 |
// FUCHSIA-SAME: "-target-feature" "+v" |
| 78 |
// FUCHSIA-SAME: "-target-feature" "+zba" |
| 79 |
// FUCHSIA-SAME: "-target-feature" "+zbb" |
| 80 |
// FUCHSIA-SAME: "-target-feature" "+zbs" |
| 81 |
|
| 82 |
|
| 83 |
// RUN: %clang --target=riscv32-unknown-elf -### -march=rv32i %s -fsyntax-only 2>&1 | FileCheck %s -check-prefix=RVI |
| 84 |
// RUN: %clang --target=riscv32-unknown-elf -### -march=rv64i %s -fsyntax-only 2>&1 | FileCheck %s -check-prefix=RVI |
| 85 |
// RUN: %clang --target=riscv32-unknown-elf -### -march=rv32e %s -fsyntax-only 2>&1 | FileCheck %s -check-prefix=RVE |
| 86 |
// RUN: %clang --target=riscv32-unknown-elf -### -march=rv64e %s -fsyntax-only 2>&1 | FileCheck %s -check-prefix=RVE |
| 87 |
|
| 88 |
// RVI: "-target-feature" "+i" |
| 89 |
// RVI-SAME: "-target-feature" "-e" |
| 90 |
|
| 91 |
// RVE: "-target-feature" "+e" |
| 92 |
// RVE-SAME: "-target-feature" "-i" |