[clang] [compiler-rt] [Sanitizer] add signed-integer-wrap sanitizer (PR #80089)

Nick Desaulniers via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 31 13:31:28 PST 2024


================
@@ -0,0 +1,77 @@
+// Check that -fsanitize=signed-integer-wrap instruments with -fwrapv
+// RUN: %clang_cc1 -fwrapv -triple x86_64-apple-darwin -emit-llvm -o - %s -fsanitize=signed-integer-wrap | FileCheck %s --check-prefix=CHECK
----------------
nickdesaulniers wrote:

`CHECK` is the implicit default prefix if otherwise unspecified.  Being explicit here is not necessary and is discouraged (unlike the zen of python).

If the first RUN line and the second run line share most output and only differ slightly, then you should use `--check-prefixes=` (plural) with a common shared prefix and non-shared prefix. Example:

```
// RUN: ... --check-prefixes=CHECK,CHECK-FOO
// RUN: ... -check-prefixes=CHECK,CHECK-BAR
```
The generated check lines from update_cc_test_checks will collapse the common lines to CHECK:, and DTRT for the rest.

https://github.com/llvm/llvm-project/pull/80089


More information about the cfe-commits mailing list