From 63c8c005d7b2ecaa85e77725113241f562adb73b Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 28 May 2020 15:55:03 -0700 Subject: [PATCH] test: add a ODR violation check for the static standard library The static version of the standard library was leaking symbols in the `llvm::` namespace which would result in ODR violations were the artifact linking against `LLVMSupport` (via another dependency). In particular, `llvm::SmallVector` and `llvm::StringSwitch` symbols were being leaked. This adds a test case specifically for the static variant of the library. The dynamic variant of the library is already tested in a separate test. --- test/stdlib/llvm-support-odr-violation-static.test-sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 test/stdlib/llvm-support-odr-violation-static.test-sh diff --git a/test/stdlib/llvm-support-odr-violation-static.test-sh b/test/stdlib/llvm-support-odr-violation-static.test-sh new file mode 100644 index 0000000000000..ca8bcc92ef490 --- /dev/null +++ b/test/stdlib/llvm-support-odr-violation-static.test-sh @@ -0,0 +1,5 @@ +// RUN: %llvm-nm --defined-only -C %target-static-stdlib-path/libswiftCore.a | %FileCheck --allow-empty %s +// CHECK-NOT: [^:]llvm:: + +// REQUIRES: OS=linux-gnu +// REQUIRES: static_stdlib