xref: /aosp_15_r20/external/llvm/test/Instrumentation/DataFlowSanitizer/external_mask.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -dfsan -S | FileCheck %s
2*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
3*9880d681SAndroid Build Coastguard Workertarget triple = "aarch64-unknown-linux-gnu"
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerdefine i32 @test(i32 %a, i32* nocapture readonly %b) #0 {
6*9880d681SAndroid Build Coastguard Worker; CHECK: @"dfs$test"
7*9880d681SAndroid Build Coastguard Worker; CHECK: %[[RV:.*]] load{{.*}}__dfsan_shadow_ptr_mask
8*9880d681SAndroid Build Coastguard Worker; CHECK: ptrtoint i32* {{.*}} to i64
9*9880d681SAndroid Build Coastguard Worker; CHECK: and {{.*}}%[[RV:.*]]
10*9880d681SAndroid Build Coastguard Worker; CHECK: mul i64
11*9880d681SAndroid Build Coastguard Worker  %1 = load i32, i32* %b, align 4
12*9880d681SAndroid Build Coastguard Worker  %2 = add nsw i32 %1, %a
13*9880d681SAndroid Build Coastguard Worker  ret i32 %2
14*9880d681SAndroid Build Coastguard Worker}
15