summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-09-07 20:59:20 +0000
committerChris Lattner <sabre@nondot.org>2001-09-07 20:59:20 +0000
commitfc8566a1ed62aadc793acace4ca564f30a7bcc2e (patch)
tree3a6f69d08168984efb9589e4929c14796c895f55
parent6f728cf288193f2c011f0eda60033d451e5c255d (diff)
downloadbcm5719-llvm-fc8566a1ed62aadc793acace4ca564f30a7bcc2e.tar.gz
bcm5719-llvm-fc8566a1ed62aadc793acace4ca564f30a7bcc2e.zip
Check opaque, abstract, and recursive type handling
llvm-svn: 479
-rw-r--r--llvm/test/Feature/opaquetypes.ll57
1 files changed, 57 insertions, 0 deletions
diff --git a/llvm/test/Feature/opaquetypes.ll b/llvm/test/Feature/opaquetypes.ll
new file mode 100644
index 00000000000..fcd0999d4a7
--- /dev/null
+++ b/llvm/test/Feature/opaquetypes.ll
@@ -0,0 +1,57 @@
+; This test case is used to test opaque type processing, forward references,
+; and recursive types. Oh my.
+;
+
+%SQ1 = type { int }
+%ITy = type opaque
+%SQ2 = type { %ITy }
+%ITy = type int
+
+
+%CCC = type { \2* }
+%BBB = type { \2*, \2 * }
+%AAA = type { \2*, {\2*}, [{\2*}], {[1x{\2*}]} }
+
+; Test numbered types
+type %CCC
+type %BBB
+%Composite = type { %0, %1 }
+
+; Test simple opaque type resolution...
+%intty = type opaque
+%intty = type int
+
+; Perform a simple forward reference...
+%ty1 = type { %ty2, int }
+%ty2 = type float
+
+; Do a recursive type...
+%list = type { %list * }
+%listp = type { %listp } *
+
+; Do two mutually recursive types...
+%TyA = type { %ty2, %TyB * }
+%TyB = type { double, %TyA * }
+
+; A complex recursive type...
+%Y = type { {%Y*}, %Y* }
+%Z = type { { %Z * }, [%Z] *, {{{ %Z * }}} }
+
+; More ridiculous test cases...
+%A = type [ 123x %A*]
+%M = type %M (%M, %M) *
+%P = type %P*
+
+; Recursive ptrs
+%u = type %v*
+%v = type %u*
+
+; Test the parser for unnamed recursive types...
+%P1 = type \1 *
+%Y1 = type { { \3 * }, \2 * }
+%Z1 = type { { \3 * }, [\3] *, { { { \5 * } } } }
+
+implementation
+
+
+
OpenPOWER on IntegriCloud