Richard Smith | d28ac5b | 2014-03-22 23:33:22 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
Richard Smith | 04d05b5 | 2014-03-23 00:27:18 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -fmodules -x objective-c++ -std=c++11 -fmodules-cache-path=%t -I %S/Inputs -triple %itanium_abi_triple -disable-llvm-optzns -emit-llvm -o - %s | FileCheck %s |
Richard Smith | d28ac5b | 2014-03-22 23:33:22 +0000 | [diff] [blame] | 3 | // FIXME: When we have a syntax for modules in C++, use that. |
| 4 | |
| 5 | @import cxx_irgen_top; |
Richard Smith | cd45dbc | 2014-04-19 03:48:30 +0000 | [diff] [blame] | 6 | |
Will Schmidt | 22b065c | 2014-06-02 21:47:14 +0000 | [diff] [blame] | 7 | // CHECK-DAG: call {{[a-z]*[ ]?i32}} @_ZN8CtorInitIiE1fEv( |
Richard Smith | cd45dbc | 2014-04-19 03:48:30 +0000 | [diff] [blame] | 8 | CtorInit<int> x; |
| 9 | |
Richard Smith | d28ac5b | 2014-03-22 23:33:22 +0000 | [diff] [blame] | 10 | @import cxx_irgen_left; |
| 11 | @import cxx_irgen_right; |
| 12 | |
Hal Finkel | 834da75 | 2014-04-12 11:50:34 +0000 | [diff] [blame] | 13 | // CHECK-DAG: define available_externally hidden {{signext i32|i32}} @_ZN1SIiE1gEv({{.*}} #[[ALWAYS_INLINE:.*]] align |
Richard Smith | d28ac5b | 2014-03-22 23:33:22 +0000 | [diff] [blame] | 14 | int a = S<int>::g(); |
| 15 | |
Richard Smith | d28ac5b | 2014-03-22 23:33:22 +0000 | [diff] [blame] | 16 | int b = h(); |
| 17 | |
Hal Finkel | 834da75 | 2014-04-12 11:50:34 +0000 | [diff] [blame] | 18 | // CHECK-DAG: define linkonce_odr {{signext i32|i32}} @_Z3minIiET_S0_S0_(i32 |
Richard Smith | 04d05b5 | 2014-03-23 00:27:18 +0000 | [diff] [blame] | 19 | int c = min(1, 2); |
| 20 | |
Richard Smith | 4d23579 | 2014-08-07 18:53:08 +0000 | [diff] [blame] | 21 | // CHECK-LABEL: define {{.*}} @_ZN20OperatorDeleteLookup1AD0Ev( |
| 22 | // CHECK: call void @_ZN20OperatorDeleteLookup1AdlEPv( |
| 23 | |
Richard Smith | 6de7a24 | 2014-07-31 23:46:44 +0000 | [diff] [blame] | 24 | namespace ImplicitSpecialMembers { |
| 25 | // CHECK-LABEL: define {{.*}} @_ZN22ImplicitSpecialMembers1DC2EOS0_( |
| 26 | // CHECK: call {{.*}} @_ZN22ImplicitSpecialMembers1AC1ERKS0_( |
| 27 | // CHECK-LABEL: define {{.*}} @_ZN22ImplicitSpecialMembers1DC2ERKS0_( |
| 28 | // CHECK: call {{.*}} @_ZN22ImplicitSpecialMembers1AC1ERKS0_( |
| 29 | // CHECK-LABEL: define {{.*}} @_ZN22ImplicitSpecialMembers1CC2EOS0_( |
| 30 | // CHECK: call {{.*}} @_ZN22ImplicitSpecialMembers1AC1ERKS0_( |
| 31 | // CHECK-LABEL: define {{.*}} @_ZN22ImplicitSpecialMembers1CC2ERKS0_( |
| 32 | // CHECK: call {{.*}} @_ZN22ImplicitSpecialMembers1AC1ERKS0_( |
| 33 | // CHECK-LABEL: define {{.*}} @_ZN22ImplicitSpecialMembers1BC2EOS0_( |
| 34 | // CHECK: call {{.*}} @_ZN22ImplicitSpecialMembers1AC1ERKS0_( |
| 35 | // CHECK-LABEL: define {{.*}} @_ZN22ImplicitSpecialMembers1BC2ERKS0_( |
Richard Smith | 46bb581 | 2014-08-01 01:56:39 +0000 | [diff] [blame] | 36 | // CHECK: call {{.*}} @_ZN22ImplicitSpecialMembers1AC1ERKS0_( |
Richard Smith | 6de7a24 | 2014-07-31 23:46:44 +0000 | [diff] [blame] | 37 | |
| 38 | extern B b1; |
| 39 | B b2(b1); |
| 40 | B b3(static_cast<B&&>(b1)); |
| 41 | |
| 42 | extern C c1; |
| 43 | C c2(c1); |
| 44 | C c3(static_cast<C&&>(c1)); |
| 45 | |
| 46 | extern D d1; |
| 47 | D d2(d1); |
| 48 | D d3(static_cast<D&&>(d1)); |
| 49 | } |
| 50 | |
Richard Smith | 4d23579 | 2014-08-07 18:53:08 +0000 | [diff] [blame] | 51 | namespace OperatorDeleteLookup { |
| 52 | // Trigger emission of B's vtable and deleting dtor. |
| 53 | // This requires us to know what operator delete was selected. |
| 54 | void g() { f(); } |
| 55 | } |
| 56 | |
Richard Smith | 6de7a24 | 2014-07-31 23:46:44 +0000 | [diff] [blame] | 57 | // CHECK: define available_externally {{signext i32|i32}} @_ZN1SIiE1fEv({{.*}} #[[ALWAYS_INLINE]] align |
| 58 | |
Richard Smith | d28ac5b | 2014-03-22 23:33:22 +0000 | [diff] [blame] | 59 | // CHECK: attributes #[[ALWAYS_INLINE]] = {{.*}} alwaysinline |