summaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/ubsan-check-debuglocs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/ubsan-check-debuglocs.cpp')
-rw-r--r--test/CodeGenCXX/ubsan-check-debuglocs.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGenCXX/ubsan-check-debuglocs.cpp b/test/CodeGenCXX/ubsan-check-debuglocs.cpp
new file mode 100644
index 000000000000..96a697aca5eb
--- /dev/null
+++ b/test/CodeGenCXX/ubsan-check-debuglocs.cpp
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited \
+// RUN: -fsanitize=null %s -o - | FileCheck %s
+
+// Check that santizer check calls have a !dbg location.
+// CHECK: define {{.*}}acquire{{.*}} !dbg
+// CHECK-NOT: define
+// CHECK: call void {{.*}}@__ubsan_handle_type_mismatch_v1
+// CHECK-SAME: !dbg
+
+struct SourceLocation {
+ SourceLocation acquire() {};
+};
+extern "C" void __ubsan_handle_type_mismatch_v1(SourceLocation *Loc);
+static void handleTypeMismatchImpl(SourceLocation *Loc) { Loc->acquire(); }
+void __ubsan_handle_type_mismatch_v1(SourceLocation *Loc) {
+ handleTypeMismatchImpl(Loc);
+}