xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenOpenCL/address-space-constant-initializers.cl (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 %s -ffake-address-space-map -emit-llvm -o - | FileCheck %s
2*0a6a1f1dSLionel Sambuc
3*0a6a1f1dSLionel Sambuctypedef struct {
4*0a6a1f1dSLionel Sambuc    int i;
5*0a6a1f1dSLionel Sambuc    float f; // At non-zero offset.
6*0a6a1f1dSLionel Sambuc} ArrayStruct;
7*0a6a1f1dSLionel Sambuc
8*0a6a1f1dSLionel Sambuc__constant ArrayStruct constant_array_struct = { 0, 0.0f };
9*0a6a1f1dSLionel Sambuc
10*0a6a1f1dSLionel Sambuctypedef struct {
11*0a6a1f1dSLionel Sambuc    __constant float* constant_float_ptr;
12*0a6a1f1dSLionel Sambuc} ConstantArrayPointerStruct;
13*0a6a1f1dSLionel Sambuc
14*0a6a1f1dSLionel Sambuc// CHECK: %struct.ConstantArrayPointerStruct = type { float addrspace(3)* }
15*0a6a1f1dSLionel Sambuc// CHECK: addrspace(3) constant %struct.ConstantArrayPointerStruct { float addrspace(3)* bitcast (i8 addrspace(3)* getelementptr (i8 addrspace(3)* bitcast (%struct.ArrayStruct addrspace(3)* @constant_array_struct to i8 addrspace(3)*), i64 4) to float addrspace(3)*) }
16*0a6a1f1dSLionel Sambuc// Bug  18567
17*0a6a1f1dSLionel Sambuc__constant ConstantArrayPointerStruct constant_array_pointer_struct = {
18*0a6a1f1dSLionel Sambuc    &constant_array_struct.f
19*0a6a1f1dSLionel Sambuc};
20*0a6a1f1dSLionel Sambuc
21