26 lines · c
1// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s2 3typedef float float4 __attribute__((ext_vector_type(4)));4 5struct __attribute__((packed, aligned(4))) struct1 {6 float4 position;7};8int x = __alignof(struct struct1);9 10float4 f(struct struct1* x) { return x->position; }11 12void 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: @func18 // CHECK: load <4 x float>, ptr {{%.*}}, align 419 // CHECK: store <4 x float> {{%.*}}, ptr {{%.*}}, align 420 // CHECK: load <4 x float>, ptr {{%.*}}, align 421 // CHECK: load <4 x float>, ptr {{%.*}}, align 422 // CHECK: load <4 x float>, ptr {{%.*}}, align 423 // CHECK: store <4 x float> {{%.*}}, ptr {{%.*}}, align 424 // CHECK: ret void25}26