Moving CBE tests to test/Regression/CodeGen/CBackend

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11486 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-02-15 22:56:30 +00:00
parent 74661c838c
commit 3a0628a29a
33 changed files with 0 additions and 237 deletions

View File

@ -1,5 +0,0 @@
; Make sure that global variables do not collide if they have the same name,
; but different types.
%X = global int 5
%X = global long 7

View File

@ -1,15 +0,0 @@
; 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.
;
void "test"() {
br label %BB1
BB2:
br label %BB2
BB1:
ret void
}

View File

@ -1,5 +0,0 @@
; Test const pointer refs & forward references
%t3 = global int * %t1 ;; Forward reference
%t1 = global int 4

View File

@ -1,7 +0,0 @@
global int* cast (float* %0 to int*) ;; Forward numeric reference
global float* %0 ;; Duplicate forward numeric reference
global float 0.0
%array = constant [2 x int] [ int 12, int 52 ]
%arrayPtr = global int* getelementptr ([2 x int]* %array, long 0, long 0) ;; int* &%array[0][0]

View File

@ -1,3 +0,0 @@
%sptr1 = global [11x sbyte]* %somestr ;; Forward ref to a constant
%somestr = constant [11x sbyte] c"hello world"

View File

@ -1,3 +0,0 @@
%fptr = global void() * %f ;; Forward ref method defn
declare void "f"() ;; External method

View File

