Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Preprocessor / openmp-macro-expansion.c
bloba83512b5920a34699da3f40c53e71023e0ab67b0
1 // RUN: %clang_cc1 -fopenmp -E -o - %s 2>&1 | FileCheck %s
3 // This is to make sure the pragma name is not expanded!
4 #define omp (0xDEADBEEF)
6 #define N 2
7 #define M 1
8 #define E N>
10 #define map_to_be_expanded(x) map(tofrom:x)
11 #define sched_to_be_expanded(x,s) schedule(x,s)
12 #define reda_to_be_expanded(x) reduction(+:x)
13 #define redb_to_be_expanded(x,op) reduction(op:x)
15 void foo(int *a, int *b) {
16 //CHECK: omp target map(a[0:2]) map(tofrom:b[0:2*1])
17 #pragma omp target map(a[0:N]) map_to_be_expanded(b[0:2*M])
19 int reda;
20 int redb;
21 //CHECK: omp parallel for schedule(static,2> >1) reduction(+:reda) reduction(*:redb)
22 #pragma omp parallel for sched_to_be_expanded(static, E>1) \
23 reda_to_be_expanded(reda) redb_to_be_expanded(redb,*)
24 for (int i = 0; i < N; ++i) {
25 reda += a[i];
26 redb += b[i];
28 a[0] = reda;
29 b[0] = redb;