Skip to content

Commit c0ddc4d

Browse files
authored
[CIR][CIRGen][NFC] Consolidate RUN lines for builtin tests (#968)
There is no change to testing functionality. This refacot let those files have the same Run options that is easier to maintain and extend.
1 parent 686294e commit c0ddc4d

File tree

4 files changed

+292
-291
lines changed

4 files changed

+292
-291
lines changed

clang/test/CIR/CodeGen/builtin-assume.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-cir %s -o %t.cir
1+
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
22
// RUN: FileCheck %s --check-prefix=CIR --input-file=%t.cir
33

44
int test_assume(int x) {
Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,186 +1,186 @@
1-
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++17 -fclangir -emit-cir %s -o %t.cir
2-
// RUN: FileCheck --input-file=%t.cir %s
1+
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
2+
// RUN: FileCheck %s --check-prefix=CIR --input-file=%t.cir
33

44
int test_builtin_clrsb(int x) {
55
return __builtin_clrsb(x);
66
}
77

8-
// CHECK: cir.func @_Z18test_builtin_clrsbi
9-
// CHECK: %{{.+}} = cir.bit.clrsb(%{{.+}} : !s32i) : !s32i
10-
// CHECK: }
8+
// CIR: cir.func @_Z18test_builtin_clrsbi
9+
// CIR: %{{.+}} = cir.bit.clrsb(%{{.+}} : !s32i) : !s32i
10+
// CIR: }
1111

1212
int test_builtin_clrsbl(long x) {
1313
return __builtin_clrsbl(x);
1414
}
1515

16-
// CHECK: cir.func @_Z19test_builtin_clrsbll
17-
// CHECK: %{{.+}} = cir.bit.clrsb(%{{.+}} : !s64i) : !s32i
18-
// CHECK: }
16+
// CIR: cir.func @_Z19test_builtin_clrsbll
17+
// CIR: %{{.+}} = cir.bit.clrsb(%{{.+}} : !s64i) : !s32i
18+
// CIR: }
1919

2020
int test_builtin_clrsbll(long long x) {
2121
return __builtin_clrsbll(x);
2222
}
2323

24-
// CHECK: cir.func @_Z20test_builtin_clrsbllx
25-
// CHECK: %{{.+}} = cir.bit.clrsb(%{{.+}} : !s64i) : !s32i
26-
// CHECK: }
24+
// CIR: cir.func @_Z20test_builtin_clrsbllx
25+
// CIR: %{{.+}} = cir.bit.clrsb(%{{.+}} : !s64i) : !s32i
26+
// CIR: }
2727

2828
int test_builtin_ctzs(unsigned short x) {
2929
return __builtin_ctzs(x);
3030
}
3131

32-
// CHECK: cir.func @_Z17test_builtin_ctzst
33-
// CHECK: %{{.+}} = cir.bit.ctz(%{{.+}} : !u16i) : !s32i
32+
// CIR: cir.func @_Z17test_builtin_ctzst
33+
// CIR: %{{.+}} = cir.bit.ctz(%{{.+}} : !u16i) : !s32i
3434
// CHEKC: }
3535

3636
int test_builtin_ctz(unsigned x) {
3737
return __builtin_ctz(x);
3838
}
3939

40-
// CHECK: cir.func @_Z16test_builtin_ctzj
41-
// CHECK: %{{.+}} = cir.bit.ctz(%{{.+}} : !u32i) : !s32i
42-
// CHECK: }
40+
// CIR: cir.func @_Z16test_builtin_ctzj
41+
// CIR: %{{.+}} = cir.bit.ctz(%{{.+}} : !u32i) : !s32i
42+
// CIR: }
4343

4444
int test_builtin_ctzl(unsigned long x) {
4545
return __builtin_ctzl(x);
4646
}
4747

48-
// CHECK: cir.func @_Z17test_builtin_ctzlm
49-
// CHECK: %{{.+}} = cir.bit.ctz(%{{.+}} : !u64i) : !s32i
50-
// CHECK: }
48+
// CIR: cir.func @_Z17test_builtin_ctzlm
49+
// CIR: %{{.+}} = cir.bit.ctz(%{{.+}} : !u64i) : !s32i
50+
// CIR: }
5151

5252
int test_builtin_ctzll(unsigned long long x) {
5353
return __builtin_ctzll(x);
5454
}
5555

56-
// CHECK: cir.func @_Z18test_builtin_ctzlly
57-
// CHECK: %{{.+}} = cir.bit.ctz(%{{.+}} : !u64i) : !s32i
58-
// CHECK: }
56+
// CIR: cir.func @_Z18test_builtin_ctzlly
57+
// CIR: %{{.+}} = cir.bit.ctz(%{{.+}} : !u64i) : !s32i
58+
// CIR: }
5959

6060
int test_builtin_ctzg(unsigned x) {
6161
return __builtin_ctzg(x);
6262
}
6363

64-
// CHECK: cir.func @_Z17test_builtin_ctzgj
65-
// CHECK: %{{.+}} = cir.bit.ctz(%{{.+}} : !u32i) : !s32i
66-
// CHECK: }
64+
// CIR: cir.func @_Z17test_builtin_ctzgj
65+
// CIR: %{{.+}} = cir.bit.ctz(%{{.+}} : !u32i) : !s32i
66+
// CIR: }
6767

6868
int test_builtin_clzs(unsigned short x) {
6969
return __builtin_clzs(x);
7070
}
7171

72-
// CHECK: cir.func @_Z17test_builtin_clzst
73-
// CHECK: %{{.+}} = cir.bit.clz(%{{.+}} : !u16i) : !s32i
74-
// CHECK: }
72+
// CIR: cir.func @_Z17test_builtin_clzst
73+
// CIR: %{{.+}} = cir.bit.clz(%{{.+}} : !u16i) : !s32i
74+
// CIR: }
7575

7676
int test_builtin_clz(unsigned x) {
7777
return __builtin_clz(x);
7878
}
7979

80-
// CHECK: cir.func @_Z16test_builtin_clzj
81-
// CHECK: %{{.+}} = cir.bit.clz(%{{.+}} : !u32i) : !s32i
82-
// CHECK: }
80+
// CIR: cir.func @_Z16test_builtin_clzj
81+
// CIR: %{{.+}} = cir.bit.clz(%{{.+}} : !u32i) : !s32i
82+
// CIR: }
8383

8484
int test_builtin_clzl(unsigned long x) {
8585
return __builtin_clzl(x);
8686
}
8787

88-
// CHECK: cir.func @_Z17test_builtin_clzlm
89-
// CHECK: %{{.+}} = cir.bit.clz(%{{.+}} : !u64i) : !s32i
90-
// CHECK: }
88+
// CIR: cir.func @_Z17test_builtin_clzlm
89+
// CIR: %{{.+}} = cir.bit.clz(%{{.+}} : !u64i) : !s32i
90+
// CIR: }
9191

9292
int test_builtin_clzll(unsigned long long x) {
9393
return __builtin_clzll(x);
9494
}
9595

96-
// CHECK: cir.func @_Z18test_builtin_clzlly
97-
// CHECK: %{{.+}} = cir.bit.clz(%{{.+}} : !u64i) : !s32i
98-
// CHECK: }
96+
// CIR: cir.func @_Z18test_builtin_clzlly
97+
// CIR: %{{.+}} = cir.bit.clz(%{{.+}} : !u64i) : !s32i
98+
// CIR: }
9999

100100
int test_builtin_clzg(unsigned x) {
101101
return __builtin_clzg(x);
102102
}
103103

104-
// CHECK: cir.func @_Z17test_builtin_clzgj
105-
// CHECK: %{{.+}} = cir.bit.clz(%{{.+}} : !u32i) : !s32i
106-
// CHECK: }
104+
// CIR: cir.func @_Z17test_builtin_clzgj
105+
// CIR: %{{.+}} = cir.bit.clz(%{{.+}} : !u32i) : !s32i
106+
// CIR: }
107107

108108
int test_builtin_ffs(int x) {
109109
return __builtin_ffs(x);
110110
}
111111

112-
// CHECK: cir.func @_Z16test_builtin_ffsi
113-
// CHECK: %{{.+}} = cir.bit.ffs(%{{.+}} : !s32i) : !s32i
114-
// CHECK: }
112+
// CIR: cir.func @_Z16test_builtin_ffsi
113+
// CIR: %{{.+}} = cir.bit.ffs(%{{.+}} : !s32i) : !s32i
114+
// CIR: }
115115

116116
int test_builtin_ffsl(long x) {
117117
return __builtin_ffsl(x);
118118
}
119119

120-
// CHECK: cir.func @_Z17test_builtin_ffsll
121-
// CHECK: %{{.+}} = cir.bit.ffs(%{{.+}} : !s64i) : !s32i
122-
// CHECK: }
120+
// CIR: cir.func @_Z17test_builtin_ffsll
121+
// CIR: %{{.+}} = cir.bit.ffs(%{{.+}} : !s64i) : !s32i
122+
// CIR: }
123123

124124
int test_builtin_ffsll(long long x) {
125125
return __builtin_ffsll(x);
126126
}
127127

128-
// CHECK: cir.func @_Z18test_builtin_ffsllx
129-
// CHECK: %{{.+}} = cir.bit.ffs(%{{.+}} : !s64i) : !s32i
130-
// CHECK: }
128+
// CIR: cir.func @_Z18test_builtin_ffsllx
129+
// CIR: %{{.+}} = cir.bit.ffs(%{{.+}} : !s64i) : !s32i
130+
// CIR: }
131131

132132
int test_builtin_parity(unsigned x) {
133133
return __builtin_parity(x);
134134
}
135135

136-
// CHECK: cir.func @_Z19test_builtin_parityj
137-
// CHECK: %{{.+}} = cir.bit.parity(%{{.+}} : !u32i) : !s32i
138-
// CHECK: }
136+
// CIR: cir.func @_Z19test_builtin_parityj
137+
// CIR: %{{.+}} = cir.bit.parity(%{{.+}} : !u32i) : !s32i
138+
// CIR: }
139139

140140
int test_builtin_parityl(unsigned long x) {
141141
return __builtin_parityl(x);
142142
}
143143

144-
// CHECK: cir.func @_Z20test_builtin_paritylm
145-
// CHECK: %{{.+}} = cir.bit.parity(%{{.+}} : !u64i) : !s32i
146-
// CHECK: }
144+
// CIR: cir.func @_Z20test_builtin_paritylm
145+
// CIR: %{{.+}} = cir.bit.parity(%{{.+}} : !u64i) : !s32i
146+
// CIR: }
147147

148148
int test_builtin_parityll(unsigned long long x) {
149149
return __builtin_parityll(x);
150150
}
151151

152-
// CHECK: cir.func @_Z21test_builtin_paritylly
153-
// CHECK: %{{.+}} = cir.bit.parity(%{{.+}} : !u64i) : !s32i
154-
// CHECK: }
152+
// CIR: cir.func @_Z21test_builtin_paritylly
153+
// CIR: %{{.+}} = cir.bit.parity(%{{.+}} : !u64i) : !s32i
154+
// CIR: }
155155

156156
int test_builtin_popcount(unsigned x) {
157157
return __builtin_popcount(x);
158158
}
159159

160-
// CHECK: cir.func @_Z21test_builtin_popcountj
161-
// CHECK: %{{.+}} = cir.bit.popcount(%{{.+}} : !u32i) : !s32i
162-
// CHECK: }
160+
// CIR: cir.func @_Z21test_builtin_popcountj
161+
// CIR: %{{.+}} = cir.bit.popcount(%{{.+}} : !u32i) : !s32i
162+
// CIR: }
163163

164164
int test_builtin_popcountl(unsigned long x) {
165165
return __builtin_popcountl(x);
166166
}
167167

168-
// CHECK: cir.func @_Z22test_builtin_popcountlm
169-
// CHECK: %{{.+}} = cir.bit.popcount(%{{.+}} : !u64i) : !s32i
170-
// CHECK: }
168+
// CIR: cir.func @_Z22test_builtin_popcountlm
169+
// CIR: %{{.+}} = cir.bit.popcount(%{{.+}} : !u64i) : !s32i
170+
// CIR: }
171171

172172
int test_builtin_popcountll(unsigned long long x) {
173173
return __builtin_popcountll(x);
174174
}
175175

176-
// CHECK: cir.func @_Z23test_builtin_popcountlly
177-
// CHECK: %{{.+}} = cir.bit.popcount(%{{.+}} : !u64i) : !s32i
178-
// CHECK: }
176+
// CIR: cir.func @_Z23test_builtin_popcountlly
177+
// CIR: %{{.+}} = cir.bit.popcount(%{{.+}} : !u64i) : !s32i
178+
// CIR: }
179179

180180
int test_builtin_popcountg(unsigned x) {
181181
return __builtin_popcountg(x);
182182
}
183183

184-
// CHECK: cir.func @_Z22test_builtin_popcountgj
185-
// CHECK: %{{.+}} = cir.bit.popcount(%{{.+}} : !u32i) : !s32i
186-
// CHECK: }
184+
// CIR: cir.func @_Z22test_builtin_popcountgj
185+
// CIR: %{{.+}} = cir.bit.popcount(%{{.+}} : !u32i) : !s32i
186+
// CIR: }
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o - | FileCheck %s
1+
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
2+
// RUN: FileCheck %s --check-prefix=CIR --input-file=%t.cir
23

34
auto func() {
45
return __builtin_strcmp("", "");
5-
// CHECK: cir.func @_Z4funcv()
6-
// CHECK-NEXT: %0 = cir.alloca !s32i, !cir.ptr<!s32i>, ["__retval"] {alignment = 4 : i64} loc(#loc2)
7-
// CHECK-NEXT: %1 = cir.const #cir.int<0> : !s32i loc(#loc7)
8-
// CHECK-NEXT: cir.store %1, %0 : !s32i, !cir.ptr<!s32i> loc(#loc8)
9-
// CHECK-NEXT: %2 = cir.load %0 : !cir.ptr<!s32i>, !s32i loc(#loc8)
10-
// CHECK-NEXT: cir.return %2 : !s32i loc(#loc8)
6+
// CIR: cir.func @_Z4funcv()
7+
// CIR-NEXT: %0 = cir.alloca !s32i, !cir.ptr<!s32i>, ["__retval"] {alignment = 4 : i64} loc(#loc2)
8+
// CIR-NEXT: %1 = cir.const #cir.int<0> : !s32i loc(#loc7)
9+
// CIR-NEXT: cir.store %1, %0 : !s32i, !cir.ptr<!s32i> loc(#loc8)
10+
// CIR-NEXT: %2 = cir.load %0 : !cir.ptr<!s32i>, !s32i loc(#loc8)
11+
// CIR-NEXT: cir.return %2 : !s32i loc(#loc8)
1112
}

0 commit comments

Comments
 (0)