blob: 8e5931859ae19f63f106caf4769dad44ea378174 [file] [log] [blame]
Chris Lattner4f1aefc2011-12-19 21:11:59 +00001// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
Eli Friedman08d78022008-05-29 11:10:27 +00002
3__attribute((aligned(16))) float a[128];
Chris Lattner4f1aefc2011-12-19 21:11:59 +00004union {int a[4]; __attribute((aligned(16))) float b[4];} b;
5
6// CHECK: @a = {{.*}}zeroinitializer, align 16
7// CHECK: @b = {{.*}}zeroinitializer, align 16
Chris Lattner4cac9e12011-12-19 21:16:08 +00008
9
10
11// PR5279 - Reduced alignment on typedef.
12typedef int myint __attribute__((aligned(1)));
13
14void test1(myint *p) {
15 *p = 0;
16}
17// CHECK: @test1(
18// CHECK: store i32 0, i32* {{.*}}, align 1
19// CHECK: ret void
20
21
22// PR5279 - Reduced alignment on typedef.
23typedef float __attribute__((vector_size(16), aligned(4))) packedfloat4;
24
25void test2(packedfloat4 *p) {
26 *p = (packedfloat4) { 3.2f, 2.3f, 0.1f, 0.0f };
27}
28// CHECK: @test2(
29// CHECK: store <4 x float> {{.*}}, align 4
30// CHECK: ret void
31
32
33// PR5279 - Reduced alignment on typedef.
34typedef float __attribute__((ext_vector_type(3), aligned(4))) packedfloat3;
35void test3(packedfloat3 *p) {
36 *p = (packedfloat3) { 3.2f, 2.3f, 0.1f };
37}
38// CHECK: @test3(
39// CHECK: store <3 x float> {{.*}}, align 4
40// CHECK: ret void
41