aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-09-04 09:44:33 +0200
committerThomas Schwinge <tschwinge@baylibre.com>2024-09-04 11:40:39 +0200
commita89321c890b96c583671b73fc802e87545e4a2b1 (patch)
treefbc96705c44e0470864b3e444c780e73fa2588b1 /gcc
parent2267d254eb6ad782cef7b462f2bb2128bc8ace30 (diff)
downloadgcc-a89321c890b96c583671b73fc802e87545e4a2b1.zip
gcc-a89321c890b96c583671b73fc802e87545e4a2b1.tar.gz
gcc-a89321c890b96c583671b73fc802e87545e4a2b1.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c b/gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c
new file mode 100644
index 0000000..3db79d1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c
@@ -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 } } */