; should pass through the optimizer without failure.
;
; Extra code:
-; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine
+; RUN: opt < %s -instcombine
; END.
-;
-
-target endian = little
-target pointersize = 32
-%silly = external constant int ; <int*> [#uses=1]
-implementation ; Functions:
+target datalayout = "e-p:32:32"
+@silly = external constant i32 ; <i32*> [#uses=1]
-declare void %bzero(sbyte*, uint)
+declare void @bzero(i8*, i32)
-declare void %bcopy(sbyte*, sbyte*, uint)
+declare void @bcopy(i8*, i8*, i32)
-declare int %bcmp(sbyte*, sbyte*, uint)
+declare i32 @bcmp(i8*, i8*, i32)
-declare int %fputs(sbyte*, sbyte*)
+declare i32 @fputs(i8*, i8*)
-declare int %fputs_unlocked(sbyte*, sbyte*)
+declare i32 @fputs_unlocked(i8*, i8*)
-int %function(int %a.1) {
-entry: ; No predecessors!
- %a.0 = alloca int ; <int*> [#uses=2]
- %result = alloca int ; <int*> [#uses=2]
- store int %a.1, int* %a.0
- %tmp.0 = load int* %a.0 ; <int> [#uses=1]
- %tmp.1 = load int* %silly ; <int> [#uses=1]
- %tmp.2 = add int %tmp.0, %tmp.1 ; <int> [#uses=1]
- store int %tmp.2, int* %result
- br label %return
+define i32 @function(i32 %a.1) {
+entry:
+ %a.0 = alloca i32 ; <i32*> [#uses=2]
+ %result = alloca i32 ; <i32*> [#uses=2]
+ store i32 %a.1, i32* %a.0
+ %tmp.0 = load i32* %a.0 ; <i32> [#uses=1]
+ %tmp.1 = load i32* @silly ; <i32> [#uses=1]
+ %tmp.2 = add i32 %tmp.0, %tmp.1 ; <i32> [#uses=1]
+ store i32 %tmp.2, i32* %result
+ br label %return
-return: ; preds = %entry
- %tmp.3 = load int* %result ; <int> [#uses=1]
- ret int %tmp.3
+return: ; preds = %entry
+ %tmp.3 = load i32* %result ; <i32> [#uses=1]
+ ret i32 %tmp.3
}
+