+; RUN: llvm-as < %s | llc -march=c
+
; Make sure that global variables do not collide if they have the same name,
; but different types.
+; RUN: llvm-as < %s | llc -march=c
+
; This case was emitting code that looked like this:
; ...
; llvm_BB1: /* no statement here */
+; RUN: llvm-as < %s | llc -march=c
+
; Test const pointer refs & forward references
%t3 = global int * %t1 ;; Forward reference
+; RUN: llvm-as < %s | llc -march=c
+
global int* cast (float* %0 to int*) ;; Forward numeric reference
global float* %0 ;; Duplicate forward numeric reference
global float 0.0
+; RUN: llvm-as < %s | llc -march=c
+
%sptr1 = global [11x sbyte]* %somestr ;; Forward ref to a constant
%somestr = constant [11x sbyte] c"hello world"
+; RUN: llvm-as < %s | llc -march=c
+
%fptr = global void() * %f ;; Forward ref method defn
declare void "f"() ;; External method
+; RUN: llvm-as < %s | llc -march=c
+
%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]
+; RUN: llvm-as < %s | llc -march=c
+
%MyIntList = uninitialized global { \2 *, int }
+; RUN: llvm-as < %s | llc -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
+; RUN: llvm-as < %s | llc -march=c
+
; Indirect function call test... found by Joel & Brian
;
+; RUN: llvm-as < %s | llc -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.
+; RUN: llvm-as < %s | llc -march=c
+
implementation
+; RUN: llvm-as < %s | llc -march=c
+
declare void %foo(...)
+; RUN: llvm-as < %s | llc -march=c
+
%MPI_Comm = type %struct.Comm*
%struct.Comm = type opaque
%thing = global %MPI_Comm* null ; <%MPI_Comm**> [#uses=0]
+; RUN: llvm-as < %s | llc -march=c
+
%bob = external global int ; <int*> [#uses=2]
+; RUN: llvm-as < %s | llc -march=c
+
%BitField = type int
%tokenptr = type %BitField*
+; RUN: llvm-as < %s | llc -march=c
+
%testString = internal constant [18 x sbyte] c "Escaped newline\n\00"
implementation
+; RUN: llvm-as < %s | llc -march=c
+
; Apparently this constant was unsigned in ISO C 90, but not in C 99.
int %foo() {
+; RUN: llvm-as < %s | llc -march=c
+
; This testcase breaks the C backend, because gcc doesn't like (...) functions
; with no arguments at all.
+; RUN: llvm-as < %s | llc -march=c
+
; The C backend was dying when there was no typename for a struct type!
declare int %test(int,{ [32 x int] }*)
+; RUN: llvm-as < %s | llc -march=c
+
%X = type { int, float }
+; RUN: llvm-as < %s | llc -march=c
+
; Make sure hex constant does not continue into a valid hexadecimal letter/number
%version = global [3 x sbyte] c"\001\00"
+; RUN: llvm-as < %s | llc -march=c
+
%version = global [3 x sbyte] c"1\00\00"
+; RUN: llvm-as < %s | llc -march=c
+
declare int %callee(int, int)
+; RUN: llvm-as < %s | llc -march=c
+
; This is a non-normal FP value: it's a nan.
%NAN = global { float } { float 0x7FF8000000000000 }
%NANs = global { float } { float 0x7FF4000000000000 }
+; RUN: llvm-as < %s | llc -march=c
+
%A = type { uint, sbyte*, { uint, uint, uint, uint, uint, uint, uint, uint }*, ushort }
+; RUN: llvm-as < %s | llc -march=c
+
declare sbyte* %llvm.va_start()
declare void %llvm.va_end(sbyte*)
+; RUN: llvm-as < %s | llc -march=c
+
; reduced from DOOM.
%union._XEvent = type { int }
%.X_event_9 = global %union._XEvent zeroinitializer
+; RUN: llvm-as < %s | llc -march=c
+
%y = weak global sbyte 0
implementation
uint %testcaseshr() {
+; RUN: llvm-as < %s | llc -march=c
+
declare void %llvm.va_end(sbyte*)
void %test() {
+; RUN: llvm-as < %s | llc
+
int %foo(int %x) {
ret int %x
}
+; RUN: llvm-as < %s | llc
+
int %foo(int %x) {
ret int 42
}
+; RUN: llvm-as < %s | llc
+
void %foo() {
ret void
}
+; RUN: llvm-as < %s | llc
+
int %bar(int %x) {
ret int 0
}
+; RUN: llvm-as < %s | llc
+
%a_fstr = internal constant [8 x sbyte] c"a = %f\0A\00"
%a_lstr = internal constant [10 x sbyte] c"a = %lld\0A\00"
%a_dstr = internal constant [8 x sbyte] c"a = %d\0A\00"
+; RUN: llvm-as < %s | llc
+
%g = global int 0
int %main() {
+; RUN: llvm-as < %s | llc
+
%.str_1 = internal constant [7 x sbyte] c"hello\0A\00"
declare int %printf(sbyte*, ...)
+; RUN: llvm-as < %s | llc
+
%.str_1 = internal constant [4 x sbyte] c"%d\0A\00"
declare int %printf(sbyte*, ...)
+; RUN: llvm-as < %s | llc
+
%a_str = internal constant [8 x sbyte] c"a = %f\0A\00"
%b_str = internal constant [8 x sbyte] c"b = %f\0A\00"
;; binary ops: arith
+; RUN: llvm-as < %s | llc
+
%a_str = internal constant [8 x sbyte] c"a = %d\0A\00"
%b_str = internal constant [8 x sbyte] c"b = %d\0A\00"
;; binary ops: arith
+; RUN: llvm-as < %s | llc
+
%.str_1 = internal constant [4 x sbyte] c"%d\0A\00"
declare int %printf(sbyte*, ...)
+; RUN: llvm-as < %s | llc
+
%a_str = internal constant [8 x sbyte] c"a = %d\0A\00"
%a_mul_str = internal constant [13 x sbyte] c"a * %d = %d\0A\00"
%A = global int 2
+; RUN: llvm-as < %s | llc
+
%a_str = internal constant [8 x sbyte] c"a = %d\0A\00"
%b_str = internal constant [8 x sbyte] c"b = %d\0A\00"
+; RUN: llvm-as < %s | llc
+
%a_str = internal constant [8 x sbyte] c"a = %d\0A\00"
%b_str = internal constant [8 x sbyte] c"b = %d\0A\00"
+; RUN: llvm-as < %s | llc
+
int %main() {
ret int 0
}
+; RUN: llvm-as < %s | llc
+
int %main() {
ret int 42
}