https://gcc.gnu.org/g:06b8c7926ef32159047be74a73930944a52a26ab

commit 06b8c7926ef32159047be74a73930944a52a26ab
Author: Tobias Burnus <tbur...@baylibre.com>
Date:   Wed Aug 7 17:59:21 2024 +0200

    libgomp.c-c++-common/target-link-2.c: Fix test on multi-device systems
    
    libgomp/ChangeLog:
    
            * testsuite/libgomp.c-c++-common/target-link-2.c: Reset variable
            value to handle multi-device tests.
    
    (cherry picked from commit aa689684d2bf58d1b7e7938a1392e7a260276d14)

Diff:
---
 libgomp/ChangeLog.omp                                  | 6 ++++++
 libgomp/testsuite/libgomp.c-c++-common/target-link-2.c | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp
index 1e6d298c40e6..4b915220fdc9 100644
--- a/libgomp/ChangeLog.omp
+++ b/libgomp/ChangeLog.omp
@@ -1,5 +1,11 @@
 2024-12-18  Thomas Schwinge  <tschwi...@baylibre.com>
 
+       Backported from trunk:
+       2024-08-07  Tobias Burnus  <tbur...@baylibre.com>
+
+       * testsuite/libgomp.c-c++-common/target-link-2.c: Reset variable
+       value to handle multi-device tests.
+
        Backported from trunk:
        2024-11-18  Tobias Burnus  <tbur...@baylibre.com>
 
diff --git a/libgomp/testsuite/libgomp.c-c++-common/target-link-2.c 
b/libgomp/testsuite/libgomp.c-c++-common/target-link-2.c
index 15da1656ebf9..b64fbde70e3d 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/target-link-2.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/target-link-2.c
@@ -54,6 +54,9 @@ int main()
       for (int i = 0; i < 10; i++)
        if (res[i] != (4 + i)*10)
          __builtin_abort ();
+
+      for (int i = 0; i < 15; i++) /* Reset. */
+       arr[i] /= 10;
     }
   return 0;
 }

Reply via email to