]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/ext-vector-member-alignment.c
Vendor import of clang trunk r238337:
[FreeBSD/FreeBSD.git] / test / CodeGen / ext-vector-member-alignment.c
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   // FIXME: We should be able to come up with a more aggressive alignment
18   // estimate.
19   // CHECK: @func
20   // CHECK: load <4 x float>, <4 x float>* {{%.*}}, align 1
21   // CHECK: store <4 x float> {{%.*}}, <4 x float>* {{%.*}}, align 1
22   // CHECK: load <4 x float>, <4 x float>* {{%.*}}, align 1
23   // CHECK: load <4 x float>, <4 x float>* {{%.*}}, align 1
24   // CHECK: load <4 x float>, <4 x float>* {{%.*}}, align 1
25   // CHECK: store <4 x float> {{%.*}}, <4 x float>* {{%.*}}, align 1
26   // CHECK: ret void
27 }