diff options
author | Daniel Sanders <daniel.sanders@imgtec.com> | 2016-06-06 12:02:21 +0000 |
---|---|---|
committer | Daniel Sanders <daniel.sanders@imgtec.com> | 2016-06-06 12:02:21 +0000 |
commit | 0ca86fe84dc916b9af9c70c1d1163298e1928993 (patch) | |
tree | 23c6e17dca1e70ccc5a0f32ebf0c27dc61df9061 /clang/test/Driver/mips-abi.c | |
parent | 3528832930542732d9defefb97e242f03fb5bd5c (diff) | |
download | bcm5719-llvm-0ca86fe84dc916b9af9c70c1d1163298e1928993.tar.gz bcm5719-llvm-0ca86fe84dc916b9af9c70c1d1163298e1928993.zip |
[mips] The default ABI depends on the CPU not the Arch on MTI and IMG vendor triples.
Summary:
32-bit CPU's default to O32. 64-bit CPU's default to N64. The default CPU
(mips32r2/mips64r2) still depends on the arch so there's no functional
change when the CPU isn't specified but commands like:
clang -target mips-mti-linux-gnu -mips64r2
will now default to a 64-bit ABI like our gcc toolchains do* instead of
asserting in the backend**.
Other vendors (including Triple::UnknownVendor) still derive the default
ABI from the arch.
* Although not the same one as our gcc toolchains, clang has historically
defaulted to N64 where gcc defaults to N32.
** Mixing O32 and a 64-bit CPU causing assertions is a long-standing bug.
Reviewers: atanasyan
Subscribers: sdardis, cfe-commits
Differential Revision: http://reviews.llvm.org/D21016
llvm-svn: 271884
Diffstat (limited to 'clang/test/Driver/mips-abi.c')
-rw-r--r-- | clang/test/Driver/mips-abi.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/clang/test/Driver/mips-abi.c b/clang/test/Driver/mips-abi.c index e83a2cf40f0..1e7467cb478 100644 --- a/clang/test/Driver/mips-abi.c +++ b/clang/test/Driver/mips-abi.c @@ -6,9 +6,22 @@ // MIPS-DEF: "-target-abi" "o32" // // RUN: %clang -target mips64-linux-gnu -### -c %s 2>&1 \ -// RUN: | FileCheck -check-prefix=MIPS64-DEF %s -// MIPS64-DEF: "-target-cpu" "mips64r2" -// MIPS64-DEF: "-target-abi" "n64" +// RUN: | FileCheck -check-prefix=MIPS64R2-N64 %s +// RUN: %clang -target mips-img-linux-gnu -mips64r2 -### -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS64R2-N64 %s +// RUN: %clang -target mips-mti-linux-gnu -mips64r2 -### -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS64R2-N64 %s +// MIPS64R2-N64: "-target-cpu" "mips64r2" +// MIPS64R2-N64: "-target-abi" "n64" +// +// RUN: %clang -target mips64-linux-gnu -### -mips64r3 -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS64R3-N64 %s +// RUN: %clang -target mips-img-linux-gnu -mips64r3 -### -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS64R3-N64 %s +// RUN: %clang -target mips-mti-linux-gnu -mips64r3 -### -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS64R3-N64 %s +// MIPS64R3-N64: "-target-cpu" "mips64r3" +// MIPS64R3-N64: "-target-abi" "n64" // // RUN: %clang -target mips-linux-gnu -### -c %s \ // RUN: -mabi=32 2>&1 \ |