Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/readonly-loc.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
line wrap: on
line source
/* { dg-do compile } */ /* { dg-options "-O" } */ int func() { const int *arr; const int arr2[5]; arr[0] = 1; /* { dg-error "assignment of read-only location" "*(arr)" } */ arr[1] = 1; /* { dg-error "assignment of read-only location" "*(arr + 4u)" } */ arr2[0] = 1; /* { dg-error "assignment of read-only location" "arr2\[0\]" } */ arr2[1] = 1; /* { dg-error "assignment of read-only location" "arr2\[1\]" } */ }