From: Tom de Vries Date: Fri, 20 Jul 2018 14:40:10 +0000 (+0200) Subject: [gdb/testsuite] Make noclone conditional in vla-optimized-out.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=232a00325b0f97e108014148c68ae314e90cbb36;p=binutils-gdb.git [gdb/testsuite] Make noclone conditional in vla-optimized-out.c Make the noclone attribute on f1 in vla-optimized-out.c conditional. This makes the test-case by default identical to gcc/testsuite/gcc.dg/guality/vla-1.c. Tested on x86_64-linux. 2018-07-20 Tom de Vries * gdb.base/vla-optimized-out.c: Make noclone attribute conditional on NOCLONE macro. * gdb.base/vla-optimized-out.exp: Use additional_flags -DNOCLONE. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 79ef76faf76..6d086644a6a 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-07-20 Tom de Vries + + * gdb.base/vla-optimized-out.c: Make noclone attribute conditional on + NOCLONE macro. + * gdb.base/vla-optimized-out.exp: Use additional_flags -DNOCLONE. + 2018-07-19 Tom de Vries * gdb.mi/list-thread-groups-available.exp (cores_re): Fix quoting in diff --git a/gdb/testsuite/gdb.base/vla-optimized-out.c b/gdb/testsuite/gdb.base/vla-optimized-out.c index 913e8ea8670..ec0a6fdd801 100644 --- a/gdb/testsuite/gdb.base/vla-optimized-out.c +++ b/gdb/testsuite/gdb.base/vla-optimized-out.c @@ -15,7 +15,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -int __attribute__((noinline, noclone)) +int +#ifdef NOCLONE +__attribute__((noinline, noclone)) +#else +__attribute__((noinline)) +#endif f1 (int i) { char a[i + 1]; diff --git a/gdb/testsuite/gdb.base/vla-optimized-out.exp b/gdb/testsuite/gdb.base/vla-optimized-out.exp index 39abb795c89..b27569ed1e1 100644 --- a/gdb/testsuite/gdb.base/vla-optimized-out.exp +++ b/gdb/testsuite/gdb.base/vla-optimized-out.exp @@ -18,7 +18,7 @@ standard_testfile if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ - {debug optimize=-O1}] } { + {debug optimize=-O1 additional_flags=-DNOCLONE}] } { return -1 }