| 1 |
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s |
| 2 |
|
| 3 |
typedef float float4 __attribute__((ext_vector_type(4))); |
| 4 |
|
| 5 |
struct __attribute__((packed, aligned(4))) struct1 { |
| 6 |
float4 position; |
| 7 |
}; |
| 8 |
int x = __alignof(struct struct1); |
| 9 |
|
| 10 |
float4 f(struct struct1* x) { return x->position; } |
| 11 |
|
| 12 |
void func(struct struct1* p, float *a, float *b, float c) { |
| 13 |
p->position.x = c; |
| 14 |
*a = p->position.y; |
| 15 |
*b = p->position[0]; |
| 16 |
p->position[2] = c; |
| 17 |
// CHECK: @func |
| 18 |
// CHECK: load <4 x float>, ptr {{%.*}}, align 4 |
| 19 |
// CHECK: store <4 x float> {{%.*}}, ptr {{%.*}}, align 4 |
| 20 |
// CHECK: load <4 x float>, ptr {{%.*}}, align 4 |
| 21 |
// CHECK: load <4 x float>, ptr {{%.*}}, align 4 |
| 22 |
// CHECK: load <4 x float>, ptr {{%.*}}, align 4 |
| 23 |
// CHECK: store <4 x float> {{%.*}}, ptr {{%.*}}, align 4 |
| 24 |
// CHECK: ret void |
| 25 |
} |