diff options
| author | Daniel Sanders <daniel.sanders@imgtec.com> | 2016-06-14 08:58:50 +0000 |
|---|---|---|
| committer | Daniel Sanders <daniel.sanders@imgtec.com> | 2016-06-14 08:58:50 +0000 |
| commit | 32b2d6b1602b4192476935eb0004c78f18d26a34 (patch) | |
| tree | d0a6f91f46d0632e090682fc1fe1fee518f600e1 /clang/test | |
| parent | bae1d89e4513c35b58e26bce2380761de0fbdbe4 (diff) | |
| download | bcm5719-llvm-32b2d6b1602b4192476935eb0004c78f18d26a34.tar.gz bcm5719-llvm-32b2d6b1602b4192476935eb0004c78f18d26a34.zip | |
[mips] Defer validity check for CPU/ABI pairs and improve error message for invalid cases.
Summary:
The validity of ABI/CPU pairs is no longer checked on the fly but is
instead checked after initialization. As a result, invalid CPU/ABI pairs
can be reported as being known but invalid instead of being unknown. For
example, we now emit:
error: ABI 'n32' is not supported on CPU 'mips32r2'
instead of:
error: unknown target ABI 'n64'
Reviewers: atanasyan
Subscribers: sdardis, cfe-commits
Differential Revision: http://reviews.llvm.org/D21023
llvm-svn: 272645
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Driver/mips-abi.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/clang/test/Driver/mips-abi.c b/clang/test/Driver/mips-abi.c index 1e7467cb478..8e3f7c0cd12 100644 --- a/clang/test/Driver/mips-abi.c +++ b/clang/test/Driver/mips-abi.c @@ -1,9 +1,18 @@ // Check passing Mips ABI options to the backend. // // RUN: %clang -target mips-linux-gnu -### -c %s 2>&1 \ -// RUN: | FileCheck -check-prefix=MIPS-DEF %s -// MIPS-DEF: "-target-cpu" "mips32r2" -// MIPS-DEF: "-target-abi" "o32" +// RUN: | FileCheck -check-prefix=MIPS32R2-O32 %s +// RUN: %clang -target mips64-linux-gnu -mips32r2 -mabi=32 -### -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS32R2-O32 %s +// MIPS32R2-O32: "-target-cpu" "mips32r2" +// MIPS32R2-O32: "-target-abi" "o32" +// +// FIXME: This is a valid combination of options but we reject it at the moment +// because the backend can't handle it. +// RUN: not %clang -target mips-linux-gnu -c %s \ +// RUN: -march=mips64r2 -mabi=32 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS64R2-O32 %s +// MIPS64R2-O32: error: ABI 'o32' is not supported on CPU 'mips64r2' // // RUN: %clang -target mips64-linux-gnu -### -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS64R2-N64 %s @@ -11,6 +20,8 @@ // 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 +// RUN: %clang -target mips-linux-gnu -mips64r2 -mabi=64 -### -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS64R2-N64 %s // MIPS64R2-N64: "-target-cpu" "mips64r2" // MIPS64R2-N64: "-target-abi" "n64" // @@ -114,7 +125,7 @@ // RUN: not %clang -target mips-linux-gnu -c %s \ // RUN: -march=p5600 -mabi=64 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ARCH-P5600-N64 %s -// MIPS-ARCH-P5600-N64: error: unknown target ABI 'n64' +// MIPS-ARCH-P5600-N64: error: ABI 'n64' is not supported on CPU 'p5600' // // RUN: %clang -target mips-linux-gnu -### -c %s \ // RUN: -march=mips64 2>&1 \ @@ -143,7 +154,7 @@ // RUN: not %clang -target mips64-linux-gnu -c %s \ // RUN: -march=mips32 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ARCH-6432 %s -// MIPS-ARCH-6432: error: unknown target CPU 'mips32' +// MIPS-ARCH-6432: error: ABI 'n64' is not supported on CPU 'mips32' // // RUN: not %clang -target mips-linux-gnu -c %s \ // RUN: -march=unknown 2>&1 \ |

