1 // RUN: %clang_safestack %s -o %t
6 // Test that loads/stores work correctly for VLAs on the unsafe stack.
8 int main(int argc
, char **argv
)
11 break_optimization(&i
);
14 // check that we can write to a buffer
15 for (i
= 0; argv
[0][i
] && i
< sizeof (buffer
) - 1; ++i
)
16 buffer
[i
] = argv
[0][i
];
19 break_optimization(buffer
);
21 // check that we can read from a buffer
22 for (i
= 0; argv
[0][i
] && i
< sizeof (buffer
) - 1; ++i
)
23 if (buffer
[i
] != argv
[0][i
])