blob: f7c3e42dc4879305279cc541e48c9211f6754371 [file] [log] [blame]
Dan Gohmanfce288f2009-09-09 00:09:15 +00001; RUN: llc < %s
Tanya Lattner2393a242004-11-06 23:08:26 +00002
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
Tanya Lattner53a66d12008-02-19 01:41:04 +000012 %struct..packet = type { %struct..packet*, i32, i32, i32, [4 x i8] }
13 %struct..task = type { %struct..task*, i32, i32, %struct..packet*, i32, %struct..task* (%struct..packet*)*, i32, i32 }
14@v1 = external global i32 ; <i32*> [#uses=1]
15@v2 = external global i32 ; <i32*> [#uses=1]
Vikram S. Adve16242152003-05-31 04:45:56 +000016
Tanya Lattner53a66d12008-02-19 01:41:04 +000017define %struct..task* @handlerfn(%struct..packet* %pkt.2) {
18entry:
19 %tmp.1 = icmp ne %struct..packet* %pkt.2, null ; <i1> [#uses=1]
20 br i1 %tmp.1, label %cond_false, label %cond_continue
Vikram S. Adve16242152003-05-31 04:45:56 +000021
Tanya Lattner53a66d12008-02-19 01:41:04 +000022cond_false: ; preds = %entry
23 br label %cond_continue
Vikram S. Adve16242152003-05-31 04:45:56 +000024
Tanya Lattner53a66d12008-02-19 01:41:04 +000025cond_continue: ; preds = %cond_false, %entry
26 %mem_tmp.0 = phi i32* [ @v2, %cond_false ], [ @v1, %entry ] ; <i32*> [#uses=1]
27 %tmp.12 = bitcast i32* %mem_tmp.0 to %struct..packet* ; <%struct..packet*> [#uses=1]
28 call void @append( %struct..packet* %pkt.2, %struct..packet* %tmp.12 )
29 ret %struct..task* null
Vikram S. Adve16242152003-05-31 04:45:56 +000030}
31
Tanya Lattner53a66d12008-02-19 01:41:04 +000032declare void @append(%struct..packet*, %struct..packet*)
33