[Openmp-commits] [openmp] r277730 - Add test case for nested creation of tasks

Jonas Hahnfeld via Openmp-commits openmp-commits at lists.llvm.org
Thu Aug 4 07:55:56 PDT 2016


Author: hahnfeld
Date: Thu Aug  4 09:55:56 2016
New Revision: 277730

URL: http://llvm.org/viewvc/llvm-project?rev=277730&view=rev
Log:
Add test case for nested creation of tasks

For discussion in D23115

Added:
    openmp/trunk/runtime/test/tasking/nested_task_creation.c

Added: openmp/trunk/runtime/test/tasking/nested_task_creation.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/test/tasking/nested_task_creation.c?rev=277730&view=auto
==============================================================================
--- openmp/trunk/runtime/test/tasking/nested_task_creation.c (added)
+++ openmp/trunk/runtime/test/tasking/nested_task_creation.c Thu Aug  4 09:55:56 2016
@@ -0,0 +1,35 @@
+// RUN: %libomp-compile-and-run
+#include <stdio.h>
+#include <omp.h>
+#include "omp_my_sleep.h"
+
+/*
+ * This test creates tasks that themselves create a new task.
+ * The runtime has to take care that they are correctly freed.
+ */
+
+int main()
+{
+  #pragma omp task
+  {
+    #pragma omp task
+    {
+      my_sleep( 0.1 );
+    }
+  }
+
+  #pragma omp parallel num_threads(2)
+  {
+    #pragma omp single
+    #pragma omp task
+    {
+      #pragma omp task
+      {
+        my_sleep( 0.1 );
+      }
+    }
+  }
+
+  printf("pass\n");
+  return 0;
+}




More information about the Openmp-commits mailing list