Changeset c6e6333


Ignore:
Timestamp:
Oct 19, 2017, 11:13:11 AM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
eaa2edaa
Parents:
8e138da
git-author:
Rob Schluntz <rschlunt@…> (10/06/17 16:16:35)
git-committer:
Rob Schluntz <rschlunt@…> (10/19/17 11:13:11)
Message:

Update autogen test case

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/ctor-autogen.c

    r8e138da rc6e6333  
     1// TODO: add error cases (e.g., use of field constructors for managed types, etc.)
     2
    13enum Color { R, G, B };
    24
     
    46union U {};
    57struct S {};
     8
     9struct SimpleUnion {
     10        int x;
     11        double y;
     12        char z;
     13};
     14
     15struct SimpleStruct {
     16        int x;
     17        double y;
     18        char z;
     19};
    620
    721// struct/union with members with generated ctor/dtors should themselves have generated ctor/dtors
     
    1327
    1428struct PopulatedStruct {
    15         Color state;
     29        Color c;
    1630        U u;
    1731        S s;
     
    2135T identity(T x) { return x; }
    2236
     37// can identity e if only sized or only the assertion, but the combination breaks...
     38// forall(dtype T | sized(T) | { void ?{}(T &); })
     39// void identity(T x) {  }
     40
    2341int main() {
    2442        S s;
    2543        U u;
     44        Color e;
    2645
    27         identity(R);  // Color should be an otype
     46        // identity(R);  // Color should be an otype
     47        // identity((Color)e);
    2848        identity(u);  // U should be an otype
    2949        identity(s);  // S should be an otype
Note: See TracChangeset for help on using the changeset viewer.