File tree 2 files changed +30
-0
lines changed 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -777,6 +777,11 @@ Driver::OpenMPRuntimeKind Driver::getOpenMPRuntime(const ArgList &Args) const {
777
777
Driver::OmpSsRuntimeKind Driver::getOmpSsRuntime (const ArgList &Args) const {
778
778
StringRef RuntimeName (CLANG_DEFAULT_OMPSS2_RUNTIME);
779
779
780
+ std::optional<std::string> OMPSS2Runtime =
781
+ llvm::sys::Process::GetEnv (" OMPSS2_RUNTIME" );
782
+ if (OMPSS2Runtime && !OMPSS2Runtime->empty ())
783
+ RuntimeName = OMPSS2Runtime.value ();
784
+
780
785
const Arg *A = Args.getLastArg (options::OPT_fompss_EQ);
781
786
if (A)
782
787
RuntimeName = A->getValue ();
@@ -790,6 +795,9 @@ Driver::OmpSsRuntimeKind Driver::getOmpSsRuntime(const ArgList &Args) const {
790
795
if (A)
791
796
Diag (diag::err_drv_unsupported_option_argument)
792
797
<< A->getSpelling () << A->getValue ();
798
+ else if (OMPSS2Runtime && !OMPSS2Runtime->empty ())
799
+ Diag (diag::err_drv_unsupported_option_argument)
800
+ << " -fompss-2=" << OMPSS2Runtime.value ();
793
801
else
794
802
// FIXME: We could use a nicer diagnostic here.
795
803
Diag (diag::err_drv_unsupported_opt) << " -fompss-2" ;
Original file line number Diff line number Diff line change 16
16
// CHECK2: clang: error: unsupported argument 'libasdf' to option '-fompss-2='
17
17
// CHECK3: clang: error: unsupported argument 'libasdf' to option '-fompss-2='
18
18
// CHECK3: clang: error: unsupported argument 'libasdf' to option '-fompss-2='
19
+
20
+ // OMPSS2_RUNTIME priority check
21
+
22
+ // CompileJob
23
+ // RUN: OMPSS2_RUNTIME=libkaka %clang -fompss-2 %s -c -### 2>&1 | FileCheck %s --check-prefix=CHECK4
24
+ // RUN: OMPSS2_RUNTIME=libkaka %clang -fompss-2=libasdf %s -c -### 2>&1 | FileCheck %s --check-prefix=CHECK5
25
+ // LinkJob
26
+ // RUN: touch %t.o
27
+ // RUN: OMPSS2_RUNTIME=libkaka %clang -fompss-2 %t.o -### 2>&1 | FileCheck %s --check-prefix=CHECK6
28
+ // RUN: OMPSS2_RUNTIME=libkaka %clang -fompss-2=libasdf %t.o -### 2>&1 | FileCheck %s --check-prefix=CHECK7
29
+ // CompileAndLinkJob
30
+ // RUN: OMPSS2_RUNTIME=libkaka %clang -fompss-2 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK8
31
+ // RUN: OMPSS2_RUNTIME=libkaka %clang -fompss-2=libasdf %s -### 2>&1 | FileCheck %s --check-prefix=CHECK9
32
+
33
+ // CHECK4: clang: error: unsupported argument 'libkaka' to option '-fompss-2='
34
+ // CHECK5: clang: error: unsupported argument 'libasdf' to option '-fompss-2='
35
+ // CHECK6: clang: error: unsupported argument 'libkaka' to option '-fompss-2='
36
+ // CHECK7: clang: error: unsupported argument 'libasdf' to option '-fompss-2='
37
+ // CHECK8: clang: error: unsupported argument 'libkaka' to option '-fompss-2='
38
+ // CHECK8: clang: error: unsupported argument 'libkaka' to option '-fompss-2='
39
+ // CHECK9: clang: error: unsupported argument 'libasdf' to option '-fompss-2='
40
+ // CHECK9: clang: error: unsupported argument 'libasdf' to option '-fompss-2='
You can’t perform that action at this time.
0 commit comments