Commit 31e1324b by Marek Polacek Committed by Marek Polacek

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
parent b50a9d38
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> 2014-07-23 Jiong Wang <jiong.wang@arm.com>
* gcc.dg/ira-shrinkwrap-prep-1.c (target): Add arm_nothumb. * gcc.dg/ira-shrinkwrap-prep-1.c (target): Add arm_nothumb.
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
/* Test runtime errors. */ /* Test runtime errors. */
struct S { int a[10]; }; struct S { int a[10]; };
struct T { int a[5]; int s[2]; };
int int
foo_5 (void) foo_5 (void)
...@@ -47,8 +48,9 @@ fn3 (void) ...@@ -47,8 +48,9 @@ fn3 (void)
static void __attribute__ ((noinline, noclone)) static void __attribute__ ((noinline, noclone))
fn4 (void) fn4 (void)
{ {
volatile int a[5]; struct T t;
a[foo_5 ()] = 1; asm ("" : : "r" (&t.a) : "memory");
t.a[foo_5 ()] = 1;
} }
static void __attribute__ ((noinline, noclone)) static void __attribute__ ((noinline, noclone))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment