diff options
author | Dylan McKay <dylanmckay34@gmail.com> | 2016-12-11 07:09:45 +0000 |
---|---|---|
committer | Dylan McKay <dylanmckay34@gmail.com> | 2016-12-11 07:09:45 +0000 |
commit | bf1d2edab22a6712e55c44c52efb87f37f86c203 (patch) | |
tree | 3819f8504dd3953038d4d379bed9026559524a0c /llvm/test/CodeGen/AVR/calling-conv/c/stack.ll | |
parent | 441e6310ae838b287b1eb77195460292563e184b (diff) | |
download | bcm5719-llvm-bf1d2edab22a6712e55c44c52efb87f37f86c203.tar.gz bcm5719-llvm-bf1d2edab22a6712e55c44c52efb87f37f86c203.zip |
[AVR] Add calling convention CodeGen tests
This adds CodeGen tests for the AVR C calling convention.
llvm-svn: 289369
Diffstat (limited to 'llvm/test/CodeGen/AVR/calling-conv/c/stack.ll')
-rw-r--r-- | llvm/test/CodeGen/AVR/calling-conv/c/stack.ll | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AVR/calling-conv/c/stack.ll b/llvm/test/CodeGen/AVR/calling-conv/c/stack.ll new file mode 100644 index 00000000000..00ff7d1acd8 --- /dev/null +++ b/llvm/test/CodeGen/AVR/calling-conv/c/stack.ll @@ -0,0 +1,32 @@ +; RUN: llc < %s -march=avr | FileCheck %s + +; CHECK-LABEL: ret_void_args_i64_i64_i32 +define void @ret_void_args_i64_i64_i32(i64 %a, i64 %b, i32 %c) { + ; We're goign to clobber PTRREG Y + ; CHECK: push r28 + ; CHECK-NEXT: push r29 + + ; Load the stack pointer into Y. + ; CHECK-NEXT: in r28, 61 + ; CHECK-NEXT: in r29, 62 + + ; Load the top two bytes from the 32-bit int. + ; CHECK-NEXT: ldd r24, Y+7 + ; CHECK-NEXT: ldd r25, Y+8 + ; Store the top two bytes of the 32-bit int to memory. + ; CHECK-NEXT: sts 7, r25 + ; CHECK-NEXT: sts 6, r24 + + ; Load the bottom two bytes from the 32-bit int. + ; CHECK-NEXT: ldd r24, Y+5 + ; CHECK-NEXT: ldd r25, Y+6 + ; Store the bottom two bytes of the 32-bit int to memory. + ; CHECK-NEXT: sts 5, r25 + ; CHECK-NEXT: sts 4, r24 + + ; Restore PTRREG Y + ; CHECK-NEXT: pop r29 + ; CHECK-NEXT: pop r28 + store volatile i32 %c, i32* inttoptr (i64 4 to i32*) + ret void +} |