2022-04-07 18:03:55 +08:00
|
|
|
// RUN: %clang_cc1 -no-opaque-pointers -x c -debug-info-kind=line-tables-only -emit-llvm -fsanitize=returns-nonnull-attribute -o - %s | FileCheck %s
|
2018-11-10 05:17:38 +08:00
|
|
|
// The UBSAN function call in the epilogue needs to have a debug location.
|
|
|
|
|
2022-02-17 05:09:36 +08:00
|
|
|
__attribute__((returns_nonnull)) void *allocate(void) {}
|
2018-11-10 05:17:38 +08:00
|
|
|
|
|
|
|
// 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]]
|