Anastasia Stulova | af0a7bb | 2017-01-27 15:11:34 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 %s -cl-std=CL2.0 -emit-llvm -o - -O0 -triple spir-unknown-unknown | FileCheck %s --check-prefix=COMMON |
| 2 | // RUN: %clang_cc1 %s -cl-std=CL2.0 -emit-llvm -o - -O0 -triple amdgcn-amd-amdhsa-opencl | FileCheck %s --check-prefix=AMD |
| 3 | |
| 4 | // Checking for null instead of @__NSConcreteGlobalBlock symbol |
| 5 | // COMMON: @__block_literal_global = internal addrspace(1) constant { i8**, i32, i32, i8*, %struct.__block_descriptor addrspace(2)* } { i8** null |
| 6 | // AMD: @__block_literal_global = internal addrspace(1) constant { i8**, i32, i32, i8*, %struct.__block_descriptor addrspace(2)* } { i8** addrspacecast (i8* addrspace(4)* null to i8**) |
| 7 | void (^block_A)(local void *) = ^(local void *a) { |
| 8 | return; |
| 9 | }; |
| 10 | |
| 11 | void foo(){ |
| 12 | int i; |
| 13 | // Checking for null instead of @_NSConcreteStackBlock symbol |
| 14 | // COMMON: store i8* null, i8** %block.isa |
| 15 | // AMD: store i8* addrspacecast (i8 addrspace(4)* null to i8*), i8** %block.isa, |
| 16 | int (^ block_B)(void) = ^{ |
| 17 | return i; |
| 18 | }; |
| 19 | } |