]> granicus.if.org Git - clang/commitdiff
Set the default ISA for OpenBSD/mips64 to MIPS III.
authorBrad Smith <brad@comstyle.com>
Tue, 6 Jan 2015 02:53:17 +0000 (02:53 +0000)
committerBrad Smith <brad@comstyle.com>
Tue, 6 Jan 2015 02:53:17 +0000 (02:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225241 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/openbsd.c

index e672d6c31154c279e9f4270a0e3085df011826c2..fb707f5c29f44034481521f8c7e16e74dee8851e 100644 (file)
@@ -977,6 +977,10 @@ void mips::getMipsCPUAndABI(const ArgList &Args,
     DefMips64CPU = "mips64r6";
   }
 
+  // MIPS3 is the default for mips64*-unknown-openbsd.
+  if (Triple.getOS() == llvm::Triple::OpenBSD)
+    DefMips64CPU = "mips3";
+
   if (Arg *A = Args.getLastArg(options::OPT_march_EQ,
                                options::OPT_mcpu_EQ))
     CPUName = A->getValue();
index d263f485bf2f0c5845189c2eb080a35c38279196..6abf040be06fbb2c2aa14edb659e64c118f623be 100644 (file)
@@ -8,6 +8,14 @@
 // CHECK-PG: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
 // CHECK-PG: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}gcrt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lgcc" "-lpthread_p" "-lc_p" "-lgcc" "{{.*}}crtend.o"
 
+// Check CPU type for MIPS64
+// RUN: %clang -target mips64-unknown-openbsd -### -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-MIPS64-CPU %s
+// RUN: %clang -target mips64el-unknown-openbsd -### -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-MIPS64EL-CPU %s
+// CHECK-MIPS64-CPU: "-target-cpu" "mips3"
+// CHECK-MIPS64EL-CPU: "-target-cpu" "mips3"
+
 // Check that the new linker flags are passed to OpenBSD
 // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -r %s -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-LD-R %s