blob: 120668aa77424310b602e9036cb3357b6726de59 [file] [log] [blame]
Tanya Lattner53a66d12008-02-19 01:41:04 +00001; RUN: llvm-as < %s -o - | llc
Tanya Lattner2393a242004-11-06 23:08:26 +00002
Vikram S. Advea7a1c7e2002-07-10 21:54:05 +00003; July 6, 2002 -- LLC Regression test
4; This test case checks if the integer CC register %xcc (or %ccr)
5; is correctly spilled. The code fragment came from function
6; MakeGraph in Olden-mst.
7; The original code made all comparisons with 0, so that the %xcc
8; register is not needed for the branch in the first basic block.
9; Replace 0 with 1 in the first comparson so that the
10; branch-on-register instruction cannot be used directly, i.e.,
11; the %xcc register is needed for the first branch.
12;
Vikram S. Advea7a1c7e2002-07-10 21:54:05 +000013
Tanya Lattner53a66d12008-02-19 01:41:04 +000014 %Graph = type %struct.graph_st*
15 %Hash = type %struct.hash*
16 %HashEntry = type %struct.hash_entry*
17 %Vertex = type %struct.vert_st*
18 %struct.graph_st = type { [1 x %Vertex] }
19 %struct.hash = type { %HashEntry*, i32 (i32)*, i32 }
20 %struct.hash_entry = type { i32, i8*, %HashEntry }
21 %struct.vert_st = type { i32, %Vertex, %Hash }
22@HashRange = external global i32 ; <i32*> [#uses=0]
23@.LC0 = internal global [13 x i8] c"Make phase 2\00" ; <[13 x i8]*> [#uses=0]
24@.LC1 = internal global [13 x i8] c"Make phase 3\00" ; <[13 x i8]*> [#uses=0]
25@.LC2 = internal global [13 x i8] c"Make phase 4\00" ; <[13 x i8]*> [#uses=0]
26@.LC3 = internal global [15 x i8] c"Make returning\00" ; <[15 x i8]*> [#uses=0]
Vikram S. Advea7a1c7e2002-07-10 21:54:05 +000027
Tanya Lattner53a66d12008-02-19 01:41:04 +000028define %Graph @MakeGraph(i32 %numvert, i32 %numproc) {
29bb1:
30 %reg111 = add i32 %numproc, -1 ; <i32> [#uses=2]
31 %cond275 = icmp slt i32 %reg111, 1 ; <i1> [#uses=1]
32 %cond276 = icmp sle i32 %reg111, 0 ; <i1> [#uses=1]
33 %cond277 = icmp sge i32 %numvert, 0 ; <i1> [#uses=1]
34 %reg162 = add i32 %numvert, 3 ; <i32> [#uses=0]
35 br i1 %cond275, label %bb7, label %bb4
Vikram S. Advea7a1c7e2002-07-10 21:54:05 +000036
Tanya Lattner53a66d12008-02-19 01:41:04 +000037bb4: ; preds = %bb1
38 br i1 %cond276, label %bb7, label %bb5
Vikram S. Advea7a1c7e2002-07-10 21:54:05 +000039
Tanya Lattner53a66d12008-02-19 01:41:04 +000040bb5: ; preds = %bb4
41 br i1 %cond277, label %bb7, label %bb6
Vikram S. Advea7a1c7e2002-07-10 21:54:05 +000042
Tanya Lattner53a66d12008-02-19 01:41:04 +000043bb6: ; preds = %bb5
44 ret %Graph null
Vikram S. Advea7a1c7e2002-07-10 21:54:05 +000045
Tanya Lattner53a66d12008-02-19 01:41:04 +000046bb7: ; preds = %bb5, %bb4, %bb1
47 ret %Graph null
Vikram S. Advea7a1c7e2002-07-10 21:54:05 +000048}
49