source: src/Tests/Attributes.c @ b1d6dd5

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change on this file since b1d6dd5 was b1d6dd5, checked in by Peter A. Buhr <pabuhr@…>, 9 years ago

fix parsing error for EOF message, change cfa-ccp -x flag to -v, regression testing third attempt: consolidate example programs

  • Property mode set to 100644
File size: 680 bytes
Line 
1int @max = 3;
2
3int main() {
4    int x;
5    type @type(type t);         // compiler intrinsic
6    type @widest(type t);
7    @type(x) *y;                // gcc: typeof(x) *y;
8    const @widest(double) *w;   // gcc: const typeof(x) *w;
9    * @type(3 + 4) z;           // cfa declaration syntax
10    y = @max;           
11    z = @max(x) + @size(int);
12    y = @min(3 + 4);
13    if ( @const(x) ) { }
14    if ( @volatile(y) ) { }
15    if ( @extern(y) ) { }
16    if ( @static(y) ) { }
17    @max;
18}
19
20int @foo(int) {
21    return 7;
22}
23
24int @voon;
25double @voon;
26
27int @bort(int);
28int @bort(double);
29
30void g( int );
31
32void f() {
33        float x;
34        double x;
35        @bort(x);
36        @bort(int);
37        g( @voon );
38}
39
40// Local Variables: //
41// tab-width: 4 //
42// End: //
Note: See TracBrowser for help on using the repository browser.