brintos

brintos / llvm-project-archived public Read only

0
0
Text · 556 B · 859c2da Raw
29 lines · cpp
1// RUN: %libomptarget-compilexx-run-and-check-generic2 3#include <algorithm>4 5extern "C" int printf(const char *, ...);6 7// std::equal is lowered to libc function memcmp.8void test_memcpy() {9  int r = 0;10#pragma omp target map(from : r)11  {12    int x[2] = {0, 0};13    int y[2] = {0, 0};14    int z[2] = {0, 1};15    bool eq1 = std::equal(x, x + 2, y);16    bool eq2 = std::equal(x, x + 2, z);17    r = eq1 && !eq2;18  }19  printf("memcmp: %s\n", r ? "PASS" : "FAIL");20}21 22int main(int argc, char *argv[]) {23  test_memcpy();24 25  return 0;26}27 28// CHECK: memcmp: PASS29