1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=m68k-linux -verify-machineinstrs | FileCheck %s
4 %struct.va_list = type { i8* }
7 define i32 @test(i32 %X, ...) {
8 ; Initialize variable argument processing
10 ; CHECK: .cfi_startproc
11 ; CHECK-NEXT: ; %bb.0:
12 ; CHECK-NEXT: suba.l #8, %sp
13 ; CHECK-NEXT: .cfi_def_cfa_offset -12
14 ; CHECK-NEXT: lea (16,%sp), %a0
15 ; CHECK-NEXT: move.l %a0, %d0
16 ; CHECK-NEXT: add.l #4, %d0
17 ; CHECK-NEXT: move.l %d0, (4,%sp)
18 ; CHECK-NEXT: move.l %d0, (0,%sp)
19 ; CHECK-NEXT: move.l (16,%sp), %d0
20 ; CHECK-NEXT: adda.l #8, %sp
22 %ap = alloca %struct.va_list
23 %ap2 = bitcast %struct.va_list* %ap to i8*
24 call void @llvm.va_start(i8* %ap2)
26 ; Read a single integer argument
27 %tmp = va_arg i8* %ap2, i32
29 ; Demonstrate usage of llvm.va_copy and llvm.va_end
31 %aq2 = bitcast i8** %aq to i8*
32 call void @llvm.va_copy(i8* %aq2, i8* %ap2)
33 call void @llvm.va_end(i8* %aq2)
35 ; Stop processing of arguments.
36 call void @llvm.va_end(i8* %ap2)
40 declare void @llvm.va_start(i8*)
41 declare void @llvm.va_copy(i8*, i8*)
42 declare void @llvm.va_end(i8*)