blob: 518e7834b14128d0fe671842ca5ad928a5cfcaff [file] [log] [blame]
Tanya Lattner2393a242004-11-06 23:08:26 +00001; RUN: llvm-as -f %s -o - | llc
2
Vikram S. Adve16242152003-05-31 04:45:56 +00003;; Date: May 28, 2003.
4;; From: test/Programs/SingleSource/richards_benchmark.c
5;; Function: struct task *handlerfn(struct packet *pkt)
6;;
7;; Error: PreSelection puts the arguments of the Phi just before
8;; the Phi instead of in predecessor blocks. This later
9;; causes llc to produces an invalid register <NULL VALUE>
10;; for the phi arguments.
Vikram S. Adve16242152003-05-31 04:45:56 +000011
Vikram S. Adve16242152003-05-31 04:45:56 +000012 %struct..packet = type { %struct..packet*, int, int, int, [4 x sbyte] }
13 %struct..task = type { %struct..task*, int, int, %struct..packet*, int, %struct..task* (%struct..packet*)*, int, int }
14%v1 = external global int
15%v2 = external global int
16
17implementation ; Functions:
18
19%struct..task* %handlerfn(%struct..packet* %pkt.2) {
20entry: ; No predecessors!
21 %tmp.1 = setne %struct..packet* %pkt.2, null
22 br bool %tmp.1, label %cond_false, label %cond_continue
23
24cond_false: ; preds = %entry
25 br label %cond_continue
26
27cond_continue: ; preds = %entry, %cond_false
28 %mem_tmp.0 = phi int* [ %v2, %cond_false ], [ %v1, %entry ]
29 %tmp.12 = cast int* %mem_tmp.0 to %struct..packet*
30 call void %append( %struct..packet* %pkt.2, %struct..packet* %tmp.12 )
31 ret %struct..task* null
32}
33
34declare void %append(%struct..packet*, %struct..packet*)