|
1 | 1 | //@ compile-flags: -O -C no-prepopulate-passes
|
2 |
| -//@ revisions: riscv64 |
| 2 | +//@ revisions: riscv64 loongarch64 |
3 | 3 |
|
4 | 4 | //@[riscv64] only-riscv64
|
5 | 5 | //@[riscv64] compile-flags: --target riscv64gc-unknown-linux-gnu
|
6 | 6 | //@[riscv64] needs-llvm-components: riscv
|
7 | 7 |
|
| 8 | +//@[loongarch64] only-loongarch64 |
| 9 | +//@[loongarch64] compile-flags: --target loongarch64-unknown-linux-gnu |
| 10 | +//@[loongarch64] needs-llvm-components: loongarch |
| 11 | + |
8 | 12 | #![crate_type = "lib"]
|
9 | 13 |
|
10 | 14 | #[no_mangle]
|
11 |
| -// riscv64: define noundef i8 @arg_attr_u8(i8 noundef zeroext %x) |
| 15 | +// riscv64: define noundef i8 @arg_attr_u8(i8 noundef zeroext %x) |
| 16 | +// loongarch64: define noundef i8 @arg_attr_u8(i8 noundef zeroext %x) |
12 | 17 | pub fn arg_attr_u8(x: u8) -> u8 {
|
13 | 18 | x
|
14 | 19 | }
|
15 | 20 |
|
16 | 21 | #[no_mangle]
|
17 |
| -// riscv64: define noundef i16 @arg_attr_u16(i16 noundef zeroext %x) |
| 22 | +// riscv64: define noundef i16 @arg_attr_u16(i16 noundef zeroext %x) |
| 23 | +// loongarch64: define noundef i16 @arg_attr_u16(i16 noundef zeroext %x) |
18 | 24 | pub fn arg_attr_u16(x: u16) -> u16 {
|
19 | 25 | x
|
20 | 26 | }
|
21 | 27 |
|
22 | 28 | #[no_mangle]
|
23 |
| -// riscv64: define noundef i32 @arg_attr_u32(i32 noundef signext %x) |
| 29 | +// riscv64: define noundef i32 @arg_attr_u32(i32 noundef signext %x) |
| 30 | +// loongarch64: define noundef i32 @arg_attr_u32(i32 noundef signext %x) |
24 | 31 | pub fn arg_attr_u32(x: u32) -> u32 {
|
25 | 32 | x
|
26 | 33 | }
|
27 | 34 |
|
28 | 35 | #[no_mangle]
|
29 |
| -// riscv64: define noundef i64 @arg_attr_u64(i64 noundef %x) |
| 36 | +// riscv64: define noundef i64 @arg_attr_u64(i64 noundef %x) |
| 37 | +// loongarch64: define noundef i64 @arg_attr_u64(i64 noundef %x) |
30 | 38 | pub fn arg_attr_u64(x: u64) -> u64 {
|
31 | 39 | x
|
32 | 40 | }
|
33 | 41 |
|
34 | 42 | #[no_mangle]
|
35 |
| -// riscv64: define noundef i128 @arg_attr_u128(i128 noundef %x) |
| 43 | +// riscv64: define noundef i128 @arg_attr_u128(i128 noundef %x) |
| 44 | +// loongarch64: define noundef i128 @arg_attr_u128(i128 noundef %x) |
36 | 45 | pub fn arg_attr_u128(x: u128) -> u128 {
|
37 | 46 | x
|
38 | 47 | }
|
39 | 48 |
|
40 | 49 | #[no_mangle]
|
41 |
| -// riscv64: define noundef i8 @arg_attr_i8(i8 noundef signext %x) |
| 50 | +// riscv64: define noundef i8 @arg_attr_i8(i8 noundef signext %x) |
| 51 | +// loongarch64: define noundef i8 @arg_attr_i8(i8 noundef signext %x) |
42 | 52 | pub fn arg_attr_i8(x: i8) -> i8 {
|
43 | 53 | x
|
44 | 54 | }
|
45 | 55 |
|
46 | 56 | #[no_mangle]
|
47 |
| -// riscv64: define noundef i16 @arg_attr_i16(i16 noundef signext %x) |
| 57 | +// riscv64: define noundef i16 @arg_attr_i16(i16 noundef signext %x) |
| 58 | +// loongarch64: define noundef i16 @arg_attr_i16(i16 noundef signext %x) |
48 | 59 | pub fn arg_attr_i16(x: i16) -> i16 {
|
49 | 60 | x
|
50 | 61 | }
|
51 | 62 |
|
52 | 63 | #[no_mangle]
|
53 |
| -// riscv64: define noundef i32 @arg_attr_i32(i32 noundef signext %x) |
| 64 | +// riscv64: define noundef i32 @arg_attr_i32(i32 noundef signext %x) |
| 65 | +// loongarch64: define noundef i32 @arg_attr_i32(i32 noundef signext %x) |
54 | 66 | pub fn arg_attr_i32(x: i32) -> i32 {
|
55 | 67 | x
|
56 | 68 | }
|
57 | 69 |
|
58 | 70 | #[no_mangle]
|
59 |
| -// riscv64: define noundef i64 @arg_attr_i64(i64 noundef %x) |
| 71 | +// riscv64: define noundef i64 @arg_attr_i64(i64 noundef %x) |
| 72 | +// loongarch64: define noundef i64 @arg_attr_i64(i64 noundef %x) |
60 | 73 | pub fn arg_attr_i64(x: i64) -> i64 {
|
61 | 74 | x
|
62 | 75 | }
|
63 | 76 |
|
64 | 77 | #[no_mangle]
|
65 |
| -// riscv64: define noundef i128 @arg_attr_i128(i128 noundef %x) |
| 78 | +// riscv64: define noundef i128 @arg_attr_i128(i128 noundef %x) |
| 79 | +// loongarch64: define noundef i128 @arg_attr_i128(i128 noundef %x) |
66 | 80 | pub fn arg_attr_i128(x: i128) -> i128 {
|
67 | 81 | x
|
68 | 82 | }
|
69 | 83 |
|
70 | 84 | #[no_mangle]
|
71 |
| -// riscv64: define noundef zeroext i1 @arg_attr_bool(i1 noundef zeroext %x) |
| 85 | +// riscv64: define noundef zeroext i1 @arg_attr_bool(i1 noundef zeroext %x) |
| 86 | +// loongarch64: define noundef zeroext i1 @arg_attr_bool(i1 noundef zeroext %x) |
72 | 87 | pub fn arg_attr_bool(x: bool) -> bool {
|
73 | 88 | x
|
74 | 89 | }
|
75 | 90 |
|
76 | 91 | #[no_mangle]
|
77 | 92 | // ignore-tidy-linelength
|
78 |
| -// riscv64: define noundef{{( range\(i32 0, 1114112\))?}} i32 @arg_attr_char(i32 noundef signext{{( range\(i32 0, 1114112\))?}} %x) |
| 93 | +// riscv64: define noundef{{( range\(i32 0, 1114112\))?}} i32 @arg_attr_char(i32 noundef signext{{( range\(i32 0, 1114112\))?}} %x) |
| 94 | +// loongarch64: define noundef{{( range\(i32 0, 1114112\))?}} i32 @arg_attr_char(i32 noundef signext{{( range\(i32 0, 1114112\))?}} %x) |
79 | 95 | pub fn arg_attr_char(x: char) -> char {
|
80 | 96 | x
|
81 | 97 | }
|
82 | 98 |
|
83 | 99 | #[no_mangle]
|
84 |
| -// riscv64: define noundef float @arg_attr_f32(float noundef %x) |
| 100 | +// riscv64: define noundef float @arg_attr_f32(float noundef %x) |
| 101 | +// loongarch64: define noundef float @arg_attr_f32(float noundef %x) |
85 | 102 | pub fn arg_attr_f32(x: f32) -> f32 {
|
86 | 103 | x
|
87 | 104 | }
|
88 | 105 |
|
89 | 106 | #[no_mangle]
|
90 |
| -// riscv64: define noundef double @arg_attr_f64(double noundef %x) |
| 107 | +// riscv64: define noundef double @arg_attr_f64(double noundef %x) |
| 108 | +// loongarch64: define noundef double @arg_attr_f64(double noundef %x) |
91 | 109 | pub fn arg_attr_f64(x: f64) -> f64 {
|
92 | 110 | x
|
93 | 111 | }
|
0 commit comments