+++ /dev/null
-; 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
+++ /dev/null
-; 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
-}
+++ /dev/null
-; Test const pointer refs & forward references
-
-%t3 = global int * %t1 ;; Forward reference
-%t1 = global int 4
-
+++ /dev/null
-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]
-
+++ /dev/null
-%sptr1 = global [11x sbyte]* %somestr ;; Forward ref to a constant
-%somestr = constant [11x sbyte] c"hello world"
-
+++ /dev/null
-%fptr = global void() * %f ;; Forward ref method defn
-declare void "f"() ;; External method
-
+++ /dev/null
-%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]
-
+++ /dev/null
-%MyIntList = uninitialized global { \2 *, int }
-
+++ /dev/null
-; 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
-}
-
+++ /dev/null
-; 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
-}
+++ /dev/null
-; 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 }
+++ /dev/null
-
-
-implementation
-
-void %test() {
- %X = alloca [4xint]
- ret void
-}
+++ /dev/null
-
-declare void %foo(...)
-
-
+++ /dev/null
- %MPI_Comm = type %struct.Comm*
- %struct.Comm = type opaque
-%thing = global %MPI_Comm* null ; <%MPI_Comm**> [#uses=0]
-
-implementation ; Functions:
+++ /dev/null
-%bob = external global int ; <int*> [#uses=2]
-
+++ /dev/null
-
- %BitField = type int
- %tokenptr = type %BitField*
-
-implementation
-
-void %test() {
- %pmf1 = alloca %tokenptr (%tokenptr, sbyte*)*
- ret void
-}
+++ /dev/null
-%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
-}
+++ /dev/null
-; Apparently this constant was unsigned in ISO C 90, but not in C 99.
-
-int %foo() {
- ret int -2147483648
-}
+++ /dev/null
-; 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
-}
+++ /dev/null
-; The C backend was dying when there was no typename for a struct type!
-
-declare int %test(int,{ [32 x int] }*)
-
+++ /dev/null
-
-%X = type { int, float }
-
-void %test() {
- getelementptr %X* null, long 0, ubyte 1
- ret void
-}
+++ /dev/null
-; Make sure hex constant does not continue into a valid hexadecimal letter/number
-%version = global [3 x sbyte] c"\001\00"
-
+++ /dev/null
-
-%version = global [3 x sbyte] c"1\00\00"
-
+++ /dev/null
-
-; 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
-}
+++ /dev/null
-
-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
-}
+++ /dev/null
-; RUN: llvm-as < %s | llc -march=c | grep common | grep X
-
-%X = linkonce global int 5
-
+++ /dev/null
-; This is a non-normal FP value: it's a nan.
-%NAN = global { float } { float 0x7FF8000000000000 }
-
+++ /dev/null
-
-%A = type { uint, sbyte*, { uint, uint, uint, uint, uint, uint, uint, uint }*, ushort }
-
+++ /dev/null
-
-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
-}
+++ /dev/null
-; 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
-}
+++ /dev/null
-%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)
-}
+++ /dev/null
-; 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
-}
+++ /dev/null
-; 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
-}