Daniel Dunbar | 195337d | 2010-02-09 02:48:28 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s |
Daniel Dunbar | 195337d | 2010-02-09 02:48:28 +0000 | [diff] [blame] | 2 | |
Daniel Dunbar | 1500657 | 2010-02-16 19:43:39 +0000 | [diff] [blame] | 3 | struct s0 { |
Daniel Dunbar | 195337d | 2010-02-09 02:48:28 +0000 | [diff] [blame] | 4 | int Start, End; |
| 5 | unsigned Alignment; |
| 6 | int TheStores __attribute__((aligned(16))); |
| 7 | }; |
Daniel Dunbar | 647a1ec | 2010-02-16 19:45:20 +0000 | [diff] [blame] | 8 | |
| 9 | // CHECK: define void @f0 |
| 10 | // CHECK: alloca %struct.s0, align 16 |
Daniel Dunbar | 1500657 | 2010-02-16 19:43:39 +0000 | [diff] [blame] | 11 | extern "C" void f0() { |
| 12 | (void) s0(); |
| 13 | } |
| 14 | |
Daniel Dunbar | 647a1ec | 2010-02-16 19:45:20 +0000 | [diff] [blame] | 15 | // CHECK: define void @f1 |
| 16 | // CHECK: alloca %struct.s0, align 16 |
Daniel Dunbar | 1500657 | 2010-02-16 19:43:39 +0000 | [diff] [blame] | 17 | extern "C" void f1() { |
Daniel Dunbar | 647a1ec | 2010-02-16 19:45:20 +0000 | [diff] [blame] | 18 | (void) (struct s0) { 0, 0, 0, 0 }; |
| 19 | } |
| 20 | |
Chris Lattner | faf23b7 | 2010-06-28 19:56:59 +0000 | [diff] [blame] | 21 | // CHECK: define i32 @f2 |
Daniel Dunbar | 647a1ec | 2010-02-16 19:45:20 +0000 | [diff] [blame] | 22 | // CHECK: alloca %struct.s1, align 2 |
| 23 | struct s1 { short x; short y; }; |
| 24 | extern "C" struct s1 f2(int a, struct s1 *x, struct s1 *y) { |
| 25 | if (a) |
| 26 | return *x; |
| 27 | return *y; |
Daniel Dunbar | 195337d | 2010-02-09 02:48:28 +0000 | [diff] [blame] | 28 | } |