[bazel] Replace strip_include_prefix in lldb with includes (#125293)
[llvm-project.git] / llvm / test / Instrumentation / DataFlowSanitizer / custom_fun_callback_attributes.ll
blob6a79fd0090f207e938655373acd2974af6c05e98
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(
8   ptr %callback_arg1,
9   i64 %an_int,
10   ptr %callback_arg2
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
21   )
23   ;; Call a custom function with two callbacks.  Check their annotations.
24   ; CHECK: call i32 @__dfsw_custom_fun_two_callbacks(
25   ; CHECK: i64 12345
26   %call2 = call i32 @custom_fun_two_callbacks(
27     ptr nonnull @a_callback_fun,
28     i64 12345,
29     ptr noalias @a_callback_fun
30   )
31   ret void