2008-03-01 07:38:40 +00:00
|
|
|
; RUN: llvm-as < %s | llvm-dis > %t1.ll
|
2004-11-07 06:08:43 +00:00
|
|
|
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
|
|
|
|
; RUN: diff %t1.ll %t2.ll
|
|
|
|
|
2001-09-07 20:59:20 +00:00
|
|
|
; This test case is used to test opaque type processing, forward references,
|
|
|
|
; and recursive types. Oh my.
|
|
|
|
;
|
|
|
|
|
2008-03-01 07:38:40 +00:00
|
|
|
%SQ1 = type { i32 }
|
2001-09-07 20:59:20 +00:00
|
|
|
%SQ2 = type { %ITy }
|
2008-03-01 07:38:40 +00:00
|
|
|
%ITy = type i32
|
2001-09-07 20:59:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
%CCC = type { \2* }
|
|
|
|
%BBB = type { \2*, \2 * }
|
2001-12-14 16:46:53 +00:00
|
|
|
%AAA = type { \2*, {\2*}, [12x{\2*}], {[1x{\2*}]} }
|
2001-09-07 20:59:20 +00:00
|
|
|
|
|
|
|
; Test numbered types
|
|
|
|
type %CCC
|
|
|
|
type %BBB
|
|
|
|
%Composite = type { %0, %1 }
|
|
|
|
|
|
|
|
; Test simple opaque type resolution...
|
2008-03-01 07:38:40 +00:00
|
|
|
%intty = type i32
|
2001-09-07 20:59:20 +00:00
|
|
|
|
|
|
|
; Perform a simple forward reference...
|
2008-03-01 07:38:40 +00:00
|
|
|
%ty1 = type { %ty2, i32 }
|
2001-09-07 20:59:20 +00:00
|
|
|
%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* }
|
2001-12-14 16:46:53 +00:00
|
|
|
%Z = type { { %Z * }, [12x%Z] *, {{{ %Z * }}} }
|
2001-09-07 20:59:20 +00:00
|
|
|
|
|
|
|
; 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 * }
|
2001-12-14 16:46:53 +00:00
|
|
|
%Z1 = type { { \3 * }, [12x\3] *, { { { \5 * } } } }
|
2001-09-07 20:59:20 +00:00
|
|
|
|