Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm %s -o - -std=c++11 -triple %itanium_abi_triple | FileCheck %s |
Fariborz Jahanian | 636a0ff | 2009-09-02 17:10:17 +0000 | [diff] [blame] | 2 | |
| 3 | extern "C" int printf(...); |
| 4 | |
| 5 | struct S { |
| 6 | S() { printf("S::S\n"); } |
| 7 | }; |
| 8 | |
| 9 | struct A { |
| 10 | double x; |
| 11 | A() : x(), y(), s() { printf("x = %f y = %x \n", x, y); } |
| 12 | int *y; |
| 13 | S s; |
| 14 | }; |
| 15 | |
| 16 | A a; |
| 17 | |
Richard Smith | 5f9a7e3 | 2012-11-12 21:38:00 +0000 | [diff] [blame] | 18 | struct B { |
| 19 | B() = default; |
| 20 | B(const B&); |
| 21 | }; |
| 22 | |
| 23 | // CHECK-NOT: _ZL1b |
| 24 | static B b; |
| 25 | |
| 26 | struct C { |
| 27 | ~C(); |
| 28 | }; |
| 29 | |
| 30 | // CHECK: _ZL1c |
| 31 | static C c[4]; |
| 32 | |
Fariborz Jahanian | 636a0ff | 2009-09-02 17:10:17 +0000 | [diff] [blame] | 33 | int main() { |
| 34 | } |
Pirama Arumuga Nainar | 3ea9e33 | 2015-04-08 08:57:32 -0700 | [diff] [blame^] | 35 | |
| 36 | namespace PR22793 { |
| 37 | template <typename> |
| 38 | struct foo { |
| 39 | protected: |
| 40 | // CHECK-NOT: _ZN7PR227933fooIiED2Ev |
| 41 | ~foo() = default; |
| 42 | friend void func(); |
| 43 | }; |
| 44 | |
| 45 | void func() { foo<int> f; } |
| 46 | |
| 47 | template struct foo<int>; |
| 48 | } |