Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/attributes.cfa

    rbada452 r77148b0  
    1 //
     1// 
    22// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
    33//
    44// The contents of this file are covered under the licence agreement in the
    55// file "LICENCE" distributed with Cforall.
    6 //
    7 // attributes.cfa --
    8 //
     6// 
     7// attributes.cfa -- 
     8// 
    99// Author           : Peter A. Buhr
    1010// Created On       : Mon Feb  6 16:07:02 2017
     
    1212// Last Modified On : Fri Dec 20 15:32:21 2024
    1313// Update Count     : 53
    14 //
     14// 
    1515
    16 #pragma GCC diagnostic ignored "-Wattributes"
    1716
    1817// label attribute
    1918int la() {
    2019  L: __attribute__(( unused )) 1;
    21   return 1;
    2220}
    2321
     
    6664// function_declarator
    6765__attribute__(( unused )) int f1() __attribute__(( used ));
    68 __attribute__(( unused )) int f1() { return 1; }
     66__attribute__(( unused )) int f1() {}
    6967__attribute__(( unused )) int * __attribute__(( unused )) * const __attribute__(( unused )) f2() __attribute__(( used ));
    70 __attribute__(( unused )) int * __attribute__(( unused )) * const __attribute__(( unused )) f2() { return 0p; }
     68__attribute__(( unused )) int * __attribute__(( unused )) * const __attribute__(( unused )) f2() {}
    7169__attribute__(( unused )) int (* __attribute__(( unused )) f3(int))[] __attribute__(( used ));
    7270__attribute__(( unused )) int ( __attribute__(( unused )) * __attribute__(( unused )) f4(int))[] __attribute__(( used ));
    73 __attribute__(( unused )) int (* __attribute__(( unused )) f5(int p))[] { (void)p; return 0p; }
    74 __attribute__(( unused )) int ( __attribute__(( unused )) * (f6)(int p))[] { (void)p; return 0p; }
     71__attribute__(( unused )) int (* __attribute__(( unused )) f5(int p))[] {}
     72__attribute__(( unused )) int ( __attribute__(( unused )) * (f6)(int p))[] {}
    7573__attribute__(( unused )) int (* __attribute__(( unused )) f7())(int) __attribute__(( used ));
    76 __attribute__(( unused )) int (* __attribute__(( unused )) f8())(int) { return 0p; }
    77 __attribute__(( unused )) int ( __attribute__(( unused )) * f9())(int) { return 0p; }
    78 __attribute__(( unused )) int ( __attribute__(( unused )) * (f10)())(int) { return 0p; }
     74__attribute__(( unused )) int (* __attribute__(( unused )) f8())(int) {}
     75__attribute__(( unused )) int ( __attribute__(( unused )) * f9())(int) {}
     76__attribute__(( unused )) int ( __attribute__(( unused )) * (f10)())(int) {}
    7977
    8078
    8179// variable_type_redeclarator
    8280typedef int t1, t2, t3, t4, t5, t6, t7, t8;
    83 void vtr() {
     81int vtr() {
    8482    // redefine typedef name in new scope
    8583    __attribute__(( unused )) int __attribute__(( unused )) t1 __attribute__(( used ));
     
    9492
    9593// identifier_parameter_declarator
    96 void ipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )),
     94int ipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )),
    9795          __attribute__(( unused )) int __attribute__(( unused )) q __attribute__(( unused )) );
    98 void ipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )),
     96int ipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )),
    9997          __attribute__(( unused )) int __attribute__(( unused )) q __attribute__(( unused )) ) {}
    100 void ipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )),
     98int ipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )),
    10199          __attribute__(( unused )) int __attribute__(( unused )) (* (q)) __attribute__(( unused )) );
    102 void ipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )),
     100int ipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )),
    103101          __attribute__(( unused )) int __attribute__(( unused )) (* (q)) __attribute__(( unused )) ) {}
    104 void ipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )),
     102int ipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )),
    105103          __attribute__(( unused )) int __attribute__(( unused )) ((q)[]) __attribute__(( unused )) );
    106 void ipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )),
     104int ipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )),
    107105          __attribute__(( unused )) int __attribute__(( unused )) ((q)[]) __attribute__(( unused )) ) {}
    108 void ipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )),
     106int ipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )),
    109107          __attribute__(( unused )) int __attribute__(( unused )) ((q)()) __attribute__(( unused )) );
    110 void ipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )),
     108int ipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )),
    111109          __attribute__(( unused )) int __attribute__(( unused )) ((q)()) __attribute__(( unused )) ) {}
    112110
     
    124122
    125123// abstract_declarator
    126 void ad() {
     124int ad() {
    127125    typeof( int __attribute__(( used )) ) ad1 __attribute__(( unused ));
    128126    typeof( int __attribute__(( unused )) * __attribute__(( unused )) ) ad2 __attribute__(( unused ));
     
    159157// variable_abstract_declarator
    160158struct Vad {
    161     int __attribute__(( unused )) x;
     159    int __attribute__(( unused ));
    162160    int __attribute__(( unused )) :4;
    163161    int __attribute__(( unused )) :4, __attribute__(( unused )) :6;
     
    176174                3;
    177175        }
    178         abort();
    179176}
    180177
    181178@[ noreturn ] void mary() {
    182         @[aligned(16)] struct S { int i; };
     179        @[aligned(64)] struct S { int i; };
    183180        int @[unused] i;
    184181        switch ( 3 ) {
     
    190187                3;
    191188        }
    192         abort();
    193189}
    194190
Note: See TracChangeset for help on using the changeset viewer.