Files
graphene/LibOS/shim/test/regression/openmp.c
Dmitrii Kuvaiskii 84ec50a2aa [LibOS/regression] Add OpenMP simple for-loop test
Previously, OpenMP apps failed to run under Graphene-SGX because it did
not support raw system calls (used inside of OpenMP lib, in particular
the futex() syscall). Since recently, Graphene-SGX has support for raw
syscall execution. This commit adds a test showing that OpenMP works.
2019-06-30 23:37:21 +02:00

16 lines
284 B
C

/* build with: gcc -fopenmp openmp-test.c -o openmp-test */
#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
int v[10];
int main(void) {
#pragma omp parallel for
for (int i=0; i<10; i++)
v[i] = i;
printf("first: %d, last: %d\n", v[0], v[9]);
return 0;
}