- Timestamp:
- Oct 19, 2017, 11:15:35 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 86f852b
- Parents:
- f232977
- git-author:
- Rob Schluntz <rschlunt@…> (10/13/17 16:07:34)
- git-committer:
- Rob Schluntz <rschlunt@…> (10/19/17 11:15:35)
- Location:
- src/tests
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/Makefile.am
rf232977 rb93a3de 133 133 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 134 134 135 ctor-autogen-ERR1: ctor-autogen.c @CFA_BINDIR@/@CFA_NAME@ 136 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 137 135 138 completeTypeError : completeTypeError.c @CFA_BINDIR@/@CFA_NAME@ 136 139 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} -
src/tests/Makefile.in
rf232977 rb93a3de 886 886 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 887 887 888 ctor-autogen-ERR1: ctor-autogen.c @CFA_BINDIR@/@CFA_NAME@ 889 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 890 888 891 completeTypeError : completeTypeError.c @CFA_BINDIR@/@CFA_NAME@ 889 892 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} -
src/tests/ctor-autogen.c
rf232977 rb93a3de 32 32 }; 33 33 34 // managed type - defines a constructor - can't use field constructors 35 struct Managed { 36 int x; 37 }; 38 39 void ?{}(Managed & m) { m.x = 0; } 40 41 // managed type since it contains a managed type - can't use field constructors 42 struct InheritManaged { 43 Managed m; 44 }; 45 34 46 forall(otype T) 35 47 T identity(T x) { return x; } … … 49 61 identity(s); // S should be an otype 50 62 63 SimpleStruct ss; 64 SimpleUnion su; 65 66 identity(ss); 67 identity(su); 68 51 69 PopulatedStruct ps; 52 70 PopulatedUnion pu; … … 54 72 identity(ps); // should recursively be an otype 55 73 identity(pu); // should recursively be an otype 74 75 #if ERR1 76 Managed x = { 123 }; // error 77 Managed y; // okay 78 79 InheritManaged z = { y }; // error? 80 #endif 81 56 82 }
Note: See TracChangeset
for help on using the changeset viewer.