[clang] [Clang] [CodeGen] UBSan Trap Reasons (PR #145967)
Dan Liew via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 30 16:53:42 PDT 2025
================
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \
+// RUN: -fsanitize=signed-integer-overflow -fsanitize-trap=signed-integer-overflow -emit-llvm %s -o - | FileCheck %s
+
+int add_overflow(int a, int b) {
+ return a + b;
+}
+
+// CHECK: call void @llvm.ubsantrap(i8 0) {{.*}}!dbg [[LOC:![0-9]+]]
+// CHECK: [[LOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})
+// CHECK: distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer
----------------
delcypher wrote:
The specific trap messages seem to be missing from the test cases.
https://github.com/llvm/llvm-project/pull/145967
More information about the cfe-commits
mailing list