Changeset 2853d6f


Ignore:
Timestamp:
Jan 2, 2025, 7:00:01 PM (3 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
656c8ac
Parents:
a6b48f6
Message:

Remove uses of warnings to show test success. Eliminate simple causes of other warnings from affected tests and remove the result from WFLAG_OPT_LAX.

Many affected tests also formerly used -fsyntax-only to avoid errors at later compilation stages, or at runtime. Repair such tests to actually work though runtime, and remove them from SYNTAX_ONLY_CODE.

Group tests listed under WFLAGS_OPT according to why they should receive lax treatment. Add reason WFLGAS_OPT_LAX_EXPECT_WARN and give the original list reason WFLGAS_OPT_LAX_TO_INVESTIGATE.

Tests whose purpose is to show a warning are listed as both SYNTAX_ONLY_CODE (so that the warning is the output) and WFLGAS_OPT_LAX_EXPECT_WARN (to document this fact).

Location:
tests
Files:
46 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tests/.expect/array-ERR1.txt

    ra6b48f6 r2853d6f  
    1 array.cfa:125:25: warning: Preprocessor started
    2 array.cfa:40:22: error: '[*]' not allowed in other than function prototype scope
     1array.cfa:40:23: error: '[*]' not allowed in other than function prototype scope
    32array.cfa:46:24: error: '[*]' not allowed in other than function prototype scope
    4 array.cfa: In function '_X4fredFi_i__1':
     3array.cfa: In function '_X4fredFv_i__1':
    54array.cfa:52:16: error: array size missing in '_X2a1A0i_2'
    65array.cfa:53:26: error: '[*]' not allowed in other than function prototype scope
    76array.cfa: At top level:
    8 array.cfa:64:1: error: '[*]' not allowed in other than function prototype scope
     7array.cfa:75:1: error: '[*]' not allowed in other than function prototype scope
  • TabularUnified tests/.expect/array-ERR2.txt

    ra6b48f6 r2853d6f  
    1 array.cfa:125:25: warning: Preprocessor started
    2 array.cfa:117:32: error: syntax error, unexpected STATIC before token "static"
     1array.cfa:139:33: error: syntax error, unexpected STATIC before token "static"
  • TabularUnified tests/.expect/array-ERR3.txt

    ra6b48f6 r2853d6f  
    1 array.cfa:125:25: warning: Preprocessor started
    2 array.cfa:118:32: error: syntax error, unexpected ']' before token "]"
     1array.cfa:140:33: error: syntax error, unexpected ']' before token "]"
  • TabularUnified tests/.expect/array.txt

    ra6b48f6 r2853d6f  
    1 array.cfa:125:25: warning: Preprocessor started
     1done
  • TabularUnified tests/.expect/attr-priority.txt

    ra6b48f6 r2853d6f  
    11attr-priority.cfa:7:1 warning: invalid attribute: constructor priorities from 101 to 200 are reserved for the implementation.
    22attr-priority.cfa:12:1 warning: invalid attribute: destructor priorities from 101 to 200 are reserved for the implementation.
    3 attr-priority.cfa:8:1 error: Invalid application of existing declaration(s) in expression Applying untyped:
    4   Name: malloc
    5 ...to:
    6 
  • TabularUnified tests/.expect/cast.txt

    ra6b48f6 r2853d6f  
    1 cast.cfa:16:25: warning: Compiled
     1done
  • TabularUnified tests/.expect/expression.txt

    ra6b48f6 r2853d6f  
    1 expression.cfa:86:25: warning: Compiled
     1done
  • TabularUnified tests/.expect/identFuncDeclarator.txt

    ra6b48f6 r2853d6f  
    1 identFuncDeclarator.cfa:114:25: warning: Compiled
     1done
  • TabularUnified tests/.expect/init1-ERROR.txt

    ra6b48f6 r2853d6f  
    1 init1.cfa:134:25: warning: Compiled
    21init1.cfa:56:1 error: Invalid application of existing declaration(s) in expression Untyped Init Expression
    32  Name: rx  InitAlternative: reference to signed int
  • TabularUnified tests/.expect/init1.txt

    ra6b48f6 r2853d6f  
    1 init1.cfa:134:25: warning: Compiled
     1done
  • TabularUnified tests/.expect/limits.txt

    ra6b48f6 r2853d6f  
    1 limits.cfa:152:25: warning: Compiled
     1done
  • TabularUnified tests/.expect/nested-types-ERR1.txt

    ra6b48f6 r2853d6f  
    1 nested-types.cfa:100:25: warning: Compiled
    2 nested-types.cfa:83:1 error: Use of undefined type T.
     1nested-types.cfa:85:1 error: Use of undefined type T.
  • TabularUnified tests/.expect/nested-types-ERR2.txt

    ra6b48f6 r2853d6f  
    1 nested-types.cfa:100:25: warning: Compiled
    2 nested-types.cfa:86:1 error: Use of undefined global type Z.
    3 nested-types.cfa:87:1 error: Qualified type requires an aggregate on the left, but has signed int.
    4 nested-types.cfa:88:1 error: Undefined type in qualified type Qualified Type:
     1nested-types.cfa:88:1 error: Use of undefined global type Z.
     2nested-types.cfa:89:1 error: Qualified type requires an aggregate on the left, but has signed int.
     3nested-types.cfa:90:1 error: Undefined type in qualified type Qualified Type:
    54  instance of struct S with body
    65  instance of type Z (not function type)
  • TabularUnified tests/.expect/nested-types.txt

    ra6b48f6 r2853d6f  
    1 nested-types.cfa:100:25: warning: Compiled
     1done
  • TabularUnified tests/.expect/numericConstants.txt

    ra6b48f6 r2853d6f  
    1 numericConstants.cfa:66:25: warning: Compiled
     1done
  • TabularUnified tests/.expect/quasiKeyword.txt

    ra6b48f6 r2853d6f  
    1 quasiKeyword.cfa:52:25: warning: Compiled
     1done
  • TabularUnified tests/.expect/switch.txt

    ra6b48f6 r2853d6f  
    1 switch.cfa:103:25: warning: Compiled
     1done
  • TabularUnified tests/.expect/typedefRedef-ERR1.txt

    ra6b48f6 r2853d6f  
    1 typedefRedef.cfa:87:25: warning: Compiled
    21typedefRedef.cfa:4:1 error: Cannot redefine typedef Foo
    32typedefRedef.cfa:31:1 error: Cannot redefine typedef ARR
  • TabularUnified tests/.expect/typedefRedef.txt

    ra6b48f6 r2853d6f  
    1 typedefRedef.cfa:87:25: warning: Compiled
     1done
  • TabularUnified tests/.expect/variableDeclarator.txt

    ra6b48f6 r2853d6f  
    1 variableDeclarator.cfa:180:25: warning: Compiled
     1done
  • TabularUnified tests/Makefile.am

    ra6b48f6 r2853d6f  
    3939        -Wall \
    4040        -Wextra \
    41         -Werror
     41        -Werror                -Wno-unused-variable -Wno-unused-parameter
    4242
    4343WFLAGS_LAX = \
     
    5151# Making this association implicit would be ideal, but requires learning more automake than is affordable.
    5252WFLGAS_OPT_LAX = \
     53        ${WFLGAS_OPT_LAX_EXPECT_WARN} \
     54        ${WFLGAS_OPT_LAX_TO_INVESTIGATE}
     55
     56# Tests checking that cfa-cc raises a certain warning, so -Werror is permanently inappropriate
     57WFLGAS_OPT_LAX_EXPECT_WARN = \
     58        attr-priority \
     59        warnings/self-assignment
     60
     61# Tests that need investigation from the CFA team about why they require lax wflags.  Goal is to eliminate this list.
     62WFLGAS_OPT_LAX_TO_INVESTIGATE = \
    5363        alloc \
    54         array \
    5564        array-collections/boxed \
    5665                array-collections/boxed% \
    5766        array-collections/dimexpr-match-c \
    5867        array-collections/dimexpr-match-cfa \
    59         array-ERR1 \
    60         array-ERR2 \
    61         array-ERR3 \
    6268        attributes \
    63         attr-priority \
    64         builtins/sync \
    65         cast \
    6669        collections/atomic_mpsc \
    6770        collections/multi_list \
     
    136139        concurrency/unified_locking/timeout_lock \
    137140        concurrency/waitfor/barge \
    138         concurrency/waitfor/parse \
    139141        concurrency/waitfor/statment \
    140142        concurrency/waitfor/when \
     
    171173        exceptions/try-leave-catch \
    172174        exceptions/virtual-poly \
    173         expression \
    174175        forall \
    175176        function-operator \
    176177        gmp \
    177         identFuncDeclarator \
    178178        identParamDeclarator \
    179179        include/includes \
     
    182182        include/vector-fstream \
    183183        include/vector-sequence \
    184         init1 \
    185         init1-ERROR \
    186184        io/away_fair \
    187185        io/comp_basic \
     
    195193        io/manipulatorsInput-uchunk \
    196194        io/many_read \
    197         limits \
    198195        linking/io-acquire \
    199196        linking/mangling/anon \
     
    207204        maybe \
    208205        minmax \
    209         nested-types \
    210         nested-types-ERR1 \
    211         nested-types-ERR2 \
    212         numericConstants \
    213206        operators \
    214207        poly-d-cycle \
     
    218211        poly-o-cycle \
    219212        PRNG \
    220         quasiKeyword \
    221213        quotedKeyword \
    222214        raii/boxed-types \
     
    237229        tuple/tuplePolymorphism \
    238230        tuple/tupleVariadic \
    239         typedefRedef \
    240         typedefRedef-ERR1 \
    241231        typeof \
    242232        userLiterals \
    243         variableDeclarator \
    244         vector \
    245         warnings/self-assignment
     233        vector
    246234
    247235WFLAGS=${if ${filter ${WFLGAS_OPT_LAX},${@}},${WFLAGS_LAX},${WFLAGS_STRICT}}
     
    413401CFACOMPILE_SYNTAX = ${CFACOMPILETEST} -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o ${abspath ${@}}
    414402
    415 SYNTAX_ONLY_CODE = \
    416         array cast expression identFuncDeclarator init1 limits nested-types numericConstants opt-params quasiKeyword switch typedefRedef variableDeclarator \
    417         builtins/sync concurrency/waitfor/parse ctrl-flow/labelledExit include/stdincludes include/includes warnings/self-assignment
     403SYNTAX_ONLY_CODE = attr-priority warnings/self-assignment
    418404
    419405${SYNTAX_ONLY_CODE} : % : %.cfa ${CFACCBIN}
  • TabularUnified tests/array.cfa

    ra6b48f6 r2853d6f  
    3737#endif
    3838
    39     int a1[0];
    40 E1( int a2[*];       )
     39    int ga1[0];
     40E1( int ga2[*];       )
    4141                                                        #ifndef __cforall
    42 E1( double a4[3.0];  )                                  // BUG 275: CFA accepts but should reject
     42E1( int ga3[3.0];  )                                  // BUG 275: CFA accepts but should reject
    4343                                                        #endif
    4444
     
    4949    typedef int T;
    5050
    51     int fred(int n) {
    52 E1(     int a1[];    )
    53 E1(     int a2[*];   )
    54         int a4[3];
    55         int T[3];
    56         int a5[n];
     51    void fred(int n) {
     52E1(     int a1[];   )
     53E1(     int a2[*];  )
     54        int a4[3];      (void) a4;
     55        int T[3];       (void) T;
     56        int a5[n];      (void) a5;
    5757    }
    5858
    59     int fred2(int n,
     59    void fred2(int n,
    6060        int a1[],
    61 E1(     int a2[*],   )
     61E1(     int a2[*],                                 )
    6262        int a4[3],
    63         int T[3],
     63        int T[3]        __attribute__((unused)),
    6464        int a5[n]
    65     ) {}
     65    ) {
     66        // FIX ME: Replace attribute-unused on T with void cast, once Trac 297 is fixed.
     67        // This parameter should be in scope and usable within the body.
    6668
    67     int mary( int T[3],                                 // same as: int *T
    68               int p1[const 3],                          // same as: int const *p1
    69               int p2[static 3],                         // same as T, but length >=3 checked
    70               int p3[static const 3]                    // both above: 3 is static, p3 is const
    71         ) {
     69        // Skip a2 because it's declared only in an error case.
     70
     71        (void) a1;
     72        (void) a4;
     73//      (void) T;
     74        (void) a5;
     75    }
     76
     77    void mary(
     78        int T[3]        __attribute__((unused)),  // same as: int *T
     79        int p1[const 3],                          // same as: int const *p1
     80        int p2[static 3],                         // same as T, but length >=3 checked
     81        int p3[static const 3]                    // both above: 3 is static, p3 is const
     82    ) {
     83        // FIX ME: Replace attribute-unused on T with void cast, once Trac 297 is fixed.
     84        // This parameter should be in scope and usable within the body.
     85
     86//      (void) T;
     87        (void) p1;
     88        (void) p2;
     89        (void) p3;
    7290    }
    7391
    7492    // function taking (), returning pointer to array of ints
    7593    int (*tom())[3] {
     94        return 0p;
    7695    }
    7796
     
    82101                     int p3[static const 3]
    83102        ) {
     103        return 0p;
    84104    }
    85105
     
    87107    #ifdef __cforall
    88108    [ * [3] int ] toms_twin(...) {
     109        return 0p;
    89110    }
    90111    [ * [int]( [3] int T,
     
    94115             )
    95116    ] janes_twin(...) {
     117        return 0p;
    96118    }
    97119    #endif
     
    112134    // fm5.
    113135
    114     int fm1x( int, int, int[][*] );
    115     int fm1y( int r, int c, int m[][c] ) {}
    116     int fm2( int r, int c, int (*m)[c] ) {}             // same as fm1
    117 E2( int fm3( int r, int c, int m[][static c] ) {}  )    // that's not static
    118 E3( int fm4( int r, int c, int m[][] );            )    // m's immediate element type is incomplete
    119     int fm5x( int, int, int[*][*] );                    // same as fm1 decl
    120     int fm5y( int r, int c, int m[r][c] ) {}            // same as fm1 defn
     136    void fm1x( int, int, int[][*] );
     137    void fm1y( int r, int c, int m[][c] ) { (void) r; (void) c; (void) m; }
     138    void fm2( int r, int c, int (*m)[c] ) { (void) r; (void) c; (void) m; }             // same as fm1
     139E2( void fm3( int r, int c, int m[][static c] ) {}  )    // that's not static
     140E3( void fm4( int r, int c, int m[][] );            )    // m's immediate element type is incomplete
     141    void fm5x( int, int, int[*][*] );                    // alt syntax for fm1 decl
     142    void fm5y( int r, int c, int m[r][c] ) { (void) r; (void) c; (void) m; }            // alt syntax for fm1 defn
    121143
    122144
    123145
    124146int main() {
    125     #pragma GCC warning "Preprocessor started"          // force non-empty .expect file, NO TABS!!!
     147    printf("done\n");
    126148}
    127149
  • TabularUnified tests/attr-priority.cfa

    ra6b48f6 r2853d6f  
    1 // Although we are testing the attribute priority checks, we also have a
    2 // resolver error to force the expect to compare against the compiler output.
     1// Is compiled -fsyntax-only, to make the test's "output" be the warnings from cfa-cpp.
     2
    33
    44int * store = 0p;
     
    66__attribute__(( constructor(150) ))
    77void ctor_store(void) {
    8         store = malloc();
     8        store = (int*)malloc(200);
    99}
    1010
     
    1414        store = 0;
    1515}
    16 
    17 int main(void) {
    18         return 0;
    19 }
  • TabularUnified tests/builtins/.expect/sync.txt

    ra6b48f6 r2853d6f  
    1 builtins/sync.cfa:356:25: warning: Compiled
     1done
  • TabularUnified tests/builtins/sync.cfa

    ra6b48f6 r2853d6f  
    354354
    355355int main() {
    356     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     356        printf("done\n");
    357357}
  • TabularUnified tests/cast.cfa

    ra6b48f6 r2853d6f  
    44void f() {
    55        char f;
    6         double f;
     6        double f __attribute__((unused));
    77        (int)f;
    88        short f;
     
    1313
    1414//Dummy main
    15 int main( int argc, char const * argv[] ) {
    16     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     15int main() {
     16    printf("done\n");
    1717}
  • TabularUnified tests/concurrency/waitfor/.expect/parse.txt

    ra6b48f6 r2853d6f  
    1 concurrency/waitfor/parse.cfa:255:25: warning: Compiled
     1done
  • TabularUnified tests/concurrency/waitfor/parse.cfa

    ra6b48f6 r2853d6f  
    252252
    253253//Dummy main
    254 int main( int argc, char const * argv[] ) {
    255     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     254int main() {
     255        printf("done\n");
    256256}
    257257
  • TabularUnified tests/ctrl-flow/.expect/labelledExit.txt

    ra6b48f6 r2853d6f  
    1 ctrl-flow/labelledExit.cfa:181:25: warning: Compiled
     1done
  • TabularUnified tests/ctrl-flow/labelledExit.cfa

    ra6b48f6 r2853d6f  
    179179
    180180int main( int argc, char const *argv[] ) {
    181     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     181        printf("done\n");
    182182}
    183183
  • TabularUnified tests/expression.cfa

    ra6b48f6 r2853d6f  
    11struct S { int i; };
    22void ?{}( S & s, int i ) { s.i = i; }
    3 int ?`mary( int );
    4 int ?`mary( S );
    5 [int] ?`mary( [int, int] );
    6 int & ?`jane( int & );
    7 int jack( int );
     3int ?`mary( int ) { return 0; }
     4int ?`mary( S ) { return 0; }
     5[int] ?`mary( [int, int] ) { return 0; }
     6int & ?`jane( int & x ) { return x; }
     7int jack( int ) { return 0; }
    88
    99int main() {
     
    8484        (S)@{2}`mary;
    8585
    86     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     86        printf("done\n");
    8787} // main
  • TabularUnified tests/identFuncDeclarator.cfa

    ra6b48f6 r2853d6f  
    1414//
    1515
     16int f1;
     17int (f2);
     18
     19int * f3;
     20int ** f4;
     21int * const * f5;
     22int * const * const f6;
     23
     24int * (f7);
     25int ** (f8);
     26int * const * (f9);
     27int * const * const (f10);
     28
     29int (* f11);
     30int (** f12);
     31int (* const * f13);
     32int (* const * const f14);
     33
     34int f15[2];
     35int f16[10];
     36int (f17[2]);
     37int (f18[10]);
     38
     39int * f19[2];
     40int * f20[10];
     41int ** f21[2];
     42int ** f22[10];
     43int * const * f23[2];
     44int * const * f24[10];
     45int * const * const f25[2];
     46int * const * const f26[10];
     47
     48int * (f27[2]);
     49int * (f28[10]);
     50int ** (f29[2]);
     51int ** (f30[10]);
     52int * const * (f31[2]);
     53int * const * (f32[10]);
     54int * const * const (f33[2]);
     55int * const * const (f34[10]);
     56
     57int (* f35[2]);
     58int (* f36[10]);
     59int (** f37[2]);
     60int (** f38[10]);
     61int (* const * f39[2]);
     62int (* const * f40[10]);
     63int (* const * const f41[2]);
     64int (* const * const f42[10]);
     65
     66int f43[2][3];
     67int f44[3][3];
     68int (f45[2])[3];
     69int (f46[3])[3];
     70int ((f47[2]))[3];
     71int ((f48[3]))[3];
     72
     73int * f49[2][3];
     74int * f50[3][3];
     75int ** f51[2][3];
     76int ** f52[3][3];
     77int * const * f53[2][3];
     78int * const * f54[3][3];
     79int * const * const f55[2][3];
     80int * const * const f56[3][3];
     81
     82int (* f57[2][3]);
     83int (* f58[3][3]);
     84int (** f59[2][3]);
     85int (** f60[3][3]);
     86int (* const * f61[2][3]);
     87int (* const * f62[3][3]);
     88int (* const * const f63[2][3]);
     89int (* const * const f64[3][3]);
     90
     91int f65(int);
     92int (f66)(int);
     93
     94#pragma GCC diagnostic push
     95#pragma GCC diagnostic ignored "-Wignored-qualifiers"
     96
     97int * f67(int);
     98int ** f68(int);
     99int * const * f69(int);
     100int * const * const f70(int);
     101
     102int * (f71)(int);
     103int ** (f72)(int);
     104int * const * (f73)(int);
     105int * const * const (f74)(int);
     106
     107int (* f75)(int);
     108int (** f76)(int);
     109int (* const * f77)(int);
     110int (* const * const f78)(int);
     111
     112int (* (* f79)(int))();
     113int (* (* const f80)(int))();
     114int (* const(* const f81)(int))();
     115
     116#pragma GCC diagnostic pop
     117
    16118int main() {
    17         int f1;
    18         int (f2);
    19 
    20         int * f3;
    21         int ** f4;
    22         int * const * f5;
    23         int * const * const f6;
    24 
    25         int * (f7);
    26         int ** (f8);
    27         int * const * (f9);
    28         int * const * const (f10);
    29 
    30         int (* f11);
    31         int (** f12);
    32         int (* const * f13);
    33         int (* const * const f14);
    34 
    35         int f15[2];
    36         int f16[10];
    37         int (f17[2]);
    38         int (f18[10]);
    39 
    40         int * f19[2];
    41         int * f20[10];
    42         int ** f21[2];
    43         int ** f22[10];
    44         int * const * f23[2];
    45         int * const * f24[10];
    46         int * const * const f25[2];
    47         int * const * const f26[10];
    48 
    49         int * (f27[2]);
    50         int * (f28[10]);
    51         int ** (f29[2]);
    52         int ** (f30[10]);
    53         int * const * (f31[2]);
    54         int * const * (f32[10]);
    55         int * const * const (f33[2]);
    56         int * const * const (f34[10]);
    57 
    58         int (* f35[2]);
    59         int (* f36[10]);
    60         int (** f37[2]);
    61         int (** f38[10]);
    62         int (* const * f39[2]);
    63         int (* const * f40[10]);
    64         int (* const * const f41[2]);
    65         int (* const * const f42[10]);
    66 
    67         int f43[2][3];
    68         int f44[3][3];
    69         int (f45[2])[3];
    70         int (f46[3])[3];
    71         int ((f47[2]))[3];
    72         int ((f48[3]))[3];
    73 
    74         int * f49[2][3];
    75         int * f50[3][3];
    76         int ** f51[2][3];
    77         int ** f52[3][3];
    78         int * const * f53[2][3];
    79         int * const * f54[3][3];
    80         int * const * const f55[2][3];
    81         int * const * const f56[3][3];
    82 
    83         int (* f57[2][3]);
    84         int (* f58[3][3]);
    85         int (** f59[2][3]);
    86         int (** f60[3][3]);
    87         int (* const * f61[2][3]);
    88         int (* const * f62[3][3]);
    89         int (* const * const f63[2][3]);
    90         int (* const * const f64[3][3]);
    91 
    92         int f65(int);
    93         int (f66)(int);
    94 
    95         int * f67(int);
    96         int ** f68(int);
    97         int * const * f69(int);
    98         int * const * const f70(int);
    99 
    100         int * (f71)(int);
    101         int ** (f72)(int);
    102         int * const * (f73)(int);
    103         int * const * const (f74)(int);
    104 
    105         int (* f75)(int);
    106         int (** f76)(int);
    107         int (* const * f77)(int);
    108         int (* const * const f78)(int);
    109 
    110         int (* (* f79)(int))();
    111         int (* (* const f80)(int))();
    112         int (* const(* const f81)(int))();
    113 
    114     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     119        printf("done\n");
    115120}
    116121
  • TabularUnified tests/include/.expect/includes.txt

    ra6b48f6 r2853d6f  
    1 include/includes.cfa:173:25: warning: Compiled
     1done
  • TabularUnified tests/include/.expect/stdincludes.txt

    ra6b48f6 r2853d6f  
    1 include/stdincludes.cfa:50:25: warning: Compiled
     1done
  • TabularUnified tests/include/includes.cfa

    ra6b48f6 r2853d6f  
    171171
    172172int main() {
    173     #pragma GCC warning "Compiled"                                                      // force non-empty .expect file, NO TABS!!!
     173    printf("done\n");
    174174}
    175175
  • TabularUnified tests/include/stdincludes.cfa

    ra6b48f6 r2853d6f  
    4848
    4949int main() {
    50     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     50    printf("done\n");
    5151}
    5252
  • TabularUnified tests/init1.cfa

    ra6b48f6 r2853d6f  
    3232    //
    3333
    34     char * str1 = "hi";
    35     const char * str2 = "hi";
     34    char * str1 = "hi";             (void) str1;
     35    const char * str2 = "hi";       (void) str2;
    3636
    37     float & rx2 = rx;
    38     float * px2 = px;
     37    float & rx2 = rx;               (void) rx2;
     38    float * px2 = px;               (void) px2;
    3939
    40     const float & crx2 = crx;
    41     const float * cpx2 = cpx;
     40    const float & crx2 = crx;       (void) crx2;
     41    const float * cpx2 = cpx;       (void) cpx2;
    4242
    4343    // FIX ME: Code gen not producing correct cast.
     
    132132
    133133int main() {
    134     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     134    printf("done\n");
    135135}
  • TabularUnified tests/limits.cfa

    ra6b48f6 r2853d6f  
    149149long double _Complex _1_sqrt_2 = _1_SQRT_2;
    150150
    151 int main(int argc, char const *argv[]) {
    152     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     151int main() {
     152        printf("done\n");
    153153}
    154154
  • TabularUnified tests/nested-types.cfa

    ra6b48f6 r2853d6f  
    6464// S.T t;
    6565
     66#pragma GCC diagnostic ignored "-Wunused-variable"
     67
    6668int main() {
    6769        // access nested struct
     
    9395
    9496        S.Bar y;
    95         S.Baz x;
     97        S.Baz w;
    9698        S.T.Bar z;
    9799
    98100        // A.N(int) x;  // xxx - should not be an error, but currently is.
    99101
    100     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     102        printf("done\n");
    101103}
    102104
  • TabularUnified tests/numericConstants.cfa

    ra6b48f6 r2853d6f  
    6464        0x_1.ffff_ffff_p_128_l;
    6565
    66     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     66        printf("done\n");
    6767} // main
    6868
  • TabularUnified tests/quasiKeyword.cfa

    ra6b48f6 r2853d6f  
    1313
    1414exception E {};
     15vtable(E) E_vt;
    1516
    16 void catch( int i ) {}
    17 void recover( int i ) {}
    18 void catchResume( int i ) {}
    19 void fixup( int i ) {}
    20 void finally( int i ) {}
     17void catch( int i )       { (void) i; }
     18void recover( int i )     { (void) i; }
     19void catchResume( int i ) { (void) i; }
     20void fixup( int i )       { (void) i; }
     21void finally( int i )     { (void) i; }
    2122
    22 int main(int argc, char const *argv[]) {
     23int main() {
    2324        int catch, recover, catchResume, fixup, finally;
    2425        try {
     
    3334                finally = 3;
    3435                finally( finally );
    35                 throw (E){};
    36                 report (E){};
    37                 throwResume (E){};
     36                throw (E){ & E_vt };
     37                report (E){ & E_vt };
     38                throwResume (E){ & E_vt };
    3839        } catch ( E * ) {
    3940        } recover ( E * ) {                                                                     // same as catch
     
    5051        else catch = 3;
    5152
    52     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     53        printf("done\n");
    5354}
  • TabularUnified tests/switch.cfa

    ra6b48f6 r2853d6f  
    101101        } // choose
    102102
    103     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     103        printf("done\n");
    104104} // main
    105105
  • TabularUnified tests/typedefRedef.cfa

    ra6b48f6 r2853d6f  
    7878#endif
    7979
    80         Foo * x;
     80        Foo * x;        (void) x;
    8181
    8282        typedef struct Bar Foo;
    83         Foo * y;
     83        Foo * y;        (void) y;
    8484
    8585        typedef int *** pt;
    8686
    87     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     87        printf("done\n");
    8888}
  • TabularUnified tests/variableDeclarator.cfa

    ra6b48f6 r2853d6f  
    9393int (f66)(int);
    9494
     95#pragma GCC diagnostic push
     96#pragma GCC diagnostic ignored "-Wignored-qualifiers"
     97
    9598int * f67(int);
    9699int ** f68(int);
     
    112115int (*(* const f80)(int))();
    113116int (* const(* const f81)(int))();
     117
     118#pragma GCC diagnostic pop
    114119
    115120// errors
     
    166171[int] cf66(int);
    167172
     173#pragma GCC diagnostic push
     174#pragma GCC diagnostic ignored "-Wignored-qualifiers"
     175
    168176[* int] cf67(int);
    169177[* * int] cf68(int);
    170178[const * * int] cf69(int);
    171179[const * const * int] cf70(int);
     180
     181#pragma GCC diagnostic pop
    172182
    173183// function pointer
     
    177187
    178188//Dummy main
    179 int main( int argc, char const * argv[] ) {
    180     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     189int main() {
     190    printf("done\n");
    181191}
    182192
  • TabularUnified tests/warnings/.expect/self-assignment.txt

    ra6b48f6 r2853d6f  
    1 warnings/self-assignment.cfa:34:25: warning: Compiled
    21warnings/self-assignment.cfa:29:1 warning: self assignment of expression: Generated Cast of:
    32  Variable Expression: j: signed int
  • TabularUnified tests/warnings/self-assignment.cfa

    ra6b48f6 r2853d6f  
    2222};
    2323
    24 int main() {
     24void f() {
    2525        int j = 0;
    2626        S s = { 0 };
     
    3232        t.s.i = t.s.i;
    3333
    34     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     34        // Is compiled -fsyntax-only (not run), to make the test's "output" be the warnings from cfa-cpp.
    3535}
    3636
Note: See TracChangeset for help on using the changeset viewer.