From a89321c890b96c583671b73fc802e87545e4a2b1 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tschwinge@baylibre.com>
Date: Wed, 4 Sep 2024 09:44:33 +0200
Subject: [PATCH] Add 'gcc.target/nvptx/alias-to-alias-1.c'
... similar to alias to alias usage in 'libgomp.c-c++-common/pr96390.c'.
PR target/104957
gcc/testsuite/
* gcc.target/nvptx/alias-to-alias-1.c: New.
---
.../gcc.target/nvptx/alias-to-alias-1.c | 27 +++++++++++++++++++
1 file changed, 27 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c
new file mode 100644
@@ -0,0 +1,27 @@
+/* Alias to alias; 'libgomp.c-c++-common/pr96390.c'. */
+
+/* { dg-do compile } */
+/* { dg-add-options ptx_alias } */
+
+int v;
+
+void foo () { v = 42; }
+void bar () __attribute__((alias ("foo")));
+void baz () __attribute__((alias ("bar")));
+
+int
+main (void)
+{
+ baz ();
+ if (v != 42)
+ __builtin_abort ();
+
+ 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 "\\.alias baz,bar;" 1 } } */
+/* { dg-final { scan-assembler-times "\\.visible \\.func baz;" 1 } } */
--
2.34.1