bounds-2.c (fn4): Adjust to check the array size in the structure.

* c-c++-common/ubsan/bounds-2.c (fn4): Adjust to check the array size
	in the structure.

From-SVN: r212933
This commit is contained in:
Marek Polacek 2014-07-23 13:24:14 +00:00 committed by Marek Polacek
parent b50a9d3894
commit 31e1324bf9
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2014-07-23 Marek Polacek <polacek@redhat.com>
* c-c++-common/ubsan/bounds-2.c (fn4): Adjust to check the array size
in the structure.
2014-07-23 Jiong Wang <jiong.wang@arm.com>
* gcc.dg/ira-shrinkwrap-prep-1.c (target): Add arm_nothumb.

View File

@ -4,6 +4,7 @@
/* Test runtime errors. */
struct S { int a[10]; };
struct T { int a[5]; int s[2]; };
int
foo_5 (void)
@ -47,8 +48,9 @@ fn3 (void)
static void __attribute__ ((noinline, noclone))
fn4 (void)
{
volatile int a[5];
a[foo_5 ()] = 1;
struct T t;
asm ("" : : "r" (&t.a) : "memory");
t.a[foo_5 ()] = 1;
}
static void __attribute__ ((noinline, noclone))