2014-03-23 07:33:22 +08:00
|
|
|
// RUN: rm -rf %t
|
2016-12-23 08:23:01 +08:00
|
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -std=c++11 -fmodules-cache-path=%t -I %S/Inputs -triple %itanium_abi_triple -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s
|
|
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -std=c++11 -fmodules-cache-path=%t -I %S/Inputs -triple %itanium_abi_triple -disable-llvm-passes -emit-llvm -debug-info-kind=limited -o - %s | FileCheck %s
|
2014-03-23 07:33:22 +08:00
|
|
|
// FIXME: When we have a syntax for modules in C++, use that.
|
|
|
|
|
|
|
|
@import cxx_irgen_top;
|
2014-04-19 11:48:30 +08:00
|
|
|
|
|
|
|
CtorInit<int> x;
|
|
|
|
|
2014-03-23 07:33:22 +08:00
|
|
|
@import cxx_irgen_left;
|
|
|
|
@import cxx_irgen_right;
|
|
|
|
|
2014-08-14 05:15:09 +08:00
|
|
|
// Keep these two namespace definitions separate; merging them hides the bug.
|
|
|
|
namespace EmitInlineMethods {
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK-DAG: define linkonce_odr {{(dso_local )?}}[[CC:([0-9_a-z]*cc[ ]+)?]]void @_ZN17EmitInlineMethods1C1fEPNS_1AE(
|
|
|
|
// CHECK-DAG: declare {{(dso_local )?}}[[CC]]void @_ZN17EmitInlineMethods1A1gEv(
|
2014-08-14 05:15:09 +08:00
|
|
|
struct C {
|
|
|
|
__attribute__((used)) void f(A *p) { p->g(); }
|
|
|
|
};
|
|
|
|
}
|
|
|
|
namespace EmitInlineMethods {
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK-DAG: define linkonce_odr {{(dso_local )?}}[[CC]]void @_ZN17EmitInlineMethods1D1fEPNS_1BE(
|
|
|
|
// CHECK-DAG: define linkonce_odr {{(dso_local )?}}[[CC]]void @_ZN17EmitInlineMethods1B1gEv(
|
2014-08-14 05:15:09 +08:00
|
|
|
struct D {
|
|
|
|
__attribute__((used)) void f(B *p) { p->g(); }
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2015-09-15 05:35:16 +08:00
|
|
|
// CHECK-DAG: define available_externally hidden {{.*}}{{signext i32|i32}} @_ZN1SIiE1gEv({{.*}} #[[ALWAYS_INLINE:.*]] align
|
2014-03-23 07:33:22 +08:00
|
|
|
int a = S<int>::g();
|
|
|
|
|
|
|
|
int b = h();
|
|
|
|
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK-DAG: define linkonce_odr {{.*}}{{signext i32|i32}} @_Z3minIiET_S0_S0_(i32
|
2014-03-23 08:27:18 +08:00
|
|
|
int c = min(1, 2);
|
2015-09-15 05:35:16 +08:00
|
|
|
// CHECK: define available_externally {{.*}}{{signext i32|i32}} @_ZN1SIiE1fEv({{.*}} #[[ALWAYS_INLINE]] align
|
2014-08-08 02:53:08 +08:00
|
|
|
|
2014-08-01 07:46:44 +08:00
|
|
|
namespace ImplicitSpecialMembers {
|
2015-01-22 08:24:57 +08:00
|
|
|
// CHECK-LABEL: define {{.*}} @_ZN22ImplicitSpecialMembers1BC2ERKS0_(
|
2014-08-01 07:46:44 +08:00
|
|
|
// CHECK: call {{.*}} @_ZN22ImplicitSpecialMembers1AC1ERKS0_(
|
2015-01-22 08:24:57 +08:00
|
|
|
// CHECK-LABEL: define {{.*}} @_ZN22ImplicitSpecialMembers1BC2EOS0_(
|
2014-08-01 07:46:44 +08:00
|
|
|
// CHECK: call {{.*}} @_ZN22ImplicitSpecialMembers1AC1ERKS0_(
|
|
|
|
// CHECK-LABEL: define {{.*}} @_ZN22ImplicitSpecialMembers1CC2ERKS0_(
|
|
|
|
// CHECK: call {{.*}} @_ZN22ImplicitSpecialMembers1AC1ERKS0_(
|
2015-01-22 08:24:57 +08:00
|
|
|
// CHECK-LABEL: define {{.*}} @_ZN22ImplicitSpecialMembers1CC2EOS0_(
|
2014-08-01 07:46:44 +08:00
|
|
|
// CHECK: call {{.*}} @_ZN22ImplicitSpecialMembers1AC1ERKS0_(
|
2015-01-22 08:24:57 +08:00
|
|
|
// CHECK-LABEL: define {{.*}} @_ZN22ImplicitSpecialMembers1DC2ERKS0_(
|
2014-08-01 09:56:39 +08:00
|
|
|
// CHECK: call {{.*}} @_ZN22ImplicitSpecialMembers1AC1ERKS0_(
|
2015-01-22 08:24:57 +08:00
|
|
|
// CHECK-LABEL: define {{.*}} @_ZN22ImplicitSpecialMembers1DC2EOS0_(
|
|
|
|
// CHECK: call {{.*}} @_ZN22ImplicitSpecialMembers1AC1ERKS0_(
|
|
|
|
// CHECK-LABEL: define {{.*}} @_ZN20OperatorDeleteLookup1AD0Ev(
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK: call {{.*}}void @_ZN20OperatorDeleteLookup1AdlEPv(
|
2015-01-22 08:24:57 +08:00
|
|
|
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK-DAG: call {{[a-z\_\d]*[ ]?i32}} @_ZN8CtorInitIiE1fEv(
|
2014-08-01 07:46:44 +08:00
|
|
|
|
|
|
|
extern B b1;
|
|
|
|
B b2(b1);
|
|
|
|
B b3(static_cast<B&&>(b1));
|
|
|
|
|
|
|
|
extern C c1;
|
|
|
|
C c2(c1);
|
|
|
|
C c3(static_cast<C&&>(c1));
|
|
|
|
|
|
|
|
extern D d1;
|
|
|
|
D d2(d1);
|
|
|
|
D d3(static_cast<D&&>(d1));
|
|
|
|
}
|
|
|
|
|
2014-08-08 02:53:08 +08:00
|
|
|
namespace OperatorDeleteLookup {
|
|
|
|
// Trigger emission of B's vtable and deleting dtor.
|
|
|
|
// This requires us to know what operator delete was selected.
|
|
|
|
void g() { f(); }
|
|
|
|
}
|
|
|
|
|
2014-08-01 07:46:44 +08:00
|
|
|
|
2014-03-23 07:33:22 +08:00
|
|
|
// CHECK: attributes #[[ALWAYS_INLINE]] = {{.*}} alwaysinline
|