xref: /llvm-project/llvm/test/Transforms/InstCombine/2009-02-25-CrashZeroSizeArray.ll (revision 4ab40eca080965c65802710e39adbb78c4ce7bde)
1; RUN: opt < %s -passes=instcombine | llvm-dis
2; PR3667
3target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
4target triple = "i386-pc-linux-gnu"
5
6define void @_ada_c32001b(i32 %tmp5, ptr %src) {
7entry:
8	%max289 = select i1 false, i32 %tmp5, i32 0		; <i32> [#uses=1]
9	%tmp6 = mul i32 %max289, 4		; <i32> [#uses=1]
10	%tmp7 = alloca i8, i32 0		; <ptr> [#uses=1]
11	%tmp11 = load i32, ptr %src, align 1		; <i32> [#uses=1]
12	%tmp12 = icmp eq i32 %tmp11, 3		; <i1> [#uses=1]
13	%tmp13 = zext i1 %tmp12 to i8		; <i8> [#uses=1]
14	%tmp14 = ashr i32 %tmp6, 2		; <i32> [#uses=1]
15	%tmp16 = mul i32 %tmp14, 4		; <i32> [#uses=1]
16	%tmp17 = mul i32 1, %tmp16		; <i32> [#uses=1]
17	%tmp18 = getelementptr i8, ptr %tmp7, i32 %tmp17		; <ptr> [#uses=1]
18	%tmp21 = getelementptr i32, ptr %tmp18, i32 0		; <ptr> [#uses=1]
19	%tmp22 = load i32, ptr %tmp21, align 1		; <i32> [#uses=1]
20	%tmp23 = icmp eq i32 %tmp22, 4		; <i1> [#uses=1]
21	%tmp24 = zext i1 %tmp23 to i8		; <i8> [#uses=1]
22	%toBool709 = icmp ne i8 %tmp13, 0		; <i1> [#uses=1]
23	%toBool710 = icmp ne i8 %tmp24, 0		; <i1> [#uses=1]
24	%tmp25 = and i1 %toBool709, %toBool710		; <i1> [#uses=1]
25	%tmp26 = zext i1 %tmp25 to i8		; <i8> [#uses=1]
26	%toBool711 = icmp ne i8 %tmp26, 0		; <i1> [#uses=1]
27	br i1 %toBool711, label %a, label %b
28
29a:		; preds = %entry
30	ret void
31
32b:		; preds = %entry
33	ret void
34}
35