mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 10:26:06 +00:00

Conversion done using the script at https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34. These are tests where the conversion worked out of the box and no manual fixup was performed.
46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
// RUN: %clang_cc1 -emit-llvm -triple x86_64 -Werror %s -o - | FileCheck %s
|
|
|
|
// CHECK: @llvm.used = appending global [7 x ptr]
|
|
// CHECK-SAME: @_ZN2X0C2Ev
|
|
// CHECK-SAME: @_ZN2X0C1Ev
|
|
// CHECK-SAME: @_ZN2X0D2Ev
|
|
// CHECK-SAME: @_ZN2X0D1Ev
|
|
// CHECK-SAME: @_ZN2X16Nested2f1Ev
|
|
// CHECK-SAME: @_ZN10merge_declL4funcEv
|
|
// CHECK-SAME: @_ZN18instantiate_member1SIiE1fEv
|
|
|
|
struct X0 {
|
|
// CHECK: define linkonce_odr{{.*}} @_ZN2X0C1Ev({{.*}}
|
|
__attribute__((used, retain)) X0() {}
|
|
// CHECK: define linkonce_odr{{.*}} @_ZN2X0D1Ev({{.*}}
|
|
__attribute__((used, retain)) ~X0() {}
|
|
};
|
|
|
|
struct X1 {
|
|
struct Nested {
|
|
// CHECK-NOT: 2f0Ev
|
|
// CHECK: define linkonce_odr{{.*}} @_ZN2X16Nested2f1Ev({{.*}}
|
|
void __attribute__((retain)) f0() {}
|
|
void __attribute__((used, retain)) f1() {}
|
|
};
|
|
};
|
|
|
|
// CHECK: define internal void @_ZN10merge_declL4funcEv(){{.*}}
|
|
namespace merge_decl {
|
|
static void func();
|
|
void bar() { void func() __attribute__((used, retain)); }
|
|
static void func() {}
|
|
} // namespace merge_decl
|
|
|
|
namespace instantiate_member {
|
|
template <typename T>
|
|
struct S {
|
|
void __attribute__((used, retain)) f() {}
|
|
};
|
|
|
|
void test() {
|
|
// CHECK: define linkonce_odr{{.*}} void @_ZN18instantiate_member1SIiE1fEv({{.*}}
|
|
S<int> a;
|
|
}
|
|
} // namespace instantiate_member
|