ADT
aaron-thesis
arm-eh
ast-experimental
cleanup-dtors
ctor
deferred_resn
demangler
enum
forall-pointer-decay
gc_noraii
jacob/cs343-translation
jenkins-sandbox
memory
new-ast
new-ast-unique-expr
new-env
no_list
persistent-indexer
pthread-emulation
qualifiedEnum
resolv-new
string
with_gc
|
Last change
on this file since fe3b61b was 51b73452, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago |
|
initial commit
|
-
Property mode
set to
100644
|
|
File size:
972 bytes
|
| Line | |
|---|
| 1 | // "../../cfa-cpp -nc Members.c"
|
|---|
| 2 |
|
|---|
| 3 | char ?=?( char*, char );
|
|---|
| 4 | int ?=?( int*, int );
|
|---|
| 5 | float ?=?( float*, float );
|
|---|
| 6 | forall( dtype DT ) DT * ?=?( DT**, DT* );
|
|---|
| 7 | forall(type T) lvalue T *?( T* );
|
|---|
| 8 | char *__builtin_memcpy();
|
|---|
| 9 |
|
|---|
| 10 | void a( char );
|
|---|
| 11 | void b( int );
|
|---|
| 12 | void c( int* );
|
|---|
| 13 | void d( float* );
|
|---|
| 14 |
|
|---|
| 15 | struct a_struct
|
|---|
| 16 | {
|
|---|
| 17 | int a;
|
|---|
| 18 | char a;
|
|---|
| 19 | float a;
|
|---|
| 20 | };
|
|---|
| 21 |
|
|---|
| 22 | union b_struct
|
|---|
| 23 | {
|
|---|
| 24 | int *a;
|
|---|
| 25 | char *a;
|
|---|
| 26 | float *a;
|
|---|
| 27 | };
|
|---|
| 28 |
|
|---|
| 29 | void f()
|
|---|
| 30 | {
|
|---|
| 31 | struct a_struct the_struct;
|
|---|
| 32 | union b_struct the_struct;
|
|---|
| 33 |
|
|---|
| 34 | a( the_struct.a );
|
|---|
| 35 | b( the_struct.a );
|
|---|
| 36 | c( the_struct.a );
|
|---|
| 37 | d( the_struct.a );
|
|---|
| 38 | }
|
|---|
| 39 |
|
|---|
| 40 | struct c_struct
|
|---|
| 41 | {
|
|---|
| 42 | int;
|
|---|
| 43 | char;
|
|---|
| 44 | float;
|
|---|
| 45 | };
|
|---|
| 46 |
|
|---|
| 47 | union d_struct
|
|---|
| 48 | {
|
|---|
| 49 | int*;
|
|---|
| 50 | char*;
|
|---|
| 51 | float*;
|
|---|
| 52 | };
|
|---|
| 53 |
|
|---|
| 54 | void g()
|
|---|
| 55 | {
|
|---|
| 56 | unsigned short x;
|
|---|
| 57 | struct c_struct x;
|
|---|
| 58 | union d_struct x;
|
|---|
| 59 |
|
|---|
| 60 | a( x ); // the 'a' and 'b' calls resolve to the ushort
|
|---|
| 61 | b( x ); // it's debatable whether this is good
|
|---|
| 62 | c( x );
|
|---|
| 63 | d( x );
|
|---|
| 64 | }
|
|---|
| 65 |
|
|---|
| 66 | // make sure that forward declarations work
|
|---|
| 67 |
|
|---|
| 68 | struct forward;
|
|---|
| 69 |
|
|---|
| 70 | struct forward *q;
|
|---|
| 71 |
|
|---|
| 72 | struct forward { int y; };
|
|---|
| 73 |
|
|---|
| 74 | void h()
|
|---|
| 75 | {
|
|---|
| 76 | q->y;
|
|---|
| 77 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.