Chris Lattner | 985f739 | 2010-05-06 06:35:23 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s |
| 2 | // RUN: %clang_cc1 -triple i386-apple-darwin -emit-llvm -o - %s |
Fariborz Jahanian | e8b31cc | 2009-11-11 17:55:25 +0000 | [diff] [blame] | 3 | |
| 4 | // PR5463 |
| 5 | extern "C" int printf(...); |
| 6 | |
| 7 | struct S { |
| 8 | double filler; |
| 9 | }; |
| 10 | |
| 11 | struct Foo { |
| 12 | Foo(void) : bar_(), dbar_(), sbar_() { |
| 13 | for (int i = 0; i < 5; i++) { |
| 14 | printf("bar_[%d] = %d\n", i, bar_[i]); |
| 15 | printf("dbar_[%d] = %f\n", i, dbar_[i]); |
| 16 | printf("sbar_[%d].filler = %f\n", i, sbar_[i].filler); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | int bar_[5]; |
| 21 | double dbar_[5]; |
| 22 | S sbar_[5]; |
| 23 | }; |
| 24 | |
Chris Lattner | 985f739 | 2010-05-06 06:35:23 +0000 | [diff] [blame] | 25 | int test1(void) { |
Fariborz Jahanian | e8b31cc | 2009-11-11 17:55:25 +0000 | [diff] [blame] | 26 | Foo a; |
| 27 | } |
| 28 | |
Chris Lattner | 985f739 | 2010-05-06 06:35:23 +0000 | [diff] [blame] | 29 | // PR7063 |
| 30 | |
| 31 | |
| 32 | struct Unit |
| 33 | { |
| 34 | Unit() {} |
| 35 | Unit(const Unit& v) {} |
| 36 | }; |
| 37 | |
| 38 | |
| 39 | struct Stuff |
| 40 | { |
| 41 | Unit leafPos[1]; |
| 42 | }; |
| 43 | |
| 44 | |
| 45 | int main() |
| 46 | { |
| 47 | |
| 48 | Stuff a; |
| 49 | Stuff b = a; |
| 50 | |
| 51 | return 0; |
Chris Lattner | 124b3de | 2010-12-21 02:36:58 +0000 | [diff] [blame] | 52 | } |