diff options
author | Thomas Schwinge <tschwinge@baylibre.com> | 2024-07-17 15:27:51 +0200 |
---|---|---|
committer | Thomas Schwinge <tschwinge@baylibre.com> | 2024-09-05 14:19:07 +0200 |
commit | d0f02538494ded78cac12c63f5708a53f5a77bda (patch) | |
tree | 85fd9b7480bbd97e29649c3dc2c1c8b47229ceb6 | |
parent | 973c1bf51fb0f58fbfe43651bb0a61e1d124b35d (diff) | |
download | gcc-d0f02538494ded78cac12c63f5708a53f5a77bda.zip gcc-d0f02538494ded78cac12c63f5708a53f5a77bda.tar.gz gcc-d0f02538494ded78cac12c63f5708a53f5a77bda.tar.bz2 |
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.
-rw-r--r-- | gcc/testsuite/gcc.target/nvptx/alias-1.c | 15 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/nvptx/alias-2.c | 16 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/nvptx/alias-3.c | 15 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/nvptx/alias-4.c | 17 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c | 22 |
5 files changed, 66 insertions, 19 deletions
diff --git a/gcc/testsuite/gcc.target/nvptx/alias-1.c b/gcc/testsuite/gcc.target/nvptx/alias-1.c index 1c0642b..0fb0649 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 7a88b6f..8ae8b5c 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 b55ff26..1906607 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 b36fa42..98c1d49 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 273baca..ebd62e1 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 } } */ |