[RISCV][VLOPT] Add vector narrowing integer right shift instructions to isSupportedIn...
[llvm-project.git] / offload / test / offloading / weak.c
blobca81db958356b2e310c911dc5d5393cb928b24ca
1 // RUN: %libomptarget-compile-generic -DA -c -o %t-a.o
2 // RUN: %libomptarget-compile-generic -DB -c -o %t-b.o
3 // RUN: %libomptarget-compile-generic %t-a.o %t-b.o && \
4 // RUN: %libomptarget-run-generic | %fcheck-generic
6 #if defined(A)
7 __attribute__((weak)) int x = 999;
8 #pragma omp declare target to(x)
9 #elif defined(B)
10 int x = 42;
11 #pragma omp declare target to(x)
12 __attribute__((weak)) int y = 42;
13 #pragma omp declare target to(y)
14 #else
16 #include <stdio.h>
18 extern int x;
19 #pragma omp declare target to(x)
20 extern int y;
21 #pragma omp declare target to(y)
23 int main() {
24 x = 0;
26 #pragma omp target update from(x)
27 #pragma omp target update from(y)
29 // CHECK: PASS
30 if (x == 42 && y == 42)
31 printf("PASS\n");
33 #endif