[PATCH] D75520: [compiler-rt] Fix tests after defaulting to -fno-common. NFC.

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 06:38:35 PST 2020


SjoerdMeijer created this revision.
SjoerdMeijer added reviewers: tstellar, peter.smith, vsk, jyknight.
Herald added subscribers: kristof.beyls, dberris.
Herald added a project: LLVM.

After committing D75056 <https://reviews.llvm.org/D75056>, which I've reverted now, these compiler-rt tests failed:

      
  FAIL: AddressSanitizer-aarch64-linux::odr_c_test.c
  FAIL: AddressSanitizer-aarch64-linux::set_shadow_test.c

and the same tests in a different configuration:

  FAIL: AddressSanitizer-aarch64-linux-dynamic::odr_c_test.c
  FAIL: AddressSanitizer-aarch64-linux-dynamic::set_shadow_test.c

I don't want to hold up this commit for these tests, so I intend to recommit D75056 <https://reviews.llvm.org/D75056> soon'ish with these test changes included. I am posting this for review so that we can (post-commit) further address this.

      

It looks like these tests are not very robust and rely on `-fcommon` behaviour. But both tests are not really in my area, so a second opinion would be good to confirm if adding `-fcommon` to the run lines is good enough, or if the tests need to be rewritten.


https://reviews.llvm.org/D75520

Files:
  compiler-rt/test/asan/TestCases/Linux/odr_c_test.c
  compiler-rt/test/asan/TestCases/set_shadow_test.c


Index: compiler-rt/test/asan/TestCases/set_shadow_test.c
===================================================================
--- compiler-rt/test/asan/TestCases/set_shadow_test.c
+++ compiler-rt/test/asan/TestCases/set_shadow_test.c
@@ -1,4 +1,4 @@
-// RUN: %clang_asan -O0 %s -o %t
+// RUN: %clang_asan -fcommon -O0 %s -o %t
 // RUN: %run %t 0x00 2>&1 | FileCheck %s -check-prefix=X00
 // RUN: not %run %t 0xf1 2>&1 | FileCheck %s -check-prefix=XF1
 // RUN: not %run %t 0xf2 2>&1 | FileCheck %s -check-prefix=XF2
Index: compiler-rt/test/asan/TestCases/Linux/odr_c_test.c
===================================================================
--- compiler-rt/test/asan/TestCases/Linux/odr_c_test.c
+++ compiler-rt/test/asan/TestCases/Linux/odr_c_test.c
@@ -1,9 +1,9 @@
 // Test that we can properly report an ODR violation
 // between an instrumented global and a non-instrumented global.
 
-// RUN: %clang_asan %s -fPIC -shared -o %dynamiclib1  -DFILE1
-// RUN: %clang_asan %s -fPIC -shared -o %dynamiclib2  -DFILE2
-// RUN: %clang_asan %s -fPIE %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t
+// RUN: %clang_asan -fcommon %s -fPIC -shared -o %dynamiclib1  -DFILE1
+// RUN: %clang_asan -fcommon %s -fPIC -shared -o %dynamiclib2  -DFILE2
+// RUN: %clang_asan -fcommon %s -fPIE %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t
 // RUN: not %run %t 2>&1 | FileCheck %s
 //
 // CHECK: The following global variable is not properly aligned.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75520.247882.patch
Type: text/x-patch
Size: 1434 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200303/a515c79f/attachment.bin>


More information about the llvm-commits mailing list