summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/ubsan-debuglog-return.c
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2018-11-09 21:17:38 +0000
committerAdrian Prantl <aprantl@apple.com>2018-11-09 21:17:38 +0000
commit42ab39f1e8fb4a6c30c77988ed01e0cc663d1e00 (patch)
treed6b624148dee7a5ba2c80788cec219c0cef83d30 /clang/test/CodeGen/ubsan-debuglog-return.c
parentef67ce0f6f979085271d6402dcb38bf90f878c65 (diff)
downloadbcm5719-llvm-42ab39f1e8fb4a6c30c77988ed01e0cc663d1e00.tar.gz
bcm5719-llvm-42ab39f1e8fb4a6c30c77988ed01e0cc663d1e00.zip
Revert "Revert rL346454: Fix a use-after-free introduced by r344915."
This un-reverts commit 346454 with a relaxed CHECK for Windows. llvm-svn: 346556
Diffstat (limited to 'clang/test/CodeGen/ubsan-debuglog-return.c')
-rw-r--r--clang/test/CodeGen/ubsan-debuglog-return.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/CodeGen/ubsan-debuglog-return.c b/clang/test/CodeGen/ubsan-debuglog-return.c
new file mode 100644
index 00000000000..23a1326934d
--- /dev/null
+++ b/clang/test/CodeGen/ubsan-debuglog-return.c
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -x c -debug-info-kind=line-tables-only -emit-llvm -fsanitize=returns-nonnull-attribute -o - %s | FileCheck %s
+// The UBSAN function call in the epilogue needs to have a debug location.
+
+__attribute__((returns_nonnull)) void *allocate() {}
+
+// CHECK: define {{.*}}nonnull i8* @allocate(){{.*}} !dbg
+// CHECK: call void @__ubsan_handle_nonnull_return_v1_abort
+// CHECK-SAME: !dbg ![[LOC:[0-9]+]]
+// CHECK: ret i8*
+// CHECK-SAME: !dbg ![[LOC]]
OpenPOWER on IntegriCloud