On Mon, Jan 21, 2013 at 03:05:45PM +0100, Jakub Jelinek wrote: > On Sun, Jan 13, 2013 at 10:06:05PM -0800, Andi Kleen wrote: > > 2013-01-12 Andi Kleen <a...@linux.intel.com> > > Jonathan Wakely <jwakely....@gmail.com> > > > > PR libstdc++/55223 > > * testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc: > > Add. > > The test is broken on i?86-linux, > > > --- /dev/null > > +++ > > b/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc > > @@ -0,0 +1,120 @@ > > +// { dg-options "-std=gnu++0x" } > > 1) you need // { dg-additional-options "-march=i486" { target ia32 } } > or something similar, otherwise for a pure i386 target it will not work > right > > > +// { dg-do compile { target i?86-*-* x86_64-*-* } } > > +// { dg-final { scan-assembler-times "\(xacquire\|\.byte.*0xf2\)" 14 } } > > +// { dg-final { scan-assembler-times "\(xrelease\|\.byte.*0xf3\)" 14 } } > > 2) \.byte.*0xf needs to be replaced by \.byte\[^\n\r]*0xf > otherwise it will happily match say > .byte 0 > > .uleb128 0x2d > > .long 0xf23 > > in .debug_info > > 3) I guess you want to add "-g0 -fno-exceptions > -fno-asynchronous-unwind-tables" > to double check that .byte 0xf2 or .byte 0xf3 won't suddenly appear in > .debug_* or .eh_frame sections.
Now in the form of a tested patch (regtested on x86_64-linux and i686-linux). Ok for trunk? dg-additional-options unfortunately isn't supported in libstdc++ testsuite, so had to use second dg-options, and also the \(, \) were wrong and resulted in no matches. 2013-01-22 Jakub Jelinek <ja...@redhat.com> * testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc: Tightten scan-assembler-times regexps, add dg-additional-options for ia32, add -g0 -fno-exceptions -fno-asynchronous-unwind-tables to dg-options. --- libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc.jj 2013-01-21 10:57:10.199935240 +0100 +++ libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc 2013-01-22 14:46:15.851668073 +0100 @@ -1,9 +1,10 @@ -// { dg-options "-std=gnu++0x" } // { dg-do compile { target i?86-*-* x86_64-*-* } } -// { dg-final { scan-assembler-times "\(xacquire\|\.byte.*0xf2\)" 14 } } -// { dg-final { scan-assembler-times "\(xrelease\|\.byte.*0xf3\)" 14 } } +// { dg-options "-std=gnu++0x -g0 -fno-exceptions -fno-asynchronous-unwind-tables" } +// { dg-options "-std=gnu++0x -g0 -fno-exceptions -fno-asynchronous-unwind-tables -march=i486" { target ia32 } } +// { dg-final { scan-assembler-times "xacquire\|\.byte\[^\n\r]*0xf2" 14 } } +// { dg-final { scan-assembler-times "xrelease\|\.byte\[^\n\r]*0xf3" 14 } } -// Copyright (C) 2008, 2009, 2013 Free Software Foundation, Inc. +// Copyright (C) 2008-2013 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the Jakub