llvm-project
33 строки · 1.4 Кб
1// RUN: %clang_cc1 %s -ffake-address-space-map -emit-llvm -o - | FileCheck -check-prefix=FAKE %s
2// RUN: %clang_cc1 %s -triple amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck -check-prefix=AMDGCN %s
3
4typedef struct {5int i;6float f; // At non-zero offset.7} ArrayStruct;8
9__constant ArrayStruct constant_array_struct = { 0, 0.0f };10
11typedef struct {12__constant float* constant_float_ptr;13} ConstantArrayPointerStruct;14
15// FAKE: %struct.ConstantArrayPointerStruct = type { ptr addrspace(2) }
16// FAKE: addrspace(2) constant %struct.ConstantArrayPointerStruct { ptr addrspace(2) getelementptr (i8, ptr addrspace(2) @constant_array_struct, i64 4) }
17// AMDGCN: %struct.ConstantArrayPointerStruct = type { ptr addrspace(4) }
18// AMDGCN: addrspace(4) constant %struct.ConstantArrayPointerStruct { ptr addrspace(4) getelementptr (i8, ptr addrspace(4) @constant_array_struct, i64 4) }
19// Bug 18567
20__constant ConstantArrayPointerStruct constant_array_pointer_struct = {21&constant_array_struct.f22};23
24__kernel void initializer_cast_is_valid_crash()25{
26unsigned char v512[64] = {270x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,280x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,290x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,300x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x0031};32
33}
34