Ignore:
Timestamp:
Sep 27, 2020, 10:00:39 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
0a19c51
Parents:
bd47f35
Message:

convert tests to always print output (no empty .expect files)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/nested-types.cfa

    rbd47f35 r66812dd  
    1010// Created On       : Mon Jul 9 10:20:03 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb 12 18:21:15 2020
    13 // Update Count     : 3
     12// Last Modified On : Sun Sep 27 08:48:59 2020
     13// Update Count     : 6
    1414//
    1515
    1616typedef int N;
    1717struct A {
    18   forall(otype T)
    19   struct N {
    20     T x;
    21   };
     18        forall(otype T)
     19        struct N {
     20                T x;
     21        };
    2222};
    2323
    2424struct S {
    25   struct T {
    26     int i;
    27     typedef int Bar;
    28   };
    29   T x;
     25        struct T {
     26                int i;
     27                typedef int Bar;
     28        };
     29        T x;
    3030
    31   // struct U;
    32   typedef T Bar;
    33   typedef int Baz;
     31        // struct U;
     32        typedef T Bar;
     33        typedef int Baz;
    3434};
    3535
     
    6565
    6666int main() {
    67   // access nested struct
    68   S.T x;
     67        // access nested struct
     68        S.T x;
    6969
    70   {
    71     struct S {
    72       int i;
    73       struct Z {
    74         double d;
    75       };
    76     };
     70        {
     71                struct S {
     72                  int i;
     73                  struct Z {
     74                    double d;
     75                  };
     76                };
    7777
    78     S.Z z;   // gets local S
    79     .S.T y;  // lookup at global scope only
     78                S.Z z;                                                                                  // gets local S
     79                .S.T y;                                                                                 // lookup at global scope only
    8080
    81     const volatile .S.T q;
     81                const volatile .S.T q;
    8282#if ERR1
    83     T err1;           // error: no T in scope
     83                T err1;                                                                                 // error: no T in scope
    8484#endif
    8585#if ERR2
    86     .Z err2;          // error: no Z in global scope
    87     .S.Baz.Bar err3;  // error: .S.Baz => int, int is not aggregate and should not appear left of the dot
    88     .S.Z err4;        // error: no Z in global S
     86                .Z err2;                                                                                // error: no Z in global scope
     87                .S.Baz.Bar err3;                                                                // error: .S.Baz => int, int is not aggregate and should not appear left of the dot
     88                .S.Z err4;                                                                              // error: no Z in global S
    8989#endif
    90   }
     90        }
    9191
    92   // U.S un;
     92        // U.S un;
    9393
    94   S.Bar y;
    95   S.Baz x;
    96   S.T.Bar z;
     94        S.Bar y;
     95        S.Baz x;
     96        S.T.Bar z;
    9797
    98   // A.N(int) x;  // xxx - should not be an error, but currently is.
     98        // A.N(int) x;  // xxx - should not be an error, but currently is.
     99
     100        #pragma message( "Compiled" )                   // force non-empty .expect file
    99101}
    100102
Note: See TracChangeset for help on using the changeset viewer.