| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| // RUN: %libomp-cxx-compile | ||
| // RUN: %libomp-run | ||
|
|
||
| // XFAIL: irbuilder | ||
|
|
||
| #include <stddef.h> | ||
| #include <stdio.h> | ||
| #include <omp.h> | ||
|
|
||
| struct Destructible { | ||
| int &Ref; | ||
| int Count; | ||
| Destructible(int &Ref, int Count) : Ref(Ref), Count(Count) {} | ||
| ~Destructible() { Ref += Count; } | ||
| }; | ||
|
|
||
| int main() { | ||
| int common = 0; | ||
| int result[2] = {0, 0}; | ||
|
|
||
| Destructible dtor1{common, 1}; | ||
|
|
||
| #pragma omp parallel num_threads(2) | ||
| { | ||
| int tid = omp_get_thread_num(); | ||
| Destructible dtor2{result[tid], 1}; | ||
| } | ||
|
|
||
| if (common == 0 && result[0] == 1 && result[1] == 1) { | ||
| printf("SUCCESS\n"); | ||
| return EXIT_SUCCESS; | ||
| } | ||
| printf("FAILED (%d, %d, %d)\n", common, result[0], result[1]); | ||
| return EXIT_FAILURE; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| // RUN: %libomp-compile-and-run | ||
| // XFAIL: irbuilder | ||
|
|
||
| #include <stdio.h> | ||
| #include "omp_testsuite.h" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // RUN: %libomp-compile | ||
| // RUN: %libomp-run | ||
|
|
||
| // XFAIL: irbuilder | ||
|
|
||
| #include <stddef.h> | ||
| #include <stdio.h> | ||
| #include <omp.h> | ||
|
|
||
| int main() { | ||
| int result[] = {0, 0}; | ||
|
|
||
| #pragma omp parallel num_threads(2) | ||
| { | ||
| int tid = omp_get_thread_num(); | ||
| result[tid] += 1; | ||
| goto cont; | ||
|
|
||
| orphaned: | ||
| result[tid] += 2; | ||
| printf("Never executed\n"); | ||
|
|
||
| cont: | ||
| result[tid] += 4; | ||
| } | ||
|
|
||
| if (result[0] == 5 && result[1] == 5) { | ||
| printf("SUCCESS\n"); | ||
| return EXIT_SUCCESS; | ||
| } | ||
|
|
||
| printf("FAILED\n"); | ||
| return EXIT_FAILURE; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| // RUN: %libomp-compile-and-run | ||
| // XFAIL: irbuilder | ||
|
|
||
| #include <stdio.h> | ||
| #include "omp_testsuite.h" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| // RUN: %libomp-compile-and-run | ||
| // UNSUPPORTED: irbuilder | ||
|
|
||
| #include <stdio.h> | ||
| #include "omp_testsuite.h" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| // RUN: %libomp-cxx-compile-and-run | ||
| // XFAIL: irbuilder | ||
|
|
||
| #include <omp.h> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| // RUN: %libomp-cxx-compile-and-run | ||
| // XFAIL: irbuilder | ||
|
|
||
| #include <stdio.h> | ||
| #include <omp.h> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| // RUN: %libomp-cxx-compile-and-run | ||
| // XFAIL: irbuilder | ||
|
|
||
| #include <stdio.h> | ||
| #include <omp.h> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| // RUN: %libomp-cxx-compile-and-run | ||
| // XFAIL: irbuilder | ||
|
|
||
| #include <stdio.h> | ||
| #include <omp.h> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| // RUN: %libomp-cxx-compile-and-run | ||
| // XFAIL: irbuilder | ||
|
|
||
| #include <stdio.h> | ||
| #include <omp.h> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| // RUN: %libomp-compile-and-run | ||
| // XFAIL: irbuilder | ||
|
|
||
| #include <stdio.h> | ||
| #include <stdlib.h> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // RUN: %libomp-compile | ||
| // RUN: %libomp-run | ||
|
|
||
| #include <stddef.h> | ||
| #include <stdio.h> | ||
| #include <omp.h> | ||
|
|
||
| int main() { | ||
| int result[2] = {0, 0}; | ||
|
|
||
| #pragma omp parallel num_threads(2) | ||
| { | ||
| int tid = omp_get_thread_num(); | ||
| #pragma omp for schedule(static) | ||
| for (int i = 0; i < 6; i += 1) | ||
| result[tid] += 1 << i; | ||
| } | ||
|
|
||
| if (result[0] == 1 + 2 + 4 && result[1] == 8 + 16 + 32) { | ||
| printf("SUCCESS\n"); | ||
| return EXIT_SUCCESS; | ||
| } | ||
| printf("FAILED\n"); | ||
| return EXIT_FAILURE; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // RUN: %libomp-compile | ||
| // RUN: %libomp-run | ||
|
|
||
| #include <stddef.h> | ||
| #include <stdio.h> | ||
| #include <omp.h> | ||
|
|
||
| int main() { | ||
| int result[2] = {0, 0}; | ||
|
|
||
| #pragma omp parallel num_threads(2) | ||
| { | ||
| int tid = omp_get_thread_num(); | ||
| #pragma omp for schedule(static, 3) | ||
| for (int i = 0; i < 10; i += 1) | ||
| result[tid] += 1 << i; | ||
| } | ||
|
|
||
| if (result[0] == 1 + 2 + 4 + 64 + 128 + 256 && | ||
| result[1] == 8 + 16 + 32 + 512) { | ||
| printf("SUCCESS\n"); | ||
| return EXIT_SUCCESS; | ||
| } | ||
| printf("FAILED\n"); | ||
| return EXIT_FAILURE; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| // RUN: %libomp-compile-and-run | ||
| // XFAIL: irbuilder | ||
|
|
||
| #include <stdio.h> | ||
| #include "omp_testsuite.h" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| // RUN: %libomp-compile-and-run | ||
| // UNSUPPORTED: irbuilder | ||
|
|
||
| #include <stdio.h> | ||
| #include "omp_testsuite.h" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| // RUN: %libomp-compile-and-run | ||
| // UNSUPPORTED: irbuilder | ||
|
|
||
| #include <stdio.h> | ||
| #include "omp_testsuite.h" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| // RUN: %libomp-compile-and-run | ||
| // UNSUPPORTED: irbuilder | ||
|
|
||
| #include <stdio.h> | ||
| #include "omp_testsuite.h" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| // RUN: %libomp-compile-and-run | ||
| // XFAIL: irbuilder | ||
|
|
||
| #include <stdio.h> | ||
| #include "omp_testsuite.h" | ||
|
|
||
|
|
||