diff options
| author | Brad Smith <brad@comstyle.com> | 2015-01-06 02:53:17 +0000 |
|---|---|---|
| committer | Brad Smith <brad@comstyle.com> | 2015-01-06 02:53:17 +0000 |
| commit | ba26f586a09bada263d08979dba9d8a07bc30e94 (patch) | |
| tree | aa3619f113f6abbb799ee8a0d87854a220adebd2 | |
| parent | 0b576b377f8b3bc2166179b9d141c4237725fdf7 (diff) | |
| download | bcm5719-llvm-ba26f586a09bada263d08979dba9d8a07bc30e94.tar.gz bcm5719-llvm-ba26f586a09bada263d08979dba9d8a07bc30e94.zip | |
Set the default ISA for OpenBSD/mips64 to MIPS III.
llvm-svn: 225241
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 4 | ||||
| -rw-r--r-- | clang/test/Driver/openbsd.c | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index e672d6c3115..fb707f5c29f 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -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(); diff --git a/clang/test/Driver/openbsd.c b/clang/test/Driver/openbsd.c index d263f485bf2..6abf040be06 100644 --- a/clang/test/Driver/openbsd.c +++ b/clang/test/Driver/openbsd.c @@ -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 |

