[PATCH] D35085: Respect exitcode sanitizer option in UBSan

Francis Ricci via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 13:19:30 PDT 2017


fjricci added inline comments.


================
Comment at: test/ubsan/TestCases/Float/cast-overflow.cpp:3
 // RUN: %run %t _
-// RUN: %env_ubsan_opts=print_summary=1:report_error_type=1 %run %t 0 2>&1 | FileCheck %s --check-prefix=CHECK-0
-// RUN: %run %t 1 2>&1 | FileCheck %s --check-prefix=CHECK-1
-// RUN: %run %t 2 2>&1 | FileCheck %s --check-prefix=CHECK-2
-// RUN: %run %t 3 2>&1 | FileCheck %s --check-prefix=CHECK-3
-// RUN: %run %t 4 2>&1 | FileCheck %s --check-prefix=CHECK-4
-// RUN: %run %t 5 2>&1 | FileCheck %s --check-prefix=CHECK-5
-// RUN: %run %t 6 2>&1 | FileCheck %s --check-prefix=CHECK-6
+// RUN: %env_ubsan_opts=print_summary=1:report_error_type=1 not %run %t 0 2>&1 | FileCheck %s --check-prefix=CHECK-0
+// RUN: not %run %t 1 2>&1 | FileCheck %s --check-prefix=CHECK-1
----------------
vsk wrote:
> fjricci wrote:
> > vsk wrote:
> > > This test doesn't use the exitcode flag, so why does this test need to change? I have the same question about the other test case changes here.
> > The exitcode flag defaults to returning failure on error (`lib/sanitizer_common/sanitizer_flags.inc`), which I think makes sense.
> I don't think that enabling a sanitizer should, by default, change the way a program's exit codes work. Users may intend to quit with specific exit codes in scenarios which trigger sanitizer diagnostics.
> 
Failing after observing an error is the default in the other sanitizers already, and I'm not sure it makes sense to special-case UBSan here.


https://reviews.llvm.org/D35085





More information about the llvm-commits mailing list