• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang -target riscv32-unknown-elf %s -S -emit-llvm -o - \
2 // RUN:   | FileCheck %s -check-prefix=RV32-DEFAULT
3 // RUN: %clang -target riscv32-unknown-elf %s -S -emit-llvm -G4 -o - \
4 // RUN:   | FileCheck %s -check-prefix=RV32-G4
5 // RUN: %clang -target riscv32-unknown-elf %s -S -emit-llvm -msmall-data-limit=0 -o - \
6 // RUN:   | FileCheck %s -check-prefix=RV32-S0
7 // RUN: %clang -target riscv32-unknown-elf %s -S -emit-llvm -msmall-data-limit=2 -G4 -o - \
8 // RUN:   | FileCheck %s -check-prefix=RV32-S2G4
9 // RUN: %clang -target riscv32-unknown-elf %s -S -emit-llvm -msmall-data-threshold=16 -o - \
10 // RUN:   | FileCheck %s -check-prefix=RV32-T16
11 // RUN: %clang -target riscv32-unknown-elf %s -S -emit-llvm -fpic -o - \
12 // RUN:   | FileCheck %s -check-prefix=RV32-PIC
13 
14 // RUN: %clang -target riscv64-unknown-elf %s -S -emit-llvm -o - \
15 // RUN:   | FileCheck %s -check-prefix=RV64-DEFAULT
16 // RUN: %clang -target riscv64-unknown-elf %s -S -emit-llvm -G4 -o - \
17 // RUN:   | FileCheck %s -check-prefix=RV64-G4
18 // RUN: %clang -target riscv64-unknown-elf %s -S -emit-llvm -msmall-data-limit=0 -o - \
19 // RUN:   | FileCheck %s -check-prefix=RV64-S0
20 // RUN: %clang -target riscv64-unknown-elf %s -S -emit-llvm -msmall-data-limit=2 -G4 -o - \
21 // RUN:   | FileCheck %s -check-prefix=RV64-S2G4
22 // RUN: %clang -target riscv64-unknown-elf %s -S -emit-llvm -msmall-data-threshold=16 -o - \
23 // RUN:   | FileCheck %s -check-prefix=RV64-T16
24 // RUN: %clang -target riscv64-unknown-elf %s -S -emit-llvm -fpic -o - \
25 // RUN:   | FileCheck %s -check-prefix=RV64-PIC
26 // RUN: %clang -target riscv64-unknown-elf %s -S -emit-llvm -mcmodel=large -o - \
27 // RUN:   | FileCheck %s -check-prefix=RV64-LARGE
28 
test()29 void test() {}
30 
31 // RV32-DEFAULT: !{i32 1, !"SmallDataLimit", i32 8}
32 // RV32-G4:      !{i32 1, !"SmallDataLimit", i32 4}
33 // RV32-S0:      !{i32 1, !"SmallDataLimit", i32 0}
34 // RV32-S2G4:    !{i32 1, !"SmallDataLimit", i32 4}
35 // RV32-T16:     !{i32 1, !"SmallDataLimit", i32 16}
36 // RV32-PIC:     !{i32 1, !"SmallDataLimit", i32 0}
37 
38 // RV64-DEFAULT: !{i32 1, !"SmallDataLimit", i32 8}
39 // RV64-G4:      !{i32 1, !"SmallDataLimit", i32 4}
40 // RV64-S0:      !{i32 1, !"SmallDataLimit", i32 0}
41 // RV64-S2G4:    !{i32 1, !"SmallDataLimit", i32 4}
42 // RV64-T16:     !{i32 1, !"SmallDataLimit", i32 16}
43 // RV64-PIC:     !{i32 1, !"SmallDataLimit", i32 0}
44 // RV64-LARGE:   !{i32 1, !"SmallDataLimit", i32 0}
45 
46 // The value will be passed by module flag instead of target feature.
47 // RV32-S0-NOT: +small-data-limit=
48 // RV64-S0-NOT: +small-data-limit=
49