From d366e4094a8277ec67057992ef0856eb0a835181 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 19 Aug 2002 23:09:30 +0000 Subject: [PATCH] * Build with warnings * Add a bunch of testcases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3393 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CBackend/2002-08-19-ConstPointerRef.ll | 5 +++++ test/CBackend/2002-08-19-ConstantExpr.ll | 7 +++++++ test/CBackend/2002-08-19-DataPointer.ll | 3 +++ test/CBackend/2002-08-19-FunctionPointer.ll | 3 +++ test/CBackend/Makefile | 2 +- test/CodeGen/CBackend/2002-08-19-ConstPointerRef.ll | 5 +++++ test/CodeGen/CBackend/2002-08-19-ConstantExpr.ll | 7 +++++++ test/CodeGen/CBackend/2002-08-19-DataPointer.ll | 3 +++ test/CodeGen/CBackend/2002-08-19-FunctionPointer.ll | 3 +++ 9 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 test/CBackend/2002-08-19-ConstPointerRef.ll create mode 100644 test/CBackend/2002-08-19-ConstantExpr.ll create mode 100644 test/CBackend/2002-08-19-DataPointer.ll create mode 100644 test/CBackend/2002-08-19-FunctionPointer.ll create mode 100644 test/CodeGen/CBackend/2002-08-19-ConstPointerRef.ll create mode 100644 test/CodeGen/CBackend/2002-08-19-ConstantExpr.ll create mode 100644 test/CodeGen/CBackend/2002-08-19-DataPointer.ll create mode 100644 test/CodeGen/CBackend/2002-08-19-FunctionPointer.ll diff --git a/test/CBackend/2002-08-19-ConstPointerRef.ll b/test/CBackend/2002-08-19-ConstPointerRef.ll new file mode 100644 index 00000000000..8654baa6af5 --- /dev/null +++ b/test/CBackend/2002-08-19-ConstPointerRef.ll @@ -0,0 +1,5 @@ +; Test const pointer refs & forward references + +%t3 = global int * %t1 ;; Forward reference +%t1 = global int 4 + diff --git a/test/CBackend/2002-08-19-ConstantExpr.ll b/test/CBackend/2002-08-19-ConstantExpr.ll new file mode 100644 index 00000000000..dca476b1d2e --- /dev/null +++ b/test/CBackend/2002-08-19-ConstantExpr.ll @@ -0,0 +1,7 @@ +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, uint 0, uint 0) ;; int* &%array[0][0] + diff --git a/test/CBackend/2002-08-19-DataPointer.ll b/test/CBackend/2002-08-19-DataPointer.ll new file mode 100644 index 00000000000..f7481ea89b2 --- /dev/null +++ b/test/CBackend/2002-08-19-DataPointer.ll @@ -0,0 +1,3 @@ +%sptr1 = global [11x sbyte]* %somestr ;; Forward ref to a constant +%somestr = constant [11x sbyte] c"hello world" + diff --git a/test/CBackend/2002-08-19-FunctionPointer.ll b/test/CBackend/2002-08-19-FunctionPointer.ll new file mode 100644 index 00000000000..ac28d939327 --- /dev/null +++ b/test/CBackend/2002-08-19-FunctionPointer.ll @@ -0,0 +1,3 @@ +%fptr = global void() * %f ;; Forward ref method defn +declare void "f"() ;; External method + diff --git a/test/CBackend/Makefile b/test/CBackend/Makefile index 27a3588bf96..7e5ba7ddefb 100644 --- a/test/CBackend/Makefile +++ b/test/CBackend/Makefile @@ -15,7 +15,7 @@ all:: $(addprefix Output/, $(TESTS:%.ll=%.to)) Output/%.to: Output/%.c - gcc -c $< -o $@ || \ + gcc -c -W -Wall $< -o $@ || \ (rm -f $@; $(FAILURE) $@ ) Output/%.c: %.ll Output/.dir $(LAS) $(LDIS) diff --git a/test/CodeGen/CBackend/2002-08-19-ConstPointerRef.ll b/test/CodeGen/CBackend/2002-08-19-ConstPointerRef.ll new file mode 100644 index 00000000000..8654baa6af5 --- /dev/null +++ b/test/CodeGen/CBackend/2002-08-19-ConstPointerRef.ll @@ -0,0 +1,5 @@ +; Test const pointer refs & forward references + +%t3 = global int * %t1 ;; Forward reference +%t1 = global int 4 + diff --git a/test/CodeGen/CBackend/2002-08-19-ConstantExpr.ll b/test/CodeGen/CBackend/2002-08-19-ConstantExpr.ll new file mode 100644 index 00000000000..dca476b1d2e --- /dev/null +++ b/test/CodeGen/CBackend/2002-08-19-ConstantExpr.ll @@ -0,0 +1,7 @@ +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, uint 0, uint 0) ;; int* &%array[0][0] + diff --git a/test/CodeGen/CBackend/2002-08-19-DataPointer.ll b/test/CodeGen/CBackend/2002-08-19-DataPointer.ll new file mode 100644 index 00000000000..f7481ea89b2 --- /dev/null +++ b/test/CodeGen/CBackend/2002-08-19-DataPointer.ll @@ -0,0 +1,3 @@ +%sptr1 = global [11x sbyte]* %somestr ;; Forward ref to a constant +%somestr = constant [11x sbyte] c"hello world" + diff --git a/test/CodeGen/CBackend/2002-08-19-FunctionPointer.ll b/test/CodeGen/CBackend/2002-08-19-FunctionPointer.ll new file mode 100644 index 00000000000..ac28d939327 --- /dev/null +++ b/test/CodeGen/CBackend/2002-08-19-FunctionPointer.ll @@ -0,0 +1,3 @@ +%fptr = global void() * %f ;; Forward ref method defn +declare void "f"() ;; External method +