1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Removing llvm upgrade, so remove tests specific to llvm-upgrade and update the tests that used it.

llvm-svn: 47225
This commit is contained in:
Tanya Lattner 2008-02-16 23:27:24 +00:00
parent cd0325cce1
commit 1ffe4f2e88
27 changed files with 13054 additions and 13270 deletions

View File

@ -1,9 +1,10 @@
; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f
; RUN: llvm-as < %s -o /dev/null -f
int *%t1({ float, int }* %X) {
%W = getelementptr { float, int }* %X, int 20, uint 1
%X = getelementptr { float, int }* %X, uint 20, uint 1
%Y = getelementptr { float, int }* %X, long 20, uint 1
%Z = getelementptr { float, int }* %X, ulong 20, uint 1
ret int* %Y
define i32* @t1({ float, i32 }* %X) {
%W = getelementptr { float, i32 }* %X, i32 20, i32 1 ; <i32*> [#uses=0]
%X.upgrd.1 = getelementptr { float, i32 }* %X, i64 20, i32 1 ; <i32*> [#uses=0]
%Y = getelementptr { float, i32 }* %X, i64 20, i32 1 ; <i32*> [#uses=1]
%Z = getelementptr { float, i32 }* %X, i64 20, i32 1 ; <i32*> [#uses=0]
ret i32* %Y
}

View File

@ -1,11 +1,11 @@
; RUN: llvm-upgrade < %s | llvm-as > /dev/null
void %t() {
; RUN: llvm-as < %s > /dev/null
define void @t() {
entry:
ret void
ret void
loop:
%tmp.4.i9 = getelementptr int* null, int %tmp.5.i10
%tmp.5.i10 = load int* %tmp.4.i9
br label %loop
loop: ; preds = %loop
%tmp.4.i9 = getelementptr i32* null, i32 %tmp.5.i10 ; <i32*> [#uses=1]
%tmp.5.i10 = load i32* %tmp.4.i9 ; <i32> [#uses=1]
br label %loop
}

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
;; The bytecode writer was trying to treat undef values as ConstantArray's when
;; they looked like strings.
;; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f
%G = internal global [8 x sbyte] undef
;; RUN: llvm-as < %s -o /dev/null -f
@G = internal global [8 x i8] undef

View File

@ -1,21 +1,21 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | \
; RUN: llvm-as < %s | opt -inline | llvm-dis | \
; RUN: not grep {%G = alloca int}
; In this testcase, %bar stores to the global G. Make sure that inlining does
; not cause it to store to the G in main instead.
@G = global i32 7 ; <i32*> [#uses=1]
%G = global int 7
int %main() {
%G = alloca int
store int 0, int* %G
call void %bar()
%RV = load int* %G
ret int %RV
define i32 @main() {
%G = alloca i32 ; <i32*> [#uses=2]
store i32 0, i32* %G
call void @bar( )
%RV = load i32* %G ; <i32> [#uses=1]
ret i32 %RV
}
internal void %bar() {
store int 123, int* %G
ret void
define internal void @bar() {
store i32 123, i32* @G
ret void
}

View File

@ -1,6 +1,6 @@
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | grep 1.0
; RUN: llvm-as < %s | llvm-dis | grep 1.0
double %test() {
define double @test() {
ret double 1.0 ;; This should not require hex notation
}

View File

@ -1,14 +1,14 @@
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | llvm-as
; RUN: llvm-as < %s | llvm-dis | llvm-as
; Ensure that the asm writer emits types before both operands of the
; store, even though they can be the same.
%RecTy = type %RecTy*
implementation
void %foo() {
%A = malloc %RecTy
%B = malloc %RecTy
store %RecTy %B, %RecTy %A ;; Both ops are the same
define void @foo() {
%A = malloc %RecTy ; <%RecTy> [#uses=1]
%B = malloc %RecTy ; <%RecTy> [#uses=1]
store %RecTy %B, %RecTy %A
ret void
}

View File

@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | llvm-as
; RUN: llvm-as < %s | llvm-dis | llvm-as
%t = type opaque
%x = global %t undef
@x = global %t undef

View File

@ -1,5 +1,6 @@
; RUN: llvm-upgrade < %s | llvm-as > /dev/null
; RUN: llvm-as < %s > /dev/null
< 4 x int> %foo() {
ret <4 x int> zeroinitializer
define <4 x i32> @foo() {
ret <4 x i32> zeroinitializer
}

View File

@ -1,5 +0,0 @@
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | grep {icmp ne}
bool %main(int %X) {
%res = cast bool true to bool
ret bool %res
}

View File

@ -1,24 +1,18 @@
; Test Case for PR1080
; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f
; RUN: llvm-as < %s -o /dev/null -f
%str = internal constant [4 x sbyte] c"-ga\00" ; <[4 x sbyte]*> [#uses=5]
@str = internal constant [4 x i8] c"-ga\00" ; <[4 x i8]*> [#uses=2]
int %main(int %argc, sbyte** %argv) {
define i32 @main(i32 %argc, i8** %argv) {
entry:
%tmp65 = getelementptr sbyte** %argv, int 1 ; <sbyte**> [#uses=1]
%tmp66 = load sbyte** %tmp65 ; <sbyte*> [#uses=3]
br bool icmp ne (
uint sub (
uint ptrtoint (
sbyte* getelementptr ([4 x sbyte]* %str, int 0, long 1)
to uint),
uint ptrtoint ([4 x sbyte]* %str to uint)
),
uint 1),
label %exit_1, label %exit_2
%tmp65 = getelementptr i8** %argv, i32 1 ; <i8**> [#uses=1]
%tmp66 = load i8** %tmp65 ; <i8*> [#uses=0]
br i1 icmp ne (i32 sub (i32 ptrtoint (i8* getelementptr ([4 x i8]* @str, i32 0, i64 1) to i32), i32 ptrtoint ([4 x i8]* @str to i32)), i32 1), label %exit_1, label %exit_2
exit_1:
ret int 0;
exit_2:
ret int 1;
exit_1: ; preds = %entry
ret i32 0
exit_2: ; preds = %entry
ret i32 1
}

View File

@ -1,23 +0,0 @@
; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f
implementation ; Functions:
void %interpret() {
entry:
%x = bitcast sbyte 1 to sbyte
%x = bitcast ubyte 1 to ubyte
%x = bitcast short 1 to short
%x = bitcast ushort 1 to ushort
%x = bitcast int 1 to int
%x = bitcast uint 1 to uint
%x = bitcast ulong 1 to ulong
%x = inttoptr ulong %x to sbyte*
%tmp = inttoptr ulong %x to float*
%tmp7360 = bitcast ubyte %x to sbyte
%tmp7361 = sub ubyte 0, %tmp7360
br label %next
next: ; preds = %cond_false165, %cond_true163
%index.0 = phi uint [ undef, %entry ], [ %index.0, %next ]
br label %next
}

View File

@ -1,28 +0,0 @@
; For PR1093: This test checks that llvm-upgrade correctly translates
; the llvm.va_* intrinsics to their cannonical argument form (i8*).
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | \
; RUN: grep { bitcast} | count 5
%str = internal constant [7 x ubyte] c"%d %d\0A\00" ; <[7 x ubyte]*> [#uses=1]
implementation ; Functions:
void %f(int %a_arg, ...) {
entry:
%l1 = alloca sbyte*, align 4 ; <sbyte**> [#uses=5]
%l2 = alloca sbyte*, align 4 ; <sbyte**> [#uses=4]
%l3 = alloca sbyte* ; <sbyte**> [#uses=2]
call void %llvm.va_start( sbyte** %l1 )
call void %llvm.va_copy( sbyte** %l2, sbyte** %l3 )
call void %llvm.va_end( sbyte** %l1 )
call void %llvm.va_end( sbyte** %l2 )
ret void
}
declare void %llvm.va_start(sbyte**)
declare void %llvm.va_copy(sbyte**, sbyte**)
declare int %printf(ubyte*, ...)
declare void %llvm.va_end(sbyte**)

View File

@ -1,13 +0,0 @@
; Make sure we don't get an assertion failure, even though this is a parse
; error
; RUN: not llvm-upgrade < %s > /dev/null |& grep {No arguments passed to a }
%ty = type void (int)
declare %ty* %foo()
void %test() {
call %ty* %foo( ) ; <%ty*>:0 [#uses=0]
ret void
}

View File

@ -1,4 +0,0 @@
; Found by inspection of the code
; RUN: not llvm-upgrade < %s > /dev/null |& grep {Shift constant expression}
global int shr (float 1.0, ubyte 2)

View File

@ -1,4 +0,0 @@
; Found by inspection of the code
; RUN: not llvm-upgrade < %s > /dev/null |& grep {Illegal number of init}
global {} { int 7, float 1.0, int 7, int 8 }

View File

@ -1,6 +0,0 @@
; RUN: not llvm-upgrade < %s -o /dev/null -f |& grep {Reference to an undef}
; END.
%d_reduction_0_dparser_gram = global { int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)*, int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)** } { int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)* null, int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)** null }
implementation

View File

@ -1,14 +0,0 @@
; PR1122
; Make sure llvm-upgrade can upgrade this.
; RUN: llvm-upgrade < %s > /dev/null
%arraytype_Char_1 = type { int, [0 x sbyte] }
%structtype_rpy_string = type { int, %arraytype_Char_1 }
%RPyString = type %structtype_rpy_string ;**doesn't work
;%RPyString = type { int, %arraytype_Char_1 } ;**works
sbyte* %RPyString_AsString(%RPyString* %structstring) {
%source1ptr = getelementptr %RPyString* %structstring, int 0, uint 1, uint 1
%source1 = cast [0 x sbyte]* %source1ptr to sbyte*
ret sbyte* %source1
}

View File

@ -1,20 +0,0 @@
; PR1137
; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f
; RUN: llvm-upgrade < %s | grep {tmp = alloca} | count 1
;
target datalayout = "e-p:32:32"
target endian = little
target pointersize = 32
target triple = "i686-pc-linux-gnu"
implementation ; Functions:
void %main() {
entry:
%tmp = alloca uint, align 4 ; <uint*> [#uses=1]
%tmp = alloca int, align 4 ; <int*> [#uses=1]
"alloca point" = cast int 0 to int ; <int> [#uses=0]
store uint 1, uint* %tmp
store int 2, int* %tmp
ret void
}

View File

@ -1,18 +0,0 @@
; Test that upgrading shift instructions and constant expressions works
; correctly.
; RUN: llvm-upgrade < %s | grep {ashr i32 .X, 2}
; RUN: llvm-upgrade < %s | grep {lshr i32 .X, 2}
; RUN: llvm-upgrade < %s | grep {shl i32 .X, 2}
; RUN: llvm-upgrade < %s | grep {ashr i32 .X, 6}
; RUN: llvm-upgrade < %s | grep {lshr i32 .X, 1}
; RUN: llvm-upgrade < %s | grep {shl i32 .X, 1}
void %test(int %X) {
%A = ashr int %X, ubyte 2
%B = lshr int %X, ubyte 2
%C = shl int %X, ubyte 2
%D = ashr int %X, ubyte trunc ( int shl (int 3, ubyte 1) to ubyte )
%E = lshr int %X, ubyte trunc ( int ashr (int 3, ubyte 1) to ubyte )
%F = shl int %X, ubyte trunc ( int lshr (int 3, ubyte 1) to ubyte )
ret void
}

View File

@ -1,14 +0,0 @@
; PR1187
; RUN: llvm-upgrade < %s | llvm-as > /dev/null
implementation
int @main(int %argc, sbyte** %argv) {
entry:
%exit = alloca int, align 4 ; <i32*> [#uses=11]
store int 0, int* %exit
br label %exit
exit:
ret int 0
}

View File

@ -1,11 +0,0 @@
; PR1187
; RUN: llvm-upgrade < %s > /dev/null
implementation
internal void %func(int %x) {
ret void
}
internal void %func(uint %x) {
ret void
}

View File

@ -1,8 +0,0 @@
; PR1187
; RUN: llvm-upgrade < %s > /dev/null
implementation
i1 %func(i8 %x, i16 %x, i32 %x, i64 %x) {
ret void
}

View File

@ -1,19 +0,0 @@
; For PR1187
; RUN: llvm-upgrade < %s > /dev/null
%struct.isc_hash_t = type { uint, sbyte*, int, uint, uint,
[4 x ubyte], ulong, ushort* }
%hash = internal global %struct.isc_hash_t* null
implementation
void %somefunc() {
%key_addr = alloca sbyte*
%tmp21 = load sbyte** %key_addr
%tmp22 = call fastcc uint %hash(sbyte* %tmp21, uint 0)
ret void
}
internal fastcc uint %hash(sbyte* %key, uint %case_sensitive) {
ret uint 0
}

View File

@ -1,24 +0,0 @@
; PR1256
; RUN: llvm-upgrade < %s | grep {call void @f( i32 .tmp )}
; RUN: llvm-upgrade < %s | grep {call void @g( i8 .tmp\.upgrd\.2 )}
target datalayout = "e-p:32:32"
target endian = little
target pointersize = 32
target triple = "i686-pc-linux-gnu"
implementation ; Functions:
void %_Z4func() {
entry:
%tmp = add int 0, 0
%tmp = add uint 1, 1
%tmp = add ubyte 1, 2
%tmp = add sbyte 2, 3
call void %f (int %tmp)
call void %g (ubyte %tmp)
ret void
}
declare void %f(int)
declare void %g(ubyte)

View File

@ -1,26 +1,26 @@
; This test checks to make sure that constant exprs fold in some simple
; situations
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | not grep {(}
; RUN: llvm-as < %s | llvm-dis | not grep {(}
%A = global long 0
@A = global i64 0
global long* cast (long add (long cast (long* %A to long), long 0) to long*) ; X + 0 == X
global long* cast (long sub (long cast (long* %A to long), long 0) to long*) ; X - 0 == X
global long* cast (long mul (long cast (long* %A to long), long 0) to long*) ; X * 0 == 0
global long* cast (long div (long cast (long* %A to long), long 1) to long*) ; X / 1 == X
global long* cast (long rem (long cast (long* %A to long), long 1) to long*) ; X % 1 == 0
global long* cast (long and (long cast (long* %A to long), long 0) to long*) ; X & 0 == 0
global long* cast (long and (long cast (long* %A to long), long -1) to long*) ; X & -1 == X
global long or (long cast (long* %A to long), long -1) ; X | -1 == -1
global long* cast (long xor (long cast (long* %A to long), long 0) to long*) ; X ^ 0 == X
global i64* inttoptr (i64 add (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X + 0 == X
global i64* inttoptr (i64 sub (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X - 0 == X
global i64* inttoptr (i64 mul (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X * 0 == 0
global i64* inttoptr (i64 sdiv (i64 ptrtoint (i64* @A to i64), i64 1) to i64*) ; X / 1 == X
global i64* inttoptr (i64 srem (i64 ptrtoint (i64* @A to i64), i64 1) to i64*) ; X % 1 == 0
global i64* inttoptr (i64 and (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X & 0 == 0
global i64* inttoptr (i64 and (i64 ptrtoint (i64* @A to i64), i64 -1) to i64*) ; X & -1 == X
global i64 or (i64 ptrtoint (i64* @A to i64), i64 -1) ; X | -1 == -1
global i64* inttoptr (i64 xor (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X ^ 0 == X
%Ty = type { int, int }
%B = external global %Ty
%Ty = type { i32, i32 }
@B = external global %Ty
global bool setlt (long* %A, long* getelementptr (long* %A, long 1)) ; true
global bool setlt (long* %A, long* getelementptr (long* %A, long 0)) ; false
global bool setlt (int* getelementptr (%Ty* %B, long 0, uint 0),
int* getelementptr (%Ty* %B, long 0, uint 1)) ; true
;global bool setne (long* %A, long* cast (%Ty* %B to long*)) ; true
global i1 icmp slt (i64* @A, i64* getelementptr (i64* @A, i64 1)) ; true
global i1 icmp slt (i64* @A, i64* getelementptr (i64* @A, i64 0)) ; false
global i1 icmp slt (i32* getelementptr (%Ty* @B, i64 0, i32 0),
i32* getelementptr (%Ty* @B, i64 0, i32 1)) ; true
global i1 icmp ne (i64* @A, i64* bitcast (%Ty* @B to i64*)) ; true

View File

@ -1,8 +1,9 @@
; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f
; RUN: llvm-as < %s -o /dev/null -f
int %test(bool %C, int %V1, int %V2) {
%X = select bool true, bool false, bool true
%V = select bool %X, int %V1, int %V2
ret int %V
define i32 @test(i1 %C, i32 %V1, i32 %V2) {
%X = select i1 true, i1 false, i1 true ; <i1> [#uses=1]
%V = select i1 %X, i32 %V1, i32 %V2 ; <i32> [#uses=1]
ret i32 %V
}