[Openmp-commits] [openmp] 3f229f4 - [OpenMP][Tests][NFC] Actually check for test outcome

Joachim Protze via Openmp-commits openmp-commits at lists.llvm.org
Mon Oct 25 09:23:24 PDT 2021


Author: Joachim Protze
Date: 2021-10-25T18:20:12+02:00
New Revision: 3f229f42b796df33770184cdb9f2f4b5d15db796

URL: https://github.com/llvm/llvm-project/commit/3f229f42b796df33770184cdb9f2f4b5d15db796
DIFF: https://github.com/llvm/llvm-project/commit/3f229f42b796df33770184cdb9f2f4b5d15db796.diff

LOG: [OpenMP][Tests][NFC] Actually check for test outcome

The CHECK: line in the test had no effect, because the test does not
pipe to FileCheck. Since the test only checks for a single value,
encode the result in the return value of the test.

Added: 
    

Modified: 
    openmp/runtime/test/tasking/detach_nested_task.c

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/test/tasking/detach_nested_task.c b/openmp/runtime/test/tasking/detach_nested_task.c
index bb0847409c58..7ed65d43ee18 100644
--- a/openmp/runtime/test/tasking/detach_nested_task.c
+++ b/openmp/runtime/test/tasking/detach_nested_task.c
@@ -15,6 +15,7 @@
 
 #include <omp.h>
 #include <stdio.h>
+#include "omp_my_sleep.h"
 
 int *buf;
 
@@ -29,6 +30,7 @@ int foo(int n)
         #pragma omp task firstprivate(event,i,j,n) shared(ret) default(none) depend(out:ret)
         {
           //printf("Task %i, %i: %i\n", i, j, omp_get_thread_num());
+          my_sleep(.01);
           #pragma omp atomic
             ret++;
 #if _OPENMP
@@ -51,12 +53,11 @@ int foo(int n)
 int main()
 {
   int ret;
-#pragma omp parallel
+#pragma omp parallel num_threads(4)
 #pragma omp master
   {
     ret = foo(8);
   }
   printf("%i\n", ret);
-  //CHECK: 64
-  return 0;
+  return !(ret == 64);
 }


        


More information about the Openmp-commits mailing list