diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/ubsan/c-shift-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/ubsan/c-shift-1.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/testsuite/gcc.dg/ubsan/c-shift-1.c b/gcc/testsuite/gcc.dg/ubsan/c-shift-1.c index 9d56101..f88ee2d 100644 --- a/gcc/testsuite/gcc.dg/ubsan/c-shift-1.c +++ b/gcc/testsuite/gcc.dg/ubsan/c-shift-1.c @@ -7,12 +7,12 @@ int main (void) { /* None of the following should pass. */ - int A[1 >> -1] = {}; /* { dg-error "variable-sized object may not be initialized" } */ - int B[-1 >> -1] = {}; /* { dg-error "variable-sized object may not be initialized" } */ - int D[1 << -1] = {}; /* { dg-error "variable-sized object may not be initialized" } */ - int E[-1 << -1] = {}; /* { dg-error "variable-sized object may not be initialized" } */ - int F[-1 >> 200] = {}; /* { dg-error "variable-sized object may not be initialized" } */ - int G[1 << 200] = {}; /* { dg-error "variable-sized object may not be initialized" } */ + int A[1 >> -1] = { 0 }; /* { dg-error "variable-sized object may not be initialized" } */ + int B[-1 >> -1] = { 0 }; /* { dg-error "variable-sized object may not be initialized" } */ + int D[1 << -1] = { 0 }; /* { dg-error "variable-sized object may not be initialized" } */ + int E[-1 << -1] = { 0 }; /* { dg-error "variable-sized object may not be initialized" } */ + int F[-1 >> 200] = { 0 }; /* { dg-error "variable-sized object may not be initialized" } */ + int G[1 << 200] = { 0 }; /* { dg-error "variable-sized object may not be initialized" } */ return 0; } |