Ignore:
Timestamp:
Jan 29, 2025, 9:09:20 AM (8 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
a22e8b4
Parents:
a950021 (diff), c699602 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/attributes.cfa

    ra950021 r49510db  
    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"
    1617
    1718// label attribute
    1819int la() {
    1920  L: __attribute__(( unused )) 1;
     21  return 1;
    2022}
    2123
     
    6466// function_declarator
    6567__attribute__(( unused )) int f1() __attribute__(( used ));
    66 __attribute__(( unused )) int f1() {}
     68__attribute__(( unused )) int f1() { return 1; }
    6769__attribute__(( unused )) int * __attribute__(( unused )) * const __attribute__(( unused )) f2() __attribute__(( used ));
    68 __attribute__(( unused )) int * __attribute__(( unused )) * const __attribute__(( unused )) f2() {}
     70__attribute__(( unused )) int * __attribute__(( unused )) * const __attribute__(( unused )) f2() { return 0p; }
    6971__attribute__(( unused )) int (* __attribute__(( unused )) f3(int))[] __attribute__(( used ));
    7072__attribute__(( unused )) int ( __attribute__(( unused )) * __attribute__(( unused )) f4(int))[] __attribute__(( used ));
    71 __attribute__(( unused )) int (* __attribute__(( unused )) f5(int p))[] {}
    72 __attribute__(( unused )) int ( __attribute__(( unused )) * (f6)(int p))[] {}
     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; }
    7375__attribute__(( unused )) int (* __attribute__(( unused )) f7())(int) __attribute__(( used ));
    74 __attribute__(( unused )) int (* __attribute__(( unused )) f8())(int) {}
    75 __attribute__(( unused )) int ( __attribute__(( unused )) * f9())(int) {}
    76 __attribute__(( unused )) int ( __attribute__(( unused )) * (f10)())(int) {}
     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; }
    7779
    7880
    7981// variable_type_redeclarator
    8082typedef int t1, t2, t3, t4, t5, t6, t7, t8;
    81 int vtr() {
     83void vtr() {
    8284    // redefine typedef name in new scope
    8385    __attribute__(( unused )) int __attribute__(( unused )) t1 __attribute__(( used ));
     
    9294
    9395// identifier_parameter_declarator
    94 int ipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )),
     96void ipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )),
    9597          __attribute__(( unused )) int __attribute__(( unused )) q __attribute__(( unused )) );
    96 int ipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )),
     98void ipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )),
    9799          __attribute__(( unused )) int __attribute__(( unused )) q __attribute__(( unused )) ) {}
    98 int ipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )),
     100void ipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )),
    99101          __attribute__(( unused )) int __attribute__(( unused )) (* (q)) __attribute__(( unused )) );
    100 int ipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )),
     102void ipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )),
    101103          __attribute__(( unused )) int __attribute__(( unused )) (* (q)) __attribute__(( unused )) ) {}
    102 int ipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )),
     104void ipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )),
    103105          __attribute__(( unused )) int __attribute__(( unused )) ((q)[]) __attribute__(( unused )) );
    104 int ipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )),
     106void ipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )),
    105107          __attribute__(( unused )) int __attribute__(( unused )) ((q)[]) __attribute__(( unused )) ) {}
    106 int ipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )),
     108void ipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )),
    107109          __attribute__(( unused )) int __attribute__(( unused )) ((q)()) __attribute__(( unused )) );
    108 int ipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )),
     110void ipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )),
    109111          __attribute__(( unused )) int __attribute__(( unused )) ((q)()) __attribute__(( unused )) ) {}
    110112
     
    122124
    123125// abstract_declarator
    124 int ad() {
     126void ad() {
    125127    typeof( int __attribute__(( used )) ) ad1 __attribute__(( unused ));
    126128    typeof( int __attribute__(( unused )) * __attribute__(( unused )) ) ad2 __attribute__(( unused ));
     
    157159// variable_abstract_declarator
    158160struct Vad {
    159     int __attribute__(( unused ));
     161    int __attribute__(( unused )) x;
    160162    int __attribute__(( unused )) :4;
    161163    int __attribute__(( unused )) :4, __attribute__(( unused )) :6;
     
    174176                3;
    175177        }
     178        abort();
    176179}
    177180
    178181@[ noreturn ] void mary() {
    179         @[aligned(64)] struct S { int i; };
     182        @[aligned(16)] struct S { int i; };
    180183        int @[unused] i;
    181184        switch ( 3 ) {
     
    187190                3;
    188191        }
     192        abort();
    189193}
    190194
Note: See TracChangeset for help on using the changeset viewer.