Changeset 049ead9 for src/tests


Ignore:
Timestamp:
Nov 8, 2017, 4:38:49 PM (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:
7543dec
Parents:
4ee36bf0
Message:

Restore multiDimension test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/multiDimension.c

    r4ee36bf0 r049ead9  
    3232}
    3333
    34 // X global[10][10] = {
    35 //   { 1, { 2 }, { 3 }, { 4 }, 5, 6, 7, 8, 9, 10, 11, 12 },
    36 //   { 1, 2, 3, 4 },
    37 //   { { 1234567 } }
    38 // };
     34X global[10][10] = {
     35  { 1, { 2 }, { 3 }, { 4 }, 5, 6, 7, 8, 9, 10, 11, 12 },
     36  { 1, 2, 3, 4 },
     37  { { 1234567 } }
     38};
    3939
    40 // X global2[3][3][3] = {
    41 //   {
    42 //     { 1, 2, 3 },
    43 //     { 4, 5, 6 },
    44 //     { 7, 8, 9 },
    45 //     { 10, 11, 12 }
    46 //   },
    47 //   {
    48 //     { 0, 0, 0 }
    49 //   }
    50 // };
     40X global2[3][3][3] = {
     41  {
     42    { 1, 2, 3 },
     43    { 4, 5, 6 },
     44    { 7, 8, 9 },
     45    { 10, 11, 12 }
     46  },
     47  {
     48    { 0, 0, 0 }
     49  }
     50};
    5151
    52 // int foo() {
    53 //   static X abc[3][3] = {
    54 //     { 11, 22, 33, 44 },
    55 //     { 55, 66 },
    56 //     { 77 },
    57 //     { 88, 99, 1010 }
    58 //   };
    59 // }
     52int foo() {
     53  static X abc[3][3] = {
     54    { 11, 22, 33, 44 },
     55    { 55, 66 },
     56    { 77 },
     57    { 88, 99, 1010 }
     58  };
     59}
    6060
    6161// ensure constructed const arrays continue to compile
    62 // const int global[1] = { -2 };
     62const int global[1] = { -2 };
    6363
    6464int main() {
    65   X a;
    66   X abc[2];
    67   // X abc[4]/*[4]*/ = {
    68   //   /*{*/ 999, 1111 /*}*/,
    69   //   // { 1, 2, 3, 4, 5 },
    70   //   // {},
    71   //   // { 0 },
    72   //   // { 88 }
    73   // };
     65  X abc[4][4] = {
     66    { 999, 1111 },
     67    { 1, 2, 3, 4, 5 },
     68    {},
     69    { 0 },
     70    { 88 }
     71  };
    7472
    75   // foo();
    76   // foo();
     73  foo();
     74  foo();
    7775}
Note: See TracChangeset for help on using the changeset viewer.