brintos

brintos / llvm-project-archived public Read only

0
0
Text · 752 B · 0a6462e Raw
21 lines · plain
1// RUN: %clang_cc1 %s -triple spir -emit-llvm -O0 -o - | FileCheck %s2 3// Test that we don't initialize local address space objects.4//CHECK: @_ZZ4testE1i = internal addrspace(3) global i32 undef5//CHECK: @_ZZ4testE2ii = internal addrspace(3) global %class.C undef6class C {7  int i;8};9 10kernel void test() {11  __local int i;12  __local C ii;13  // FIXME: In OpenCL C we don't accept initializers for local14  // address space variables. User defined initialization could15  // make sense, but would it mean that all work items need to16  // execute it? Potentially disallowing any initialization would17  // make things easier and assignments can be used to set specific18  // values. This rules should make it consistent with OpenCL C.19  //__local C c();20}21