Skip to content

Commit 8ecaac6

Browse files
author
Raúl Peñacoba Veigas
committed
Fix previous commit. Introduce _OMPSS_NANOS6 only if we define _OMPSS_2
1 parent c3f4cfc commit 8ecaac6

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

clang/lib/Frontend/InitPreprocessor.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,13 +1263,13 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
12631263
}
12641264

12651265
// OmpSs-2
1266-
if (LangOpts.OmpSs)
1266+
if (LangOpts.OmpSs) {
12671267
Builder.defineMacro("_OMPSS_2", "1");
1268-
if (LangOpts.OmpSsRuntimeName == std::string("libnodes"))
1269-
Builder.defineMacro("_OMPSS_2_NODES", "1");
1270-
else
1271-
Builder.defineMacro("_OMPSS_2_NANOS6", "1");
1272-
1268+
if (LangOpts.OmpSsRuntimeName == std::string("libnodes"))
1269+
Builder.defineMacro("_OMPSS_2_NODES", "1");
1270+
else
1271+
Builder.defineMacro("_OMPSS_2_NANOS6", "1");
1272+
}
12731273

12741274
// CUDA device path compilaton
12751275
if (LangOpts.CUDAIsDevice && !LangOpts.HIP) {

clang/test/OmpSs/Driver/driver.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44
// RUN: %clang %s -c -E -dM -fompss-2=libnodes | FileCheck --check-prefix=USING-OMPSS-2-NODES %s
55
// RUN: %clang %s -c -E -dM | FileCheck --check-prefix=NO-USING-OMPSS-2-NODES %s
66

7-
// RUN: %clang %s -c -E -dM -fompss-2=libnodes | FileCheck --check-prefix=USING-OMPSS-2-NANOS6 %s
7+
// RUN: %clang %s -c -E -dM -fompss-2=libnanos6 | FileCheck --check-prefix=USING-OMPSS-2-NANOS6 %s
88
// RUN: %clang %s -c -E -dM | FileCheck --check-prefix=NO-USING-OMPSS-2-NANOS6 %s
99

10+
11+
// USING-OMPSS-2: #define _OMPSS_2 1
12+
// NO-USING-OMPSS-2-NOT: #define _OMPSS_2
13+
1014
// USING-OMPSS-2-NODES: #define _OMPSS_2
1115
// USING-OMPSS-2-NODES: #define _OMPSS_2_NODES 1
1216
// NO-USING-OMPSS-2-NODES-NOT: #define _OMPSS_2

0 commit comments

Comments
 (0)