Skip to content

Commit 9c7600c

Browse files
committed
Manually fixed tests
1 parent 9ecb299 commit 9c7600c

File tree

11 files changed

+185
-184
lines changed

11 files changed

+185
-184
lines changed

clang/test/CodeGen/attr-noundef.cpp

Lines changed: 152 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -10,157 +10,158 @@
1010
// TODO: No structs may currently be marked noundef
1111

1212
namespace check_structs {
13-
struct Trivial {
14-
int a;
15-
};
16-
Trivial ret_trivial() { return {}; }
17-
void pass_trivial(Trivial e) {}
18-
// CHECK-INTEL: [[DEF:define( dso_local)?]] i32 @{{.*}}ret_trivial
19-
// CHECK-AARCH: [[DEF:define( dso_local)?]] i32 @{{.*}}ret_trivial
20-
// CHECK-INTEL: [[DEF]] void @{{.*}}pass_trivial{{.*}}(i32 %
21-
// CHECK-AARCH: [[DEF]] void @{{.*}}pass_trivial{{.*}}(i64 %
22-
23-
struct NoCopy {
24-
int a;
25-
NoCopy(NoCopy &) = delete;
26-
};
27-
NoCopy ret_nocopy() { return {}; }
28-
void pass_nocopy(NoCopy e) {}
29-
// CHECK: [[DEF]] void @{{.*}}ret_nocopy{{.*}}(ptr dead_on_unwind noalias writable sret({{[^)]+}}) align 4 %
30-
// CHECK: [[DEF]] void @{{.*}}pass_nocopy{{.*}}(ptr noundef %
31-
32-
struct Huge {
33-
int a[1024];
34-
};
35-
Huge ret_huge() { return {}; }
36-
void pass_huge(Huge h) {}
37-
// CHECK: [[DEF]] void @{{.*}}ret_huge{{.*}}(ptr dead_on_unwind noalias writable sret({{[^)]+}}) align 4 %
38-
// CHECK: [[DEF]] void @{{.*}}pass_huge{{.*}}(ptr noundef
39-
} // namespace check_structs
40-
41-
//************ Passing unions by value
42-
// No unions may be marked noundef
43-
44-
namespace check_unions {
45-
union Trivial {
46-
int a;
47-
};
48-
Trivial ret_trivial() { return {}; }
49-
void pass_trivial(Trivial e) {}
50-
// CHECK-INTEL: [[DEF]] i32 @{{.*}}ret_trivial
51-
// CHECK-AARCH: [[DEF]] i32 @{{.*}}ret_trivial
52-
// CHECK-INTEL: [[DEF]] void @{{.*}}pass_trivial{{.*}}(i32 %
53-
// CHECK-AARCH: [[DEF]] void @{{.*}}pass_trivial{{.*}}(i64 %
54-
55-
union NoCopy {
56-
int a;
57-
NoCopy(NoCopy &) = delete;
58-
};
59-
NoCopy ret_nocopy() { return {}; }
60-
void pass_nocopy(NoCopy e) {}
61-
// CHECK: [[DEF]] void @{{.*}}ret_nocopy{{.*}}(ptr dead_on_unwind noalias writable sret({{[^)]+}}) align 4 %
62-
// CHECK: [[DEF]] void @{{.*}}pass_nocopy{{.*}}(ptr noundef %
63-
} // namespace check_unions
64-
65-
//************ Passing `this` pointers
66-
// `this` pointer must always be defined
67-
68-
namespace check_this {
69-
struct Object {
70-
int data[];
71-
72-
Object() {
73-
this->data[0] = 0;
13+
struct Trivial {
14+
int a;
15+
};
16+
Trivial ret_trivial() { return {}; }
17+
void pass_trivial(Trivial e) {}
18+
// CHECK-INTEL: [[DEF:define( dso_local)?]] i32 @{{.*}}ret_trivial
19+
// CHECK-AARCH: [[DEF:define( dso_local)?]] i32 @{{.*}}ret_trivial
20+
// CHECK-INTEL: [[DEF]] void @{{.*}}pass_trivial{{.*}}(i32 %
21+
// CHECK-AARCH: [[DEF]] void @{{.*}}pass_trivial{{.*}}(i64 %
22+
23+
struct NoCopy {
24+
int a;
25+
NoCopy(NoCopy &) = delete;
26+
};
27+
NoCopy ret_nocopy() { return {}; }
28+
void pass_nocopy(NoCopy e) {}
29+
// CHECK: [[DEF]] void @{{.*}}ret_nocopy{{.*}}(ptr dead_on_unwind noalias writable sret({{[^)]+}}) align 4 %
30+
// CHECK: [[DEF]] void @{{.*}}pass_nocopy{{.*}}(ptr noundef %
31+
32+
struct Huge {
33+
int a[1024];
34+
};
35+
Huge ret_huge() { return {}; }
36+
void pass_huge(Huge h) {}
37+
// CHECK: [[DEF]] void @{{.*}}ret_huge{{.*}}(ptr dead_on_unwind noalias writable sret({{[^)]+}}) align 4 %
38+
// CHECK: [[DEF]] void @{{.*}}pass_huge{{.*}}(ptr noundef
39+
} // namespace check_structs
40+
41+
//************ Passing unions by value
42+
// No unions may be marked noundef
43+
44+
namespace check_unions {
45+
union Trivial {
46+
int a;
47+
};
48+
Trivial ret_trivial() { return {}; }
49+
void pass_trivial(Trivial e) {}
50+
// CHECK-INTEL: [[DEF]] i32 @{{.*}}ret_trivial
51+
// CHECK-AARCH: [[DEF]] i32 @{{.*}}ret_trivial
52+
// CHECK-INTEL: [[DEF]] void @{{.*}}pass_trivial{{.*}}(i32 %
53+
// CHECK-AARCH: [[DEF]] void @{{.*}}pass_trivial{{.*}}(i64 %
54+
55+
union NoCopy {
56+
int a;
57+
NoCopy(NoCopy &) = delete;
58+
};
59+
NoCopy ret_nocopy() { return {}; }
60+
void pass_nocopy(NoCopy e) {}
61+
// CHECK: [[DEF]] void @{{.*}}ret_nocopy{{.*}}(ptr dead_on_unwind noalias writable sret({{[^)]+}}) align 4 %
62+
// CHECK: [[DEF]] void @{{.*}}pass_nocopy{{.*}}(ptr noundef %
63+
} // namespace check_unions
64+
65+
//************ Passing `this` pointers
66+
// `this` pointer must always be defined
67+
68+
namespace check_this {
69+
struct Object {
70+
int data[];
71+
72+
Object() {
73+
this->data[0] = 0;
74+
}
75+
int getData() {
76+
return this->data[0];
77+
}
78+
Object *getThis() {
79+
return this;
80+
}
81+
};
82+
83+
void use_object() {
84+
Object obj;
85+
obj.getData();
86+
obj.getThis();
7487
}
75-
int getData() {
76-
return this->data[0];
88+
// CHECK: define linkonce_odr void @{{.*}}Object{{.*}}(ptr noalias noundef nonnull align 4 dereferenceable(1) %
89+
// CHECK: define linkonce_odr noundef i32 @{{.*}}Object{{.*}}getData{{.*}}(ptr noundef nonnull align 4 dereferenceable(1) %
90+
// CHECK: define linkonce_odr noundef ptr @{{.*}}Object{{.*}}getThis{{.*}}(ptr noundef nonnull align 4 dereferenceable(1) %
91+
} // namespace check_this
92+
93+
//************ Passing vector types
94+
95+
namespace check_vecs {
96+
typedef int __attribute__((vector_size(12))) i32x3;
97+
i32x3 ret_vec() {
98+
return {};
7799
}
78-
Object *getThis() {
79-
return this;
100+
void pass_vec(i32x3 v) {
80101
}
81-
};
82-
83-
void use_object() {
84-
Object obj;
85-
obj.getData();
86-
obj.getThis();
87-
}
88-
// CHECK: define linkonce_odr void @{{.*}}Object{{.*}}(ptr noundef nonnull align 4 dereferenceable(1) %
89-
// CHECK: define linkonce_odr noundef i32 @{{.*}}Object{{.*}}getData{{.*}}(ptr noundef nonnull align 4 dereferenceable(1) %
90-
// CHECK: define linkonce_odr noundef ptr @{{.*}}Object{{.*}}getThis{{.*}}(ptr noundef nonnull align 4 dereferenceable(1) %
91-
} // namespace check_this
92-
93-
//************ Passing vector types
94-
95-
namespace check_vecs {
96-
typedef int __attribute__((vector_size(12))) i32x3;
97-
i32x3 ret_vec() {
98-
return {};
99-
}
100-
void pass_vec(i32x3 v) {
101-
}
102-
103-
// CHECK: [[DEF]] noundef <3 x i32> @{{.*}}ret_vec{{.*}}()
104-
// CHECK-INTEL: [[DEF]] void @{{.*}}pass_vec{{.*}}(<3 x i32> noundef %
105-
// CHECK-AARCH: [[DEF]] void @{{.*}}pass_vec{{.*}}(<4 x i32> %
106-
} // namespace check_vecs
107-
108-
//************ Passing exotic types
109-
// Function/Array pointers, Function member / Data member pointers, nullptr_t, ExtInt types
110-
111-
namespace check_exotic {
112-
struct Object {
113-
int mfunc();
114-
int mdata;
115-
};
116-
typedef int Object::*mdptr;
117-
typedef int (Object::*mfptr)();
118-
typedef decltype(nullptr) nullptr_t;
119-
typedef int (*arrptr)[32];
120-
typedef int (*fnptr)(int);
121-
122-
arrptr ret_arrptr() {
123-
return nullptr;
124-
}
125-
fnptr ret_fnptr() {
126-
return nullptr;
127-
}
128-
mdptr ret_mdptr() {
129-
return nullptr;
130-
}
131-
mfptr ret_mfptr() {
132-
return nullptr;
133-
}
134-
nullptr_t ret_npt() {
135-
return nullptr;
136-
}
137-
void pass_npt(nullptr_t t) {
138-
}
139-
_BitInt(3) ret_BitInt() {
140-
return 0;
141-
}
142-
void pass_BitInt(_BitInt(3) e) {
143-
}
144-
void pass_large_BitInt(_BitInt(127) e) {
145-
}
146-
147-
// Pointers to arrays/functions are always noundef
148-
// CHECK: [[DEF]] noundef ptr @{{.*}}ret_arrptr{{.*}}()
149-
// CHECK: [[DEF]] noundef ptr @{{.*}}ret_fnptr{{.*}}()
150-
151-
// Pointers to members are never noundef
152-
// CHECK: [[DEF]] i64 @{{.*}}ret_mdptr{{.*}}()
153-
// CHECK-INTEL: [[DEF]] { i64, i64 } @{{.*}}ret_mfptr{{.*}}()
154-
// CHECK-AARCH: [[DEF]] [2 x i64] @{{.*}}ret_mfptr{{.*}}()
155-
156-
// nullptr_t is never noundef
157-
// CHECK: [[DEF]] ptr @{{.*}}ret_npt{{.*}}()
158-
// CHECK: [[DEF]] void @{{.*}}pass_npt{{.*}}(ptr %
159-
160-
// CHECK-INTEL: [[DEF]] noundef signext i3 @{{.*}}ret_BitInt{{.*}}()
161-
// CHECK-AARCH: [[DEF]] noundef i3 @{{.*}}ret_BitInt{{.*}}()
162-
// CHECK-INTEL: [[DEF]] void @{{.*}}pass_BitInt{{.*}}(i3 noundef signext %
163-
// CHECK-AARCH: [[DEF]] void @{{.*}}pass_BitInt{{.*}}(i3 noundef %
164-
// CHECK-INTEL: [[DEF]] void @{{.*}}pass_large_BitInt{{.*}}(i64 noundef %{{.*}}, i64 noundef %
165-
// CHECK-AARCH: [[DEF]] void @{{.*}}pass_large_BitInt{{.*}}(i127 noundef %
166-
} // namespace check_exotic
102+
103+
// CHECK: [[DEF]] noundef <3 x i32> @{{.*}}ret_vec{{.*}}()
104+
// CHECK-INTEL: [[DEF]] void @{{.*}}pass_vec{{.*}}(<3 x i32> noundef %
105+
// CHECK-AARCH: [[DEF]] void @{{.*}}pass_vec{{.*}}(<4 x i32> %
106+
} // namespace check_vecs
107+
108+
//************ Passing exotic types
109+
// Function/Array pointers, Function member / Data member pointers, nullptr_t, ExtInt types
110+
111+
namespace check_exotic {
112+
struct Object {
113+
int mfunc();
114+
int mdata;
115+
};
116+
typedef int Object::*mdptr;
117+
typedef int (Object::*mfptr)();
118+
typedef decltype(nullptr) nullptr_t;
119+
typedef int (*arrptr)[32];
120+
typedef int (*fnptr)(int);
121+
122+
arrptr ret_arrptr() {
123+
return nullptr;
124+
}
125+
fnptr ret_fnptr() {
126+
return nullptr;
127+
}
128+
mdptr ret_mdptr() {
129+
return nullptr;
130+
}
131+
mfptr ret_mfptr() {
132+
return nullptr;
133+
}
134+
nullptr_t ret_npt() {
135+
return nullptr;
136+
}
137+
void pass_npt(nullptr_t t) {
138+
}
139+
_BitInt(3) ret_BitInt() {
140+
return 0;
141+
}
142+
void pass_BitInt(_BitInt(3) e) {
143+
}
144+
void pass_large_BitInt(_BitInt(127) e) {
145+
}
146+
147+
// Pointers to arrays/functions are always noundef
148+
// CHECK: [[DEF]] noundef ptr @{{.*}}ret_arrptr{{.*}}()
149+
// CHECK: [[DEF]] noundef ptr @{{.*}}ret_fnptr{{.*}}()
150+
151+
// Pointers to members are never noundef
152+
// CHECK: [[DEF]] i64 @{{.*}}ret_mdptr{{.*}}()
153+
// CHECK-INTEL: [[DEF]] { i64, i64 } @{{.*}}ret_mfptr{{.*}}()
154+
// CHECK-AARCH: [[DEF]] [2 x i64] @{{.*}}ret_mfptr{{.*}}()
155+
156+
// nullptr_t is never noundef
157+
// CHECK: [[DEF]] ptr @{{.*}}ret_npt{{.*}}()
158+
// CHECK: [[DEF]] void @{{.*}}pass_npt{{.*}}(ptr %
159+
160+
// CHECK-INTEL: [[DEF]] noundef signext i3 @{{.*}}ret_BitInt{{.*}}()
161+
// CHECK-AARCH: [[DEF]] noundef i3 @{{.*}}ret_BitInt{{.*}}()
162+
// CHECK-INTEL: [[DEF]] void @{{.*}}pass_BitInt{{.*}}(i3 noundef signext %
163+
// CHECK-AARCH: [[DEF]] void @{{.*}}pass_BitInt{{.*}}(i3 noundef %
164+
// CHECK-INTEL: [[DEF]] void @{{.*}}pass_large_BitInt{{.*}}(i64 noundef %{{.*}}, i64 noundef %
165+
// CHECK-AARCH: [[DEF]] void @{{.*}}pass_large_BitInt{{.*}}(i127 noundef %
166+
} // namespace check_exotic
167+

clang/test/CodeGenCUDA/record-layout.cu

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,37 +162,37 @@ void test_J() {
162162
J_kernel<<<1, 1>>>();
163163
}
164164

165-
// HOST: define linkonce_odr dso_local noundef ptr @"??0J@@QEAA@XZ"(ptr noundef nonnull returned align 8 dereferenceable(24) %this)
165+
// HOST: define linkonce_odr dso_local noundef ptr @"??0J@@QEAA@XZ"(ptr noalias noundef nonnull returned align 8 dereferenceable(24) %this)
166166
// HOST: %this.addr = alloca ptr, align 8
167167
// HOST: store ptr %this, ptr %this.addr, align 8
168168
// HOST: %this1 = load ptr, ptr %this.addr, align 8
169169
// HOST: %call = call noundef ptr @"??0I@@QEAA@XZ"(ptr noundef nonnull align 8 dereferenceable(16) %this1) #5
170170
// HOST: store ptr @"??_7J@@6B@", ptr %this1, align 8
171171
// HOST: ret ptr %this1
172172

173-
// HOST: define linkonce_odr dso_local noundef ptr @"??0I@@QEAA@XZ"(ptr noundef nonnull returned align 8 dereferenceable(16) %this)
173+
// HOST: define linkonce_odr dso_local noundef ptr @"??0I@@QEAA@XZ"(ptr noalias noundef nonnull returned align 8 dereferenceable(16) %this)
174174
// HOST: %this.addr = alloca ptr, align 8
175175
// HOST: store ptr %this, ptr %this.addr, align 8
176176
// HOST: %this1 = load ptr, ptr %this.addr, align 8
177177
// HOST: store ptr @"??_7I@@6B@", ptr %this1, align 8
178178
// HOST: ret ptr %this1
179179

180-
// DEV: define linkonce_odr void @_ZN1JC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %this)
180+
// DEV: define linkonce_odr void @_ZN1JC1Ev(ptr noalias noundef nonnull align 8 dereferenceable(24) %this)
181181
// DEV: %this.addr = alloca ptr, align 8, addrspace(5)
182182
// DEV: %this.addr.ascast = addrspacecast ptr addrspace(5) %this.addr to ptr
183183
// DEV: store ptr %this, ptr %this.addr.ascast, align 8
184184
// DEV: %this1 = load ptr, ptr %this.addr.ascast, align 8
185185
// DEV: call void @_ZN1JC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %this1)
186186

187-
// DEV: define linkonce_odr void @_ZN1JC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %this)
187+
// DEV: define linkonce_odr void @_ZN1JC2Ev(ptr noalias noundef nonnull align 8 dereferenceable(24) %this)
188188
// DEV: %this.addr = alloca ptr, align 8, addrspace(5)
189189
// DEV: %this.addr.ascast = addrspacecast ptr addrspace(5) %this.addr to ptr
190190
// DEV: store ptr %this, ptr %this.addr.ascast, align 8
191191
// DEV: %this1 = load ptr, ptr %this.addr.ascast, align 8
192192
// DEV: call void @_ZN1IC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %this1)
193193
// DEV: store ptr addrspace(1) getelementptr inbounds inrange(-16, 24) ({ [5 x ptr addrspace(1)] }, ptr addrspace(1) @_ZTV1J, i32 0, i32 0, i32 2), ptr %this1, align 8
194194

195-
// DEV: define linkonce_odr void @_ZN1IC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %this)
195+
// DEV: define linkonce_odr void @_ZN1IC2Ev(ptr noalias noundef nonnull align 8 dereferenceable(16) %this)
196196
// DEV: %this.addr = alloca ptr, align 8, addrspace(5)
197197
// DEV: %this.addr.ascast = addrspacecast ptr addrspace(5) %this.addr to ptr
198198
// DEV: store ptr %this, ptr %this.addr.ascast, align 8

clang/test/CodeGenCUDA/vtbl.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "Inputs/cuda.h"
55

6-
// CHECK-LABEL: define {{.*}}@_ZN1AC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this)
6+
// CHECK-LABEL: define {{.*}}@_ZN1AC2Ev(ptr noalias noundef nonnull align 8 dereferenceable(8) %this)
77
// CHECK: store ptr %this, ptr %this.addr.ascast
88
// CHECK: %this1 = load ptr, ptr %this.addr.ascast
99
// CHECK: store ptr addrspace(1) {{.*}} @_ZTV1A{{.*}}, ptr %this1

clang/test/CodeGenCXX/LoongArch/abi-lp64d-struct-inherit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct child5_virtual_s : virtual parent5_virtual_s {
6969
float f1;
7070
};
7171

72-
// CHECK-LABEL: define{{.*}} void @_ZN16child5_virtual_sC1EOS_(ptr noundef nonnull align 8 dereferenceable(12) %this, ptr noundef nonnull align 8 dereferenceable(12) %0)
72+
// CHECK-LABEL: define{{.*}} void @_ZN16child5_virtual_sC1EOS_(ptr noalias noundef nonnull align 8 dereferenceable(12) %this, ptr noundef nonnull align 8 dereferenceable(12) %0)
7373
struct child5_virtual_s int32_float_virtual_struct_inheritance(struct child5_virtual_s a) {
7474
return a;
7575
}

clang/test/CodeGenCXX/ibm128-declarations.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ int main(void) {
137137
// CHECK: ret i32 0
138138
// CHECK: }
139139

140-
// CHECK: define linkonce_odr void @_ZN5CTestC1Eg(ptr noundef nonnull align 16 dereferenceable(32) %this, ppc_fp128 noundef %arg)
140+
// CHECK: define linkonce_odr void @_ZN5CTestC1Eg(ptr noalias noundef nonnull align 16 dereferenceable(32) %this, ppc_fp128 noundef %arg)
141141
// CHECK: entry:
142142
// CHECK: store ptr %this, ptr %this.addr, align 8
143143
// CHECK: store ppc_fp128 %arg, ptr %arg.addr, align 16
@@ -157,7 +157,7 @@ int main(void) {
157157
// CHECK: ret ppc_fp128 %mul
158158
// CHECK: }
159159

160-
// CHECK: define linkonce_odr void @_ZN5CTestC2Eg(ptr noundef nonnull align 16 dereferenceable(32) %this, ppc_fp128 noundef %arg)
160+
// CHECK: define linkonce_odr void @_ZN5CTestC2Eg(ptr noalias noundef nonnull align 16 dereferenceable(32) %this, ppc_fp128 noundef %arg)
161161
// CHECK: entry:
162162
// CHECK: store ptr %this, ptr %this.addr, align 8
163163
// CHECK: store ppc_fp128 %arg, ptr %arg.addr, align 16

0 commit comments

Comments
 (0)