llvm-project/clang/test/InterfaceStubs/class-template-specialization.cpp
Puyan Lotfi e782192d5e [clang][IFS][test][NFC] Tightening up clang-ifs tests to use -cc1 more often.
Unless the test is explicitly testing a driver feature if clang
interface stubs I have changed the tests to use %clang_cc1. This should
make some changes I plan to make to the driver job pipeline cause fewer
test changes and breakages.
2019-11-14 02:25:22 -05:00

42 lines
1.2 KiB
C++

// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
// RUN: FileCheck -check-prefix=CHECK-TAPI %s
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
// RUN: FileCheck -check-prefix=CHECK-TAPI2 %s
// RUN: %clang -target x86_64-unknown-linux-gnu -c -o - %s | llvm-readelf -s - 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-SYMBOLS %s
// For the following:
// g()
// n::S<int>::S()
// n::S<int>::~S()
// n::S<int>::func() const
// n::S<int>::S(n::S<int> const&)
// We expect these manglings:
// CHECK-TAPI: Symbols:
// CHECK-TAPI-NOT: _ZNK1n1SIiEclEv
// CHECK-TAPI2: Symbols:
// CHECK-TAPI2: _Z1g
// CHECK-SYMBOLS-DAG: FUNC GLOBAL DEFAULT {{[0-9]}} _Z1g
// CHECK-SYMBOLS-DAG: FUNC WEAK HIDDEN {{[0-9]}} _ZNK1n1SIiEclEv
namespace n {
template <typename T>
struct __attribute__((__visibility__("default"))) S {
S() = default;
~S() = default;
int __attribute__((__visibility__(("default")))) func() const {
return 1844;
}
int __attribute__((__visibility__(("hidden")))) operator()() const {
return 1863;
}
};
} // namespace n
void g() { n::S<int>()(); }