A significant number of our tests in C accidentally use functions without prototypes. This patch converts the function signatures to have a prototype for the situations where the test is not specific to K&R C declarations. e.g., void func(); becomes void func(void); This is the twelfth batch of tests being updated (the end may be in sight soon though).
11 lines
466 B
C
11 lines
466 B
C
// 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(void) {}
|
|
|
|
// 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]]
|