[llvm] [Offload][OpenMP] Test requries libc on GPU for printf (PR #155785)

Jan Patrick Lehr via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 28 01:46:56 PDT 2025


https://github.com/jplehr updated https://github.com/llvm/llvm-project/pull/155785

>From 29928eb0d623b1e81474d54d0f0e745a460aaece Mon Sep 17 00:00:00 2001
From: JP Lehr <JanPatrick.Lehr at amd.com>
Date: Thu, 28 Aug 2025 03:25:21 -0500
Subject: [PATCH 1/2] [Offload][OpenMP] Tests require libc on GPU for printf

These tests currently fail when libc is not configured to be built as
they require printf to be available in target regions.
---
 offload/test/mapping/map_ptr_and_star_global.c         | 1 +
 offload/test/mapping/map_ptr_and_star_local.c          | 1 +
 offload/test/mapping/map_ptr_and_subscript_global.c    | 1 +
 offload/test/mapping/map_ptr_and_subscript_local.c     | 1 +
 offload/test/mapping/map_structptr_and_member_global.c | 1 +
 offload/test/mapping/map_structptr_and_member_local.c  | 1 +
 6 files changed, 6 insertions(+)

diff --git a/offload/test/mapping/map_ptr_and_star_global.c b/offload/test/mapping/map_ptr_and_star_global.c
index c3b0dd2f49e6b..b38502f4bab3c 100644
--- a/offload/test/mapping/map_ptr_and_star_global.c
+++ b/offload/test/mapping/map_ptr_and_star_global.c
@@ -1,4 +1,5 @@
 // RUN: %libomptarget-compilexx-run-and-check-generic
+// REQUIRES: libc
 
 #include <omp.h>
 #include <stdio.h>
diff --git a/offload/test/mapping/map_ptr_and_star_local.c b/offload/test/mapping/map_ptr_and_star_local.c
index f0ca84d1cc4dd..64b673459184e 100644
--- a/offload/test/mapping/map_ptr_and_star_local.c
+++ b/offload/test/mapping/map_ptr_and_star_local.c
@@ -1,4 +1,5 @@
 // RUN: %libomptarget-compilexx-run-and-check-generic
+// REQUIRES: libc
 
 #include <omp.h>
 #include <stdio.h>
diff --git a/offload/test/mapping/map_ptr_and_subscript_global.c b/offload/test/mapping/map_ptr_and_subscript_global.c
index a3a10b6c9b212..cb1eafe4d0a13 100644
--- a/offload/test/mapping/map_ptr_and_subscript_global.c
+++ b/offload/test/mapping/map_ptr_and_subscript_global.c
@@ -1,4 +1,5 @@
 // RUN: %libomptarget-compilexx-run-and-check-generic
+// REQUIRES: libc
 
 #include <omp.h>
 #include <stdio.h>
diff --git a/offload/test/mapping/map_ptr_and_subscript_local.c b/offload/test/mapping/map_ptr_and_subscript_local.c
index bb44999541a7b..cdd09b271e8bf 100644
--- a/offload/test/mapping/map_ptr_and_subscript_local.c
+++ b/offload/test/mapping/map_ptr_and_subscript_local.c
@@ -1,4 +1,5 @@
 // RUN: %libomptarget-compilexx-run-and-check-generic
+// REQUIRES: libc
 
 #include <omp.h>
 #include <stdio.h>
diff --git a/offload/test/mapping/map_structptr_and_member_global.c b/offload/test/mapping/map_structptr_and_member_global.c
index 10e72e070dbc5..74e79ebcf2ad0 100644
--- a/offload/test/mapping/map_structptr_and_member_global.c
+++ b/offload/test/mapping/map_structptr_and_member_global.c
@@ -1,4 +1,5 @@
 // RUN: %libomptarget-compilexx-run-and-check-generic
+// REQUIRES: libc
 
 #include <omp.h>
 #include <stdio.h>
diff --git a/offload/test/mapping/map_structptr_and_member_local.c b/offload/test/mapping/map_structptr_and_member_local.c
index 9e59551ad3d6c..178fb89f2ed6a 100644
--- a/offload/test/mapping/map_structptr_and_member_local.c
+++ b/offload/test/mapping/map_structptr_and_member_local.c
@@ -1,4 +1,5 @@
 // RUN: %libomptarget-compilexx-run-and-check-generic
+// REQUIRES: libc
 
 #include <omp.h>
 #include <stdio.h>

>From 0e0551031bdae46d2de94a1e8b94d4c4a83f829a Mon Sep 17 00:00:00 2001
From: JP Lehr <JanPatrick.Lehr at amd.com>
Date: Thu, 28 Aug 2025 03:46:28 -0500
Subject: [PATCH 2/2] Format to follow precedent in other places.

---
 offload/test/mapping/map_ptr_and_star_global.c         | 1 +
 offload/test/mapping/map_ptr_and_star_local.c          | 1 +
 offload/test/mapping/map_ptr_and_subscript_global.c    | 1 +
 offload/test/mapping/map_ptr_and_subscript_local.c     | 1 +
 offload/test/mapping/map_structptr_and_member_global.c | 1 +
 offload/test/mapping/map_structptr_and_member_local.c  | 1 +
 6 files changed, 6 insertions(+)

diff --git a/offload/test/mapping/map_ptr_and_star_global.c b/offload/test/mapping/map_ptr_and_star_global.c
index b38502f4bab3c..869fb8ca9bc2d 100644
--- a/offload/test/mapping/map_ptr_and_star_global.c
+++ b/offload/test/mapping/map_ptr_and_star_global.c
@@ -1,4 +1,5 @@
 // RUN: %libomptarget-compilexx-run-and-check-generic
+
 // REQUIRES: libc
 
 #include <omp.h>
diff --git a/offload/test/mapping/map_ptr_and_star_local.c b/offload/test/mapping/map_ptr_and_star_local.c
index 64b673459184e..cc826b3c0290b 100644
--- a/offload/test/mapping/map_ptr_and_star_local.c
+++ b/offload/test/mapping/map_ptr_and_star_local.c
@@ -1,4 +1,5 @@
 // RUN: %libomptarget-compilexx-run-and-check-generic
+
 // REQUIRES: libc
 
 #include <omp.h>
diff --git a/offload/test/mapping/map_ptr_and_subscript_global.c b/offload/test/mapping/map_ptr_and_subscript_global.c
index cb1eafe4d0a13..839db068aa906 100644
--- a/offload/test/mapping/map_ptr_and_subscript_global.c
+++ b/offload/test/mapping/map_ptr_and_subscript_global.c
@@ -1,4 +1,5 @@
 // RUN: %libomptarget-compilexx-run-and-check-generic
+
 // REQUIRES: libc
 
 #include <omp.h>
diff --git a/offload/test/mapping/map_ptr_and_subscript_local.c b/offload/test/mapping/map_ptr_and_subscript_local.c
index cdd09b271e8bf..68ac9dc0917fc 100644
--- a/offload/test/mapping/map_ptr_and_subscript_local.c
+++ b/offload/test/mapping/map_ptr_and_subscript_local.c
@@ -1,4 +1,5 @@
 // RUN: %libomptarget-compilexx-run-and-check-generic
+
 // REQUIRES: libc
 
 #include <omp.h>
diff --git a/offload/test/mapping/map_structptr_and_member_global.c b/offload/test/mapping/map_structptr_and_member_global.c
index 74e79ebcf2ad0..960eea419964f 100644
--- a/offload/test/mapping/map_structptr_and_member_global.c
+++ b/offload/test/mapping/map_structptr_and_member_global.c
@@ -1,4 +1,5 @@
 // RUN: %libomptarget-compilexx-run-and-check-generic
+
 // REQUIRES: libc
 
 #include <omp.h>
diff --git a/offload/test/mapping/map_structptr_and_member_local.c b/offload/test/mapping/map_structptr_and_member_local.c
index 178fb89f2ed6a..bd759407ef09c 100644
--- a/offload/test/mapping/map_structptr_and_member_local.c
+++ b/offload/test/mapping/map_structptr_and_member_local.c
@@ -1,4 +1,5 @@
 // RUN: %libomptarget-compilexx-run-and-check-generic
+
 // REQUIRES: libc
 
 #include <omp.h>



More information about the llvm-commits mailing list