summaryrefslogtreecommitdiffstats
path: root/test/Feature
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-12-14 16:46:53 +0000
committerChris Lattner <sabre@nondot.org>2001-12-14 16:46:53 +0000
commitf493a569c3d79cbe148fd9fa69a139cdff066116 (patch)
tree900b48bf6f5567579df85d09c8d4f743d4fd2059 /test/Feature
parent48e9f40be0ef7522416520da5dfc1dc6a80b9423 (diff)
downloadexternal_llvm-f493a569c3d79cbe148fd9fa69a139cdff066116.zip
external_llvm-f493a569c3d79cbe148fd9fa69a139cdff066116.tar.gz
external_llvm-f493a569c3d79cbe148fd9fa69a139cdff066116.tar.bz2
Update LLVM tests to use new pointer indexing, and remove unsized array test support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Feature')
-rw-r--r--test/Feature/allocatest2.ll8
-rw-r--r--test/Feature/globalvars.ll2
-rw-r--r--test/Feature/opaquetypes.ll6
-rw-r--r--test/Feature/recursivetype.ll7
-rw-r--r--test/Feature/testalloca.ll10
-rw-r--r--test/Feature/testconstants.ll23
-rw-r--r--test/Feature/testmemory.ll16
7 files changed, 32 insertions, 40 deletions
diff --git a/test/Feature/allocatest2.ll b/test/Feature/allocatest2.ll
index 2775f01..7c93215 100644
--- a/test/Feature/allocatest2.ll
+++ b/test/Feature/allocatest2.ll
@@ -8,8 +8,8 @@ void "_Z17UseAllocaFunctionj"(uint %n)
begin
bb1: ;;<label>
%reg110 = shl uint %n, ubyte 2 ;;<uint>
- %reg108 = alloca [ubyte], uint %reg110 ;;<ubyte*>
- %cast1000 = cast [ubyte]* %reg108 to uint* ;;<uint*>
+ %reg108 = alloca ubyte, uint %reg110 ;;<ubyte*>
+ %cast1000 = cast ubyte* %reg108 to uint* ;;<uint*>
call void %_Z12combinationsjPj(uint %n, uint* %cast1000) ;;<void>
%cast113 = cast uint %reg110 to ulong* ;;<ulong*>
cast uint 7 to ulong *
@@ -17,8 +17,8 @@ bb1: ;;<label>
%reg115 = shr ulong* %reg114, ubyte 3 ;;<ulong*>:(uns ops)
%reg117 = shl ulong* %reg115, ubyte 3 ;;<ulong*>
%cast1001 = cast ulong* %reg117 to uint ;;<uint>
- %reg118 = alloca [ubyte], uint %cast1001 ;;<ubyte*>
- %cast1002 = cast [ubyte]* %reg118 to uint* ;;<uint*>
+ %reg118 = alloca ubyte, uint %cast1001 ;;<ubyte*>
+ %cast1002 = cast ubyte* %reg118 to uint* ;;<uint*>
call void %_Z12combinationsjPj(uint %n, uint* %cast1002) ;;<void>
ret void ;;<void>
end
diff --git a/test/Feature/globalvars.ll b/test/Feature/globalvars.ll
index 3914efc..b243ba5 100644
--- a/test/Feature/globalvars.ll
+++ b/test/Feature/globalvars.ll
@@ -12,7 +12,7 @@ implementation
int "foo"(int %blah)
begin
store int 5, int *%MyVar
- store int 12, { \2 *, int } * %MyIntList, ubyte 1
+ store int 12, { \2 *, int } * %MyIntList, uint 0, ubyte 1
ret int %blah
end
diff --git a/test/Feature/opaquetypes.ll b/test/Feature/opaquetypes.ll
index fcd0999..271493f 100644
--- a/test/Feature/opaquetypes.ll
+++ b/test/Feature/opaquetypes.ll
@@ -10,7 +10,7 @@
%CCC = type { \2* }
%BBB = type { \2*, \2 * }
-%AAA = type { \2*, {\2*}, [{\2*}], {[1x{\2*}]} }
+%AAA = type { \2*, {\2*}, [12x{\2*}], {[1x{\2*}]} }
; Test numbered types
type %CCC
@@ -35,7 +35,7 @@ type %BBB
; A complex recursive type...
%Y = type { {%Y*}, %Y* }
-%Z = type { { %Z * }, [%Z] *, {{{ %Z * }}} }
+%Z = type { { %Z * }, [12x%Z] *, {{{ %Z * }}} }
; More ridiculous test cases...
%A = type [ 123x %A*]
@@ -49,7 +49,7 @@ type %BBB
; Test the parser for unnamed recursive types...
%P1 = type \1 *
%Y1 = type { { \3 * }, \2 * }
-%Z1 = type { { \3 * }, [\3] *, { { { \5 * } } } }
+%Z1 = type { { \3 * }, [12x\3] *, { { { \5 * } } } }
implementation
diff --git a/test/Feature/recursivetype.ll b/test/Feature/recursivetype.ll
index ce82145..60ffc51 100644
--- a/test/Feature/recursivetype.ll
+++ b/test/Feature/recursivetype.ll
@@ -85,11 +85,10 @@ bb2:
br bool %cond1011, label %bb4, label %bb3
bb3:
- %cast1015 = cast ulong 0 to %list* ;;<%list*>
- ret %list* %cast1015
+ ret %list* null
bb4:
- %reg111 = load %list* %reg115, ubyte 1 ;;<int>
+ %reg111 = load %list* %reg115, uint 0, ubyte 1 ;;<int>
%cond1013 = setne int %reg111, %Data ;;<bool>
br bool %cond1013, label %bb6, label %bb5
@@ -97,6 +96,6 @@ bb5:
ret %list* %reg115
bb6:
- %reg116 = load %list* %reg115, ubyte 0 ;;<%list*>
+ %reg116 = load %list* %reg115, uint 0, ubyte 0 ;;<%list*>
br label %bb2
end
diff --git a/test/Feature/testalloca.ll b/test/Feature/testalloca.ll
index cb867c0..9b0630a 100644
--- a/test/Feature/testalloca.ll
+++ b/test/Feature/testalloca.ll
@@ -5,17 +5,17 @@ implementation
int "test function"(int %i0, int %j0)
begin
- alloca [ubyte], uint 5
+ alloca ubyte, uint 5
%ptr = alloca int ; yields {int*}:ptr
store int 3, int* %ptr ; yields {void}
%val = load int* %ptr ; yields {int}:val = int %3
%sptr = alloca %struct ; yields {%struct*}:sptr
- %nsptr = getelementptr %struct * %sptr, ubyte 1 ; yields {inners*}:nsptr
- %ubsptr = getelementptr %inners * %nsptr, ubyte 1 ; yields {{ubyte}*}:ubsptr
- store ubyte 4, {ubyte} * %ubsptr, ubyte 0
+ %nsptr = getelementptr %struct * %sptr, uint 0, ubyte 1 ; yields {inners*}:nsptr
+ %ubsptr = getelementptr %inners * %nsptr, uint 0, ubyte 1 ; yields {{ubyte}*}:ubsptr
+ store ubyte 4, {ubyte} * %ubsptr, uint 0, ubyte 0
- %fptr = getelementptr %struct * %sptr, ubyte 1, ubyte 0 ; yields {float*}:fptr
+ %fptr = getelementptr %struct * %sptr, uint 0, ubyte 1, ubyte 0 ; yields {float*}:fptr
store float 4.0, float * %fptr
ret int 3
diff --git a/test/Feature/testconstants.ll b/test/Feature/testconstants.ll
index a894c3d..baf1c1d 100644
--- a/test/Feature/testconstants.ll
+++ b/test/Feature/testconstants.ll
@@ -1,29 +1,22 @@
-%somestr = constant [sbyte] c"hello world"
%somestr = constant [11x sbyte] c"hello world"
-%array = constant [[2 x int]] [ [2 x int] [ int 12, int 52 ] ]
+%array = constant [2 x int] [ int 12, int 52 ]
constant { int, int } { int 4, int 3 }
implementation
-[[2 x int]]* "test function"(int %i0, int %j0)
+[2 x int]* "test function"(int %i0, int %j0)
begin
- ret [[2x int]]* %array
+ ret [2x int]* %array
end
-[sbyte]* "other func"(int, double)
+sbyte* "other func"(int, double)
begin
- ret [sbyte]* %somestr
+ %somestr = getelementptr [11x sbyte]* %somestr, uint 0, uint 0
+ ret sbyte* %somestr
end
-[sbyte]* "yet another func"(int, double)
+sbyte* "yet another func"(int, double)
begin
- ret [sbyte]* null ; Test null
-end
-
-
-[sbyte]* "again"(float)
-begin
- %cast = cast [11x sbyte]* %somestr to [sbyte]*
- ret [sbyte]* %cast
+ ret sbyte* null ; Test null
end
diff --git a/test/Feature/testmemory.ll b/test/Feature/testmemory.ll
index b65c4f3..b2cf051 100644
--- a/test/Feature/testmemory.ll
+++ b/test/Feature/testmemory.ll
@@ -1,5 +1,5 @@
%struct = type { int , {float, {ubyte } } , ulong }
-%complexty = type [{int, {[4 x sbyte *], float}, double}]
+%complexty = type {int, {[4 x sbyte *], float}, double}
implementation
@@ -13,13 +13,13 @@ int "testfunction"(uint %i0, uint %j0)
begin
%array0 = malloc [4 x ubyte] ; yields {[4 x ubyte]*}:array0
%size = add uint 2, 2 ; yields {uint}:size = uint %4
- %array1 = malloc [ubyte], uint 4 ; yields {[ubyte]*}:array1
- %array2 = malloc [ubyte], uint %size ; yields {[ubyte]*}:array2
+ %array1 = malloc ubyte, uint 4 ; yields {ubyte*}:array1
+ %array2 = malloc ubyte, uint %size ; yields {ubyte*}:array2
- store ubyte 123, [4 x ubyte]* %array0, uint 2
+ store ubyte 123, [4 x ubyte]* %array0, uint 0, uint 2
free [4x ubyte]* %array0
- free [ubyte]* %array1
- free [ubyte]* %array2
+ free ubyte* %array1
+ free ubyte* %array2
%aa = alloca %complexty, uint 5
@@ -30,8 +30,8 @@ begin
%val = load int* %ptr ; yields {int}:val = int %3
%sptr = alloca %struct ; yields {%struct*}:sptr
- %ubsptr = getelementptr %struct * %sptr, ubyte 1, ubyte 1 ; yields {{ubyte}*}:ubsptr
- store ubyte 4, {ubyte} * %ubsptr, ubyte 0
+ %ubsptr = getelementptr %struct * %sptr, uint 0, ubyte 1, ubyte 1 ; yields {{ubyte}*}:ubsptr
+ store ubyte 4, {ubyte} * %ubsptr, uint 0, ubyte 0
ret int 3
end