1 ; RUN: llc -mtriple=x86_64-unknown-unknown < %s | FileCheck %s
2 ; RUN: llc -mtriple=x86_64-unknown-unknown -O0 < %s | FileCheck %s
3 ; RUN: llc -mtriple=i686-unknown-unknown -mattr=+sse2 < %s | FileCheck %s
4 ; RUN: llc -mtriple=i686-unknown-unknown -mattr=+sse2 -O0 < %s | FileCheck %s
6 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7 ;; In functions with 'no_caller_saved_registers' attribute, all registers should
8 ;; be preserved except for registers used for passing/returning arguments.
9 ;; The test checks that function "bar" preserves xmm0 register.
10 ;; It also checks that caller function "foo" does not store registers for callee
11 ;; "bar". For example, there is no store/load/access to xmm registers.
12 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
14 define i32 @bar(i32 %a0, i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 %a6, i32 %a7, i32 %a8) #0 {
16 ; CHECK: mov{{.*}} %xmm0
17 ; CHECK: mov{{.*}} {{.*}}, %xmm0
19 call void asm sideeffect "", "~{xmm0}"()
23 define x86_intrcc void @foo(i8* nocapture readnone %c) {
27 tail call i32 @bar(i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8) #0
31 attributes #0 = { "no_caller_saved_registers" }