aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-09-07 10:30:32 -0400
committerJack Lloyd <[email protected]>2017-09-07 10:30:32 -0400
commit37f238eb7655f881526ab0bf4b8cdad96827cd4c (patch)
tree5ebaae3e31a3921ea697bb0b283ddda92d27d478 /src
parentf3d2b1b68592ce11da07129e8f6afa69a094bf14 (diff)
parent2f4cfb3f941166232fb5ecd85b8f30f0bf30d337 (diff)
Merge GH #1190 Correct Apple clang version detection for XCode 9
Diffstat (limited to 'src')
-rwxr-xr-xsrc/scripts/python_unittests.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/scripts/python_unittests.py b/src/scripts/python_unittests.py
index fff32e03f..1df35f0cd 100755
--- a/src/scripts/python_unittests.py
+++ b/src/scripts/python_unittests.py
@@ -96,6 +96,20 @@ Candidate multilib: .;@m32
Selected multilib: .;@m32"""
self.assertEqual(detector.version_from_compiler_output(compiler_out), "3.7")
+ def test_clang_version_appleclang(self):
+ detector = CompilerDetector("clang", "clang++", "darwin")
+ compiler_out = """Apple LLVM version 8.1.0 (clang-802.0.42)
+Target: x86_64-apple-darwin16.7.0
+Thread model: posix
+InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin"""
+ self.assertEqual(detector.version_from_compiler_output(compiler_out), "3.9")
+
+ compiler_out = """Apple LLVM version 9.0.0 (clang-900.0.35)
+Target: x86_64-apple-darwin16.7.0
+Thread model: posix
+InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin"""
+ self.assertEqual(detector.version_from_compiler_output(compiler_out), "4.0")
+
def test_msvc_version(self):
detector = CompilerDetector("msvc", "cl.exe", "windows")
compiler_out = """msvc_version.c