Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / ext-vector-member-alignment.c
blob1eb6de32109cb1163c10eb98a27a7d498a11e127
1 // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
3 typedef float float4 __attribute__((ext_vector_type(4)));
5 struct __attribute__((packed, aligned(4))) struct1 {
6 float4 position;
7 };
8 int x = __alignof(struct struct1);
10 float4 f(struct struct1* x) { return x->position; }
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