diff --git a/llvm/test/CodeGen/AMDGPU/memcpy-inline-fails.ll b/llvm/test/CodeGen/AMDGPU/memcpy-inline-fails.ll new file mode 100644 index 00000000000000..88107ea23252b7 --- /dev/null +++ b/llvm/test/CodeGen/AMDGPU/memcpy-inline-fails.ll @@ -0,0 +1,11 @@ +; NOTE: This is expected to fail on target that do not support memcpy. +; RUN: llc < %s -mtriple=r600-unknown-linux-gnu 2> %t.err || true +; RUN: FileCheck --input-file %t.err %s + +declare void @llvm.memcpy.inline.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind + +define void @test1(i8* %a, i8* %b) nounwind { +; CHECK: LLVM ERROR + tail call void @llvm.memcpy.inline.p0i8.p0i8.i64(i8* %a, i8* %b, i64 8, i1 0 ) + ret void +} diff --git a/llvm/test/CodeGen/X86/memcpy-inline.ll b/llvm/test/CodeGen/X86/memcpy-inline.ll index d563679aac084b..a91e6d48213709 100644 --- a/llvm/test/CodeGen/X86/memcpy-inline.ll +++ b/llvm/test/CodeGen/X86/memcpy-inline.ll @@ -1,35 +1,34 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=core2 | FileCheck -check-prefix=X64 %s +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=core2 | FileCheck %s declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind declare void @llvm.memcpy.inline.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind define void @test1(i8* %a, i8* %b) nounwind { -; X64-LABEL: test1: -; X64: # %bb.0: -; X64-NEXT: movq (%rsi), %rax -; X64-NEXT: movq %rax, (%rdi) -; X64-NEXT: retq -; R600: LLVM ERROR +; CHECK-LABEL: test1: +; CHECK: # %bb.0: +; CHECK-NEXT: movq (%rsi), %rax +; CHECK-NEXT: movq %rax, (%rdi) +; CHECK-NEXT: retq tail call void @llvm.memcpy.inline.p0i8.p0i8.i64(i8* %a, i8* %b, i64 8, i1 0 ) ret void } define void @regular_memcpy_calls_external_function(i8* %a, i8* %b) nounwind { -; X64-LABEL: regular_memcpy_calls_external_function: -; X64: # %bb.0: -; X64-NEXT: movl $128, %edx -; X64-NEXT: jmp memcpy # TAILCALL +; CHECK-LABEL: regular_memcpy_calls_external_function: +; CHECK: # %bb.0: +; CHECK-NEXT: movl $128, %edx +; CHECK-NEXT: jmp memcpy # TAILCALL tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* %b, i64 128, i1 0 ) ret void } define void @inlined_copy_doesnt_call_external_function(i8* %a, i8* %b) nounwind { -; X64-LABEL: inlined_copy_doesnt_call_external_function: -; X64: # %bb.0: -; X64-NEXT: movl $128, %ecx -; X64-NEXT: rep;movsb (%rsi), %es:(%rdi) -; X64-NEXT: retq +; CHECK-LABEL: inlined_copy_doesnt_call_external_function: +; CHECK: # %bb.0: +; CHECK-NEXT: movl $128, %ecx +; CHECK-NEXT: rep;movsb (%rsi), %es:(%rdi) +; CHECK-NEXT: retq tail call void @llvm.memcpy.inline.p0i8.p0i8.i64(i8* %a, i8* %b, i64 128, i1 0 ) ret void }