Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions offload/test/offloading/disable_default_device.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// RUN: %libomptarget-compile-generic
// RUN: env OMP_TARGET_OFFLOAD=disabled %libomptarget-run-generic 2>&1 |
Copy link
Member

@Meinersbur Meinersbur Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is nobody testing this? Fails unconditionally with

# shell parser error on RUN: at line 2: env OMP_TARGET_OFFLOAD=disabled /home/meinersbur/src/llvm/work/release/runtimes/runtimes-bins/offload/test/x86_64-unknown-linux-gnu-LTO/offloading/Output/disable_default_device.c.tmp 2>&1 |

FileCheck %s is missing at the end of the line

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, didn't catch that. The OpenMP testing situation is a travesty and has been for several years.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow clang-format added a new line and break the added test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// %fcheck-generic

#include <omp.h>
#include <stdio.h>

// Sanity checks to make sure that this works and is thread safe.
int main() {
// CHECK: number of devices 0
printf("number of devices %d\n", omp_get_num_devices());
// CHECK:initial device 0
printf("initial device %d\n", omp_get_initial_device());
// CHECK:default device 0
printf("default device %d\n", omp_get_default_device());
// CHECK: PASS
if (omp_get_initial_device() == omp_get_default_device()) {
printf("PASS\n");
return 0;
}
return 1;
}
Loading