source: tests/expression.cfa @ 10b5970

Last change on this file since 10b5970 was 2853d6f, checked in by Michael Brooks <mlbrooks@…>, 3 weeks ago

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).

  • Property mode set to 100644
File size: 1007 bytes
Line 
1struct S { int i; };
2void ?{}( S & s, int i ) { s.i = i; }
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; }
8
9int main() {
10        int a[3] = { 0, 0, 0 };
11        S s = { 3 }, * ps = &s;
12        [int] t = { 3 };
13        * [int] pt = &t;
14        int i = 1, j = 2;
15
16        // operators
17
18        !i;
19        ~i;
20        +i;
21        -i;
22        *ps;
23        ++ps;
24        --ps;
25        ps++;
26        ps--;
27
28        i + j;
29        i - j;
30        i * j;
31
32        i / j;
33        i % j;
34        i ^ j;
35        i & j;
36        i | j;
37        i < j;
38        i > j;
39        i = j;
40
41        i == j;
42        i != j;
43        i << j;
44        i >> j;
45        i <= j;
46        i >= j;
47        i && j;
48        i || j;
49        ps->i;
50
51        i *= j;
52        i /= j;
53        i %= j;
54        i += j;
55        i -= j;
56        i &= j;
57        i |= j;
58        i ^= j;
59        i <<= j;
60        i >>= j;
61
62        i ? i : j;
63
64        // postfix function call
65
66        (3 + 4)`mary;
67        ({3 + 4;})`mary;
68        [3, 4]`mary;
69        3`mary;
70        a[0]`mary;
71        a[0]`mary`mary;
72        s{0}`mary;
73        a[3]`jane++;
74        jack(3)`mary;
75        s.i`mary;
76        t.0`mary;
77        s.[i]`mary;
78        ps->i`mary;
79        pt->0`mary;
80        ps->[i]`mary;
81        i++`mary;
82        i--`mary;
83        (S){2}`mary;
84        (S)@{2}`mary;
85
86        printf("done\n");
87} // main
Note: See TracBrowser for help on using the repository browser.