aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/declare-variant-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/gomp/declare-variant-3.c')
-rw-r--r--gcc/testsuite/gcc.dg/gomp/declare-variant-3.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/declare-variant-3.c b/gcc/testsuite/gcc.dg/gomp/declare-variant-3.c
new file mode 100644
index 0000000..92b71fe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/declare-variant-3.c
@@ -0,0 +1,18 @@
+/* PR118839: Check that error is diagnosed when the variant is the same as
+ the base function. */
+
+/* No previous declaration. */
+#pragma omp declare variant(f) match(user={condition(1)}) /* { dg-error "variant 'f' is the same as base function" } */
+void f(int *x);
+
+/* Previous declaration. */
+void g(int *x)
+{
+ *x = 42;
+}
+
+#pragma omp declare variant(g) match(user={condition(1)}) /* { dg-error "variant 'g' is the same as base function" } */
+void g(int *x);
+
+
+