summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCharles Davis <cdavis5x@gmail.com>2015-02-27 00:57:01 +0000
committerCharles Davis <cdavis5x@gmail.com>2015-02-27 00:57:01 +0000
commitd51be017f089137d356219d08f563d7961c664ce (patch)
treed032ff0ba146f47a388ae96cae94174ddc3b0c67 /test
parenta72314cd80bdea6a35cb021304073b4f39c609db (diff)
Target/X86: Save Win64 non-volatile registers in a Win64 ABI function.
Summary: This change causes us to actually save non-volatile registers in a Win64 ABI function that calls a System V ABI function, and vice-versa. Reviewers: rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7919 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230714 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/win64_nonvol.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/CodeGen/X86/win64_nonvol.ll b/test/CodeGen/X86/win64_nonvol.ll
new file mode 100644
index 00000000000..8e5f6cec1ab
--- /dev/null
+++ b/test/CodeGen/X86/win64_nonvol.ll
@@ -0,0 +1,28 @@
+; RUN: llc < %s -mtriple=x86_64-pc-win32 | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-pc-linux | FileCheck %s
+
+; Check that, if a Win64 ABI function calls a SysV ABI function, all the
+; Win64 nonvolatile registers get saved.
+
+; CHECK-LABEL: bar:
+define x86_64_win64cc void @bar(i32 %a, i32 %b) {
+; CHECK-DAG: pushq %rdi
+; CHECK-DAG: pushq %rsi
+; CHECK-DAG: movaps %xmm6,
+; CHECK-DAG: movaps %xmm7,
+; CHECK-DAG: movaps %xmm8,
+; CHECK-DAG: movaps %xmm9,
+; CHECK-DAG: movaps %xmm10,
+; CHECK-DAG: movaps %xmm11,
+; CHECK-DAG: movaps %xmm12,
+; CHECK-DAG: movaps %xmm13,
+; CHECK-DAG: movaps %xmm14,
+; CHECK-DAG: movaps %xmm15,
+; CHECK: callq foo
+; CHECK: ret
+ call x86_64_sysvcc void @foo(i32 %a, i32 %b)
+ ret void
+}
+
+declare x86_64_sysvcc void @foo(i32 %a, i32 %b)
+