1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/CodeGen/AArch64/fast-isel-memcpy.ll
Juergen Ributzka a7f0b27412 [FastISel][AArch64] Fix a missing nullptr check in 'computeAddress'.
The load/store value type is currently not available when lowering the memcpy
intrinsic. Add the missing nullptr check to support this in 'computeAddress'.

Fixes rdar://problem/19178947.

llvm-svn: 223818
2014-12-09 19:44:38 +00:00

16 lines
578 B
LLVM

; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -fast-isel-abort -verify-machineinstrs < %s | FileCheck %s
; Test that we don't segfault.
; CHECK-LABEL: test
; CHECK: ldr [[REG1:x[0-9]+]], [x1]
; CHECK-NEXT: and [[REG2:x[0-9]+]], x0, #0x7fffffffffffffff
; CHECK-NEXT: str [[REG1]], {{\[}}[[REG2]]{{\]}}
define void @test(i64 %a, i8* %b) {
%1 = and i64 %a, 9223372036854775807
%2 = inttoptr i64 %1 to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* %b, i64 8, i32 8, i1 false)
ret void
}
declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i32, i1)