blob: d5dd1050b199060b174bba9d8187b89620061427 [file] [log] [blame]
Brendon Cahoon86f783e2016-04-04 18:13:18 +00001; RUN: opt < %s -analyze -basicaa -da
Philip Pfaffeefb5ad12019-01-08 14:06:58 +00002; RUN: opt < %s -passes="print<da>"
Brendon Cahoon86f783e2016-04-04 18:13:18 +00003
4; Test that the dependence analysis pass does seg-fault due to a null pointer
5; dereference. The code in gcdMIVTest requires a null check for the result of
6; getConstantPart.
7
8target datalayout = "e-m:e-p:32:32-i1:32-i64:64-a:0-v32:32-n16:32"
9
10%0 = type { i32 }
11%1 = type { [2 x [512 x %0]], [512 x %0], %2, [144 x i8], %9, %10, %11, %12, %17, [12 x i8], %18, %19, %21, [128 x i8] }
12%2 = type { [64 x i16], [64 x i16], [64 x %0], [64 x %0], [128 x %0], [128 x %0], [256 x %0], [256 x %0], [32 x %0], [32 x %0], [64 x i16], [64 x i16], [64 x i16], [64 x i16], [64 x i16], %3, %4, %5, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], %6, %7, [32 x i32], [32 x i32], [32 x i32], [64 x i16], %8, [8 x i64], [4 x i64], [2 x i64], [256 x i8], [256 x i32], [64 x i16], [64 x i16] }
13%3 = type { [64 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [64 x i32], [64 x i32], [64 x i32], [64 x i32], [64 x i32], [64 x i32], [64 x i32], [64 x i32], [64 x i32], [64 x i16], [64 x i16], [64 x i16], [64 x i16], [64 x i16], [64 x i16], [64 x i16], [64 x i16], [64 x i16], [64 x i16], [64 x i16], [64 x i16], [32 x %0], [32 x %0], [128 x i8] }
14%4 = type { [64 x i16], [64 x i16], [64 x i16], [64 x i16], [64 x i16], [64 x i16], [64 x i16], [64 x i16] }
15%5 = type { [128 x i8], [256 x i8], [256 x i8] }
16%6 = type { [64 x i32], [128 x i16], [64 x i16], [64 x i16], [64 x i16] }
17%7 = type { [192 x %0], [192 x %0], [384 x %0], [1984 x %0] }
18%8 = type { [128 x i8], [128 x i8], [64 x i16], [64 x i16], [64 x i16], [64 x i16], [64 x i16], [64 x i16] }
19%9 = type { [32 x %0], [32 x %0], [64 x i32], [64 x i32], [64 x i32], [64 x i32] }
20%10 = type { [1536 x %0], [2048 x %0], [512 x i32], [256 x i32], [32 x %0], [64 x i32], [128 x i8], [512 x i32], [1024 x %0] }
21%11 = type { [512 x i32], [512 x i32], [1024 x %0], [512 x i32], [512 x %0] }
22%12 = type { %13, [2048 x %0], [2048 x %0], [256 x i32], [1024 x i32], %14, [512 x %0], [256 x i32], %15, [4 x [256 x %0]], [4 x [256 x %0]], [256 x i32], [8 x [32 x i32]], [8 x [32 x %0]], [384 x %0], [256 x i32], %16 }
23%13 = type { [2048 x %0] }
24%14 = type { [1024 x %0], [1024 x %0] }
25%15 = type { [256 x %0], [256 x %0] }
26%16 = type { [128 x %0], [128 x %0] }
27%17 = type { [32 x %0], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [2 x [8 x [32 x %0]]], [512 x %0], [512 x %0], [58 x i16] }
28%18 = type { [512 x i8] }
29%19 = type { [2048 x %0], [2560 x i16], %20, [512 x i32], [256 x i32], [512 x i8] }
30%20 = type { [768 x i32] }
31%21 = type { [416 x i32] }
32
33define void @test(%1* %A) #0 align 2 {
34entry:
35 %v1 = load i32, i32* undef, align 4
36 br label %bb13
37
38bb13:
39 %v2 = phi i32 [ undef, %entry ], [ %v39, %bb38 ]
40 br i1 undef, label %bb15, label %bb38
41
42bb15:
43 %v3 = mul nsw i32 %v2, undef
44 br label %bb17
45
46bb17:
47 br i1 undef, label %bb21, label %bb37
48
49bb21:
50 %v22 = add nsw i32 undef, 1
51 %v23 = add i32 %v22, %v3
52 %v24 = mul nsw i32 %v23, %v1
53 %v25 = getelementptr inbounds %1, %1* %A, i32 0, i32 7, i32 1, i32 %v24
54 %v26 = bitcast %0* %v25 to <32 x i32>*
55 %v27 = load <32 x i32>, <32 x i32>* %v26, align 256
56 %v28 = add i32 undef, %v3
57 %v29 = mul nsw i32 %v28, 32
58 %v30 = getelementptr inbounds %1, %1* %A, i32 0, i32 7, i32 14, i32 %v29
59 %v31 = bitcast %0* %v30 to <32 x i32>*
60 %v32 = load <32 x i32>, <32 x i32>* %v31, align 128
61 br i1 undef, label %bb21, label %bb37
62
63bb37:
64 br i1 undef, label %bb17, label %bb38
65
66bb38:
67 %v39 = add nsw i32 %v2, 1
68 br label %bb13
69
70bb40:
71 ret void
72}
73
74attributes #0 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }