xref: /llvm-project/llvm/test/Instrumentation/DataFlowSanitizer/force_zero.ll (revision 66c3444f4cc5c1f70ec33e7806f8236a39b6adc2)
1; RUN: opt < %s -passes=dfsan -dfsan-abilist=%S/Inputs/abilist.txt -S | FileCheck %s -DSHADOW_XOR_MASK=87960930222080
2target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
3target triple = "x86_64-pc-linux-gnu"
4
5define i32 @function_to_force_zero(i32 %0, ptr %1) {
6  ; CHECK-LABEL: define i32 @function_to_force_zero.dfsan
7  ; CHECK: %[[#SHADOW_XOR:]] = xor i64 {{.*}}, [[SHADOW_XOR_MASK]]
8  ; CHECK: %[[#SHADOW_PTR:]] = inttoptr i64 %[[#SHADOW_XOR]] to ptr
9  ; CHECK: store i32 0, ptr %[[#SHADOW_PTR]]
10  ; CHECK: store i32 %{{.*}}
11  store i32 %0, ptr %1, align 4
12  ; CHECK: store i8 0, {{.*}}@__dfsan_retval_tls
13  ; CHECK: ret i32
14  ret i32 %0
15}
16