diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-06-24 06:36:07 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-06-24 06:36:07 +0000 |
commit | 9f76ed512747fc95400b4963900cd3d316c3182e (patch) | |
tree | 0fd51c27c3bb6fee75fab11e568771175d14c44f /test/CodeGen/Thumb/inlineasm-imm-thumb.ll | |
parent | 974469d7aa2b5761d34dbf6c750b3e55057cc4bc (diff) | |
download | external_llvm-9f76ed512747fc95400b4963900cd3d316c3182e.zip external_llvm-9f76ed512747fc95400b4963900cd3d316c3182e.tar.gz external_llvm-9f76ed512747fc95400b4963900cd3d316c3182e.tar.bz2 |
Move thumb and thumb2 tests into separate directories.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74068 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Thumb/inlineasm-imm-thumb.ll')
-rw-r--r-- | test/CodeGen/Thumb/inlineasm-imm-thumb.ll | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/CodeGen/Thumb/inlineasm-imm-thumb.ll b/test/CodeGen/Thumb/inlineasm-imm-thumb.ll new file mode 100644 index 0000000..2c872e7 --- /dev/null +++ b/test/CodeGen/Thumb/inlineasm-imm-thumb.ll @@ -0,0 +1,43 @@ +; RUN: llvm-as < %s | llc -march=thumb + +; Test Thumb-mode "I" constraint, for ADD immediate. +define i32 @testI(i32 %x) { + %y = call i32 asm "add $0, $1, $2", "=r,r,I"( i32 %x, i32 255 ) nounwind + ret i32 %y +} + +; Test Thumb-mode "J" constraint, for negated ADD immediates. +define void @testJ() { + tail call void asm sideeffect ".word $0", "J"( i32 -255 ) nounwind + ret void +} + +; Test Thumb-mode "K" constraint, for compatibility with GCC's internal use. +define void @testK() { + tail call void asm sideeffect ".word $0", "K"( i32 65280 ) nounwind + ret void +} + +; Test Thumb-mode "L" constraint, for 3-operand ADD immediates. +define i32 @testL(i32 %x) { + %y = call i32 asm "add $0, $1, $2", "=r,r,L"( i32 %x, i32 -7 ) nounwind + ret i32 %y +} + +; Test Thumb-mode "M" constraint, for "ADD r = sp + imm". +define i32 @testM() { + %y = call i32 asm "add $0, sp, $1", "=r,M"( i32 1020 ) nounwind + ret i32 %y +} + +; Test Thumb-mode "N" constraint, for values between 0 and 31. +define i32 @testN(i32 %x) { + %y = call i32 asm "lsl $0, $1, $2", "=r,r,N"( i32 %x, i32 31 ) nounwind + ret i32 %y +} + +; Test Thumb-mode "O" constraint, for "ADD sp = sp + imm". +define void @testO() { + tail call void asm sideeffect "add sp, sp, $0; add sp, sp, $1", "O,O"( i32 -508, i32 508 ) nounwind + ret void +} |