diff options
| author | Simon Atanasyan <simon@atanasyan.com> | 2018-02-07 12:36:39 +0000 |
|---|---|---|
| committer | Simon Atanasyan <simon@atanasyan.com> | 2018-02-07 12:36:39 +0000 |
| commit | 70498f81dea7104b45269714d2238fe01263ab01 (patch) | |
| tree | a6ba04235c0d130cc57952e0ceb0e7b8a3dcef7e /llvm/test/CodeGen | |
| parent | 737bec38d0bd6ced5639169c1445791327911e01 (diff) | |
| download | bcm5719-llvm-70498f81dea7104b45269714d2238fe01263ab01.tar.gz bcm5719-llvm-70498f81dea7104b45269714d2238fe01263ab01.zip | |
[mips] Support 'y' operand code to print exact log2 of the operand
llvm-svn: 324477
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/Mips/inlineasm-opcode-bad-y.ll | 11 | ||||
| -rw-r--r-- | llvm/test/CodeGen/Mips/inlineasm-operand-code.ll | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Mips/inlineasm-opcode-bad-y.ll b/llvm/test/CodeGen/Mips/inlineasm-opcode-bad-y.ll new file mode 100644 index 00000000000..e94b608d047 --- /dev/null +++ b/llvm/test/CodeGen/Mips/inlineasm-opcode-bad-y.ll @@ -0,0 +1,11 @@ +; Negative test for the 'm' operand code. This operand code is applicable +; for an immediate whic is exact power of 2. + +; RUN: not llc -march=mips < %s 2>&1 | FileCheck %s + +define i32 @foo() nounwind { +entry: +; CHECK: error: invalid operand in inline asm: 'addiu $0, $1, ${2:y}' + tail call i32 asm sideeffect "addiu $0, $1, ${2:y}", "=r,r,I"(i32 7, i32 3) ; + ret i32 0 +} diff --git a/llvm/test/CodeGen/Mips/inlineasm-operand-code.ll b/llvm/test/CodeGen/Mips/inlineasm-operand-code.ll index 6b46884e9af..0b8e831150e 100644 --- a/llvm/test/CodeGen/Mips/inlineasm-operand-code.ll +++ b/llvm/test/CodeGen/Mips/inlineasm-operand-code.ll @@ -63,6 +63,17 @@ entry: ret i32 0 } +; y with 4 +define i32 @constraint_y_4() nounwind { +entry: +; ALL-LABEL: constraint_y_4: +; ALL: #APP +; ALL: addiu ${{[0-9]+}}, ${{[0-9]+}}, 2 +; ALL: #NO_APP + tail call i32 asm sideeffect "addiu $0, $1, ${2:y}", "=r,r,I"(i32 7, i32 4) ; + ret i32 0 +} + ; z with -3 define void @constraint_z_0() nounwind { entry: |

