Skip to content

Commit e564f51

Browse files
committed
[clang][test] Avoid UB in overload.cl
1 parent 1a6d770 commit e564f51

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

clang/test/CodeGenOpenCL/overload.cl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,34 @@ void __attribute__((overloadable)) bar(generic int *generic *a, generic int *gen
1414

1515
// Checking address space resolution
1616
void kernel test1() {
17-
global int *a;
18-
global int *b;
19-
generic int *c;
20-
local int *d;
21-
generic int *generic *gengen;
22-
generic int *local *genloc;
23-
generic int *global *genglob;
24-
// CHECK-DAG: call spir_func void @_Z3fooPU3AS1iS0_(i32 addrspace(1)* noundef undef, i32 addrspace(1)* noundef undef)
17+
global int *a = 0;
18+
global int *b = 0;
19+
generic int *c = 0;
20+
local int *d = 0;
21+
generic int *generic *gengen = 0;
22+
generic int *local *genloc = 0;
23+
generic int *global *genglob = 0;
24+
// CHECK-DAG: call spir_func void @_Z3fooPU3AS1iS0_(i32 addrspace(1)* noundef {{.*}}, i32 addrspace(1)* noundef {{.*}})
2525
foo(a, b);
26-
// CHECK-DAG: call spir_func void @_Z3fooPU3AS4iS0_(i32 addrspace(4)* noundef undef, i32 addrspace(4)* noundef undef)
26+
// CHECK-DAG: call spir_func void @_Z3fooPU3AS4iS0_(i32 addrspace(4)* noundef {{.*}}, i32 addrspace(4)* noundef {{.*}})
2727
foo(b, c);
28-
// CHECK-DAG: call spir_func void @_Z3fooPU3AS4iS0_(i32 addrspace(4)* noundef undef, i32 addrspace(4)* noundef undef)
28+
// CHECK-DAG: call spir_func void @_Z3fooPU3AS4iS0_(i32 addrspace(4)* noundef {{.*}}, i32 addrspace(4)* noundef {{.*}})
2929
foo(a, d);
3030

31-
// CHECK-DAG: call spir_func void @_Z3barPU3AS4PU3AS4iS2_(i32 addrspace(4)* addrspace(4)* noundef undef, i32 addrspace(4)* addrspace(4)* noundef undef)
31+
// CHECK-DAG: call spir_func void @_Z3barPU3AS4PU3AS4iS2_(i32 addrspace(4)* addrspace(4)* noundef {{.*}}, i32 addrspace(4)* addrspace(4)* noundef {{.*}})
3232
bar(gengen, genloc);
33-
// CHECK-DAG: call spir_func void @_Z3barPU3AS4PU3AS4iS2_(i32 addrspace(4)* addrspace(4)* noundef undef, i32 addrspace(4)* addrspace(4)* noundef undef)
33+
// CHECK-DAG: call spir_func void @_Z3barPU3AS4PU3AS4iS2_(i32 addrspace(4)* addrspace(4)* noundef {{.*}}, i32 addrspace(4)* addrspace(4)* noundef {{.*}})
3434
bar(gengen, genglob);
35-
// CHECK-DAG: call spir_func void @_Z3barPU3AS1PU3AS4iS2_(i32 addrspace(4)* addrspace(1)* noundef undef, i32 addrspace(4)* addrspace(1)* noundef undef)
35+
// CHECK-DAG: call spir_func void @_Z3barPU3AS1PU3AS4iS2_(i32 addrspace(4)* addrspace(1)* noundef {{.*}}, i32 addrspace(4)* addrspace(1)* noundef {{.*}})
3636
bar(genglob, genglob);
3737
}
3838

3939
// Checking vector vs scalar resolution
4040
void kernel test2() {
4141
short4 e0=0;
4242

43-
// CHECK-DAG: call spir_func <4 x i16> @_Z5clampDv4_sss(<4 x i16> noundef zeroinitializer, i16 noundef signext 0, i16 noundef signext 255)
43+
// CHECK-DAG: call spir_func <4 x i16> @_Z5clampDv4_sss(<4 x i16> noundef {{.*}}, i16 noundef signext 0, i16 noundef signext 255)
4444
clamp(e0, 0, 255);
45-
// CHECK-DAG: call spir_func <4 x i16> @_Z5clampDv4_sS_S_(<4 x i16> noundef zeroinitializer, <4 x i16> noundef zeroinitializer, <4 x i16> noundef zeroinitializer)
45+
// CHECK-DAG: call spir_func <4 x i16> @_Z5clampDv4_sS_S_(<4 x i16> noundef {{.*}}, <4 x i16> noundef {{.*}}, <4 x i16> noundef {{.*}})
4646
clamp(e0, e0, e0);
4747
}

0 commit comments

Comments
 (0)