https://gcc.gnu.org/g:efbbbadff8b2774930e9b69fe9ff65e74878f48b
commit efbbbadff8b2774930e9b69fe9ff65e74878f48b Author: Thomas Schwinge <tschwi...@baylibre.com> Date: Wed Jul 17 15:27:51 2024 +0200 Enhance 'gcc.target/nvptx/alias-*.c' assembler scanning ... in order to demonstrate unexpected behavior (XFAILed here). PR target/104957 gcc/testsuite/ * gcc.target/nvptx/alias-1.c: Enhance assembler scanning. * gcc.target/nvptx/alias-2.c: Likewise. * gcc.target/nvptx/alias-3.c: Likewise. * gcc.target/nvptx/alias-4.c: Likewise. * gcc.target/nvptx/alias-to-alias-1.c: Likewise. (cherry picked from commit d0f02538494ded78cac12c63f5708a53f5a77bda) Diff: --- gcc/testsuite/ChangeLog.omp | 10 ++++++++++ gcc/testsuite/gcc.target/nvptx/alias-1.c | 15 ++++++++++++--- gcc/testsuite/gcc.target/nvptx/alias-2.c | 16 ++++++++++++---- gcc/testsuite/gcc.target/nvptx/alias-3.c | 15 ++++++++++++--- gcc/testsuite/gcc.target/nvptx/alias-4.c | 17 +++++++++++++---- gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c | 22 +++++++++++++++++----- 6 files changed, 76 insertions(+), 19 deletions(-) diff --git a/gcc/testsuite/ChangeLog.omp b/gcc/testsuite/ChangeLog.omp index 50d36148e724..5b3fa9876d73 100644 --- a/gcc/testsuite/ChangeLog.omp +++ b/gcc/testsuite/ChangeLog.omp @@ -1,5 +1,15 @@ 2025-02-18 Thomas Schwinge <tho...@codesourcery.com> + Backported from trunk: + 2024-09-05 Thomas Schwinge <tschwi...@baylibre.com> + + PR target/104957 + * gcc.target/nvptx/alias-1.c: Enhance assembler scanning. + * gcc.target/nvptx/alias-2.c: Likewise. + * gcc.target/nvptx/alias-3.c: Likewise. + * gcc.target/nvptx/alias-4.c: Likewise. + * gcc.target/nvptx/alias-to-alias-1.c: Likewise. + Backported from trunk: 2024-09-05 Thomas Schwinge <tho...@codesourcery.com> diff --git a/gcc/testsuite/gcc.target/nvptx/alias-1.c b/gcc/testsuite/gcc.target/nvptx/alias-1.c index 1c0642b14d91..0fb06495f675 100644 --- a/gcc/testsuite/gcc.target/nvptx/alias-1.c +++ b/gcc/testsuite/gcc.target/nvptx/alias-1.c @@ -23,6 +23,15 @@ main (void) return 0; } -/* { dg-final { scan-assembler-times "\\.alias f,__f;" 1 } } */ -/* { dg-final { scan-assembler-times "\\.visible \\.func __f;" 1 } } */ -/* { dg-final { scan-assembler-times "\\.visible \\.func f;" 1 } } */ +/* { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DECL: __f$} 1 } } + { dg-final { scan-assembler-times {(?n)^\.visible \.func __f;$} 1 } } + { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DEF: __f$} 1 } } + { dg-final { scan-assembler-times {(?n)^\.visible \.func __f$} 1 } } */ + +/* { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DECL: f$} 1 { xfail *-*-* } } } + { dg-final { scan-assembler-times {(?n)^\.visible \.func f;$} 1 } } + { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DEF: f$} 1 { xfail *-*-* } } } + { dg-final { scan-assembler-times {(?n)^\.alias f,__f;$} 1 } } */ + +/* { dg-final { scan-assembler-times {(?n)\tcall __f;$} 0 } } + { dg-final { scan-assembler-times {(?n)\tcall f;$} 1 } } */ diff --git a/gcc/testsuite/gcc.target/nvptx/alias-2.c b/gcc/testsuite/gcc.target/nvptx/alias-2.c index 7a88b6f4f6f1..8ae8b5cfaed9 100644 --- a/gcc/testsuite/gcc.target/nvptx/alias-2.c +++ b/gcc/testsuite/gcc.target/nvptx/alias-2.c @@ -5,10 +5,18 @@ #include "alias-1.c" +/* Note extern and inlined, so still there. */ +/* { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DECL: __f$} 1 } } + { dg-final { scan-assembler-times {(?n)^\.visible \.func __f;$} 1 } } + { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DEF: __f$} 1 } } + { dg-final { scan-assembler-times {(?n)^\.visible \.func __f$} 1 } } */ + /* Inlined, so no alias. */ -/* { dg-final { scan-assembler-not "\\.alias.*;" } } */ -/* { dg-final { scan-assembler-not "\\.visible \\.func f;" } } */ -/* Note extern and inlined, so still there. */ -/* { dg-final { scan-assembler-times "\\.visible \\.func __f;" 1 } } */ +/* { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DECL: f$} 0 } } + { dg-final { scan-assembler-times {(?n)^\.visible \.func f;$} 0 } } + { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DEF: f$} 0 } } + { dg-final { scan-assembler-times {(?n)^\.alias f,__f;$} 0 } } */ +/* { dg-final { scan-assembler-times {(?n)\tcall __f;$} 0 } } + { dg-final { scan-assembler-times {(?n)\tcall f;$} 0 } } */ diff --git a/gcc/testsuite/gcc.target/nvptx/alias-3.c b/gcc/testsuite/gcc.target/nvptx/alias-3.c index b55ff26269e1..1906607f95f5 100644 --- a/gcc/testsuite/gcc.target/nvptx/alias-3.c +++ b/gcc/testsuite/gcc.target/nvptx/alias-3.c @@ -25,6 +25,15 @@ main (void) return 0; } -/* { dg-final { scan-assembler-times "\\.alias f,__f;" 1 } } */ -/* { dg-final { scan-assembler-times "\\.func __f;" 1 } } */ -/* { dg-final { scan-assembler-times "\\.func f;" 1 } } */ +/* { dg-final { scan-assembler-times {(?n)^// BEGIN FUNCTION DECL: __f$} 1 } } + { dg-final { scan-assembler-times {(?n)^\.func __f;$} 1 } } + { dg-final { scan-assembler-times {(?n)^// BEGIN FUNCTION DEF: __f$} 1 } } + { dg-final { scan-assembler-times {(?n)^\.func __f$} 1 } } */ + +/* { dg-final { scan-assembler-times {(?n)^// BEGIN FUNCTION DECL: f$} 1 { xfail *-*-* } } } + { dg-final { scan-assembler-times {(?n)^\.func f;$} 1 } } + { dg-final { scan-assembler-times {(?n)^// BEGIN FUNCTION DEF: f$} 1 { xfail *-*-* } } } + { dg-final { scan-assembler-times {(?n)^\.alias f,__f;$} 1 } } */ + +/* { dg-final { scan-assembler-times {(?n)\tcall __f;$} 0 } } + { dg-final { scan-assembler-times {(?n)\tcall f;$} 1 } } */ diff --git a/gcc/testsuite/gcc.target/nvptx/alias-4.c b/gcc/testsuite/gcc.target/nvptx/alias-4.c index b36fa420aa7e..98c1d4972b85 100644 --- a/gcc/testsuite/gcc.target/nvptx/alias-4.c +++ b/gcc/testsuite/gcc.target/nvptx/alias-4.c @@ -5,9 +5,18 @@ #include "alias-3.c" +/* Static and inlined, so it's deleted. */ +/* { dg-final { scan-assembler-times {(?n)^// BEGIN FUNCTION DECL: __f$} 0 } } + { dg-final { scan-assembler-times {(?n)^\.visible \.func __f;$} 0 } } + { dg-final { scan-assembler-times {(?n)^// BEGIN FUNCTION DEF: __f$} 0 } } + { dg-final { scan-assembler-times {(?n)^\.visible \.func __f$} 0 } } */ + /* Inlined, so no alias. */ -/* { dg-final { scan-assembler-not "\\.alias.*;" } } */ -/* { dg-final { scan-assembler-not "\\.func f;" } } */ -/* Static and inlined, so it's deleted. */ -/* { dg-final { scan-assembler-not "\\.func __f;" } } */ +/* { dg-final { scan-assembler-times {(?n)^// BEGIN FUNCTION DECL: f$} 0 } } + { dg-final { scan-assembler-times {(?n)^\.visible \.func f;$} 0 } } + { dg-final { scan-assembler-times {(?n)^// BEGIN FUNCTION DEF: f$} 0 } } + { dg-final { scan-assembler-times {(?n)^\.alias f,__f;$} 0 } } */ + +/* { dg-final { scan-assembler-times {(?n)\tcall __f;$} 0 } } + { dg-final { scan-assembler-times {(?n)\tcall f;$} 0 } } */ diff --git a/gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c b/gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c index 273baca89c4a..ebd62e119649 100644 --- a/gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c +++ b/gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c @@ -19,9 +19,21 @@ main (void) return 0; } -/* { dg-final { scan-assembler-times "\\.alias bar,foo;" 1 } } */ -/* { dg-final { scan-assembler-times "\\.visible \\.func foo;" 1 } } */ -/* { dg-final { scan-assembler-times "\\.visible \\.func bar;" 1 } } */ +/* { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DECL: foo$} 1 } } + { dg-final { scan-assembler-times {(?n)^\.visible \.func foo;$} 1 } } + { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DEF: foo$} 1 } } + { dg-final { scan-assembler-times {(?n)^\.visible \.func foo$} 1 } } */ -/* { dg-final { scan-assembler-times "\\.alias baz,bar;" 1 } } */ -/* { dg-final { scan-assembler-times "\\.visible \\.func baz;" 1 } } */ +/* { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DECL: bar$} 1 { xfail *-*-* } } } + { dg-final { scan-assembler-times {(?n)^\.visible \.func bar;$} 1 } } + { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DEF: bar$} 1 { xfail *-*-* } } } + { dg-final { scan-assembler-times {(?n)^\.alias bar,foo;$} 1 } } */ + +/* { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DECL: baz$} 1 { xfail *-*-* } } } + { dg-final { scan-assembler-times {(?n)^\.visible \.func baz;$} 1 } } + { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DEF: baz$} 1 { xfail *-*-* } } } + { dg-final { scan-assembler-times {(?n)^\.alias baz,bar;$} 1 } } */ + +/* { dg-final { scan-assembler-times {(?n)\tcall foo;$} 0 } } + { dg-final { scan-assembler-times {(?n)\tcall bar;$} 0 } } + { dg-final { scan-assembler-times {(?n)\tcall baz;$} 1 } } */