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

Nick Desaulniers via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 13 10:41:24 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=CHECKSIW
+
+// Check that -fsanitize=signed-integer-overflow doesn't instrument with -fwrapv
+// RUN: %clang_cc1 -fwrapv -triple x86_64-apple-darwin -emit-llvm -o - %s -fsanitize=signed-integer-overflow | FileCheck %s --check-prefix=CHECKSIO
----------------
nickdesaulniers wrote:

Wait a second, why are you testing `signed-integer-overflow`? This is already tested in clang/test/codegen/integer-overflow.c. I didn't think your patch is changing the behavior of sio, only adding support for siw?

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


More information about the cfe-commits mailing list