Changeset 72f85de for src


Ignore:
Timestamp:
Oct 20, 2017, 11:58:18 AM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
88e79ad
Parents:
837ce06
Message:

Update memberCtors test

Location:
src/tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/tests/.expect/memberCtors-ERR1.txt

    r837ce06 r72f85de  
    1 memberCtors.c:71:1 error: in void ?{}(B &b), field a2 used before being constructed
     1memberCtors.c:78:1 error: in void ?{}(B &b), field a2 used before being constructed
  • src/tests/.expect/memberCtors.txt

    r837ce06 r72f85de  
    9898end copy construct A
    9999End of main
     100begin destruct B
    100101constructing int
    101102constructing int
     
    146147destructing int: 0
    147148destructing int: 1000
    148 destructing int: 0
    149 destructing int: 0
    150 destructing int: 999
    151 destructing int: 0
    152 destructing int: 0
    153 destructing int: 0
    154 destructing int: 0
    155 destructing int: 0
    156 destructing int: 999
     149end destruct B
     150destructing int: 0
     151destructing int: 0
     152destructing int: 999
     153destructing int: 0
     154destructing int: 0
     155destructing int: 0
     156destructing int: 0
     157destructing int: 0
     158destructing int: 999
     159begin destruct B
    157160constructing int
    158161constructing int
     
    203206destructing int: 0
    204207destructing int: 1000
    205 destructing int: 0
    206 destructing int: 0
    207 destructing int: 999
    208 destructing int: 0
    209 destructing int: 0
    210 destructing int: 0
    211 destructing int: 0
    212 destructing int: 0
    213 destructing int: 999
     208end destruct B
     209destructing int: 0
     210destructing int: 0
     211destructing int: 999
     212destructing int: 0
     213destructing int: 0
     214destructing int: 0
     215destructing int: 0
     216destructing int: 0
     217destructing int: 999
  • src/tests/memberCtors.c

    r837ce06 r72f85de  
    2222}
    2323
    24 void ?=?(WrappedInt & this, int x) {
     24/* WrappedInt */ void ?=?(WrappedInt & this, int x) {
    2525  printf("assigning int: %d %d\n", this.x, x);
    2626  this.x = x;
     27  // return this;
    2728}
     29
     30// WrappedInt ?=?(WrappedInt & this, WrappedInt other) {
     31//   printf("assigning int: %d %d\n", this.x, other.x);
     32//   this.x = other.x;
     33//   return this;
     34// }
    2835
    2936struct A {
     
    7986
    8087void ^?{}(B & b) {
     88  printf("begin destruct B\n");
    8189  b.a2 = (A) { 0 };
    8290  ^(b.a1){};
     91  printf("end destruct B\n");
    8392} // a2, a3 never destructed - will be automatically destructed
    8493
    8594int main() {
    8695  printf("Before declaration of b1\n");
    87   B b1;
     96  B b1;  // b1 = { { 1000, 0, 0 }, { 1001, 0, 0 }, { 0, 0, 0 } }
    8897  printf("Before declaration of b2\n");
    8998  B b2 = b1;
Note: See TracChangeset for help on using the changeset viewer.