1 ; RUN: opt < %s -dfsan -S | FileCheck %s
2 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
3 target triple = "x86_64-unknown-linux-gnu"
5 ; CHECK: @__dfsan_shadow_width_bits = weak_odr constant i32 [[#SBITS:]]
6 ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]]
8 @a = common global i32 0
9 @b = common global i32 0
11 ; Check that we reuse unions where possible.
13 ; CHECK-LABEL: @f.dfsan
14 define void @f(i32 %x, i32 %y) {
15 ; CHECK: or i[[#SBITS]]
17 store i32 %xay, i32* @a
18 ; CHECK-NOT: or i[[#SBITS]]
20 store i32 %xmy, i32* @b
24 ; In this case, we compute the unions on both sides because neither block
25 ; dominates the other.
27 ; CHECK-LABEL: @g.dfsan
28 define void @g(i1 %p, i32 %x, i32 %y) {
29 br i1 %p, label %l1, label %l2
32 ; CHECK: or i[[#SBITS]]
34 store i32 %xay, i32* @a
38 ; CHECK: or i[[#SBITS]]
40 store i32 %xmy, i32* @b
47 ; In this case, we know that the label for %xayax subsumes the label for %xay.
49 ; CHECK-LABEL: @h.dfsan
50 define i32 @h(i32 %x, i32 %y) {
51 ; CHECK: or i[[#SBITS]]
53 ; CHECK-NOT: or i[[#SBITS]]
54 %xayax = add i32 %xay, %x