Files
clang-p2996/clang/test/CodeGenOpenCL/blocks.cl
Matt Arsenault bf5e3e4391 AMDGPU: Make 0 the private nullptr value
We can't actually pretend that 0 is valid for address space 0.
r295877 added a workaround to stop allocating user objects
there, so we can use 0 as the invalid pointer.

Some of the tests seemed to be using private as the non-0 null
test address space, so add copies using local to make sure
this is still stressed.

llvm-svn: 297659
2017-03-13 19:47:53 +00:00

18 lines
738 B
Common Lisp

// RUN: %clang_cc1 %s -cl-std=CL2.0 -emit-llvm -o - -O0 -triple spir-unknown-unknown | FileCheck -check-prefix=GENERIC -check-prefix=COMMON %s
// RUN: %clang_cc1 %s -cl-std=CL2.0 -emit-llvm -o - -O0 -triple amdgcn-amd-amdhsa-opencl | FileCheck -check-prefix=AMD -check-prefix=COMMON %s
// Checking for null instead of @__NSConcreteGlobalBlock symbol
// COMMON: @__block_literal_global = internal addrspace(1) constant { i8**, i32, i32, i8*, %struct.__block_descriptor addrspace(2)* } { i8** null
void (^block_A)(local void *) = ^(local void *a) {
return;
};
void foo(){
int i;
// Checking for null instead of @_NSConcreteStackBlock symbol
// COMMON: store i8* null, i8** %block.isa
int (^ block_B)(void) = ^{
return i;
};
}