summaryrefslogtreecommitdiffstats
path: root/clang/test/InterfaceStubs/class-template-specialization.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-06-18 05:52:39 +0000
committerFangrui Song <maskray@google.com>2019-06-18 05:52:39 +0000
commit2d94dd812ff6a7639f44cf118bd3cc76c5e05efe (patch)
treede25eebc9ac2bbc5d7df08b68836231fae0ff118 /clang/test/InterfaceStubs/class-template-specialization.cpp
parent4d36782446daee1ac81e33f4ebd73cd135865d51 (diff)
downloadbcm5719-llvm-2d94dd812ff6a7639f44cf118bd3cc76c5e05efe.tar.gz
bcm5719-llvm-2d94dd812ff6a7639f44cf118bd3cc76c5e05efe.zip
Revert D60974 "[clang-ifs] Clang Interface Stubs, first version."
This reverts commit rC363626. clangIndex depends on clangFrontend. r363626 adds a dependency from clangFrontend to clangIndex, which creates a circular dependency. This is disallowed by -DBUILD_SHARED_LIBS=on builds: CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle): "clangFrontend" of type SHARED_LIBRARY depends on "clangIndex" (weak) "clangIndex" of type SHARED_LIBRARY depends on "clangFrontend" (weak) At least one of these targets is not a STATIC_LIBRARY. Cyclic dependencies are allowed only among static libraries. Note, the dependency on clangIndex cannot be removed because libclangFrontend.so is linked with -Wl,-z,defs: a shared object must have its full direct dependencies specified on the linker command line. In -DBUILD_SHARED_LIBS=off builds, this appears to work when linking `bin/clang-9`. However, it can cause trouble to downstream clang library users. The llvm build system links libraries this way: clang main_program_object_file ... lib/libclangIndex.a ... lib/libclangFrontend.a -o exe libclangIndex.a etc are not wrapped in --start-group. If the downstream application depends on libclangFrontend.a but not any other clang libraries that depend on libclangIndex.a, this can cause undefined reference errors when the linker is ld.bfd or gold. The proper fix is to not include clangIndex files in clangFrontend. llvm-svn: 363649
Diffstat (limited to 'clang/test/InterfaceStubs/class-template-specialization.cpp')
-rw-r--r--clang/test/InterfaceStubs/class-template-specialization.cpp42
1 files changed, 0 insertions, 42 deletions
diff --git a/clang/test/InterfaceStubs/class-template-specialization.cpp b/clang/test/InterfaceStubs/class-template-specialization.cpp
deleted file mode 100644
index d1f1d067ccd..00000000000
--- a/clang/test/InterfaceStubs/class-template-specialization.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \
-// RUN: FileCheck -check-prefix=CHECK-TAPI %s
-
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \
-// RUN: FileCheck -check-prefix=CHECK-TAPI2 %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -c %s | \
-// RUN: 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>()(); }
OpenPOWER on IntegriCloud