[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

Michael Buch via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 13 01:21:35 PDT 2025


================
@@ -0,0 +1,16 @@
+// RUN: %clang -O0 -g -debug-info-kind=standalone -dwarf-version=5 -fsanitize=undefined \
+// RUN: -fsanitize-trap=undefined -emit-llvm -S -c %s -o - | FileCheck %s
+
+void target() { }
+
+int function_type_mismatch() {
+    int (*fp_int)(int);
+
+    fp_int = (int (*)(int))(void *)target;
+
+    return fp_int(42);
+}
+
+// CHECK: call void @llvm.ubsantrap(i8 6) {{.*}}!dbg [[LOC:![0-9]+]]
+// CHECK: [[LOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})
+// CHECK: distinct !DISubprogram(name: "__clang_trap_msg$
----------------
Michael137 wrote:

lets check that the "category" part of the fake frame name is correct too

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


More information about the cfe-commits mailing list