clang/test/CodeGen/ubsan-function.c
raw| 1 | // RUN: %clang_cc1 -emit-llvm -triple x86_64 -std=c17 -fsanitize=function %s -o - | FileCheck %s |
| 2 | |
| 3 | // CHECK-LABEL: define{{.*}} @call_no_prototype( |
| 4 | // CHECK-NOT: __ubsan_handle_function_type_mismatch |
| 5 | void call_no_prototype(void (*f)()) { f(); } |
| 6 | |
| 7 | // CHECK-LABEL: define{{.*}} @call_prototype( |
| 8 | // CHECK: __ubsan_handle_function_type_mismatch |
| 9 | void call_prototype(void (*f)(void)) { f(); } |