[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / openmp / libomptarget / test / libc / fwrite.c
blob7ffb449fee6672ef860fc716cd6243f4231324a3
1 // RUN: %libomptarget-compile-run-and-check-generic
3 // REQUIRES: libc
5 #include <assert.h>
6 #include <stdio.h>
8 #pragma omp declare target to(stdout)
10 int main() {
11 int r = 0;
12 // CHECK: PASS
13 #pragma omp target map(from : r)
14 { r = fwrite("PASS\n", 1, sizeof("PASS\n") - 1, stdout); }
15 assert(r == sizeof("PASS\n") - 1 && "Incorrect number of bytes written");
17 // CHECK: PASS
18 #pragma omp target map(from : r) nowait
19 { r = fwrite("PASS\n", 1, 5, stdout); }
20 #pragma omp taskwait
21 assert(r == sizeof("PASS\n") - 1 && "Incorrect number of bytes written");