Changeset 25cdca5 for tests/polymorphism.cfa
- Timestamp:
- Jan 8, 2019, 11:31:21 AM (5 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 08222c7, 274da98
- Parents:
- 84b4d607 (diff), d5b2ac8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/polymorphism.cfa
r84b4d607 r25cdca5 9 9 // Author : Rob Schluntz 10 10 // Created On : Tue Oct 17 12:19:48 2017 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Tue Oct 17 12:21:07 201713 // Update Count : 111 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 25 14:40:24 2018 13 // Update Count : 3 14 14 // 15 15 16 16 #include <assert.h> 17 17 #include <inttypes.h> 18 #include <fstream.hfa> 18 19 19 20 forall(otype T) … … 61 62 int y = 456; 62 63 int z = f(x, y); 63 printf("%d %d %d\n", x, y, z);64 sout | x | y | z; 64 65 } 65 66 66 { 67 67 // explicitly specialize function 68 68 int (*f)(int) = ident; 69 69 ((int(*)(int))ident); 70 printf("%d %d\n", f(5), ((int(*)(int))ident)(5));70 sout | f(5) | ((int(*)(int))ident)(5); 71 71 } 72 73 72 { 74 73 // test aggregates with polymorphic members … … 100 99 101 100 void print(x_type x) { 102 printf("%"PRIu32"\n", x);101 sout | x; 103 102 } 104 103 105 104 void print(y_type y) { 106 printf("%"PRIu64"\n", y);105 sout | y; 107 106 } 108 107
Note: See TracChangeset
for help on using the changeset viewer.