Fix InstCombine/2007-10-31-StringCrash.ll by removing an obvious
[oota-llvm.git] / test / Transforms / InstCombine / 2003-07-21-ExternalConstant.ll
1 ;
2 ; Test: ExternalConstant
3 ;
4 ; Description:
5 ;       This regression test helps check whether the instruction combining
6 ;       optimization pass correctly handles global variables which are marked
7 ;       as external and constant.
8 ;
9 ;       If a problem occurs, we should die on an assert().  Otherwise, we
10 ;       should pass through the optimizer without failure.
11 ;
12 ; Extra code:
13 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine
14 ; END.
15 ;
16
17 target endian = little
18 target pointersize = 32
19 %silly = external constant int          ; <int*> [#uses=1]
20
21 implementation   ; Functions:
22
23 declare void %bzero(sbyte*, uint)
24
25 declare void %bcopy(sbyte*, sbyte*, uint)
26
27 declare int %bcmp(sbyte*, sbyte*, uint)
28
29 declare int %fputs(sbyte*, sbyte*)
30
31 declare int %fputs_unlocked(sbyte*, sbyte*)
32
33 int %function(int %a.1) {
34 entry:          ; No predecessors!
35         %a.0 = alloca int               ; <int*> [#uses=2]
36         %result = alloca int            ; <int*> [#uses=2]
37         store int %a.1, int* %a.0
38         %tmp.0 = load int* %a.0         ; <int> [#uses=1]
39         %tmp.1 = load int* %silly               ; <int> [#uses=1]
40         %tmp.2 = add int %tmp.0, %tmp.1         ; <int> [#uses=1]
41         store int %tmp.2, int* %result
42         br label %return
43
44 return:         ; preds = %entry
45         %tmp.3 = load int* %result              ; <int> [#uses=1]
46         ret int %tmp.3
47 }