https://gcc.gnu.org/g:e1e5444ff2a0d3ca670ee5f48bc601fa9a071c80

commit r16-4455-ge1e5444ff2a0d3ca670ee5f48bc601fa9a071c80
Author: Tobias Burnus <[email protected]>
Date:   Thu Oct 16 11:11:39 2025 +0200

    libgomp.c/declare-variant-4-gfx*: Add missing archs + dg-excess-errors
    
    Add missing tests for gfx* context selectors; mark all but the
    default-arch declare-variant-4.c with 'dg-excess-errors' to
    silence libgomp not-found errors (still passing the
    scan-offload-tree-dump check) - or at least causing just
    UNRESOLVED errors if the error is
      "built without library support ... consider compiling for
       the associated generic architecture".
    
    In case the multilib is configured, the result will be
    an XPASS.
    
    libgomp/ChangeLog:
    
            * testsuite/libgomp.c/declare-variant-4-gfx10-3-generic.c: Add
            dg-excess-errors to handle possible missing libgomp multi lib.
            * testsuite/libgomp.c/declare-variant-4-gfx1030.c: Likewise.
            * testsuite/libgomp.c/declare-variant-4-gfx1036.c: Likewise.
            * testsuite/libgomp.c/declare-variant-4-gfx11-generic.c: Likewise.
            * testsuite/libgomp.c/declare-variant-4-gfx1100.c: Likewise.
            * testsuite/libgomp.c/declare-variant-4-gfx1103.c: Likewise.
            * testsuite/libgomp.c/declare-variant-4-gfx9-4-generic.c: Likewise.
            * testsuite/libgomp.c/declare-variant-4-gfx9-generic.c: Likewise.
            * testsuite/libgomp.c/declare-variant-4-gfx900.c: Likewise.
            * testsuite/libgomp.c/declare-variant-4-gfx906.c: Likewise.
            * testsuite/libgomp.c/declare-variant-4-gfx908.c: Likewise.
            * testsuite/libgomp.c/declare-variant-4-gfx90a.c: Likewise.
            * testsuite/libgomp.c/declare-variant-4-gfx90c.c: Likewise.
            * testsuite/libgomp.c/declare-variant-4-gfx942.c: Likewise.
            * testsuite/libgomp.c/declare-variant-4-gfx1031.c: New test.
            * testsuite/libgomp.c/declare-variant-4-gfx1032.c: New test.
            * testsuite/libgomp.c/declare-variant-4-gfx1033.c: New test.
            * testsuite/libgomp.c/declare-variant-4-gfx1034.c: New test.
            * testsuite/libgomp.c/declare-variant-4-gfx1035.c: New test.
            * testsuite/libgomp.c/declare-variant-4-gfx1101.c: New test.
            * testsuite/libgomp.c/declare-variant-4-gfx1102.c: New test.
            * testsuite/libgomp.c/declare-variant-4-gfx1150.c: New test.
            * testsuite/libgomp.c/declare-variant-4-gfx1151.c: New test.
            * testsuite/libgomp.c/declare-variant-4-gfx1152.c: New test.
            * testsuite/libgomp.c/declare-variant-4-gfx1153.c: New test.
            * testsuite/libgomp.c/declare-variant-4-gfx902.c: New test.
            * testsuite/libgomp.c/declare-variant-4-gfx904.c: New test.
            * testsuite/libgomp.c/declare-variant-4-gfx909.c: New test.
            * testsuite/libgomp.c/declare-variant-4-gfx950.c: New test.

