[Openmp-commits] [openmp] [NFC][OpenMP][Flang] Add smoke test for omp target parallel (PR #77579)
Dominik Adamski via Openmp-commits
openmp-commits at lists.llvm.org
Wed Jan 10 02:47:19 PST 2024
https://github.com/DominikAdamski created https://github.com/llvm/llvm-project/pull/77579
Added test which proves that end-to-end compilation of omp target parallel costruct is successful for Flang compiler.
>From c44e0ad1a82e78a0604d83b6b16fb765844484ef Mon Sep 17 00:00:00 2001
From: Dominik Adamski <dominik.adamski at amd.com>
Date: Fri, 27 Oct 2023 13:21:46 -0500
Subject: [PATCH] [NFC][OpenMP][Flang] Add smoke test for omp target parallel
Added test which proves that end-to-end compilation of omp target
parallel costruct is successful for Flang compiler.
---
.../fortran/basic-target-parallel-region.f90 | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 openmp/libomptarget/test/offloading/fortran/basic-target-parallel-region.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/basic-target-parallel-region.f90 b/openmp/libomptarget/test/offloading/fortran/basic-target-parallel-region.f90
new file mode 100644
index 00000000000000..54341f7c40ff3b
--- /dev/null
+++ b/openmp/libomptarget/test/offloading/fortran/basic-target-parallel-region.f90
@@ -0,0 +1,21 @@
+! Basic offloading test with a target region
+! REQUIRES: flang
+! UNSUPPORTED: nvptx64-nvidia-cuda-LTO
+! UNSUPPORTED: aarch64-unknown-linux-gnu
+! UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
+! UNSUPPORTED: x86_64-pc-linux-gnu
+! UNSUPPORTED: x86_64-pc-linux-gnu-LTO
+
+! RUN: %libomptarget-compile-fortran-run-and-check-generic
+program main
+ use omp_lib
+ integer :: x
+
+ !$omp target parallel map(from: x)
+ x = omp_get_num_threads()
+ !$omp end target parallel
+ print *,"parallel = ", (x .ne. 1)
+
+end program main
+
+! CHECK: parallel = T
More information about the Openmp-commits
mailing list