[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
Wed Mar 4 02:53:05 PST 2020
SjoerdMeijer updated this revision to Diff 248133.
SjoerdMeijer added a comment.
Thanks for that solution, have copied it to the test file.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75520/new/
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
@@ -21,13 +21,13 @@
void __asan_set_shadow_f5(size_t addr, size_t size);
void __asan_set_shadow_f8(size_t addr, size_t size);
-char a __attribute__((aligned(8)));
+char* a;
void f(long arg) {
size_t shadow_offset;
size_t shadow_scale;
__asan_get_shadow_mapping(&shadow_scale, &shadow_offset);
- size_t addr = (((size_t)&a) >> shadow_scale) + shadow_offset;
+ size_t addr = (((size_t)a) >> shadow_scale) + shadow_offset;
switch (arg) {
// X00-NOT: AddressSanitizer
@@ -61,9 +61,10 @@
int main(int argc, char **argv) {
assert(argc > 1);
+ a = malloc(8);
long arg = strtol(argv[1], 0, 16);
f(arg);
- a = 1;
+ *a = 1;
printf("PASS\n");
return 0;
}
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.248133.patch
Type: text/x-patch
Size: 1845 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200304/20e3678a/attachment.bin>
More information about the llvm-commits
mailing list