blob: b70e366f4cfbd66ba92f98ba58241afd1f58e8f0 [file] [log] [blame]
Daniel Dunbar195337d2010-02-09 02:48:28 +00001// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
Daniel Dunbar195337d2010-02-09 02:48:28 +00002
Daniel Dunbar15006572010-02-16 19:43:39 +00003struct s0 {
Daniel Dunbar195337d2010-02-09 02:48:28 +00004 int Start, End;
5 unsigned Alignment;
6 int TheStores __attribute__((aligned(16)));
7};
Daniel Dunbar647a1ec2010-02-16 19:45:20 +00008
9// CHECK: define void @f0
10// CHECK: alloca %struct.s0, align 16
Daniel Dunbar15006572010-02-16 19:43:39 +000011extern "C" void f0() {
12 (void) s0();
13}
14
Daniel Dunbar647a1ec2010-02-16 19:45:20 +000015// CHECK: define void @f1
16// CHECK: alloca %struct.s0, align 16
Daniel Dunbar15006572010-02-16 19:43:39 +000017extern "C" void f1() {
Daniel Dunbar647a1ec2010-02-16 19:45:20 +000018 (void) (struct s0) { 0, 0, 0, 0 };
19}
20
21// CHECK: define i64 @f2
22// CHECK: alloca %struct.s1, align 2
23struct s1 { short x; short y; };
24extern "C" struct s1 f2(int a, struct s1 *x, struct s1 *y) {
25 if (a)
26 return *x;
27 return *y;
Daniel Dunbar195337d2010-02-09 02:48:28 +000028}