blob: 4374d6ecda21ad6153d98448e23b65cc0aac71f7 [file] [log] [blame]
Jonathan Peytonc76f9f02016-06-21 19:12:07 +00001// RUN: %libomp-compile-and-run
2#include <stdio.h>
3#include <omp.h>
4
5/*
6 * This test would hang when level instead of active level
7 * used to push task state.
8 */
9
10int main()
11{
12 // If num_threads is changed to a value greater than 1, then the test passes
13 #pragma omp parallel num_threads(1)
14 {
15 #pragma omp parallel
16 printf("Hello World from thread %d\n", omp_get_thread_num());
17 }
18
19 printf("omp_num_threads: %d\n", omp_get_max_threads());
20
21 #pragma omp parallel
22 {
23 #pragma omp master
24 #pragma omp task default(none)
25 {
26 printf("%d is executing this task\n", omp_get_thread_num());
27 }
28 }
29
30 printf("pass\n");
31 return 0;
32}