Index: openmp/libomptarget/test/jit/empty_kernel.inc =================================================================== --- /dev/null +++ openmp/libomptarget/test/jit/empty_kernel.inc @@ -0,0 +1,13 @@ + +#ifndef DIRECTIVE +#error DIRECTIVE should be defined +#endif + +int main() { +#pragma omp DIRECTIVE + {} +} + +// Check for an empty kernel (IR level) +// TARGET: define weak_odr {{.*}} void @__omp_offloading_{{.*}}_main +// TARGET-NEXT: ret void Index: openmp/libomptarget/test/jit/empty_kernel_target.c =================================================================== --- /dev/null +++ openmp/libomptarget/test/jit/empty_kernel_target.c @@ -0,0 +1,11 @@ +// clang-format off +// RUN: %libomptarget-compileopt-generic -DDIRECTIVE=target -fopenmp-target-jit +// RUN: env LIBOMPTARGET_JIT_PRE_OPT_IR_MODULE=%T/pre.ll \ +// RUN: %libomptarget-run-generic +// RUN: cat %T/pre.ll | %fcheck-plain-generic %S/empty_kernel.inc --check-prefix=TARGET +// clang-format on + +// UNSUPPORTED: x86_64-pc-linux-gnu +// UNSUPPORTED: x86_64-pc-linux-gnu-LTO + +#include "empty_kernel.inc" Index: openmp/libomptarget/test/jit/empty_kernel_target.cpp =================================================================== --- /dev/null +++ openmp/libomptarget/test/jit/empty_kernel_target.cpp @@ -0,0 +1,11 @@ +// clang-format off +// RUN: %libomptarget-compileoptxx-generic -DDIRECTIVE=target -fopenmp-target-jit +// RUN: env LIBOMPTARGET_JIT_PRE_OPT_IR_MODULE=%T/pre.ll \ +// RUN: %libomptarget-run-generic +// RUN: cat %T/pre.ll | %fcheck-plain-generic %S/empty_kernel.inc --check-prefix=TARGET +// clang-format on + +// UNSUPPORTED: x86_64-pc-linux-gnu +// UNSUPPORTED: x86_64-pc-linux-gnu-LTO + +#include "empty_kernel.inc" Index: openmp/libomptarget/test/jit/empty_kernel_target_teams.c =================================================================== --- /dev/null +++ openmp/libomptarget/test/jit/empty_kernel_target_teams.c @@ -0,0 +1,11 @@ +// clang-format off +// RUN: %libomptarget-compileopt-generic -DDIRECTIVE="target teams" -fopenmp-target-jit +// RUN: env LIBOMPTARGET_JIT_PRE_OPT_IR_MODULE=%T/pre.ll \ +// RUN: %libomptarget-run-generic +// RUN: cat %T/pre.ll | %fcheck-plain-generic %S/empty_kernel.inc --check-prefix=TARGET +// clang-format on + +// UNSUPPORTED: x86_64-pc-linux-gnu +// UNSUPPORTED: x86_64-pc-linux-gnu-LTO + +#include "empty_kernel.inc" Index: openmp/libomptarget/test/jit/empty_kernel_target_teams.cpp =================================================================== --- /dev/null +++ openmp/libomptarget/test/jit/empty_kernel_target_teams.cpp @@ -0,0 +1,11 @@ +// clang-format off +// RUN: %libomptarget-compileoptxx-generic -DDIRECTIVE="target teams" -fopenmp-target-jit +// RUN: env LIBOMPTARGET_JIT_PRE_OPT_IR_MODULE=%T/pre.ll \ +// RUN: %libomptarget-run-generic +// RUN: cat %T/pre.ll | %fcheck-plain-generic %S/empty_kernel.inc --check-prefix=TARGET +// clang-format on + +// UNSUPPORTED: x86_64-pc-linux-gnu +// UNSUPPORTED: x86_64-pc-linux-gnu-LTO + +#include "empty_kernel.inc" Index: openmp/libomptarget/test/lit.cfg =================================================================== --- openmp/libomptarget/test/lit.cfg +++ openmp/libomptarget/test/lit.cfg @@ -181,6 +181,8 @@ "%clang-" + libomptarget_target)) config.substitutions.append(("%fcheck-generic", config.libomptarget_filecheck + " %s")) + config.substitutions.append(("%fcheck-plain-generic", + config.libomptarget_filecheck)) config.substitutions.append(("%libomptarget-compilexx-run-and-check-" + \