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