[UBSan] Fix shared library linking in test for Darwin.
authorusama hameed <u_hameed@apple.com>
Fri, 30 Jun 2023 19:58:55 +0000 (12:58 -0700)
committerusama hameed <u_hameed@apple.com>
Fri, 30 Jun 2023 20:00:29 +0000 (13:00 -0700)
Without rpath information, the test fails on some Darwin platforms since the binary fails to find the shared library.

rdar://110010041

Differential Revision: https://reviews.llvm.org/D154003

compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp

index 965e865..ddd6933 100644 (file)
@@ -1,5 +1,5 @@
-// RUN: %clangxx -std=c++17 -fsanitize=function %s -O3 -g -DSHARED_LIB -fPIC -shared -o %t-so.so
-// RUN: %clangxx -std=c++17 -fsanitize=function %s -O3 -g -o %t %t-so.so
+// RUN: %clangxx -std=c++17 -fsanitize=function %s -O3 -g -DSHARED_LIB -fPIC -shared -o %dynamiclib %ld_flags_rpath_so
+// RUN: %clangxx -std=c++17 -fsanitize=function %s -O3 -g -o %t %ld_flags_rpath_exe
 // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK
 // Verify that we can disable symbolization if needed:
 // RUN: %env_ubsan_opts=symbolize=0 %run %t 2>&1 | FileCheck %s --check-prefix=NOSYM