1; RUN: opt < %s -loop-unswitch -enable-new-pm=0 -disable-output
2; RUN: opt < %s -loop-unswitch -enable-new-pm=0 -enable-mssa-loop-dependency=true -verify-memoryssa -disable-output
3; PR1559
4
5target triple = "i686-pc-linux-gnu"
6	%struct.re_pattern_buffer = type { i8*, i32, i32, i32, i8*, i8*, i32, i8 }
7
8define fastcc i32 @byte_regex_compile(i8* %pattern, i32 %size, i32 %syntax, %struct.re_pattern_buffer* %bufp) {
9entry:
10        br i1 false, label %bb147, label %cond_next123
11
12cond_next123:           ; preds = %entry
13        ret i32 0
14
15bb147:          ; preds = %entry
16        switch i32 0, label %normal_char [
17                 i32 91, label %bb1734
18                 i32 92, label %bb5700
19        ]
20
21bb1734:         ; preds = %bb147
22        br label %bb1855.outer.outer
23
24cond_true1831:          ; preds = %bb1855.outer
25        br i1 %tmp1837, label %cond_next1844, label %cond_true1840
26
27cond_true1840:          ; preds = %cond_true1831
28        ret i32 0
29
30cond_next1844:          ; preds = %cond_true1831
31        br i1 false, label %bb1855.outer, label %cond_true1849
32
33cond_true1849:          ; preds = %cond_next1844
34        br label %bb1855.outer.outer
35
36bb1855.outer.outer:             ; preds = %cond_true1849, %bb1734
37        %b.10.ph.ph = phi i8* [ null, %cond_true1849 ], [ null, %bb1734 ]               ; <i8*> [#uses=1]
38        br label %bb1855.outer
39
40bb1855.outer:           ; preds = %bb1855.outer.outer, %cond_next1844
41        %b.10.ph = phi i8* [ null, %cond_next1844 ], [ %b.10.ph.ph, %bb1855.outer.outer ]               ; <i8*> [#uses=1]
42        %tmp1837 = icmp eq i8* null, null               ; <i1> [#uses=2]
43        br i1 false, label %cond_true1831, label %cond_next1915
44
45cond_next1915:          ; preds = %cond_next1961, %bb1855.outer
46        store i8* null, i8** null
47        br i1 %tmp1837, label %cond_next1929, label %cond_true1923
48
49cond_true1923:          ; preds = %cond_next1915
50        ret i32 0
51
52cond_next1929:          ; preds = %cond_next1915
53        br i1 false, label %cond_next1961, label %cond_next2009
54
55cond_next1961:          ; preds = %cond_next1929
56        %tmp1992 = getelementptr i8, i8* %b.10.ph, i32 0            ; <i8*> [#uses=0]
57        br label %cond_next1915
58
59cond_next2009:          ; preds = %cond_next1929
60        ret i32 0
61
62bb5700:         ; preds = %bb147
63        ret i32 0
64
65normal_char:            ; preds = %bb147
66        ret i32 0
67}
68