Cleanup a bunch of tests. In particular do not allow target directives in
[oota-llvm.git] / test / CodeGen / Generic / 2003-05-30-BadPreselectPhi.ll
1 ; RUN: llvm-as -f %s -o - | llc
2
3 ;; 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.
11
12         %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
17 implementation   ; Functions:
18
19 %struct..task* %handlerfn(%struct..packet* %pkt.2) {
20 entry:          ; No predecessors!
21         %tmp.1 = setne %struct..packet* %pkt.2, null
22         br bool %tmp.1, label %cond_false, label %cond_continue
23
24 cond_false:             ; preds = %entry
25         br label %cond_continue
26
27 cond_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
34 declare void %append(%struct..packet*, %struct..packet*)