Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/virtual-cast.cfa

    recfd758 r66812dd  
    1212#include <assert.h>
    1313
    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 
    2614struct alpha_vtable {
    27         struct __cfatid_struct_alpha const * const __cfavir_typeid;
     15        alpha_vtable const * const parent;
    2816        char (*code)(void);
    2917};
     
    3927
    4028
    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 
    5129struct beta_vtable {
    52         struct __cfatid_struct_beta const * const __cfavir_typeid;
     30        alpha_vtable const * const parent;
    5331        char (*code)(void);
    5432};
     
    6442
    6543
    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 
    7644struct gamma_vtable {
    77         struct __cfatid_struct_gamma const * const __cfavir_typeid;
     45        beta_vtable const * const parent;
    7846        char (*code)(void);
    7947};
     
    8957
    9058extern "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 };
    9462}
    9563
Note: See TracChangeset for help on using the changeset viewer.