blob: b044b5cf52e804dd0c58687e0663a1446f8770a4 [file] [log] [blame]
Tanya Lattner3f7706b2004-11-07 06:08:43 +00001; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
2; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3; RUN: diff %t1.ll %t2.ll
4
Chris Lattner13d38cd2001-11-26 19:16:37 +00005implementation
6
7;; This is an irreducible flow graph
8
9
10void "irreducible"(bool %cond)
11begin
12 br bool %cond, label %X, label %Y
13
14X:
15 br label %Y
16Y:
17 br label %X
18end
19
20;; This is a pair of loops that share the same header
21
22void "sharedheader"(bool %cond)
23begin
24 br label %A
25A:
26 br bool %cond, label %X, label %Y
27
28X:
29 br label %A
30Y:
31 br label %A
32end
33
34;; This is a simple nested loop
35void "nested"(bool %cond1, bool %cond2, bool %cond3)
36begin
37 br label %Loop1
38
39Loop1:
40 br label %Loop2
41
42Loop2:
43 br label %Loop3
44
45Loop3:
46 br bool %cond3, label %Loop3, label %L3Exit
47
48L3Exit:
49 br bool %cond2, label %Loop2, label %L2Exit
50
51L2Exit:
52 br bool %cond1, label %Loop1, label %L1Exit
53
54L1Exit:
55 ret void
56end
57