2017-04-12 01:24:23 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -triple "spir-unknown-unknown" -O0 -cl-std=CL2.0 -o - %s | FileCheck -check-prefixes=CHECK,SPIR %s
|
2018-02-16 03:12:41 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -triple amdgcn-amd-amdhsa -O0 -cl-std=CL2.0 -o - %s | FileCheck -check-prefixes=CHECK,AMDGCN %s
|
2016-06-07 12:34:00 +08:00
|
|
|
|
|
|
|
constant int sz0 = 5;
|
2018-02-14 02:01:21 +08:00
|
|
|
// SPIR: @sz0 = addrspace(2) constant i32 5
|
2018-02-16 03:12:41 +08:00
|
|
|
// AMDGCN: @sz0 = addrspace(4) constant i32 5
|
2016-06-07 12:34:00 +08:00
|
|
|
const global int sz1 = 16;
|
|
|
|
// CHECK: @sz1 = addrspace(1) constant i32 16
|
|
|
|
const constant int sz2 = 8;
|
2018-02-14 02:01:21 +08:00
|
|
|
// SPIR: @sz2 = addrspace(2) constant i32 8
|
2018-02-16 03:12:41 +08:00
|
|
|
// AMDGCN: @sz2 = addrspace(4) constant i32 8
|
2016-06-07 12:34:00 +08:00
|
|
|
// CHECK: @testvla.vla2 = internal addrspace(3) global [8 x i16] undef
|
|
|
|
|
|
|
|
kernel void testvla()
|
|
|
|
{
|
|
|
|
int vla0[sz0];
|
2017-04-12 01:24:23 +08:00
|
|
|
// SPIR: %vla0 = alloca [5 x i32]
|
|
|
|
// SPIR-NOT: %vla0 = alloca [5 x i32]{{.*}}addrspace
|
2018-02-16 03:12:41 +08:00
|
|
|
// AMDGCN: %vla0 = alloca [5 x i32]{{.*}}addrspace(5)
|
2016-06-07 12:34:00 +08:00
|
|
|
char vla1[sz1];
|
2017-04-12 01:24:23 +08:00
|
|
|
// SPIR: %vla1 = alloca [16 x i8]
|
|
|
|
// SPIR-NOT: %vla1 = alloca [16 x i8]{{.*}}addrspace
|
2018-02-16 03:12:41 +08:00
|
|
|
// AMDGCN: %vla1 = alloca [16 x i8]{{.*}}addrspace(5)
|
2016-06-07 12:34:00 +08:00
|
|
|
local short vla2[sz2];
|
|
|
|
}
|