Remove stale CBackend tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153433 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2012-03-26 11:16:50 +00:00
parent 72e84f51a6
commit d792a27094
52 changed files with 0 additions and 627 deletions

View File

@ -1,8 +0,0 @@
; RUN: llc < %s -march=c
; Make sure that global variables do not collide if they have the same name,
; but different types.
@X = global i32 5 ; <i32*> [#uses=0]
@X.upgrd.1 = global i64 7 ; <i64*> [#uses=0]

View File

@ -1,20 +0,0 @@
; RUN: llc < %s -march=c
; This case was emitting code that looked like this:
; ...
; llvm_BB1: /* no statement here */
; }
;
; Which the Sun C compiler rejected, so now we are sure to put a return
; instruction in there if the basic block is otherwise empty.
;
define void @test() {
br label %BB1
BB2: ; preds = %BB2
br label %BB2
BB1: ; preds = %0
ret void
}

View File

@ -1,7 +0,0 @@
; RUN: llc < %s -march=c
; Test const pointer refs & forward references
@t3 = global i32* @t1 ; <i32**> [#uses=0]
@t1 = global i32 4 ; <i32*> [#uses=1]

View File

@ -1,8 +0,0 @@
; RUN: llc < %s -march=c
global i32* bitcast (float* @2 to i32*) ;; Forward numeric reference
global float* @2 ;; Duplicate forward numeric reference
global float 0.0
@array = constant [2 x i32] [ i32 12, i32 52 ]
@arrayPtr = global i32* getelementptr ([2 x i32]* @array, i64 0, i64 0)

View File

@ -1,4 +0,0 @@
; RUN: llc < %s -march=c
@sptr1 = global [11 x i8]* @somestr ;; Forward ref to a constant
@somestr = constant [11 x i8] c"hello world"

View File

@ -1,5 +0,0 @@
; RUN: llc < %s -march=c
@fptr = global void ()* @f ;; Forward ref method defn
declare void @f() ;; External method

View File

@ -1,5 +0,0 @@
; RUN: llc < %s -march=c
@array = constant [2 x i32] [ i32 12, i32 52 ] ; <[2 x i32]*> [#uses=1]
@arrayPtr = global i32* getelementptr ([2 x i32]* @array, i64 0, i64 0) ; <i32**> [#uses=0]

View File

@ -1,10 +0,0 @@
; RUN: llc < %s -march=c
; The C Writer bombs on this testcase because it tries the print the prototype
; for the test function, which tries to print the argument name. The function
; has not been incorporated into the slot calculator, so after it does the name
; lookup, it tries a slot calculator lookup, which fails.
define i32 @test(i32) {
ret i32 0
}

View File

@ -1,17 +0,0 @@
; RUN: llc < %s -march=c
; Indirect function call test... found by Joel & Brian
;
@taskArray = external global i32* ; <i32**> [#uses=1]
define void @test(i32 %X) {
%Y = add i32 %X, -1 ; <i32> [#uses=1]
%cast100 = sext i32 %Y to i64 ; <i64> [#uses=1]
%gep100 = getelementptr i32** @taskArray, i64 %cast100 ; <i32**> [#uses=1]
%fooPtr = load i32** %gep100 ; <i32*> [#uses=1]
%cast101 = bitcast i32* %fooPtr to void (i32)* ; <void (i32)*> [#uses=1]
call void %cast101( i32 1000 )
ret void
}

View File

@ -1,8 +0,0 @@
; RUN: llc < %s -march=c
; This testcase fails because the C backend does not arrange to output the
; contents of a structure type before it outputs the structure type itself.
@Y = external global { { i32 } } ; <{ { i32 } }*> [#uses=0]
@X = external global { float } ; <{ float }*> [#uses=0]

View File

@ -1,7 +0,0 @@
; RUN: llc < %s -march=c
define void @test() {
%X = alloca [4 x i32] ; <[4 x i32]*> [#uses=0]
ret void
}

View File

@ -1,6 +0,0 @@
; RUN: llc < %s -march=c
declare void @foo(...)

View File

@ -1,4 +0,0 @@
; RUN: llc < %s -march=c
@bob = external global i32 ; <i32*> [#uses=0]

View File

@ -1,11 +0,0 @@
; RUN: llc < %s -march=c
@testString = internal constant [18 x i8] c"Escaped newline\5Cn\00" ; <[18 x i8]*> [#uses=1]
declare i32 @printf(i8*, ...)
define i32 @main() {
call i32 (i8*, ...)* @printf( i8* getelementptr ([18 x i8]* @testString, i64 0, i64 0) ) ; <i32>:1 [#uses=0]
ret i32 0
}

View File

@ -1,8 +0,0 @@
; RUN: llc < %s -march=c
; Apparently this constant was unsigned in ISO C 90, but not in C 99.
define i32 @foo() {
ret i32 -2147483648
}

View File

@ -1,11 +0,0 @@
; RUN: llc < %s -march=c
; This testcase breaks the C backend, because gcc doesn't like (...) functions
; with no arguments at all.
define void @test(i64 %Ptr) {
%P = inttoptr i64 %Ptr to void (...)* ; <void (...)*> [#uses=1]
call void (...)* %P( i64 %Ptr )
ret void
}

View File

@ -1,5 +0,0 @@
; RUN: llc < %s -march=c
; The C backend was dying when there was no typename for a struct type!
declare i32 @test(i32, { [32 x i32] }*)

View File

@ -1,9 +0,0 @@
; RUN: llc < %s -march=c
%X = type { i32, float }
define void @test() {
getelementptr %X* null, i64 0, i32 1 ; <float*>:1 [#uses=0]
ret void
}

View File

@ -1,4 +0,0 @@
; RUN: llc < %s -march=c
; Make sure hex constant does not continue into a valid hexadecimal letter/number
@version = global [3 x i8] c"\001\00"

View File

@ -1,3 +0,0 @@
; RUN: llc < %s -march=c
@version = global [3 x i8] c"1\00\00"

View File

@ -1,17 +0,0 @@
; RUN: llc < %s -march=c
declare i32 @callee(i32, i32)
define i32 @test(i32 %X) {
; <label>:0
%A = invoke i32 @callee( i32 %X, i32 5 )
to label %Ok unwind label %Threw ; <i32> [#uses=1]
Ok: ; preds = %Threw, %0
%B = phi i32 [ %A, %0 ], [ -1, %Threw ] ; <i32> [#uses=1]
ret i32 %B
Threw: ; preds = %0
br label %Ok
}

View File

@ -1,3 +0,0 @@
; RUN: llc < %s -march=c | grep common | grep X
@X = linkonce global i32 5

View File

@ -1,5 +0,0 @@
; RUN: llc < %s -march=c
; This is a non-normal FP value: it's a nan.
@NAN = global { float } { float 0x7FF8000000000000 } ; <{ float }*> [#uses=0]
@NANs = global { float } { float 0x7FFC000000000000 } ; <{ float }*> [#uses=0]

View File

@ -1,8 +0,0 @@
; RUN: llc < %s -march=c
%A = type { i32, i8*, { i32, i32, i32, i32, i32, i32, i32, i32 }*, i16 }
define void @test(%A*) {
ret void
}

View File

@ -1,12 +0,0 @@
; RUN: llc < %s -march=c
; reduced from DOOM.
%union._XEvent = type { i32 }
@.X_event_9 = global %union._XEvent zeroinitializer ; <%union._XEvent*> [#uses=1]
define void @I_InitGraphics() {
shortcirc_next.3:
%tmp.319 = load i32* getelementptr ({ i32, i32 }* bitcast (%union._XEvent* @.X_event_9 to { i32, i32 }*), i64 0, i32 1) ; <i32> [#uses=0]
ret void
}

View File

@ -1,13 +0,0 @@
; RUN: llc < %s -march=c
@y = weak global i8 0 ; <i8*> [#uses=1]
define i32 @testcaseshr() {
entry:
ret i32 lshr (i32 ptrtoint (i8* @y to i32), i32 4)
}
define i32 @testcaseshl() {
entry:
ret i32 shl (i32 ptrtoint (i8* @y to i32), i32 4)
}

View File

@ -1,16 +0,0 @@
; RUN: llc < %s -march=c | grep builtin_return_address
declare i8* @llvm.returnaddress(i32)
declare i8* @llvm.frameaddress(i32)
define i8* @test1() {
%X = call i8* @llvm.returnaddress( i32 0 ) ; <i8*> [#uses=1]
ret i8* %X
}
define i8* @test2() {
%X = call i8* @llvm.frameaddress( i32 0 ) ; <i8*> [#uses=1]
ret i8* %X
}

View File

@ -1,18 +0,0 @@
; The intrinsic lowering pass was lowering intrinsics like llvm.memcpy to
; explicitly specified prototypes, inserting a new function if the old one
; didn't exist. This caused there to be two external memcpy functions in
; this testcase for example, which caused the CBE to mangle one, screwing
; everything up. :( Test that this does not happen anymore.
;
; RUN: llc < %s -march=c | not grep _memcpy
declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
declare float* @memcpy(i32*, i32, i32)
define i32 @test(i8* %A, i8* %B, i32* %C) {
call float* @memcpy( i32* %C, i32 4, i32 17 ) ; <float*>:1 [#uses=0]
call void @llvm.memcpy.i32( i8* %A, i8* %B, i32 123, i32 14 )
ret i32 7
}

View File

@ -1,11 +0,0 @@
; This is a non-normal FP value
; RUN: llc < %s -march=c | grep FPConstant | grep static
define float @func() {
ret float 0xFFF0000000000000
}
define double @func2() {
ret double 0xFF20000000000000
}

View File

@ -1,6 +0,0 @@
; RUN: llc < %s -march=c | grep func1 | grep WEAK
define linkonce i32 @func1() {
ret i32 5
}

View File

@ -1,10 +0,0 @@
; RUN: llc < %s -march=c
declare void @llvm.va_end(i8*)
define void @test() {
%va.upgrd.1 = bitcast i8* null to i8* ; <i8*> [#uses=1]
call void @llvm.va_end( i8* %va.upgrd.1 )
ret void
}

View File

@ -1,12 +0,0 @@
; The CBE should not emit code that casts the function pointer. This causes
; GCC to get testy and insert trap instructions instead of doing the right
; thing. :(
; RUN: llc < %s -march=c
declare void @external(i8*)
define i32 @test(i32* %X) {
%RV = call i32 bitcast (void (i8*)* @external to i32 (i32*)*)( i32* %X ) ; <i32> [#uses=1]
ret i32 %RV
}

View File

@ -1,10 +0,0 @@
; RUN: llc < %s -march=c | not grep extern.*msg
; PR472
@msg = internal global [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1]
define i8* @foo() {
entry:
ret i8* getelementptr ([6 x i8]* @msg, i32 0, i32 0)
}

View File

@ -1,5 +0,0 @@
; RUN: llc < %s -march=c
define i32 @foo() {
ret i32 and (i32 123456, i32 ptrtoint (i32 ()* @foo to i32))
}

View File

@ -1,18 +0,0 @@
; RUN: llc < %s -march=c | not grep -- --65535
; PR596
target datalayout = "e-p:32:32"
target triple = "i686-pc-linux-gnu"
declare void @func(i32)
define void @funcb() {
entry:
%tmp.1 = sub i32 0, -65535 ; <i32> [#uses=1]
call void @func( i32 %tmp.1 )
br label %return
return: ; preds = %entry
ret void
}

View File

@ -1,7 +0,0 @@
; RUN: llc < %s -march=c | grep fmod
define double @test(double %A, double %B) {
%C = frem double %A, %B ; <double> [#uses=1]
ret double %C
}

View File

@ -1,49 +0,0 @@
; RUN: llc < %s -march=c | \
; RUN: grep __BITCAST | count 14
define i32 @test1(float %F) {
%X = bitcast float %F to i32 ; <i32> [#uses=1]
ret i32 %X
}
define float @test2(i32 %I) {
%X = bitcast i32 %I to float ; <float> [#uses=1]
ret float %X
}
define i64 @test3(double %D) {
%X = bitcast double %D to i64 ; <i64> [#uses=1]
ret i64 %X
}
define double @test4(i64 %L) {
%X = bitcast i64 %L to double ; <double> [#uses=1]
ret double %X
}
define double @test5(double %D) {
%X = bitcast double %D to double ; <double> [#uses=1]
%Y = fadd double %X, 2.000000e+00 ; <double> [#uses=1]
%Z = bitcast double %Y to i64 ; <i64> [#uses=1]
%res = bitcast i64 %Z to double ; <double> [#uses=1]
ret double %res
}
define float @test6(float %F) {
%X = bitcast float %F to float ; <float> [#uses=1]
%Y = fadd float %X, 2.000000e+00 ; <float> [#uses=1]
%Z = bitcast float %Y to i32 ; <i32> [#uses=1]
%res = bitcast i32 %Z to float ; <float> [#uses=1]
ret float %res
}
define i32 @main(i32 %argc, i8** %argv) {
%a = call i32 @test1( float 0x400921FB40000000 ) ; <i32> [#uses=2]
%b = call float @test2( i32 %a ) ; <float> [#uses=0]
%c = call i64 @test3( double 0x400921FB4D12D84A ) ; <i64> [#uses=1]
%d = call double @test4( i64 %c ) ; <double> [#uses=0]
%e = call double @test5( double 7.000000e+00 ) ; <double> [#uses=0]
%f = call float @test6( float 7.000000e+00 ) ; <float> [#uses=0]
ret i32 %a
}

View File

@ -1,26 +0,0 @@
; For PR1099
; RUN: llc < %s -march=c | grep {(llvm_cbe_tmp2 == llvm_cbe_b_2e_0_2e_0_2e_val)}
target datalayout = "e-p:32:32"
target triple = "i686-apple-darwin8"
%struct.Connector = type { i16, i16, i8, i8, %struct.Connector*, i8* }
define i1 @prune_match_entry_2E_ce(%struct.Connector* %a, i16 %b.0.0.val) {
newFuncRoot:
br label %entry.ce
cond_next.exitStub: ; preds = %entry.ce
ret i1 true
entry.return_crit_edge.exitStub: ; preds = %entry.ce
ret i1 false
entry.ce: ; preds = %newFuncRoot
%tmp1 = getelementptr %struct.Connector* %a, i32 0, i32 0 ; <i16*> [#uses=1]
%tmp2 = load i16* %tmp1 ; <i16> [#uses=1]
%tmp3 = icmp eq i16 %tmp2, %b.0.0.val ; <i1> [#uses=1]
br i1 %tmp3, label %cond_next.exitStub, label %entry.return_crit_edge.exitStub
}

View File

@ -1,12 +0,0 @@
; RUN: llc < %s -march=c | grep __builtin_stack_save
; RUN: llc < %s -march=c | grep __builtin_stack_restore
; PR1028
declare i8* @llvm.stacksave()
declare void @llvm.stackrestore(i8*)
define i8* @test() {
%s = call i8* @llvm.stacksave()
call void @llvm.stackrestore(i8* %s)
ret i8* %s
}

View File

@ -1,13 +0,0 @@
; RUN: llc < %s -march=c
; PR1181
target datalayout = "e-p:64:64"
target triple = "x86_64-apple-darwin8"
declare void @llvm.memset.i64(i8*, i8, i64, i32)
define fastcc void @InitUser_data_unregistered() {
entry:
tail call void @llvm.memset.i64( i8* null, i8 0, i64 65496, i32 1 )
ret void
}

View File

@ -1,14 +0,0 @@
; PR1164
; RUN: llc < %s -march=c | grep {llvm_cbe_A = \\*llvm_cbe_G;}
; RUN: llc < %s -march=c | grep {llvm_cbe_B = \\*(&ltmp_0_1);}
; RUN: llc < %s -march=c | grep {return (((unsigned int )(((unsigned int )llvm_cbe_A) + ((unsigned int )llvm_cbe_B))));}
@G = global i32 123
@ltmp_0_1 = global i32 123
define i32 @test(i32 *%G) {
%A = load i32* %G
%B = load i32* @ltmp_0_1
%C = add i32 %A, %B
ret i32 %C
}

View File

@ -1,9 +0,0 @@
; RUN: llc < %s -march=c | grep {packed}
%struct.p = type <{ i16 }>
define i32 @main() {
entry:
%t = alloca %struct.p, align 2
ret i32 5
}

View File

@ -1,15 +0,0 @@
; RUN: llc < %s -march=c | \
; RUN: grep {struct __attribute__ ((packed, aligned(} | count 4
define void @test(i32* %P) {
%X = load i32* %P, align 1
store i32 %X, i32* %P, align 1
ret void
}
define void @test2(i32* %P) {
%X = load volatile i32* %P, align 2
store volatile i32 %X, i32* %P, align 2
ret void
}

View File

@ -1,14 +0,0 @@
; RUN: llc < %s -march=c | grep {llvm_cbe_t.*&1}
define i32 @test(i32 %r) {
%s = icmp eq i32 %r, 0
%t = add i1 %s, %s
%u = zext i1 %t to i32
br i1 %t, label %A, label %B
A:
ret i32 %u
B:
%v = select i1 %t, i32 %r, i32 %u
ret i32 %v
}

View File

@ -1,29 +0,0 @@
; RUN: llc < %s -march=c
; PR2907
target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
target triple = "powerpc-apple-darwin9.5"
%"struct.Point<0>" = type { %"struct.Tensor<1,0>" }
%"struct.QGauss2<1>" = type { %"struct.Quadrature<0>" }
%"struct.Quadrature<0>" = type { %struct.Subscriptor, i32, %"struct.std::vector<Point<0>,std::allocator<Point<0> > >", %"struct.std::vector<double,std::allocator<double> >" }
%struct.Subscriptor = type { i32 (...)**, i32, %"struct.std::type_info"* }
%"struct.Tensor<1,0>" = type { [1 x double] }
%"struct.std::_Vector_base<Point<0>,std::allocator<Point<0> > >" = type { %"struct.std::_Vector_base<Point<0>,std::allocator<Point<0> > >::_Vector_impl" }
%"struct.std::_Vector_base<Point<0>,std::allocator<Point<0> > >::_Vector_impl" = type { %"struct.Point<0>"*, %"struct.Point<0>"*, %"struct.Point<0>"* }
%"struct.std::_Vector_base<double,std::allocator<double> >" = type { %"struct.std::_Vector_base<double,std::allocator<double> >::_Vector_impl" }
%"struct.std::_Vector_base<double,std::allocator<double> >::_Vector_impl" = type { double*, double*, double* }
%"struct.std::type_info" = type { i32 (...)**, i8* }
%"struct.std::vector<Point<0>,std::allocator<Point<0> > >" = type { %"struct.std::_Vector_base<Point<0>,std::allocator<Point<0> > >" }
%"struct.std::vector<double,std::allocator<double> >" = type { %"struct.std::_Vector_base<double,std::allocator<double> >" }
define fastcc void @_ZN6QGaussILi1EEC1Ej(%"struct.QGauss2<1>"* %this, i32 %n) {
entry:
br label %bb4
bb4: ; preds = %bb5.split, %bb4, %entry
%0 = fcmp ogt ppc_fp128 0xM00000000000000000000000000000000, select (i1 fcmp olt (ppc_fp128 fpext (double 0x3C447AE147AE147B to ppc_fp128), ppc_fp128 fmul (ppc_fp128 0xM00000000000000010000000000000000, ppc_fp128 0xM40140000000000000000000000000000)), ppc_fp128 fmul (ppc_fp128 0xM00000000000000010000000000000000, ppc_fp128 0xM40140000000000000000000000000000), ppc_fp128 fpext (double 0x3C447AE147AE147B to ppc_fp128)) ; <i1> [#uses=1]
br i1 %0, label %bb4, label %bb5.split
bb5.split: ; preds = %bb4
%1 = getelementptr double* null, i32 0 ; <double*> [#uses=0]
br label %bb4
}

View File

@ -1,35 +0,0 @@
; RUN: llc < %s -march=c
; Check that uadd and sadd with overflow are handled by C Backend.
%0 = type { i32, i1 } ; type %0
define i1 @func1(i32 zeroext %v1, i32 zeroext %v2) nounwind {
entry:
%t = call %0 @llvm.uadd.with.overflow.i32(i32 %v1, i32 %v2) ; <%0> [#uses=1]
%obit = extractvalue %0 %t, 1 ; <i1> [#uses=1]
br i1 %obit, label %carry, label %normal
normal: ; preds = %entry
ret i1 true
carry: ; preds = %entry
ret i1 false
}
define i1 @func2(i32 signext %v1, i32 signext %v2) nounwind {
entry:
%t = call %0 @llvm.sadd.with.overflow.i32(i32 %v1, i32 %v2) ; <%0> [#uses=1]
%obit = extractvalue %0 %t, 1 ; <i1> [#uses=1]
br i1 %obit, label %carry, label %normal
normal: ; preds = %entry
ret i1 true
carry: ; preds = %entry
ret i1 false
}
declare %0 @llvm.sadd.with.overflow.i32(i32, i32) nounwind
declare %0 @llvm.uadd.with.overflow.i32(i32, i32) nounwind

View File

@ -1,12 +0,0 @@
; RUN: llc < %s -march=c | grep {"m"(llvm_cbe_newcw))}
; PR2407
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i386-pc-linux-gnu"
define void @foo() {
%newcw = alloca i16 ; <i16*> [#uses=2]
call void asm sideeffect "fldcw $0", "*m,~{dirflag},~{fpsr},~{flags}"( i16*
%newcw ) nounwind
ret void
}

View File

@ -1,6 +0,0 @@
config.suffixes = ['.ll', '.c', '.cpp']
targets = set(config.root.targets_to_build.split())
if not 'CBackend' in targets or not 'X86' in targets:
config.unsupported = True

View File

@ -1,7 +0,0 @@
; RUN: llc < %s -march=c
define void @func() nounwind {
entry:
%0 = fsub double -0.0, undef
ret void
}

View File

@ -1,6 +0,0 @@
config.suffixes = ['.ll', '.c', '.cpp']
targets = set(config.root.targets_to_build.split())
if not 'CBackend' in targets:
config.unsupported = True

View File

@ -1,12 +0,0 @@
; RUN: llc < %s -march=c | grep {\\* ((unsigned int )}
; PR2408
define i32 @a(i32 %a) {
entry:
%shr = ashr i32 %a, 0 ; <i32> [#uses=1]
%shr2 = ashr i32 2, 0 ; <i32> [#uses=1]
%mul = mul i32 %shr, %shr2 ; <i32> [#uses=1]
%shr4 = ashr i32 2, 0 ; <i32> [#uses=1]
%div = sdiv i32 %mul, %shr4 ; <i32> [#uses=1]
ret i32 %div
}

View File

@ -1,37 +0,0 @@
; RUN: llc < %s -march=c
@.str15 = external global [2 x i8]
define <4 x i32> @foo(<4 x i32> %a, i32 %b) {
%c = insertelement <4 x i32> %a, i32 1, i32 %b
ret <4 x i32> %c
}
define i32 @test2(<4 x i32> %a, i32 %b) {
%c = extractelement <4 x i32> %a, i32 1
ret i32 %c
}
define <4 x float> @test3(<4 x float> %Y) {
%Z = fadd <4 x float> %Y, %Y
%X = shufflevector <4 x float> zeroinitializer, <4 x float> %Z, <4 x i32> < i32 0, i32 5, i32 6, i32 7 >
ret <4 x float> %X
}
define void @test4() {
%x = alloca <4 x float>
%tmp3.i16 = getelementptr <4 x float>* %x, i32 0, i32 0
store float 1.0, float* %tmp3.i16
ret void
}
define i32* @test5({i32, i32} * %P) {
%x = getelementptr {i32, i32} * %P, i32 0, i32 1
ret i32* %x
}
define i8* @test6() {
ret i8* getelementptr ([2 x i8]* @.str15, i32 0, i32 0)
}