On Mon, Jul 20, 2020 at 05:55:53PM -0400, Jason Merrill via Gcc-patches wrote: > +// { dg-final { scan-assembler _Z1g1AIXadixdtL_Z1bE1jLl1EEE } } > +void g(A<&b.j[0]+1>) {} > +TEQ(&b.j[1],&b.j[1]); > +TEQ(&b.j[1],&b.j[0]+1); > +TNEQ(&b.j[1],&b.j[0]);
This test FAILs on e.g. x86_64 -m32. because there is no l1, but i1 in that case instead. We have also targets where size_t is unsigned short (pdp11) or unsigned long long (mingw64), so I think we need all of s1, i1, l1 and x1 (is it ptrdiff_t)? Examples of all those cases: config/i386/cygming.h:#define PTRDIFF_TYPE (TARGET_64BIT ? "long long int" : "int") config/pdp11/pdp11.h:#define PTRDIFF_TYPE "short int" config/i386/x86-64.h:#define PTRDIFF_TYPE (TARGET_LP64 ? "long int" : "int") I've tested following on x86_64-linux -m32/-m64 and committed to trunk as obvious. 2020-07-28 Jakub Jelinek <ja...@redhat.com> * g++.dg/cpp2a/nontype-subob1.C: Allow s1, i1 or x1 instead of l1 for targets with short, int or long long ssize_t. --- gcc/testsuite/g++.dg/cpp2a/nontype-subob1.C.jj 2020-07-27 10:38:19.839619363 +0200 +++ gcc/testsuite/g++.dg/cpp2a/nontype-subob1.C 2020-07-28 11:28:43.695368508 +0200 @@ -18,7 +18,7 @@ struct B: C void f(A<&b.i>) {} TEQ(&b.i,&((C*)&b)->i); -// { dg-final { scan-assembler _Z1g1AIXadixdtL_Z1bE1jLl1EEE } } +// { dg-final { scan-assembler "_Z1g1AIXadixdtL_Z1bE1jL\[silx]1EEE" } } void g(A<&b.j[0]+1>) {} TEQ(&b.j[1],&b.j[1]); TEQ(&b.j[1],&b.j[0]+1); Jakub