diff options
| author | Simon Dardis <simon.dardis@imgtec.com> | 2017-07-11 21:28:36 +0000 |
|---|---|---|
| committer | Simon Dardis <simon.dardis@imgtec.com> | 2017-07-11 21:28:36 +0000 |
| commit | 805f1e03b82386612127c1efe6ce5bdbb64890a3 (patch) | |
| tree | 2af25c5eb3b67602ab0f6cce47eff0152fdb10a6 /llvm/test | |
| parent | 9647a28fb7c97d9bbaafe10321e4bb4e61a181f4 (diff) | |
| download | bcm5719-llvm-805f1e03b82386612127c1efe6ce5bdbb64890a3.tar.gz bcm5719-llvm-805f1e03b82386612127c1efe6ce5bdbb64890a3.zip | |
[mips][mt][2/7] Implement .module and .set directives for the MT ASE.
This patch implements the .module and .set directives for the MT ASE,
notably that .module sets the relevant flags in .MIPS.abiflags and .set
doesn't.
Reviewers: slthakur, atanasyan
Differential Revision: https://reviews.llvm.org/D35249
llvm-svn: 307716
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/MC/Mips/mt/module-directive-invalid.s | 6 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mt/module-directive.s | 16 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mt/set-directive.s | 14 |
3 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/MC/Mips/mt/module-directive-invalid.s b/llvm/test/MC/Mips/mt/module-directive-invalid.s new file mode 100644 index 00000000000..38baaa07cdc --- /dev/null +++ b/llvm/test/MC/Mips/mt/module-directive-invalid.s @@ -0,0 +1,6 @@ +# RUN: not llvm-mc -arch=mips -mcpu=mips32r5 < %s 2>&1 | FileCheck %s + +# CHECK: error: .module directive must appear before any code + .set nomips16 + .module mt + nop diff --git a/llvm/test/MC/Mips/mt/module-directive.s b/llvm/test/MC/Mips/mt/module-directive.s new file mode 100644 index 00000000000..d316f054eaa --- /dev/null +++ b/llvm/test/MC/Mips/mt/module-directive.s @@ -0,0 +1,16 @@ +# RUN: llvm-mc < %s -arch=mips -mcpu=mips32r2 -filetype=obj -o - | \ +# RUN: llvm-readobj -mips-abi-flags | FileCheck --check-prefix=CHECK-OBJ %s +# RUN: llvm-mc < %s -arch=mips -mcpu=mips32r2 -filetype=asm -o - | \ +# RUN: FileCheck --check-prefix=CHECK-ASM %s + +# Test that the .module directive sets the MT flag in .MIPS.abiflags when +# assembling to boject files. + +# Test that the .moodule directive is re-emitted when expanding assembly. + +# CHECK-OBJ: ASEs +# CHECK-OBJ-NEXT: MT (0x40) + +# CHECK-ASM: .module mt +.module mt +nop diff --git a/llvm/test/MC/Mips/mt/set-directive.s b/llvm/test/MC/Mips/mt/set-directive.s new file mode 100644 index 00000000000..53ed4b27379 --- /dev/null +++ b/llvm/test/MC/Mips/mt/set-directive.s @@ -0,0 +1,14 @@ +# RUN: llvm-mc < %s -arch=mips -mcpu=mips32r2 -filetype=obj -o - | \ +# RUN: llvm-readobj -mips-abi-flags | FileCheck %s --check-prefix=CHECK-OBJ +# RUN: llvm-mc < %s -arch=mips -mcpu=mips32r2 -filetype=asm -o - | \ +# RUN: FileCheck %s --check-prefix=CHECK-ASM + +# Test that the MT ASE flag in .MIPS.abiflags is _not_ set by .set. +# Test that '.set mt' is emitted by the asm target streamer. + +# CHECK-OBJ: ASEs +# CHECK-OBJ-NOT: MT (0x40) + +# CHECK-ASM: .set mt + .set mt + nop |

