xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenOpenCL/spir64_target.cl (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 %s -triple "spir64-unknown-unknown" -emit-llvm -o - | FileCheck %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc// CHECK: target triple = "spir64-unknown-unknown"
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambuctypedef struct {
6*f4a2713aSLionel Sambuc  char c;
7*f4a2713aSLionel Sambuc  void *v;
8*f4a2713aSLionel Sambuc  void *v2;
9*f4a2713aSLionel Sambuc} my_st;
10*f4a2713aSLionel Sambuc
11*f4a2713aSLionel Sambuckernel void foo(global long *arg) {
12*f4a2713aSLionel Sambuc  int res1[sizeof(my_st)  == 24 ? 1 : -1];
13*f4a2713aSLionel Sambuc  int res2[sizeof(void *) ==  8 ? 1 : -1];
14*f4a2713aSLionel Sambuc  int res3[sizeof(arg)    ==  8 ? 1 : -1];
15*f4a2713aSLionel Sambuc
16*f4a2713aSLionel Sambuc  my_st *tmp = 0;
17*f4a2713aSLionel Sambuc  arg[3] = (long)(&tmp->v);
18*f4a2713aSLionel Sambuc//CHECK: store i64 8, i64 addrspace(1)*
19*f4a2713aSLionel Sambuc  arg[4] = (long)(&tmp->v2);
20*f4a2713aSLionel Sambuc//CHECK: store i64 16, i64 addrspace(1)*
21*f4a2713aSLionel Sambuc}
22