1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -O0 -mtriple=x86_64-unknown-unknown < %s | FileCheck %s
4 ; ModuleID = 'variadic.c'
5 source_filename = "variadic.c"
6 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7 target triple = "x86_64-unknown-linux"
9 %struct.__va_list_tag = type { i32, i32, ptr, ptr }
11 @.str = private unnamed_addr constant [9 x i8] c"\0A hello \00", align 1
13 ; Function Attrs: noinline nounwind optnone uwtable
14 define dso_local void @testvarargs(ptr %fmt, ...) {
15 ; CHECK-LABEL: testvarargs:
16 ; CHECK: # %bb.0: # %entry
17 ; CHECK-NEXT: subq $216, %rsp
18 ; CHECK-NEXT: .cfi_def_cfa_offset 224
19 ; CHECK-NEXT: testb %al, %al
20 ; CHECK-NEXT: je .LBB0_2
21 ; CHECK-NEXT: # %bb.1: # %entry
22 ; CHECK-NEXT: movaps %xmm0, {{[0-9]+}}(%rsp)
23 ; CHECK-NEXT: movaps %xmm1, {{[0-9]+}}(%rsp)
24 ; CHECK-NEXT: movaps %xmm2, {{[0-9]+}}(%rsp)
25 ; CHECK-NEXT: movaps %xmm3, {{[0-9]+}}(%rsp)
26 ; CHECK-NEXT: movaps %xmm4, {{[0-9]+}}(%rsp)
27 ; CHECK-NEXT: movaps %xmm5, {{[0-9]+}}(%rsp)
28 ; CHECK-NEXT: movaps %xmm6, {{[0-9]+}}(%rsp)
29 ; CHECK-NEXT: movaps %xmm7, {{[0-9]+}}(%rsp)
30 ; CHECK-NEXT: .LBB0_2: # %entry
31 ; CHECK-NEXT: movq %r9, {{[0-9]+}}(%rsp)
32 ; CHECK-NEXT: movq %r8, {{[0-9]+}}(%rsp)
33 ; CHECK-NEXT: movq %rcx, {{[0-9]+}}(%rsp)
34 ; CHECK-NEXT: movq %rdx, {{[0-9]+}}(%rsp)
35 ; CHECK-NEXT: movq %rsi, {{[0-9]+}}(%rsp)
36 ; CHECK-NEXT: movq %rdi, {{[0-9]+}}(%rsp)
37 ; CHECK-NEXT: movq %rsp, %rax
38 ; CHECK-NEXT: movq %rax, {{[0-9]+}}(%rsp)
39 ; CHECK-NEXT: leaq {{[0-9]+}}(%rsp), %rax
40 ; CHECK-NEXT: movq %rax, {{[0-9]+}}(%rsp)
41 ; CHECK-NEXT: movl $48, {{[0-9]+}}(%rsp)
42 ; CHECK-NEXT: movl $8, {{[0-9]+}}(%rsp)
43 ; CHECK-NEXT: movl $.L.str, %edi
44 ; CHECK-NEXT: xorl %eax, %eax
45 ; CHECK-NEXT: # kill: def $al killed $al killed $eax
46 ; CHECK-NEXT: callq printf
47 ; CHECK-NEXT: addq $216, %rsp
48 ; CHECK-NEXT: .cfi_def_cfa_offset 8
51 %fmt.addr = alloca ptr, align 8
52 %va = alloca [1 x %struct.__va_list_tag], align 16
53 store ptr %fmt, ptr %fmt.addr, align 8
54 call void @llvm.va_start(ptr %va)
55 call void @llvm.va_end(ptr %va)
56 %call = call i32 (ptr, ...) @printf(ptr @.str)
60 ; Function Attrs: nounwind
61 declare void @llvm.va_start(ptr)
63 ; Function Attrs: nounwind
64 declare void @llvm.va_end(ptr)
66 declare dso_local i32 @printf(ptr, ...)