On 21 March 2017 at 08:55, Ville Voutilainen <ville.voutilai...@gmail.com> wrote: >>> +// { dg-options "-O2 --std=gnu++11" } >> >> -O2 -std=gnu++11 is enough, no need for double dash --std=gnu++11. >> >>> +// { dg-do compile } >>> +// { dg-final { scan-assembler "test.*%rdi, %rdi" { target i?86-*-* >>> x86_64-*-* } } } >> >> This will surely fail on 32-bit or with -mx32. So either you need to use it >> on { target { { i?86-*-* x86_64-*-* } && lp64 } } only, or perhaps instead >> of scanning assembler add -fdump-tree-optimized to dg-options and >> scan-tree-dump for the NULL? pointer comparison there. > > I weakly vote for the former, since that's less intrusive. I managed > to commit the patch before > I saw these remarks, so we need to patch that fix in as a separate tweak.
So, shall I just push in the attached?
diff --git a/gcc/testsuite/g++.dg/init/pr35878_1.C b/gcc/testsuite/g++.dg/init/pr35878_1.C index b45c009..d4cad74 100644 --- a/gcc/testsuite/g++.dg/init/pr35878_1.C +++ b/gcc/testsuite/g++.dg/init/pr35878_1.C @@ -1,6 +1,6 @@ -// { dg-options "-O2 --std=gnu++11" } +// { dg-options "-O2 -std=gnu++11" } // { dg-do compile } -// { dg-final { scan-assembler "test.*%rdi, %rdi" { target i?86-*-* x86_64-*-* } } } +// { dg-final { scan-assembler "test.*%rdi, %rdi" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } #include <new> #include <utility> diff --git a/gcc/testsuite/g++.dg/init/pr35878_2.C b/gcc/testsuite/g++.dg/init/pr35878_2.C index 0664494..ef55463 100644 --- a/gcc/testsuite/g++.dg/init/pr35878_2.C +++ b/gcc/testsuite/g++.dg/init/pr35878_2.C @@ -1,6 +1,6 @@ -// { dg-options "-O2 --std=gnu++17 -fcheck-new" } +// { dg-options "-O2 -std=gnu++17 -fcheck-new" } // { dg-do compile } -// { dg-final { scan-assembler "test.*%rdi, %rdi" { target i?86-*-* x86_64-*-* } } } +// { dg-final { scan-assembler "test.*%rdi, %rdi" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } #include <new> #include <utility> diff --git a/gcc/testsuite/g++.dg/init/pr35878_3.C b/gcc/testsuite/g++.dg/init/pr35878_3.C index 8a5614f..9a2efa2 100644 --- a/gcc/testsuite/g++.dg/init/pr35878_3.C +++ b/gcc/testsuite/g++.dg/init/pr35878_3.C @@ -1,6 +1,6 @@ -// { dg-options "-O2 --std=gnu++17" } +// { dg-options "-O2 -std=gnu++17" } // { dg-do compile } -// { dg-final { scan-assembler-not "test.*%rdi, %rdi" { target i?86-*-* x86_64-*-* } } } +// { dg-final { scan-assembler-not "test.*%rdi, %rdi" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } #include <new> #include <utility>