xref: /aosp_15_r20/external/clang/test/CodeGen/align-param.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -emit-llvm -triple i386-apple-macosx10.7.2 < %s | FileCheck %s
2*67e74705SXin Li 
3*67e74705SXin Li // The preferred alignment for a long long on x86-32 is 8; make sure the
4*67e74705SXin Li // alloca for x uses that alignment.
test(long long x)5*67e74705SXin Li int test (long long x) {
6*67e74705SXin Li   return (int)x;
7*67e74705SXin Li }
8*67e74705SXin Li // CHECK-LABEL: define i32 @test
9*67e74705SXin Li // CHECK: alloca i64, align 8
10*67e74705SXin Li 
11*67e74705SXin Li 
12*67e74705SXin Li // Make sure we honor the aligned attribute.
13*67e74705SXin Li struct X { int x,y,z,a; };
test2(struct X x __attribute ((aligned (16))))14*67e74705SXin Li int test2(struct X x __attribute((aligned(16)))) {
15*67e74705SXin Li   return x.z;
16*67e74705SXin Li }
17*67e74705SXin Li // CHECK-LABEL: define i32 @test2
18*67e74705SXin Li // CHECK: alloca %struct.X, align 16
19