From: usama hameed Date: Fri, 30 Jun 2023 19:58:55 +0000 (-0700) Subject: [UBSan] Fix shared library linking in test for Darwin. X-Git-Tag: upstream/17.0.6~3213 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=52a280bb60c20e12df3e1e91701f6338e03595d1;p=platform%2Fupstream%2Fllvm.git [UBSan] Fix shared library linking in test for Darwin. 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 --- diff --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp b/compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp index 965e865..ddd6933 100644 --- a/compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp +++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp @@ -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