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

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 11:57:38 PDT 2020


vsk added inline comments.


================
Comment at: compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp:12
+// RUN: %clangxx %gmlt -fsanitize=alignment -fsanitize-trap %s -O3 -o %t
+// RUN: not --crash %run %t s1
+
----------------
ro wrote:
> vsk wrote:
> > Is it possible to write this as `not --crash %run %t s1 2>&1 | FileCheck %s --check-prefix=CHECK-STORE`? I'd expect the ubsan runtime to be able to print out the diagnostic, then call abort().
> Unfortunately not: with `-fsanitize-trap` the runtime isn't entered at all.  Everywhere I tried (Linux/x86_84, Solaris/sparcv9, Linux/sparc64) the test program just prints
> ```
> Illegal Instruction (core dumped)
> ```
> IIUC this is just the use case for `-fsanitize-trap`: environments where the runtime isn't available (kernel) or cannot be used (libc).
I apologize - I mixed up -fsanitize-trap and -fno-sanitize-recover=alignment. According to https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#usage, it should be possible to use the latter to enter the runtime and then abort.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85433



More information about the llvm-commits mailing list