From 72d13ff755fe8484c89468252f945ba23fe98f71 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sat, 26 Jun 2010 18:22:20 +0000 Subject: When splitting a VAARG, remember its alignment. This produces terrible but correct code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106952 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/ARM/va_arg.ll | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/CodeGen/ARM/va_arg.ll (limited to 'test/CodeGen/ARM/va_arg.ll') diff --git a/test/CodeGen/ARM/va_arg.ll b/test/CodeGen/ARM/va_arg.ll new file mode 100644 index 0000000000..a54a499cf1 --- /dev/null +++ b/test/CodeGen/ARM/va_arg.ll @@ -0,0 +1,19 @@ +; RUN: llc < %s -mtriple=armv7-none-linux-gnueabi | FileCheck %s +; Test that we correctly align elements when using va_arg + +; CHECK: add r0, r0, #7 +; CHECK: bfc r0, #0, #3 + +define i64 @f8(i32 %i, ...) nounwind optsize { +entry: + %g = alloca i8*, align 4 + %g1 = bitcast i8** %g to i8* + call void @llvm.va_start(i8* %g1) + %0 = va_arg i8** %g, i64 + call void @llvm.va_end(i8* %g1) + ret i64 %0 +} + +declare void @llvm.va_start(i8*) nounwind + +declare void @llvm.va_end(i8*) nounwind -- cgit v1.2.3