aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2010-09-15 15:20:41 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2010-09-15 15:20:41 +0000
commite6334d84f7e45ff150475d9881d7be592fa326da (patch)
tree4a51013739d86b8014bbc7f8098f07af17733e3e
parent161b4c46a3ab2ab2c4086d6656cf365ae0f49a07 (diff)
downloadexternal_llvm-e6334d84f7e45ff150475d9881d7be592fa326da.zip
external_llvm-e6334d84f7e45ff150475d9881d7be592fa326da.tar.gz
external_llvm-e6334d84f7e45ff150475d9881d7be592fa326da.tar.bz2
llvmc: make -x work with unknown suffixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113972 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CompilerDriver/CompilationGraph.cpp5
-rw-r--r--test/LLVMC/C++/dg.exp2
-rw-r--r--test/LLVMC/C++/unknown_suffix.unk9
3 files changed, 13 insertions, 3 deletions
diff --git a/lib/CompilerDriver/CompilationGraph.cpp b/lib/CompilerDriver/CompilationGraph.cpp
index d0c0e15..0aecfa6 100644
--- a/lib/CompilerDriver/CompilationGraph.cpp
+++ b/lib/CompilerDriver/CompilationGraph.cpp
@@ -218,10 +218,11 @@ FindToolChain(const sys::Path& In, const std::string* ForceLanguage,
InputLanguagesSet& InLangs, const LanguageMap& LangMap) const {
// Determine the input language.
- const std::string* InLang = LangMap.GetLanguage(In);
+ const std::string* InLang = (ForceLanguage ? ForceLanguage
+ : LangMap.GetLanguage(In));
if (InLang == 0)
return 0;
- const std::string& InLanguage = (ForceLanguage ? *ForceLanguage : *InLang);
+ const std::string& InLanguage = *InLang;
// Add the current input language to the input language set.
InLangs.insert(InLanguage);
diff --git a/test/LLVMC/C++/dg.exp b/test/LLVMC/C++/dg.exp
index fc852e3..2093455 100644
--- a/test/LLVMC/C++/dg.exp
+++ b/test/LLVMC/C++/dg.exp
@@ -1,5 +1,5 @@
load_lib llvm.exp
if [ llvm_gcc_supports c++ ] then {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
+ RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{unk,ll,c,cpp}]]
}
diff --git a/test/LLVMC/C++/unknown_suffix.unk b/test/LLVMC/C++/unknown_suffix.unk
new file mode 100644
index 0000000..bf4aea2
--- /dev/null
+++ b/test/LLVMC/C++/unknown_suffix.unk
@@ -0,0 +1,9 @@
+// Test that the -x option works for files with unknown suffixes.
+// RUN: llvmc -x c++ %s -o %t
+// RUN: %abs_tmp | grep hello
+// XFAIL: vg
+#include <iostream>
+
+int main() {
+ std::cout << "hello" << '\n';
+}