Puyan Lotfi | 678e19d | 2019-06-20 18:28:21 +0000 | [diff] [blame] | 1 | // REQUIRES: x86-registered-target |
Puyan Lotfi | c382d03 | 2019-10-08 15:23:14 +0000 | [diff] [blame] | 2 | // RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs -emit-merged-ifs \ |
Puyan Lotfi | 926f4f7 | 2019-08-22 23:44:34 +0000 | [diff] [blame] | 3 | // RUN: -interface-stub-version=experimental-ifs-v1 %s | \ |
Puyan Lotfi | 68f29da | 2019-06-20 16:59:48 +0000 | [diff] [blame] | 4 | // RUN: FileCheck -check-prefix=CHECK-TAPI %s |
| 5 | |
Puyan Lotfi | c382d03 | 2019-10-08 15:23:14 +0000 | [diff] [blame] | 6 | // RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs -emit-merged-ifs \ |
Puyan Lotfi | 926f4f7 | 2019-08-22 23:44:34 +0000 | [diff] [blame] | 7 | // RUN: -interface-stub-version=experimental-ifs-v1 %s | \ |
Puyan Lotfi | 68f29da | 2019-06-20 16:59:48 +0000 | [diff] [blame] | 8 | // 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 | |
| 29 | namespace n { |
| 30 | template <typename T> |
| 31 | struct __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 | |
| 43 | void g() { n::S<int>()(); } |