Diff:
---
 .../libgomp.c/declare-variant-4-gfx10-3-generic.c  | 17 +++++++++++
 .../libgomp.c/declare-variant-4-gfx1030.c          | 25 ++++++++++++++++
 .../libgomp.c/declare-variant-4-gfx1031.c          | 33 ++++++++++++++++++++++
 .../libgomp.c/declare-variant-4-gfx1032.c          | 33 ++++++++++++++++++++++
 .../libgomp.c/declare-variant-4-gfx1033.c          | 33 ++++++++++++++++++++++
 .../libgomp.c/declare-variant-4-gfx1034.c          | 33 ++++++++++++++++++++++
 .../libgomp.c/declare-variant-4-gfx1035.c          | 33 ++++++++++++++++++++++
 .../libgomp.c/declare-variant-4-gfx1036.c          | 25 ++++++++++++++++
 .../libgomp.c/declare-variant-4-gfx11-generic.c    | 17 +++++++++++
 .../libgomp.c/declare-variant-4-gfx1100.c          | 25 ++++++++++++++++
 .../libgomp.c/declare-variant-4-gfx1101.c          | 33 ++++++++++++++++++++++
 .../libgomp.c/declare-variant-4-gfx1102.c          | 33 ++++++++++++++++++++++
 .../libgomp.c/declare-variant-4-gfx1103.c          | 25 ++++++++++++++++
 .../libgomp.c/declare-variant-4-gfx1150.c          | 33 ++++++++++++++++++++++
 .../libgomp.c/declare-variant-4-gfx1151.c          | 33 ++++++++++++++++++++++
 .../libgomp.c/declare-variant-4-gfx1152.c          | 33 ++++++++++++++++++++++
 .../libgomp.c/declare-variant-4-gfx1153.c          | 33 ++++++++++++++++++++++
 .../libgomp.c/declare-variant-4-gfx9-4-generic.c   | 17 +++++++++++
 .../libgomp.c/declare-variant-4-gfx9-generic.c     | 17 +++++++++++
 .../testsuite/libgomp.c/declare-variant-4-gfx900.c | 25 ++++++++++++++++
 .../testsuite/libgomp.c/declare-variant-4-gfx902.c | 33 ++++++++++++++++++++++
 .../testsuite/libgomp.c/declare-variant-4-gfx904.c | 33 ++++++++++++++++++++++
 .../testsuite/libgomp.c/declare-variant-4-gfx906.c | 25 ++++++++++++++++
 .../testsuite/libgomp.c/declare-variant-4-gfx908.c | 25 ++++++++++++++++
 .../testsuite/libgomp.c/declare-variant-4-gfx909.c | 33 ++++++++++++++++++++++
 .../testsuite/libgomp.c/declare-variant-4-gfx90a.c | 25 ++++++++++++++++
 .../testsuite/libgomp.c/declare-variant-4-gfx90c.c | 25 ++++++++++++++++
 .../testsuite/libgomp.c/declare-variant-4-gfx942.c | 25 ++++++++++++++++
 .../testsuite/libgomp.c/declare-variant-4-gfx950.c | 33 ++++++++++++++++++++++
 29 files changed, 813 insertions(+)

diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx10-3-generic.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx10-3-generic.c
index 3df81a34fc96..b7b95e68ad8c 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx10-3-generic.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx10-3-generic.c
@@ -6,3 +6,20 @@
 #include "declare-variant-4.h"
 
 /* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx10_3_generic \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available (as this is a generic config),
+   scan-offload-tree-dump will PASS - but linking fails with the
+   following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1030.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1030.c
index d98d5ef54ec7..3703e961c0b3 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1030.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1030.c
@@ -6,3 +6,28 @@
 #include "declare-variant-4.h"
 
 /* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx1030 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1031.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1031.c
new file mode 100644
index 000000000000..e0d628944445
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1031.c
@@ -0,0 +1,33 @@
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx1031 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx1031 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1032.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1032.c
new file mode 100644
index 000000000000..46174cc2afc6
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1032.c
@@ -0,0 +1,33 @@
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx1032 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx1032 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1033.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1033.c
new file mode 100644
index 000000000000..1bd6e661e10c
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1033.c
@@ -0,0 +1,33 @@
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx1033 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx1033 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1034.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1034.c
new file mode 100644
index 000000000000..4f67a73bc480
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1034.c
@@ -0,0 +1,33 @@
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx1034 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx1034 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1035.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1035.c
new file mode 100644
index 000000000000..a69d5e7e808c
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1035.c
@@ -0,0 +1,33 @@
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx1035 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx1035 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1036.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1036.c
index 93b8641b3e15..8c258c4011db 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1036.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1036.c
@@ -6,3 +6,28 @@
 #include "declare-variant-4.h"
 
 /* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx1036 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx11-generic.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx11-generic.c
index ca03f4a2ede5..fa9efb4cea4d 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx11-generic.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx11-generic.c
@@ -6,3 +6,20 @@
 #include "declare-variant-4.h"
 
 /* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx11_generic \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available (as this is a generic config),
+   scan-offload-tree-dump will PASS - but linking fails with the
+   following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1100.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1100.c
index 6ade35224cc4..f0b7c6db1ae6 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1100.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1100.c
@@ -6,3 +6,28 @@
 #include "declare-variant-4.h"
 
 /* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx1100 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1101.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1101.c
new file mode 100644
index 000000000000..213e904fc9cc
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1101.c
@@ -0,0 +1,33 @@
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx1101 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx1101 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1102.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1102.c
new file mode 100644
index 000000000000..3f68dc8cc7c7
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1102.c
@@ -0,0 +1,33 @@
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx1102 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx1102 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1103.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1103.c
index 6a6dc4fba3fd..c1eed448f8be 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1103.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1103.c
@@ -6,3 +6,28 @@
 #include "declare-variant-4.h"
 
 /* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx1103 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1150.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1150.c
new file mode 100644
index 000000000000..39d64ca789df
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1150.c
@@ -0,0 +1,33 @@
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx1150 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx1150 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1151.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1151.c
new file mode 100644
index 000000000000..2a0c73227240
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1151.c
@@ -0,0 +1,33 @@
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx1151 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx1151 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1152.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1152.c
new file mode 100644
index 000000000000..3c987ddbac83
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1152.c
@@ -0,0 +1,33 @@
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx1152 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx1152 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1153.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1153.c
new file mode 100644
index 000000000000..7d38b82c2a4e
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx1153.c
@@ -0,0 +1,33 @@
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx1153 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx1153 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx9-4-generic.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx9-4-generic.c
index 3921bddbf80f..07d1254bbb66 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx9-4-generic.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx9-4-generic.c
@@ -6,3 +6,20 @@
 #include "declare-variant-4.h"
 
 /* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx9_4_generic \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available (as this is a generic config),
+   scan-offload-tree-dump will PASS - but linking fails with the
+   following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx9-generic.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx9-generic.c
index 5aa8a2e32241..d6ba097ce392 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx9-generic.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx9-generic.c
@@ -6,3 +6,20 @@
 #include "declare-variant-4.h"
 
 /* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx9_generic \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available (as this is a generic config),
+   scan-offload-tree-dump will PASS - but linking fails with the
+   following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx900.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx900.c
index f3f5244c7bc7..37005fc5c7ff 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx900.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx900.c
@@ -6,3 +6,28 @@
 #include "declare-variant-4.h"
 
 /* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx900 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx902.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx902.c
new file mode 100644
index 000000000000..82981c5cbcc0
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx902.c
@@ -0,0 +1,33 @@
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx902 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx902 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx904.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx904.c
new file mode 100644
index 000000000000..89815fe760ef
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx904.c
@@ -0,0 +1,33 @@
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx904 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx904 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx906.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx906.c
index ac43388a59f0..aeef690f8708 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx906.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx906.c
@@ -6,3 +6,28 @@
 #include "declare-variant-4.h"
 
 /* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx906 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx908.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx908.c
index f60741f202fa..799b5465bd43 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx908.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx908.c
@@ -6,3 +6,28 @@
 #include "declare-variant-4.h"
 
 /* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx908 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx909.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx909.c
new file mode 100644
index 000000000000..e8a6f63a0471
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx909.c
@@ -0,0 +1,33 @@
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx909 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx909 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx90a.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx90a.c
index 832d174e4a5b..de5626efff8b 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx90a.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx90a.c
@@ -6,3 +6,28 @@
 #include "declare-variant-4.h"
 
 /* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx90a \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx90c.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx90c.c
index 44629a806b46..dfad7ece1c95 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx90c.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx90c.c
@@ -6,3 +6,28 @@
 #include "declare-variant-4.h"
 
 /* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx90c \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx942.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx942.c
index d1df5500d5f9..c8c744662b1a 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx942.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx942.c
@@ -6,3 +6,28 @@
 #include "declare-variant-4.h"
 
 /* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx942 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx950.c 
b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx950.c
new file mode 100644
index 000000000000..af81f1116d1b
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx950.c
@@ -0,0 +1,33 @@
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx950 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump 
"= gfx950 \\(\\);" "optimized" } } */
+
+
+/* This code will link nicely if the multilib for that GPU architecture
+   has been build for GCC. In that case, scan-offload-tree-dump will
+   PASS and the linking will yield an XPASS message due to following line: */
+
+/* { dg-excess-errors "ld: error: unable to find library -lgomp|gcn mkoffload: 
fatal error" } */
+
+/* If the multi-lib config is not available, there are two options:
+
+   * If the generic multi-lib is available, mkoffload fails early,
+     yielding UNRESOLVED for scan-offload-tree-dump and an XFAIL
+     for the message:
+       gcn mkoffload: fatal error: GCC was built without library support
+       for '-march=gfx...'; consider compiling for the associated
+       generic architecture '-march=gfx...-generic' instead
+
+   * Or compling succeeds - then scan-offload-tree-dump will PASS -
+     but linking fails with the following error (XFAIL):
+       ld: error: unable to find library -lgomp
+       collect2: error: ld returned 1 exit status
+       gcn mkoffload: fatal error: ...-gnu-accel-amdgcn-amdhsa-gcc returned 1 
exit status
+       compilation terminated.
+       lto-wrapper: fatal error: .../amdgcn-amdhsa/mkoffload returned 1 exit 
status
+       compilation terminated. */

Reply via email to