- File:
-
- 1 edited
-
tests/exceptions/virtual-cast.cfa (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/exceptions/virtual-cast.cfa
recfd758 r66812dd 12 12 #include <assert.h> 13 13 14 15 16 // Hand defined alpha virtual type:17 struct __cfatid_struct_alpha {18 __cfa__parent_vtable const * parent;19 };20 21 __attribute__(( section(".gnu.linkonce.__cfatid_alpha") ))22 struct __cfatid_struct_alpha __cfatid_alpha = {23 (__cfa__parent_vtable *)0,24 };25 26 14 struct alpha_vtable { 27 struct __cfatid_struct_alpha const * const __cfavir_typeid;15 alpha_vtable const * const parent; 28 16 char (*code)(void); 29 17 }; … … 39 27 40 28 41 // Hand defined beta virtual type:42 struct __cfatid_struct_beta {43 __cfatid_struct_alpha const * parent;44 };45 46 __attribute__(( section(".gnu.linkonce.__cfatid_beta") ))47 struct __cfatid_struct_beta __cfatid_beta = {48 &__cfatid_alpha,49 };50 51 29 struct beta_vtable { 52 struct __cfatid_struct_beta const * const __cfavir_typeid;30 alpha_vtable const * const parent; 53 31 char (*code)(void); 54 32 }; … … 64 42 65 43 66 // Hand defined gamma virtual type:67 struct __cfatid_struct_gamma {68 __cfatid_struct_beta const * parent;69 };70 71 __attribute__(( section(".gnu.linkonce.__cfatid_gamma") ))72 struct __cfatid_struct_gamma __cfatid_gamma = {73 &__cfatid_beta,74 };75 76 44 struct gamma_vtable { 77 struct __cfatid_struct_gamma const * const __cfavir_typeid;45 beta_vtable const * const parent; 78 46 char (*code)(void); 79 47 }; … … 89 57 90 58 extern "C" { 91 alpha_vtable _alpha_vtable_instance = { &__cfatid_alpha, ret_a };92 beta_vtable _beta_vtable_instance = { &_ _cfatid_beta, ret_b };93 gamma_vtable _gamma_vtable_instance = { &_ _cfatid_gamma, ret_g };59 alpha_vtable _alpha_vtable_instance = { 0, ret_a }; 60 beta_vtable _beta_vtable_instance = { &_alpha_vtable_instance, ret_b }; 61 gamma_vtable _gamma_vtable_instance = { &_beta_vtable_instance, ret_g }; 94 62 } 95 63
Note:
See TracChangeset
for help on using the changeset viewer.