brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 3457654 Raw
42 lines · cpp
1// REQUIRES: x86-registered-target2// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \3// RUN: FileCheck -check-prefix=CHECK-TAPI %s4 5// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \6// RUN: FileCheck -check-prefix=CHECK-TAPI2 %s7 8// RUN: %clang -target x86_64-unknown-linux-gnu -c -o - %s | llvm-readelf -s - 2>&1 | \9// RUN: FileCheck -check-prefix=CHECK-SYMBOLS %s10 11// For the following:12// g()13// n::S<int>::S()14// n::S<int>::~S()15// n::S<int>::func() const16// n::S<int>::S(n::S<int> const&)17 18// We expect these manglings:19// CHECK-TAPI: Symbols:20// CHECK-TAPI-NOT: _ZNK1n1SIiEclEv21// CHECK-TAPI2: Symbols:22// CHECK-TAPI2: _Z1g23 24// CHECK-SYMBOLS-DAG: FUNC    GLOBAL DEFAULT    {{[0-9]}} _Z1g25// CHECK-SYMBOLS-DAG: FUNC    WEAK   HIDDEN     {{[0-9]}} _ZNK1n1SIiEclEv26 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 n40 41void g() { n::S<int>()(); }42