[PATCH] D85433: [compiler-rt][ubsan][test] XFAIL TypeCheck/misaligned.cpp on Sparc

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 01:54:44 PDT 2020


ro updated this revision to Diff 283840.
ro added a comment.

Use -fsanitize-trap for the s1 subtest.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85433/new/

https://reviews.llvm.org/D85433

Files:
  compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp


Index: compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp
===================================================================
--- compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp
+++ compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp
@@ -1,7 +1,6 @@
 // RUN: %clangxx %gmlt -fsanitize=alignment %s -O3 -o %t
 // RUN: %run %t l0 && %run %t s0 && %run %t r0 && %run %t m0 && %run %t f0 && %run %t n0 && %run %t u0
 // RUN: %run %t l1 2>&1 | FileCheck %s --check-prefix=CHECK-LOAD --strict-whitespace
-// RUN: %run %t s1 2>&1 | FileCheck %s --check-prefix=CHECK-STORE
 // RUN: %run %t r1 2>&1 | FileCheck %s --check-prefix=CHECK-REFERENCE
 // RUN: %run %t m1 2>&1 | FileCheck %s --check-prefix=CHECK-MEMBER
 // RUN: %run %t f1 2>&1 | FileCheck %s --check-prefix=CHECK-MEMFUN
@@ -9,6 +8,9 @@
 // RUN: %run %t u1 2>&1 | FileCheck %s --check-prefix=CHECK-UPCAST
 // RUN: %env_ubsan_opts=print_stacktrace=1 %run %t l1 2>&1 | FileCheck %s --check-prefix=CHECK-LOAD --check-prefix=CHECK-STACK-LOAD
 
+// RUN: %clangxx %gmlt -fsanitize=alignment -fsanitize-trap %s -O3 -o %t
+// RUN: not --crash %run %t s1
+
 // RUN: %clangxx -fsanitize=alignment -fno-sanitize-recover=alignment %s -O3 -o %t
 // RUN: not %run %t w1 2>&1 | FileCheck %s --check-prefix=CHECK-WILD
 // Compilation error make the test fails.
@@ -48,6 +50,9 @@
     // CHECK-STACK-LOAD: #0 {{.*}}main{{.*}}misaligned.cpp
 
   case 's':
+    // CHECK-STORE isn't currently used: e.g. on SPARC, a strict-alignment
+    // target,  the access generates a SIGBUS that ubsan cannot currently handle.
+    // Cf. Bug 47015.
     // CHECK-STORE: misaligned.cpp:[[@LINE+4]]{{(:5)?}}: runtime error: store to misaligned address [[PTR:0x[0-9a-f]*]] for type 'int', which requires 4 byte alignment
     // CHECK-STORE-NEXT: [[PTR]]: note: pointer points here
     // CHECK-STORE-NEXT: {{^ 00 00 00 01 02 03 04  05}}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85433.283840.patch
Type: text/x-patch
Size: 1881 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200807/3db39b18/attachment.bin>


More information about the llvm-commits mailing list