[TwoAddressInstructionPass] When looking for a 3 addr conversion after commuting...
[oota-llvm.git] / test / CodeGen / MSP430 / 2009-11-08-InvalidResNo.ll
1 ; RUN: llc < %s
2 target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
3 target triple = "msp430-elf"
4
5 %struct.httpd_fs_file = type { i8*, i16 }
6 %struct.psock = type { %struct.pt, %struct.pt, i8*, i8*, i8*, i16, i16, %struct.httpd_fs_file, i16, i8, i8 }
7 %struct.pt = type { i16 }
8
9 @foo = external global i8*
10
11 define signext i8 @psock_readto(%struct.psock* nocapture %psock, i8 zeroext %c) nounwind {
12 entry:
13   switch i16 undef, label %sw.epilog [
14     i16 0, label %sw.bb
15     i16 283, label %if.else.i
16   ]
17
18 sw.bb:                                            ; preds = %entry
19   br label %do.body
20
21 do.body:                                          ; preds = %while.cond36.i, %while.end.i, %sw.bb
22   br label %while.cond.i
23
24 if.else.i:                                        ; preds = %entry
25   br i1 undef, label %psock_newdata.exit, label %if.else11.i
26
27 if.else11.i:                                      ; preds = %if.else.i
28   ret i8 0
29
30 psock_newdata.exit:                               ; preds = %if.else.i
31   ret i8 0
32
33 while.cond.i:                                     ; preds = %while.body.i, %do.body
34   br i1 undef, label %while.end.i, label %while.body.i
35
36 while.body.i:                                     ; preds = %while.cond.i
37   br i1 undef, label %do.end41, label %while.cond.i
38
39 while.end.i:                                      ; preds = %while.cond.i
40   br i1 undef, label %do.body, label %while.cond36.i.preheader
41
42 while.cond36.i.preheader:                         ; preds = %while.end.i
43   br label %while.cond36.i
44
45 while.cond36.i:                                   ; preds = %while.body41.i, %while.cond36.i.preheader
46   br i1 undef, label %do.body, label %while.body41.i
47
48 while.body41.i:                                   ; preds = %while.cond36.i
49   %tmp43.i = load i8*, i8** @foo                      ; <i8*> [#uses=2]
50   %tmp44.i = load i8, i8* %tmp43.i                    ; <i8> [#uses=1]
51   %ptrincdec50.i = getelementptr inbounds i8, i8* %tmp43.i, i16 1 ; <i8*> [#uses=1]
52   store i8* %ptrincdec50.i, i8** @foo
53   %cmp55.i = icmp eq i8 %tmp44.i, %c              ; <i1> [#uses=1]
54   br i1 %cmp55.i, label %do.end41, label %while.cond36.i
55
56 do.end41:                                         ; preds = %while.body41.i, %while.body.i
57   br i1 undef, label %if.then46, label %sw.epilog
58
59 if.then46:                                        ; preds = %do.end41
60   ret i8 0
61
62 sw.epilog:                                        ; preds = %do.end41, %entry
63   ret i8 2
64 }