--- /dev/null
+; RUN: llvm-upgrade < %s | llvm-as | llc
+ %struct._obstack_chunk = type { sbyte*, %struct._obstack_chunk*, [4 x sbyte] }
+ %struct.obstack = type { int, %struct._obstack_chunk*, sbyte*, sbyte*, sbyte*, int, int, %struct._obstack_chunk* (...)*, void (...)*, sbyte*, ubyte }
+%stmt_obstack = external global %struct.obstack ; <%struct.obstack*> [#uses=1]
+
+implementation ; Functions:
+
+void %expand_start_bindings() {
+entry:
+ br bool false, label %cond_true, label %cond_next
+
+cond_true: ; preds = %entry
+ %new_size.0.i = select bool false, int 0, int 0 ; <int> [#uses=1]
+ %tmp.i = load uint* cast (ubyte* getelementptr (%struct.obstack* %stmt_obstack, int 0, uint 10) to uint*) ; <uint> [#uses=1]
+ %tmp.i = cast uint %tmp.i to ubyte ; <ubyte> [#uses=1]
+ %tmp21.i = and ubyte %tmp.i, 1 ; <ubyte> [#uses=1]
+ %tmp22.i = seteq ubyte %tmp21.i, 0 ; <bool> [#uses=1]
+ br bool %tmp22.i, label %cond_false30.i, label %cond_true23.i
+
+cond_true23.i: ; preds = %cond_true
+ ret void
+
+cond_false30.i: ; preds = %cond_true
+ %tmp35.i = tail call %struct._obstack_chunk* null( int %new_size.0.i ) ; <%struct._obstack_chunk*> [#uses=0]
+ ret void
+
+cond_next: ; preds = %entry
+ ret void
+}
--- /dev/null
+; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu | \
+; RUN: grep .hidden | count 2
+; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin8.8.0 | \
+; RUN: grep .private_extern | count 2
+
+%struct.Person = type { i32 }
+@a = hidden global i32 0
+@b = external global i32
+
+
+define weak hidden void @_ZN6Person13privateMethodEv(%struct.Person* %this) {
+ ret void
+}
+
+declare void @function(i32)
+
+define weak void @_ZN6PersonC1Ei(%struct.Person* %this, i32 %_c) {
+ ret void
+}
+
--- /dev/null
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f
+; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
+; RUN: grep piclabel %t | count 3
+; RUN: grep GOT %t | count 3
+; RUN: not grep GOTOFF %t
+
+@ptr = external global i32*
+@dst = external global i32
+@src = external global i32
+
+define void @foo() {
+entry:
+ store i32* @dst, i32** @ptr
+ %tmp.s = load i32* @src
+ store i32 %tmp.s, i32* @dst
+ ret void
+}
+
--- /dev/null
+; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
+; RUN: -o %t -f
+; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
+; RUN: grep piclabel %t | count 3
+; RUN: grep GOTOFF %t | count 4
+
+@ptr = internal global i32* null
+@dst = internal global i32 0
+@src = internal global i32 0
+
+define void @foo() {
+entry:
+ store i32* @dst, i32** @ptr
+ %tmp.s = load i32* @src
+ store i32 %tmp.s, i32* @dst
+ ret void
+}
+
--- /dev/null
+; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
+; RUN: -o %t -f
+; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
+; RUN: grep piclabel %t | count 3
+; RUN: grep PLT %t | count 1
+
+define void @bar() {
+entry:
+ call void(...)* @foo()
+ br label %return
+return:
+ ret void
+}
+
+declare void @foo(...)
--- /dev/null
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f
+; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
+; RUN: grep piclabel %t | count 3
+; RUN: grep PLT %t | count 1
+; RUN: grep GOT %t | count 1
+; RUN: not grep GOTOFF %t
+
+@pfoo = external global void(...)*
+
+define void @bar() {
+entry:
+ %tmp = call void(...)*(...)* @afoo()
+ store void(...)* %tmp, void(...)** @pfoo
+ %tmp1 = load void(...)** @pfoo
+ call void(...)* %tmp1()
+ br label %return
+return:
+ ret void
+}
+
+declare void(...)* @afoo(...)
--- /dev/null
+; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
+; RUN: -o %t -f
+; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
+; RUN: grep piclabel %t | count 3
+; RUN: grep PLT %t | count 1
+
+@ptr = external global i32*
+
+define void @foo() {
+entry:
+ %ptr = malloc i32, i32 10
+ ret void
+}
+
--- /dev/null
+; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
+; RUN: -o %t -f
+; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
+; RUN: grep piclabel %t | count 3
+; RUN: grep GOT %t | count 3
+
+@ptr = global i32* null
+@dst = global i32 0
+@src = global i32 0
+
+define void @foo() {
+entry:
+ store i32* @dst, i32** @ptr
+ %tmp.s = load i32* @src
+ store i32 %tmp.s, i32* @dst
+ ret void
+}
+
--- /dev/null
+; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
+; RUN: -o %t -f
+; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
+; RUN: grep piclabel %t | count 3
+; RUN: grep GOTOFF %t | count 2
+; RUN: grep CPI %t | count 4
+
+define double @foo(i32 %a.u) {
+entry:
+ %tmp = icmp eq i32 %a.u,0
+ %retval = select i1 %tmp, double 4.561230e+02, double 1.234560e+02
+ ret double %retval
+}
+
--- /dev/null
+; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
+; RUN: -o %t -f
+; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
+; RUN: grep piclabel %t | count 3
+; RUN: grep PLT %t | count 6
+; RUN: grep GOTOFF %t | count 14
+; RUN: grep JTI %t | count 2
+
+define void @bar(i32 %n.u) {
+entry:
+ switch i32 %n.u, label %bb12 [i32 1, label %bb i32 2, label %bb6 i32 4, label %bb7 i32 5, label %bb8 i32 6, label %bb10 i32 7, label %bb1 i32 8, label %bb3 i32 9, label %bb4 i32 10, label %bb9 i32 11, label %bb2 i32 12, label %bb5 i32 13, label %bb11 ]
+bb:
+ tail call void(...)* @foo1()
+ ret void
+bb1:
+ tail call void(...)* @foo2()
+ ret void
+bb2:
+ tail call void(...)* @foo6()
+ ret void
+bb3:
+ tail call void(...)* @foo3()
+ ret void
+bb4:
+ tail call void(...)* @foo4()
+ ret void
+bb5:
+ tail call void(...)* @foo5()
+ ret void
+bb6:
+ tail call void(...)* @foo1()
+ ret void
+bb7:
+ tail call void(...)* @foo2()
+ ret void
+bb8:
+ tail call void(...)* @foo6()
+ ret void
+bb9:
+ tail call void(...)* @foo3()
+ ret void
+bb10:
+ tail call void(...)* @foo4()
+ ret void
+bb11:
+ tail call void(...)* @foo5()
+ ret void
+bb12:
+ tail call void(...)* @foo6()
+ ret void
+}
+
+declare void @foo1(...)
+declare void @foo2(...)
+declare void @foo6(...)
+declare void @foo3(...)
+declare void @foo4(...)
+declare void @foo5(...)
+++ /dev/null
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu | \
-; RUN: grep .hidden | count 2
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin8.8.0 | \
-; RUN: grep .private_extern | count 2
-
-%struct.Person = type { i32 }
-@a = hidden global i32 0
-@b = external global i32
-
-
-define weak hidden void @_ZN6Person13privateMethodEv(%struct.Person* %this) {
- ret void
-}
-
-declare void @function(i32)
-
-define weak void @_ZN6PersonC1Ei(%struct.Person* %this, i32 %_c) {
- ret void
-}
-
+++ /dev/null
-; RUN: llvm-upgrade < %s | llvm-as | llc
- %struct._obstack_chunk = type { sbyte*, %struct._obstack_chunk*, [4 x sbyte] }
- %struct.obstack = type { int, %struct._obstack_chunk*, sbyte*, sbyte*, sbyte*, int, int, %struct._obstack_chunk* (...)*, void (...)*, sbyte*, ubyte }
-%stmt_obstack = external global %struct.obstack ; <%struct.obstack*> [#uses=1]
-
-implementation ; Functions:
-
-void %expand_start_bindings() {
-entry:
- br bool false, label %cond_true, label %cond_next
-
-cond_true: ; preds = %entry
- %new_size.0.i = select bool false, int 0, int 0 ; <int> [#uses=1]
- %tmp.i = load uint* cast (ubyte* getelementptr (%struct.obstack* %stmt_obstack, int 0, uint 10) to uint*) ; <uint> [#uses=1]
- %tmp.i = cast uint %tmp.i to ubyte ; <ubyte> [#uses=1]
- %tmp21.i = and ubyte %tmp.i, 1 ; <ubyte> [#uses=1]
- %tmp22.i = seteq ubyte %tmp21.i, 0 ; <bool> [#uses=1]
- br bool %tmp22.i, label %cond_false30.i, label %cond_true23.i
-
-cond_true23.i: ; preds = %cond_true
- ret void
-
-cond_false30.i: ; preds = %cond_true
- %tmp35.i = tail call %struct._obstack_chunk* null( int %new_size.0.i ) ; <%struct._obstack_chunk*> [#uses=0]
- ret void
-
-cond_next: ; preds = %entry
- ret void
-}
+++ /dev/null
-; RUN: llvm-as < %s | \
-; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep GOT %t | count 3
-; RUN: not grep GOTOFF %t
-
-@ptr = external global i32*
-@dst = external global i32
-@src = external global i32
-
-define void @foo() {
-entry:
- store i32* @dst, i32** @ptr
- %tmp.s = load i32* @src
- store i32 %tmp.s, i32* @dst
- ret void
-}
-
+++ /dev/null
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
-; RUN: -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep GOTOFF %t | count 4
-
-@ptr = internal global i32* null
-@dst = internal global i32 0
-@src = internal global i32 0
-
-define void @foo() {
-entry:
- store i32* @dst, i32** @ptr
- %tmp.s = load i32* @src
- store i32 %tmp.s, i32* @dst
- ret void
-}
-
+++ /dev/null
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
-; RUN: -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep PLT %t | count 1
-
-define void @bar() {
-entry:
- call void(...)* @foo()
- br label %return
-return:
- ret void
-}
-
-declare void @foo(...)
+++ /dev/null
-; RUN: llvm-as < %s | \
-; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep PLT %t | count 1
-; RUN: grep GOT %t | count 1
-; RUN: not grep GOTOFF %t
-
-@pfoo = external global void(...)*
-
-define void @bar() {
-entry:
- %tmp = call void(...)*(...)* @afoo()
- store void(...)* %tmp, void(...)** @pfoo
- %tmp1 = load void(...)** @pfoo
- call void(...)* %tmp1()
- br label %return
-return:
- ret void
-}
-
-declare void(...)* @afoo(...)
+++ /dev/null
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
-; RUN: -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep PLT %t | count 1
-
-@ptr = external global i32*
-
-define void @foo() {
-entry:
- %ptr = malloc i32, i32 10
- ret void
-}
-
+++ /dev/null
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
-; RUN: -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep GOT %t | count 3
-
-@ptr = global i32* null
-@dst = global i32 0
-@src = global i32 0
-
-define void @foo() {
-entry:
- store i32* @dst, i32** @ptr
- %tmp.s = load i32* @src
- store i32 %tmp.s, i32* @dst
- ret void
-}
-
+++ /dev/null
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
-; RUN: -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep GOTOFF %t | count 2
-; RUN: grep CPI %t | count 4
-
-define double @foo(i32 %a.u) {
-entry:
- %tmp = icmp eq i32 %a.u,0
- %retval = select i1 %tmp, double 4.561230e+02, double 1.234560e+02
- ret double %retval
-}
-
+++ /dev/null
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
-; RUN: -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep PLT %t | count 6
-; RUN: grep GOTOFF %t | count 14
-; RUN: grep JTI %t | count 2
-
-define void @bar(i32 %n.u) {
-entry:
- switch i32 %n.u, label %bb12 [i32 1, label %bb i32 2, label %bb6 i32 4, label %bb7 i32 5, label %bb8 i32 6, label %bb10 i32 7, label %bb1 i32 8, label %bb3 i32 9, label %bb4 i32 10, label %bb9 i32 11, label %bb2 i32 12, label %bb5 i32 13, label %bb11 ]
-bb:
- tail call void(...)* @foo1()
- ret void
-bb1:
- tail call void(...)* @foo2()
- ret void
-bb2:
- tail call void(...)* @foo6()
- ret void
-bb3:
- tail call void(...)* @foo3()
- ret void
-bb4:
- tail call void(...)* @foo4()
- ret void
-bb5:
- tail call void(...)* @foo5()
- ret void
-bb6:
- tail call void(...)* @foo1()
- ret void
-bb7:
- tail call void(...)* @foo2()
- ret void
-bb8:
- tail call void(...)* @foo6()
- ret void
-bb9:
- tail call void(...)* @foo3()
- ret void
-bb10:
- tail call void(...)* @foo4()
- ret void
-bb11:
- tail call void(...)* @foo5()
- ret void
-bb12:
- tail call void(...)* @foo6()
- ret void
-}
-
-declare void @foo1(...)
-declare void @foo2(...)
-declare void @foo6(...)
-declare void @foo3(...)
-declare void @foo4(...)
-declare void @foo5(...)