@ -1,3 +0,0 @@
%array = constant [2 x int] [ int 12, int 52 ] ; <[2 x int]*> [#uses=1]
%arrayPtr = global int* getelementptr ([2 x int]* %array, long 0, long 0) ; <int**> [#uses=1]

View File

@ -1,2 +0,0 @@
%MyIntList = uninitialized global { \2 *, int }

View File

@ -1,9 +0,0 @@
; 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.
int %test(int) {
ret int 0
}

View File

@ -1,14 +0,0 @@
; Indirect function call test... found by Joel & Brian
;
%taskArray = uninitialized global int*
void %test(int %X) {
%Y = add int %X, -1 ; <int>:1 [#uses=3]
%cast100 = cast int %Y to long ; <uint> [#uses=1]
%gep100 = getelementptr int** %taskArray, long %cast100 ; <int**> [#uses=1]
%fooPtr = load int** %gep100 ; <int*> [#uses=1]
%cast101 = cast int* %fooPtr to void (int)* ; <void (int)*> [#uses=1]
call void %cast101( int 1000 )
ret void
}

View File

@ -1,5 +0,0 @@
; 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 = uninitialized global { {int } }
%X = uninitialized global { float }

View File

@ -1,8 +0,0 @@
implementation
void %test() {
%X = alloca [4xint]
ret void
}

View File

@ -1,4 +0,0 @@
declare void %foo(...)

View File

@ -1,5 +0,0 @@
%MPI_Comm = type %struct.Comm*
%struct.Comm = type opaque
%thing = global %MPI_Comm* null ; <%MPI_Comm**> [#uses=0]
implementation ; Functions:

View File

@ -1,2 +0,0 @@
%bob = external global int ; <int*> [#uses=2]

View File

@ -1,10 +0,0 @@
%BitField = type int
%tokenptr = type %BitField*
implementation
void %test() {
%pmf1 = alloca %tokenptr (%tokenptr, sbyte*)*
ret void
}

View File

@ -1,10 +0,0 @@
%testString = internal constant [18 x sbyte] c "Escaped newline\n\00"
implementation
declare int %printf(sbyte*, ...)
int %main() {
call int (sbyte*, ...)* %printf( sbyte* getelementptr ([18 x sbyte]* %testString, long 0, long 0))
ret int 0
}

View File

@ -1,5 +0,0 @@
; Apparently this constant was unsigned in ISO C 90, but not in C 99.
int %foo() {
ret int -2147483648
}

View File

@ -1,8 +0,0 @@
; This testcase breaks the C backend, because gcc doesn't like (...) functions
; with no arguments at all.
void %test(long %Ptr) {
%P = cast long %Ptr to void(...) *
call void(...)* %P(long %Ptr)
ret void
}

View File

@ -1,4 +0,0 @@
; The C backend was dying when there was no typename for a struct type!
declare int %test(int,{ [32 x int] }*)

View File

@ -1,7 +0,0 @@
%X = type { int, float }
void %test() {
getelementptr %X* null, long 0, ubyte 1
ret void
}

View File

@ -1,3 +0,0 @@
; Make sure hex constant does not continue into a valid hexadecimal letter/number
%version = global [3 x sbyte] c"\001\00"

View File

@ -1,3 +0,0 @@
%version = global [3 x sbyte] c"1\00\00"

View File

@ -1,16 +0,0 @@
; RUN: llvm-as < %s | llc -march=c > %t1.cbe.c
; RUN: gcc -B/usr/bin/ %t1.cbe.c -o %t1.cbe
; RUN: %t1.cbe
bool %doTest(ubyte %x) {
%dec.0 = add ubyte %x, 255
%tmp.1001 = cast ubyte %dec.0 to bool
ret bool %tmp.1001
}
int %main () {
%result = call bool %doTest(ubyte 1)
%p = cast bool %result to int
ret int %p
}

View File

@ -1,12 +0,0 @@
declare int %callee(int, int)
int %test(int %X) {
%A = invoke int %callee(int %X, int 5) to label %Ok except label %Threw
Ok:
%B = phi int [%A, %0], [-1, %Threw]
ret int %A
Threw:
br label %Ok
}

View File

@ -1,4 +0,0 @@
; RUN: llvm-as < %s | llc -march=c | grep common | grep X
%X = linkonce global int 5

View File

@ -1,3 +0,0 @@
; This is a non-normal FP value: it's a nan.
%NAN = global { float } { float 0x7FF8000000000000 }

View File

@ -1,3 +0,0 @@
%A = type { uint, sbyte*, { uint, uint, uint, uint, uint, uint, uint, uint }*, ushort }

View File

@ -1,9 +0,0 @@
declare sbyte* %llvm.va_start()
declare void %llvm.va_end(sbyte*)
void %test(...) {
%P = call sbyte* %llvm.va_start()
call void %llvm.va_end(sbyte* %P)
ret void
}

View File

@ -1,10 +0,0 @@
; reduced from DOOM.
%union._XEvent = type { int }
%.X_event_9 = global %union._XEvent zeroinitializer
implementation ; Functions:
void %I_InitGraphics() {
shortcirc_next.3: ; preds = %no_exit.1
%tmp.319 = load int* getelementptr ({ int, int }* cast (%union._XEvent* %.X_event_9 to { int, int }*), long 0, ubyte 1) ; <int> [#uses=1]
ret void
}

View File

@ -1,10 +0,0 @@
%y = weak global sbyte 0
implementation
uint %testcaseshr() {
entry:
ret uint shr (uint cast (sbyte* %y to uint), ubyte 4)
}
uint %testcaseshl() {
entry:
ret uint shl (uint cast (sbyte* %y to uint), ubyte 4)
}

View File

@ -1,14 +0,0 @@
; RUN: llvm-as < %s | llc -march=c | grep builtin_return_address
declare sbyte* %llvm.returnaddress(uint)
declare sbyte* %llvm.frameaddress(uint)
sbyte *%test1() {
%X = call sbyte* %llvm.returnaddress(uint 0)
ret sbyte* %X
}
sbyte *%test2() {
%X = call sbyte* %llvm.frameaddress(uint 0)
ret sbyte* %X
}

View File

@ -1,16 +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: llvm-as < %s | llc -march=c | not grep _memcpy
declare void %llvm.memcpy(sbyte*, sbyte*, uint,uint)
declare float* %memcpy(int*, uint,int)
int %test(sbyte *%A, sbyte* %B, int* %C) {
call float* %memcpy(int* %C, uint 4, int 17)
call void %llvm.memcpy(sbyte* %A, sbyte* %B, uint 123, uint 14)
ret int 7
}