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