]> granicus.if.org Git - clang/commitdiff
lit.cfg: Don't expand %ms_abi_triple to non-X86 triples
authorHans Wennborg <hans@hanshq.net>
Wed, 15 Jan 2014 01:08:42 +0000 (01:08 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 15 Jan 2014 01:08:42 +0000 (01:08 +0000)
This is a follow-up to r199260. On ARM hosts, we were attempting to run
tests with triples such as armv7l-unknown-win32. This expands that fix to
cover all non-x86 targets since we only support MS ABI on x86.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199280 91177308-0d34-0410-b5e6-96231b3b80d8

test/lit.cfg

index c2a991f298eaee5759f70d3eb27493c4259b1ccf..7f2d9eaf8725a938ce029b42b92f3e3d321de164 100644 (file)
@@ -241,17 +241,17 @@ def makeMSABITriple(triple):
     m = re.match(r'(\w+)-(\w+)-(\w+)', triple)
     if not m:
       lit_config.fatal("Could not turn '%s' into MS ABI triple" % triple)
-    isa = m.group(1)
-    vendor = m.group(2)
-    os = m.group(3)
-    if os.lower() == 'win32':
+    isa = m.group(1).lower()
+    vendor = m.group(2).lower()
+    os = m.group(3).lower()
+    if os == 'win32':
       # If the OS is win32, we're done.
       return triple
-    if "arm" in isa.lower():
-      # FIXME: Fix failures with arm*-*-win32.
-      isa = "i686"
-    # Otherwise, replace the OS part with Win32.
-    return isa + '-' + vendor + '-win32'
+    if isa.startswith('x86') or isa == 'amd64' or re.match(r'i\d86', isa): 
+      # For x86 ISAs, adjust the OS.
+      return isa + '-' + vendor + '-win32'
+    # -win32 is not supported for non-x86 targets; use a default.
+    return 'i686-pc-win32'
 
 config.substitutions.append( ('%clang_cc1', '%s -cc1 -internal-isystem %s'
                               % (config.clang,