Changes in tests/polymorphism.cfa [801978b:fd54fef]
- File:
-
- 1 edited
-
tests/polymorphism.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/polymorphism.cfa
r801978b rfd54fef 54 54 b.i = s.i; 55 55 return b.j; 56 }57 58 void checkPlan9offsets() {59 60 forall( T )61 struct thing {62 T q; // variable-sized padding63 inline double;64 inline float;65 };66 67 #define SHOW_OFFSETS \68 double & x_inner_double = x; \69 float & x_inner_float = x; \70 printf(" offset of inner double: %ld\n", ((char *) & x_inner_double) - ((char *) & x) ); \71 printf(" offset of inner float: %ld\n", ((char *) & x_inner_float ) - ((char *) & x) );72 73 void showStatic( thing(int) & x ) {74 printf("static:\n");75 SHOW_OFFSETS76 }77 78 forall( T )79 void showDynamic( thing(T) & x ) {80 printf("dynamic:\n");81 SHOW_OFFSETS82 }83 84 #undef SHOW_OFFSETS85 86 printf("=== checkPlan9offsets\n");87 thing(int) x;88 showStatic(x);89 showDynamic(x);90 56 } 91 57 … … 148 114 assertf(ret == u.f2, "union operation fails in polymorphic context."); 149 115 } 150 151 checkPlan9offsets();152 116 } 153 117
Note:
See TracChangeset
for help on using the changeset viewer.