Changeset 0b9be4d
- Timestamp:
- Oct 20, 2017, 5:04:11 PM (7 years ago)
- 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:
- 4ee1efb
- Parents:
- 88e79ad
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/multiDimension.c
r88e79ad r0b9be4d 32 32 } 33 33 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 };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 // }; 39 39 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 };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 // }; 51 51 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 }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 // } 60 60 61 61 // ensure constructed const arrays continue to compile 62 const int global[1] = { -2 };62 // const int global[1] = { -2 }; 63 63 64 64 int main() { 65 X abc[4][4] = { 66 { 999, 1111 }, 67 { 1, 2, 3, 4, 5 }, 68 {}, 69 { 0 }, 70 { 88 } 71 }; 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 // }; 72 74 73 foo();74 foo();75 // foo(); 76 // foo(); 75 77 }
Note: See TracChangeset
for help on using the changeset viewer.