You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
libcxx
libcxxabi
libunwind
lld
lldb
llvm
openmp
cmake
libomptarget
offload
runtime
cmake
doc
src
test
api
atomic
barrier
critical
env
flush
lock
master
omp_master.c
omp_master_3.c
misc_bugs
ompt
parallel
tasking
threadprivate
worksharing
CMakeLists.txt
lit.cfg
lit.site.cfg.in
omp_my_sleep.h
omp_testsuite.h
tools
.clang-format
CMakeLists.txt
README.txt
www
.arcconfig
.gitignore
CMakeLists.txt
CREDITS.txt
LICENSE.txt
README.rst
polly
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
39 lines
622 B
C
39 lines
622 B
C
![]() |
// RUN: %libomp-compile-and-run
|
||
|
#include <stdio.h>
|
||
|
#include "omp_testsuite.h"
|
||
|
|
||
|
int test_omp_master()
|
||
|
{
|
||
|
int nthreads;
|
||
|
int executing_thread;
|
||
|
|
||
|
nthreads = 0;
|
||
|
executing_thread = -1;
|
||
|
|
||
|
#pragma omp parallel
|
||
|
{
|
||
|
#pragma omp master
|
||
|
{
|
||
|
#pragma omp critical
|
||
|
{
|
||
|
nthreads++;
|
||
|
}
|
||
|
executing_thread = omp_get_thread_num();
|
||
|
} /* end of master*/
|
||
|
} /* end of parallel*/
|
||
|
return ((nthreads == 1) && (executing_thread == 0));
|
||
|
}
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
int i;
|
||
|
int num_failed=0;
|
||
|
|
||
|
for(i = 0; i < REPETITIONS; i++) {
|
||
|
if(!test_omp_master()) {
|
||
|
num_failed++;
|
||
|
}
|
||
|
}
|
||
|
return num_failed;
|
||
|
}
|