Author: Arthur Eubanks
Date: 2022-11-13T14:02:24-08:00
New Revision: e564f5153f91ef40a406c7f907877ceafb6da39d

URL: 
https://github.com/llvm/llvm-project/commit/e564f5153f91ef40a406c7f907877ceafb6da39d
DIFF: 
https://github.com/llvm/llvm-project/commit/e564f5153f91ef40a406c7f907877ceafb6da39d.diff

LOG: [clang][test] Avoid UB in overload.cl

Added: 
    

Modified: 
    clang/test/CodeGenOpenCL/overload.cl

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGenOpenCL/overload.cl 
b/clang/test/CodeGenOpenCL/overload.cl
index f9e69c6d11540..62ed84c7ec972 100644
--- a/clang/test/CodeGenOpenCL/overload.cl
+++ b/clang/test/CodeGenOpenCL/overload.cl
@@ -14,25 +14,25 @@ void __attribute__((overloadable)) bar(generic int *generic 
*a, generic int *gen
 
 // Checking address space resolution
 void kernel test1() {
-  global int *a;
-  global int *b;
-  generic int *c;
-  local int *d;
-  generic int *generic *gengen;
-  generic int *local *genloc;
-  generic int *global *genglob;
-  // CHECK-DAG: call spir_func void @_Z3fooPU3AS1iS0_(i32 addrspace(1)* 
noundef undef, i32 addrspace(1)* noundef undef)
+  global int *a = 0;
+  global int *b = 0;
+  generic int *c = 0;
+  local int *d = 0;
+  generic int *generic *gengen = 0;
+  generic int *local *genloc = 0;
+  generic int *global *genglob = 0;
+  // CHECK-DAG: call spir_func void @_Z3fooPU3AS1iS0_(i32 addrspace(1)* 
noundef {{.*}}, i32 addrspace(1)* noundef {{.*}})
   foo(a, b);
-  // CHECK-DAG: call spir_func void @_Z3fooPU3AS4iS0_(i32 addrspace(4)* 
noundef undef, i32 addrspace(4)* noundef undef)
+  // CHECK-DAG: call spir_func void @_Z3fooPU3AS4iS0_(i32 addrspace(4)* 
noundef {{.*}}, i32 addrspace(4)* noundef {{.*}})
   foo(b, c);
-  // CHECK-DAG: call spir_func void @_Z3fooPU3AS4iS0_(i32 addrspace(4)* 
noundef undef, i32 addrspace(4)* noundef undef)
+  // CHECK-DAG: call spir_func void @_Z3fooPU3AS4iS0_(i32 addrspace(4)* 
noundef {{.*}}, i32 addrspace(4)* noundef {{.*}})
   foo(a, d);
 
-  // CHECK-DAG: call spir_func void @_Z3barPU3AS4PU3AS4iS2_(i32 addrspace(4)* 
addrspace(4)* noundef undef, i32 addrspace(4)* addrspace(4)* noundef undef)
+  // CHECK-DAG: call spir_func void @_Z3barPU3AS4PU3AS4iS2_(i32 addrspace(4)* 
addrspace(4)* noundef {{.*}}, i32 addrspace(4)* addrspace(4)* noundef {{.*}})
   bar(gengen, genloc);
-  // CHECK-DAG: call spir_func void @_Z3barPU3AS4PU3AS4iS2_(i32 addrspace(4)* 
addrspace(4)* noundef undef, i32 addrspace(4)* addrspace(4)* noundef undef)
+  // CHECK-DAG: call spir_func void @_Z3barPU3AS4PU3AS4iS2_(i32 addrspace(4)* 
addrspace(4)* noundef {{.*}}, i32 addrspace(4)* addrspace(4)* noundef {{.*}})
   bar(gengen, genglob);
-  // CHECK-DAG: call spir_func void @_Z3barPU3AS1PU3AS4iS2_(i32 addrspace(4)* 
addrspace(1)* noundef undef, i32 addrspace(4)* addrspace(1)* noundef undef)
+  // CHECK-DAG: call spir_func void @_Z3barPU3AS1PU3AS4iS2_(i32 addrspace(4)* 
addrspace(1)* noundef {{.*}}, i32 addrspace(4)* addrspace(1)* noundef {{.*}})
   bar(genglob, genglob);
 }
 
@@ -40,8 +40,8 @@ void kernel test1() {
 void kernel test2() {
   short4 e0=0;
 
-  // CHECK-DAG: call spir_func <4 x i16> @_Z5clampDv4_sss(<4 x i16> noundef 
zeroinitializer, i16 noundef signext 0, i16 noundef signext 255)
+  // CHECK-DAG: call spir_func <4 x i16> @_Z5clampDv4_sss(<4 x i16> noundef 
{{.*}}, i16 noundef signext 0, i16 noundef signext 255)
   clamp(e0, 0, 255);
-  // 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)
+  // CHECK-DAG: call spir_func <4 x i16> @_Z5clampDv4_sS_S_(<4 x i16> noundef 
{{.*}}, <4 x i16> noundef {{.*}}, <4 x i16> noundef {{.*}})
   clamp(e0, e0, e0);
 }


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to