Changeset ecfd758 for tests/exceptions/virtual-poly.cfa
- Timestamp:
- Apr 9, 2021, 2:11:43 PM (2 years ago)
- Branches:
- ADT, arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- b91bfde
- Parents:
- e07b589
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/exceptions/virtual-poly.cfa
re07b589 recfd758 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 10 20 struct mono_base_vtable { 11 mono_base_vtable const * const parent;21 __cfatid_struct_mono_base const * const __cfavir_typeid; 12 22 }; 13 23 … … 17 27 18 28 forall(T) 29 struct __cfatid_struct_mono_child { 30 __cfatid_struct_mono_base const * parent; 31 }; 32 33 forall(T) 19 34 struct mono_child_vtable { 20 mono_base_vtable const * const parent;35 __cfatid_struct_mono_child(T) const * const __cfavir_typeid; 21 36 }; 22 37 … … 26 41 }; 27 42 28 mono_base_vtable _mono_base_vtable_instance @= { 0 }; 43 __cfatid_struct_mono_child(int) __cfatid_mono_child @= { 44 &__cfatid_mono_base, 45 }; 46 29 47 mono_child_vtable(int) _mono_child_vtable_instance @= { 30 &_ mono_base_vtable_instance48 &__cfatid_mono_child, 31 49 }; 32 50 … … 37 55 } 38 56 57 58 forall(U) 59 struct __cfatid_struct_poly_base { 60 __cfa__parent_vtable const * parent; 61 }; 62 39 63 forall(U) 40 64 struct poly_base_vtable { 41 poly_base_vtable(U) const * const parent;65 __cfatid_struct_poly_base(U) const * const __cfavir_typeid; 42 66 }; 43 67 … … 48 72 49 73 forall(V) 74 struct __cfatid_struct_poly_child { 75 __cfatid_struct_poly_base(V) const * parent; 76 }; 77 78 forall(V) 50 79 struct poly_child_vtable { 51 poly_base_vtable(V) const * const parent;80 __cfatid_struct_poly_child(V) const * const __cfavir_typeid; 52 81 }; 53 82 … … 57 86 }; 58 87 59 poly_base_vtable(int) _poly_base_vtable_instance @= { 0 }; 88 __cfatid_struct_poly_base(int) __cfatid_poly_base @= { 89 (__cfa__parent_vtable *)0, 90 }; 91 __cfatid_struct_poly_child(int) __cfatid_poly_child = { 92 &__cfatid_poly_base, 93 }; 60 94 poly_child_vtable(int) _poly_child_vtable_instance @= { 61 &_ poly_base_vtable_instance95 &__cfatid_poly_child, 62 96 }; 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_instance67 };68 */69 97 70 98 void poly_poly_test() { … … 77 105 mono_poly_test(); 78 106 poly_poly_test(); 79 printf( "done\n" ); // non-empty .expect file107 printf( "done\n" ); 80 108 }
Note: See TracChangeset
for help on using the changeset viewer.