From de1d3dd30e8975dd6053c925dba1181fb93773d2 Mon Sep 17 00:00:00 2001 From: edlinger Date: Thu, 17 Sep 2015 19:43:00 +0000 Subject: [PATCH] 2015-09-17 Bernd Edlinger PR sanitizer/64078 * c-c++-common/ubsan/object-size-9.c (s): Add alignment attribute. (f2, f3): Make the function static. * c-c++-common/ubsan/object-size-10.c (a, b): Add alignment attribute. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227886 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/c-c++-common/ubsan/object-size-10.c | 4 ++-- gcc/testsuite/c-c++-common/ubsan/object-size-9.c | 6 +++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 86ba5b7e919..904a40a64be 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2015-09-17 Bernd Edlinger + + PR sanitizer/64078 + * c-c++-common/ubsan/object-size-9.c (s): Add alignment attribute. + (f2, f3): Make the function static. + * c-c++-common/ubsan/object-size-10.c (a, b): Add alignment attribute. + 2015-09-17 Christian Bruel * gcc.target/arm/attr_thumb-static2.c: New test. diff --git a/gcc/testsuite/c-c++-common/ubsan/object-size-10.c b/gcc/testsuite/c-c++-common/ubsan/object-size-10.c index cafab519130..53e719de0cd 100644 --- a/gcc/testsuite/c-c++-common/ubsan/object-size-10.c +++ b/gcc/testsuite/c-c++-common/ubsan/object-size-10.c @@ -2,8 +2,8 @@ /* { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */ /* { dg-options "-fsanitize=undefined" } */ -static char a[128]; -static int b[128]; +static char a[128] __attribute__ ((aligned(4096))); +static int b[128] __attribute__ ((aligned(4096))); __attribute__ ((noinline, noclone)) int fn1 (int i) diff --git a/gcc/testsuite/c-c++-common/ubsan/object-size-9.c b/gcc/testsuite/c-c++-common/ubsan/object-size-9.c index 379744d6212..46f1fb9f9b4 100644 --- a/gcc/testsuite/c-c++-common/ubsan/object-size-9.c +++ b/gcc/testsuite/c-c++-common/ubsan/object-size-9.c @@ -11,7 +11,7 @@ struct C { C () : d("abcdefg"), e(1) {} C (const C &x) { __builtin_memcpy (d, x. #endif struct U { int a : 5; int b : 19; int c : 8; }; struct S { struct U d[10]; }; -struct S s; +struct S s __attribute__ ((aligned(4096))); int f1 (struct T x, int i) @@ -27,7 +27,7 @@ f1 (struct T x, int i) /* { dg-output "\[^\n\r]*\\^\[^\n\r]*(\n|\r\n|\r)" } */ #ifdef __cplusplus -struct C +static struct C f2 (int i) { struct C x; @@ -41,7 +41,7 @@ f2 (int i) /* { dg-output "\[^\n\r]*\[^\n\r]*(\n|\r\n|\r)" { target { c++ } } } */ /* { dg-output "\[^\n\r]*\\^\[^\n\r]*(\n|\r\n|\r)" { target { c++ } } } */ -struct C +static struct C f3 (int i) { struct C x; -- 2.11.4.GIT