[Openmp-commits] [PATCH] D101315: [OpenMP][libomptarget][test] Separate lit tests for different offloading targets

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Apr 26 13:18:26 PDT 2021


protze.joachim updated this revision to Diff 340618.
protze.joachim added a comment.

The majority of tests has 5 identical RUN lines, which just differ in the triple-suffix. These 5 identical lines fold into the generic RUN line like I showed for private_mappings.c
The code I added in lit.cfg effectively makes the generic RUN line an alias for the selected specific RUN line.
I'm not sure, what special handling for nvptx you have in mind.

Tests in `unified_shared_memory` have 4 RUN lines and omit a nvptx line. 
In these tests, I would also use the generic RUN line and mark `nvptx64-nvidia-cuda` as UNSUPPORTED or XFAIL. I just added api.c and close_enter_exit.c to showcase the changes.
This demonstrates, how you would use UNSUPPORTED / XFAIL for specific target triples.

When I run the libomptarget-nvptx64-nvidia-cuda tests, the output will contain:

  $ make check-libomptarget-nvptx64-nvidia-cuda
  Unsupported Tests (1):
    libomptarget :: nvptx64-nvidia-cuda :: unified_shared_memory/api.c
  
  ********************
  Expectedly Failed Tests (1):
    libomptarget :: nvptx64-nvidia-cuda :: unified_shared_memory/close_enter_exit.c

UNSUPPORTED will not even try to run the test for the specified target. XFAIL will try and expect to fail.
I prefer XFAIL if there is a chance, that the test might succeed in the future, so that we remember to activate a test once the test case is supported. 
I use UNSUPPORTED in two cases

- if there is no chance, the test will ever work with this feature (like some clauses/directives are just not available in older clang).
- if a specific test was fixed between minor releases (e.g. fail with clang/11.0, succeeds with clang/11.1)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101315/new/

https://reviews.llvm.org/D101315

Files:
  openmp/libomptarget/test/CMakeLists.txt
  openmp/libomptarget/test/lit.cfg
  openmp/libomptarget/test/lit.site.cfg.in
  openmp/libomptarget/test/mapping/private_mapping.c
  openmp/libomptarget/test/unified_shared_memory/api.c
  openmp/libomptarget/test/unified_shared_memory/close_enter_exit.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101315.340618.patch
Type: text/x-patch
Size: 7613 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210426/88efe5b5/attachment.bin>


More information about the Openmp-commits mailing list