diff --git a/test/smoke-fails/selfmap/Makefile b/test/smoke-fails/selfmap/Makefile new file mode 100644 index 000000000..29844d8af --- /dev/null +++ b/test/smoke-fails/selfmap/Makefile @@ -0,0 +1,22 @@ +include ../../Makefile.defs + +TESTNAME = selfmap +TESTSRC_MAIN = selfmap.cpp +TESTSRC_AUX = +TESTSRC_ALL = $(TESTSRC_MAIN) $(TESTSRC_AUX) + +RUNCMD_COPY = HSA_XNACK=0 ./$(TESTNAME) +RUNCMD_AUTOZERO = HSA_XNACK=1 ./$(TESTNAME) + + +CLANG = clang++ +OMP_BIN = $(AOMP)/bin/$(CLANG) +CC = $(OMP_BIN) $(VERBOSE) +#-ccc-print-phases +#"-\#\#\#" + +include ../Makefile.rules + +run: $(TESTNAME) + $(RUNCMD_COPY) + $(RUNCMD_AUTOZERO) \ No newline at end of file diff --git a/test/smoke-fails/selfmap/selfmap.cpp b/test/smoke-fails/selfmap/selfmap.cpp new file mode 100644 index 000000000..cbed1ddac --- /dev/null +++ b/test/smoke-fails/selfmap/selfmap.cpp @@ -0,0 +1,24 @@ +#include +#include + +#define N 100 + +int main() { + int x = 0; + +#pragma omp target teams distribute parallel for map(self : x) + { + for (unsigned i = 0; i < N; ++i) +#pragma omp atomic update + x++; + } + +#pragma omp target teams distribute parallel for map(self, tofrom : x) + { + for (unsigned i = 0; i < N; ++i) +#pragma omp atomic update + x++; + } + + return 0; +} \ No newline at end of file diff --git a/test/smoke-fails/selfmap_map_mixed/Makefile b/test/smoke-fails/selfmap_map_mixed/Makefile new file mode 100644 index 000000000..9fcb83ff3 --- /dev/null +++ b/test/smoke-fails/selfmap_map_mixed/Makefile @@ -0,0 +1,22 @@ +include ../../Makefile.defs + +TESTNAME = selfmap_map_mixed +TESTSRC_MAIN = selfmap_map_mixed.cpp +TESTSRC_AUX = +TESTSRC_ALL = $(TESTSRC_MAIN) $(TESTSRC_AUX) + +RUNCMD_COPY = HSA_XNACK=0 ./$(TESTNAME) +RUNCMD_AUTOZERO = HSA_XNACK=1 ./$(TESTNAME) + + +CLANG = clang++ +OMP_BIN = $(AOMP)/bin/$(CLANG) +CC = $(OMP_BIN) $(VERBOSE) +#-ccc-print-phases +#"-\#\#\#" + +include ../Makefile.rules + +run: $(TESTNAME) + $(RUNCMD_COPY) + $(RUNCMD_AUTOZERO) \ No newline at end of file diff --git a/test/smoke-fails/selfmap_map_mixed/selfmap_map_mixed.cpp b/test/smoke-fails/selfmap_map_mixed/selfmap_map_mixed.cpp new file mode 100644 index 000000000..5c47d5c62 --- /dev/null +++ b/test/smoke-fails/selfmap_map_mixed/selfmap_map_mixed.cpp @@ -0,0 +1,13 @@ +int main() { + int x = 0; +#pragma omp target data map(self : x) + { +#pragma omp target map(x) + { +// unspecified behaviour. It is not clear what x is used. Maybe a warning should +// be issued to inform the programmer. +#pragma omp atomic update + x++; + } + } +} \ No newline at end of file