- File:
-
- 1 edited
-
tests/exceptions/virtual-poly.cfa (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/exceptions/virtual-poly.cfa
recfd758 rfd54fef 8 8 #include <assert.h> 9 9 10 11 struct __cfatid_struct_mono_base {12 __cfa__parent_vtable const * parent;13 };14 15 __attribute__(( section(".gnu.linkonce.__cfatid_mono_base") ))16 struct __cfatid_struct_mono_base __cfatid_mono_base = {17 (__cfa__parent_vtable *)0,18 };19 20 10 struct mono_base_vtable { 21 __cfatid_struct_mono_base const * const __cfavir_typeid;11 mono_base_vtable const * const parent; 22 12 }; 23 13 … … 27 17 28 18 forall(T) 29 struct __cfatid_struct_mono_child {30 __cfatid_struct_mono_base const * parent;31 };32 33 forall(T)34 19 struct mono_child_vtable { 35 __cfatid_struct_mono_child(T) const * const __cfavir_typeid;20 mono_base_vtable const * const parent; 36 21 }; 37 22 … … 41 26 }; 42 27 43 __cfatid_struct_mono_child(int) __cfatid_mono_child @= { 44 &__cfatid_mono_base, 45 }; 46 28 mono_base_vtable _mono_base_vtable_instance @= { 0 }; 47 29 mono_child_vtable(int) _mono_child_vtable_instance @= { 48 &_ _cfatid_mono_child,30 &_mono_base_vtable_instance 49 31 }; 50 32 … … 55 37 } 56 38 57 58 forall(U)59 struct __cfatid_struct_poly_base {60 __cfa__parent_vtable const * parent;61 };62 63 39 forall(U) 64 40 struct poly_base_vtable { 65 __cfatid_struct_poly_base(U) const * const __cfavir_typeid;41 poly_base_vtable(U) const * const parent; 66 42 }; 67 43 … … 72 48 73 49 forall(V) 74 struct __cfatid_struct_poly_child {75 __cfatid_struct_poly_base(V) const * parent;76 };77 78 forall(V)79 50 struct poly_child_vtable { 80 __cfatid_struct_poly_child(V) const * const __cfavir_typeid;51 poly_base_vtable(V) const * const parent; 81 52 }; 82 53 … … 86 57 }; 87 58 88 __cfatid_struct_poly_base(int) __cfatid_poly_base @= { 89 (__cfa__parent_vtable *)0, 59 poly_base_vtable(int) _poly_base_vtable_instance @= { 0 }; 60 poly_child_vtable(int) _poly_child_vtable_instance @= { 61 &_poly_base_vtable_instance 90 62 }; 91 __cfatid_struct_poly_child(int) __cfatid_poly_child = { 92 &__cfatid_poly_base, 63 /* Resolver bug keeps me from adding these. 64 poly_base_vtable(char) _poly_base_vtable_instance @= { 0 }; 65 poly_child_vtable(char) _poly_child_vtable_instance @= { 66 &_poly_base_vtable_instance 93 67 }; 94 poly_child_vtable(int) _poly_child_vtable_instance @= { 95 &__cfatid_poly_child, 96 }; 68 */ 97 69 98 70 void poly_poly_test() { … … 105 77 mono_poly_test(); 106 78 poly_poly_test(); 107 printf( "done\n" ); 79 printf( "done\n" ); // non-empty .expect file 108 80 }
Note:
See TracChangeset
for help on using the changeset viewer.