blob: 34576546571d4157cae9c955591a5169a528be35 [file] [log] [blame]
Puyan Lotfi678e19d2019-06-20 18:28:21 +00001// REQUIRES: x86-registered-target
Puyan Lotfie7821922019-11-13 23:58:09 -05002// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
Puyan Lotfi68f29da2019-06-20 16:59:48 +00003// RUN: FileCheck -check-prefix=CHECK-TAPI %s
4
Puyan Lotfie7821922019-11-13 23:58:09 -05005// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
Puyan Lotfi68f29da2019-06-20 16:59:48 +00006// RUN: FileCheck -check-prefix=CHECK-TAPI2 %s
Puyan Lotfie7821922019-11-13 23:58:09 -05007
8// RUN: %clang -target x86_64-unknown-linux-gnu -c -o - %s | llvm-readelf -s - 2>&1 | \
Puyan Lotfi68f29da2019-06-20 16:59:48 +00009// RUN: FileCheck -check-prefix=CHECK-SYMBOLS %s
10
11// For the following:
12// g()
13// n::S<int>::S()
14// n::S<int>::~S()
15// n::S<int>::func() const
16// n::S<int>::S(n::S<int> const&)
17
18// We expect these manglings:
19// CHECK-TAPI: Symbols:
20// CHECK-TAPI-NOT: _ZNK1n1SIiEclEv
21// CHECK-TAPI2: Symbols:
22// CHECK-TAPI2: _Z1g
23
24// CHECK-SYMBOLS-DAG: FUNC GLOBAL DEFAULT {{[0-9]}} _Z1g
25// CHECK-SYMBOLS-DAG: FUNC WEAK HIDDEN {{[0-9]}} _ZNK1n1SIiEclEv
26
27namespace n {
28template <typename T>
29struct __attribute__((__visibility__("default"))) S {
30 S() = default;
31 ~S() = default;
32 int __attribute__((__visibility__(("default")))) func() const {
33 return 1844;
34 }
35 int __attribute__((__visibility__(("hidden")))) operator()() const {
36 return 1863;
37 }
38};
39} // namespace n
40
41void g() { n::S<int>()(); }