source: src/Tests/ResolvExpr/Members.c@ f7d59bf

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 f7d59bf was 843054c2, checked in by Peter A. Buhr <pabuhr@…>, 10 years ago

licencing: seventh groups of files

  • Property mode set to 100644
File size: 972 bytes
Line 
1// "../../cfa-cpp -nc Members.c"
2
3char ?=?( char*, char );
4int ?=?( int*, int );
5float ?=?( float*, float );
6forall( dtype DT ) DT * ?=?( DT**, DT* );
7forall(type T) lvalue T *?( T* );
8char *__builtin_memcpy();
9
10void a( char );
11void b( int );
12void c( int* );
13void d( float* );
14
15struct a_struct
16{
17 int a;
18 char a;
19 float a;
20};
21
22union b_struct
23{
24 int *a;
25 char *a;
26 float *a;
27};
28
29void 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
40struct c_struct
41{
42 int;
43 char;
44 float;
45};
46
47union d_struct
48{
49 int*;
50 char*;
51 float*;
52};
53
54void 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
68struct forward;
69
70struct forward *q;
71
72struct forward { int y; };
73
74void h()
75{
76 q->y;
77}
Note: See TracBrowser for help on using the repository browser.