diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2007-02-05 20:47:22 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2007-02-05 20:47:22 +0000 |
| commit | 3aaaa0b2bd3825580647b7e0ee5045a8e32e0413 (patch) | |
| tree | 2ca99bb6046e1441bf5af80fc1dff176ddc79a8c /llvm/test | |
| parent | e84cf921412069284266f02e8aa3fa18ca315e25 (diff) | |
| download | bcm5719-llvm-3aaaa0b2bd3825580647b7e0ee5045a8e32e0413.tar.gz bcm5719-llvm-3aaaa0b2bd3825580647b7e0ee5045a8e32e0413.zip | |
For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.
llvm-svn: 33918
Diffstat (limited to 'llvm/test')
22 files changed, 14 insertions, 236 deletions
diff --git a/llvm/test/Integer/calltest_bt.ll b/llvm/test/Integer/calltest_bt.ll index c4a7f63fe4c..ac0c79563c2 100644 --- a/llvm/test/Integer/calltest_bt.ll +++ b/llvm/test/Integer/calltest_bt.ll @@ -5,7 +5,6 @@ %FunTy = type i28(i28) declare i28 @"test"(...) ; Test differences of prototype -declare i28 @"test"() ; Differ only by vararg implementation @@ -17,18 +16,18 @@ define void @"invoke"(%FunTy *%x) { define i28 @"main"(i28 %argc) ; TODO: , sbyte **argv, sbyte **envp) begin - %retval = call i28 (i28) *@test(i28 %argc) + %retval = call i28 (i28) *@test2(i28 %argc) %two = add i28 %retval, %retval - %retval2 = invoke i28 @test(i28 %argc) + %retval2 = invoke i28 @test2(i28 %argc) to label %Next unwind label %Error Next: %two2 = add i28 %two, %retval2 - call void @invoke (%FunTy* @test) + call void @invoke (%FunTy* @test2) ret i28 %two2 Error: ret i28 -1 end -define i28 @"test"(i28 %i0) { +define i28 @"test2"(i28 %i0) { ret i28 %i0 } diff --git a/llvm/test/Linker/redefinition.ll b/llvm/test/Linker/redefinition.ll new file mode 100644 index 00000000000..ae2dc624756 --- /dev/null +++ b/llvm/test/Linker/redefinition.ll @@ -0,0 +1,10 @@ +; Test linking two functions with different prototypes and two globals +; in different modules. +; RUN: llvm-as %s -o %t.foo1.bc -f +; RUN: llvm-as %s -o %t.foo2.bc -f +; RUN: echo "define void @foo(i32 %x) { ret void }" | llvm-as -o %t.foo3.bc -f +; RUN: llvm-link %t.foo1.bc %t.foo2.bc -o %t.bc 2>&1 | \ +; RUN: grep "Function is already defined" +; RUN: llvm-link %t.foo1.bc %t.foo3.bc -o %t.bc 2>&1 | \ +; RUN: grep "Function 'foo' defined as both" +define void @foo() { ret void } diff --git a/llvm/test/Transforms/FunctionResolve/.cvsignore b/llvm/test/Transforms/FunctionResolve/.cvsignore deleted file mode 100644 index 7f2443f2f31..00000000000 --- a/llvm/test/Transforms/FunctionResolve/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -Output -*.log -*.sum diff --git a/llvm/test/Transforms/FunctionResolve/2002-08-19-ResolveGlobalVars.ll b/llvm/test/Transforms/FunctionResolve/2002-08-19-ResolveGlobalVars.ll deleted file mode 100644 index 427227aeb3e..00000000000 --- a/llvm/test/Transforms/FunctionResolve/2002-08-19-ResolveGlobalVars.ll +++ /dev/null @@ -1,18 +0,0 @@ -; Test that: extern int X[] and int X[] = { 1, 2, 3, 4 } are resolved -; correctly. -; -; RUN: llvm-as < %s | opt -funcresolve | llvm-dis | not grep external - -@X = external global [0 x int] -@X = global [4 x int] [ int 1, int 2, int 3, int 4 ] - -implementation ; Functions: - -int @foo(int %x) { -bb1: ;[#uses=0] - store int 5, int* getelementptr ([0 x int]* @X, long 0, long 2) - %F = getelementptr [0 x int]* @X, long 0, long 2 - %val = load int* %F - ret int %val -} - diff --git a/llvm/test/Transforms/FunctionResolve/2002-08-19-ResolveGlobalVarsEasier.ll b/llvm/test/Transforms/FunctionResolve/2002-08-19-ResolveGlobalVarsEasier.ll deleted file mode 100644 index 188fc95b12d..00000000000 --- a/llvm/test/Transforms/FunctionResolve/2002-08-19-ResolveGlobalVarsEasier.ll +++ /dev/null @@ -1,20 +0,0 @@ -; Test that: extern int X[] and int X[] = { 1, 2, 3, 4 } are resolved -; correctly. This doesn't have constantexprs -; -; RUN: llvm-as < %s | opt -funcresolve | llvm-dis | not grep external -; - -@X = external global [0 x int] -@X = global [4 x int] [ int 1, int 2, int 3, int 4 ] - -implementation ; Functions: - -int %foo(int %x) { -bb1: ;[#uses=0] - %G = getelementptr [0 x int]* @X, long 0, long 1 - store int 5, int* %G - %F = getelementptr [0 x int]* @X, long 0, long 2 - %val = load int* %F - ret int %val -} - diff --git a/llvm/test/Transforms/FunctionResolve/2002-11-07-RetMismatch.ll b/llvm/test/Transforms/FunctionResolve/2002-11-07-RetMismatch.ll deleted file mode 100644 index 2ca82686fb6..00000000000 --- a/llvm/test/Transforms/FunctionResolve/2002-11-07-RetMismatch.ll +++ /dev/null @@ -1,12 +0,0 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -funcresolve -funcresolve | llvm-dis | not grep declare - -declare void %qsortg(sbyte*, int, int) - -void %test() { - call void %qsortg(sbyte* null, int 0, int 0) - ret void -} - -int %qsortg(sbyte* %base, int %n, int %size) { - ret int %n -} diff --git a/llvm/test/Transforms/FunctionResolve/2002-11-09-ExternFn.ll b/llvm/test/Transforms/FunctionResolve/2002-11-09-ExternFn.ll deleted file mode 100644 index d5eb0ca9b3b..00000000000 --- a/llvm/test/Transforms/FunctionResolve/2002-11-09-ExternFn.ll +++ /dev/null @@ -1,11 +0,0 @@ -; XFAIL: * -; -; RUN: llvm-upgrade < %s | llvm-as | opt -funcresolve -instcombine | llvm-dis | not grep '\.\.\.' - -declare int %foo(...) -declare int %foo(int) - -void %bar() { - call int(...)* %foo(int 7) - ret void -} diff --git a/llvm/test/Transforms/FunctionResolve/2003-04-18-ForwardDeclGlobal.ll b/llvm/test/Transforms/FunctionResolve/2003-04-18-ForwardDeclGlobal.ll deleted file mode 100644 index 663d3eb18f9..00000000000 --- a/llvm/test/Transforms/FunctionResolve/2003-04-18-ForwardDeclGlobal.ll +++ /dev/null @@ -1,14 +0,0 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -funcresolve -disable-output 2>&1 | not grep WARNING - -%__popcount_tab = external constant [0 x ubyte] -%__popcount_tab = constant [4 x ubyte] c"\00\01\01\02" - -declare void %foo(ubyte *) - -void %test() { - getelementptr [0 x ubyte]* %__popcount_tab, long 0, long 2 - getelementptr [4 x ubyte]* %__popcount_tab, long 0, long 2 - call void %foo(ubyte * getelementptr ([0 x ubyte]* %__popcount_tab, long 0, long 2)) - ret void -} - diff --git a/llvm/test/Transforms/FunctionResolve/2003-05-21-MissingArguments.ll b/llvm/test/Transforms/FunctionResolve/2003-05-21-MissingArguments.ll deleted file mode 100644 index b54d595c5f7..00000000000 --- a/llvm/test/Transforms/FunctionResolve/2003-05-21-MissingArguments.ll +++ /dev/null @@ -1,11 +0,0 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -funcresolve -disable-output - -void %foo(int, int) { - ret void -} -declare void %foo(...) - -void %test() { - call void(...)* %foo(int 7) - ret void -} diff --git a/llvm/test/Transforms/FunctionResolve/2003-05-31-AllInternalDecls.ll b/llvm/test/Transforms/FunctionResolve/2003-05-31-AllInternalDecls.ll deleted file mode 100644 index 7abf0c2ce49..00000000000 --- a/llvm/test/Transforms/FunctionResolve/2003-05-31-AllInternalDecls.ll +++ /dev/null @@ -1,7 +0,0 @@ -; This testcase should not cause a warning! - -; RUN: (as < %s | opt -funcresolve -disable-output) 2>&1 | not grep 'WARNING' - -%X = internal global float 1.0 -%X = internal global int 1 - diff --git a/llvm/test/Transforms/FunctionResolve/2003-05-31-FuncPointerResolve.ll b/llvm/test/Transforms/FunctionResolve/2003-05-31-FuncPointerResolve.ll deleted file mode 100644 index 51b00010232..00000000000 --- a/llvm/test/Transforms/FunctionResolve/2003-05-31-FuncPointerResolve.ll +++ /dev/null @@ -1,11 +0,0 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -funcresolve | llvm-dis | not grep declare - -%Table = constant int(...)* %foo - -%Table2 = constant [1 x int(...)* ] [ int(...)* %foo ] - -declare int %foo(...) - -int %foo() { - ret int 0 -} diff --git a/llvm/test/Transforms/FunctionResolve/2003-05-31-InternalDecl.ll b/llvm/test/Transforms/FunctionResolve/2003-05-31-InternalDecl.ll deleted file mode 100644 index c8d2de6d230..00000000000 --- a/llvm/test/Transforms/FunctionResolve/2003-05-31-InternalDecl.ll +++ /dev/null @@ -1,12 +0,0 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -funcresolve | llvm-dis | grep declare - -declare void %test(...) - -int %callee() { - call void(...)* %test(int 5) - ret int 2 -} - -internal void %test(int) { - ret void -} diff --git a/llvm/test/Transforms/FunctionResolve/2003-06-18-TypePromotion.ll b/llvm/test/Transforms/FunctionResolve/2003-06-18-TypePromotion.ll deleted file mode 100644 index 9c22cbfca3b..00000000000 --- a/llvm/test/Transforms/FunctionResolve/2003-06-18-TypePromotion.ll +++ /dev/null @@ -1,12 +0,0 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -funcresolve | dis | not grep declare - -declare void %test(int) - -int %callee(int %X) { - call void %test(int %X) - ret int 2 -} - -internal void %test(sbyte) { - ret void -} diff --git a/llvm/test/Transforms/FunctionResolve/2003-07-23-CPR-Reference.ll b/llvm/test/Transforms/FunctionResolve/2003-07-23-CPR-Reference.ll deleted file mode 100644 index e1a29ec2824..00000000000 --- a/llvm/test/Transforms/FunctionResolve/2003-07-23-CPR-Reference.ll +++ /dev/null @@ -1,10 +0,0 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -funcresolve | llvm-dis | not grep foo - -; The funcresolve pass was resolving the two foo's together in this test, -; adding a ConstantPointerRef to one of them. Then because of this -; reference, it wasn't able to delete the dead declaration. :( - -declare int %foo(...) -declare int %foo(int) - - diff --git a/llvm/test/Transforms/FunctionResolve/2003-08-23-ArgumentWarning.ll b/llvm/test/Transforms/FunctionResolve/2003-08-23-ArgumentWarning.ll deleted file mode 100644 index 4e0a4aff9db..00000000000 --- a/llvm/test/Transforms/FunctionResolve/2003-08-23-ArgumentWarning.ll +++ /dev/null @@ -1,12 +0,0 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -funcresolve -disable-output 2>&1 | not grep WARNING - -declare int %foo(int *%X) -declare int %foo(float *%X) - -implementation - -void %test() { - call int %foo(int* null) - call int %foo(float* null) - ret void -} diff --git a/llvm/test/Transforms/FunctionResolve/2003-10-21-GlobalResolveHack.ll b/llvm/test/Transforms/FunctionResolve/2003-10-21-GlobalResolveHack.ll deleted file mode 100644 index df5340f46a2..00000000000 --- a/llvm/test/Transforms/FunctionResolve/2003-10-21-GlobalResolveHack.ll +++ /dev/null @@ -1,12 +0,0 @@ -; This tests a hack put into place specifically for the C++ libstdc++ library. -; It uses an ugly hack which is cleaned up by the funcresolve pass. -; -; RUN: llvm-as < %s | opt -funcresolve | llvm-dis | grep @X | grep '{' - -@X = external global { i32 } -@X = global [ 4 x i8 ] zeroinitializer - -define i32* @test() { - %P = getelementptr {i32}* @X, i64 0, i32 0 - ret i32* %P -} diff --git a/llvm/test/Transforms/FunctionResolve/2003-11-20-BogusResolveWarning.ll b/llvm/test/Transforms/FunctionResolve/2003-11-20-BogusResolveWarning.ll deleted file mode 100644 index cc481f5143c..00000000000 --- a/llvm/test/Transforms/FunctionResolve/2003-11-20-BogusResolveWarning.ll +++ /dev/null @@ -1,10 +0,0 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -funcresolve -disable-output 2>&1 | not grep WARNING - - -void %test() { - call int(...)* %test() - ret void -} - -declare int %test(...) - diff --git a/llvm/test/Transforms/FunctionResolve/basictest.ll b/llvm/test/Transforms/FunctionResolve/basictest.ll deleted file mode 100644 index 866ae8e54b5..00000000000 --- a/llvm/test/Transforms/FunctionResolve/basictest.ll +++ /dev/null @@ -1,12 +0,0 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -funcresolve -instcombine | llvm-dis | grep '\.\.\.' | not grep call - -declare int %foo(...) - -int %foo(int %x, float %y) { - ret int %x -} - -int %bar() { - %x = call int(...)* %foo(double 12.5, int 48) - ret int %x -} diff --git a/llvm/test/Transforms/FunctionResolve/dg.exp b/llvm/test/Transforms/FunctionResolve/dg.exp deleted file mode 100644 index 142de8a6c8f..00000000000 --- a/llvm/test/Transforms/FunctionResolve/dg.exp +++ /dev/null @@ -1,3 +0,0 @@ -load_lib llvm-dg.exp - -llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]] $objdir $srcdir $subdir $target_triplet $llvmgcc $llvmgxx $prcontext $llvmgcc_version diff --git a/llvm/test/Transforms/FunctionResolve/retmismatch1.ll b/llvm/test/Transforms/FunctionResolve/retmismatch1.ll deleted file mode 100644 index 51aeff851c9..00000000000 --- a/llvm/test/Transforms/FunctionResolve/retmismatch1.ll +++ /dev/null @@ -1,14 +0,0 @@ -; This shows where the function is called with the prototype indicating a -; return type exists, but it really doesn't. -; RUN: llvm-upgrade < %s | llvm-as | opt -funcresolve -instcombine | llvm-dis | grep '\.\.\.' | not grep call - -declare int %foo(...) - -void %foo(int %x, float %y) { - ret void -} - -int %bar() { - %x = call int(...)* %foo(double 12.5, int 48) - ret int %x -} diff --git a/llvm/test/Transforms/FunctionResolve/retmismatch2.ll b/llvm/test/Transforms/FunctionResolve/retmismatch2.ll deleted file mode 100644 index 749ca40db82..00000000000 --- a/llvm/test/Transforms/FunctionResolve/retmismatch2.ll +++ /dev/null @@ -1,15 +0,0 @@ -; This shows where the function is called with the prototype indicating a -; return type doesn't exists, but it really does. -; -; RUN: llvm-upgrade < %s | llvm-as | opt -funcresolve -instcombine | llvm-dis | grep '\.\.\.' | not grep call - -declare void %foo(...) - -int %foo(int %x, float %y) { - ret int %x -} - -int %bar() { - call void (...)* %foo(double 12.5, int 48) - ret int 6 -} diff --git a/llvm/test/Transforms/FunctionResolve/retmismatch3.ll b/llvm/test/Transforms/FunctionResolve/retmismatch3.ll deleted file mode 100644 index f9850d67a7d..00000000000 --- a/llvm/test/Transforms/FunctionResolve/retmismatch3.ll +++ /dev/null @@ -1,12 +0,0 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -funcresolve - -declare int %read(...) - -long %read() { - ret long 0 -} - -int %testfunc() { - %X = call int(...)* %read() - ret int %X -} |

