aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/ubsan-function.c
blob: c3113757b468a1f4c21579c0f890239f7758dde3 (plain)
1
2
3
4
5
6
7
8
9
// RUN: %clang_cc1 -emit-llvm -triple x86_64 -std=c17 -fsanitize=function %s -o - | FileCheck %s

// CHECK-LABEL: define{{.*}} @call_no_prototype(
// CHECK-NOT:     __ubsan_handle_function_type_mismatch
void call_no_prototype(void (*f)()) { f(); }

// CHECK-LABEL: define{{.*}} @call_prototype(
// CHECK:         __ubsan_handle_function_type_mismatch
void call_prototype(void (*f)(void)) { f(); }