projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0e051c0
)
[OpenMP] Fix the test case issue that printf cannot be used in target region for...
author
Shilei Tian
<i@tianshilei.me>
Thu, 4 Aug 2022 18:48:07 +0000
(14:48 -0400)
committer
Shilei Tian
<i@tianshilei.me>
Thu, 4 Aug 2022 18:48:48 +0000
(14:48 -0400)
openmp/libomptarget/test/offloading/test_libc.cpp
patch
|
blob
|
history
diff --git
a/openmp/libomptarget/test/offloading/test_libc.cpp
b/openmp/libomptarget/test/offloading/test_libc.cpp
index
cfccf47
..
66d73d7
100644
(file)
--- a/
openmp/libomptarget/test/offloading/test_libc.cpp
+++ b/
openmp/libomptarget/test/offloading/test_libc.cpp
@@
-6,16
+6,17
@@
extern "C" int printf(const char *, ...);
// std::equal is lowered to libc function memcmp.
void test_memcpy() {
-#pragma omp target
+ int r = 0;
+#pragma omp target map(from: r)
{
int x[2] = {0, 0};
int y[2] = {0, 0};
int z[2] = {0, 1};
bool eq1 = std::equal(x, x + 2, y);
bool eq2 = std::equal(x, x + 2, z);
- bool r = eq1 && !eq2;
- printf("memcmp: %s\n", r ? "PASS" : "FAIL");
+ r = eq1 && !eq2;
}
+ printf("memcmp: %s\n", r ? "PASS" : "FAIL");
}
int main(int argc, char *argv[]) {