1 ; RUN: opt < %s -passes=dfsan -dfsan-abilist=%S/Inputs/abilist.txt -S | FileCheck %s
2 target triple = "x86_64-unknown-linux-gnu"
4 ; Declare custom functions. Inputs/abilist.txt causes any function with a
5 ; name matching /custom.*/ to be a custom function.
6 declare i32 @custom_fun_one_callback(ptr %callback_arg)
7 declare i32 @custom_fun_two_callbacks(
13 declare i8 @a_callback_fun(i32, double)
15 ; CHECK-LABEL: @call_custom_funs_with_callbacks.dfsan
16 define void @call_custom_funs_with_callbacks(ptr %callback_arg) {
17 ;; The callback should have attribute 'nonnull':
18 ; CHECK: call signext i32 @__dfsw_custom_fun_one_callback(
19 %call1 = call signext i32 @custom_fun_one_callback(
20 ptr nonnull @a_callback_fun
23 ;; Call a custom function with two callbacks. Check their annotations.
24 ; CHECK: call i32 @__dfsw_custom_fun_two_callbacks(
26 %call2 = call i32 @custom_fun_two_callbacks(
27 ptr nonnull @a_callback_fun,
29 ptr noalias @a_callback_fun