Richard Trieu | 7533eba | 2012-12-12 00:52:15 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -triple "spir-unknown-unknown" -emit-llvm -o - | FileCheck %s |
| 2 | |
| 3 | // CHECK: target triple = "spir-unknown-unknown" |
| 4 | |
| 5 | typedef struct { |
| 6 | char c; |
| 7 | void *v; |
| 8 | void *v2; |
| 9 | } my_st; |
| 10 | |
| 11 | kernel void foo(global long *arg) { |
Guy Benyei | bd5da3c | 2012-12-11 21:38:14 +0000 | [diff] [blame] | 12 | int res1[sizeof(my_st) == 12 ? 1 : -1]; |
| 13 | int res2[sizeof(void *) == 4 ? 1 : -1]; |
| 14 | int res3[sizeof(arg) == 4 ? 1 : -1]; |
Richard Trieu | 7533eba | 2012-12-12 00:52:15 +0000 | [diff] [blame] | 15 | |
| 16 | my_st *tmp = 0; |
| 17 | |
| 18 | arg[0] = (long)(&tmp->v); |
| 19 | //CHECK: store i64 4, i64 addrspace(1)* |
| 20 | arg[1] = (long)(&tmp->v2); |
| 21 | //CHECK: store i64 8, i64 addrspace(1)* |
| 22 | } |