view clang/test/CodeGen/builtins-memcpy-inline.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
line wrap: on
line source

// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -triple x86_64-unknown-linux -emit-llvm %s -o - | FileCheck %s

// CHECK-LABEL: define{{.*}} void @test_memcpy_inline_0(i8* %dst, i8* %src)
void test_memcpy_inline_0(void *dst, const void *src) {
  // CHECK:   call void @llvm.memcpy.inline.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 0, i1 false)
  __builtin_memcpy_inline(dst, src, 0);
}

// CHECK-LABEL: define{{.*}} void @test_memcpy_inline_1(i8* %dst, i8* %src)
void test_memcpy_inline_1(void *dst, const void *src) {
  // CHECK:   call void @llvm.memcpy.inline.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 1, i1 false)
  __builtin_memcpy_inline(dst, src, 1);
}

// CHECK-LABEL: define{{.*}} void @test_memcpy_inline_4(i8* %dst, i8* %src)
void test_memcpy_inline_4(void *dst, const void *src) {
  // CHECK:   call void @llvm.memcpy.inline.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 4, i1 false)
  __builtin_memcpy_inline(dst, src, 4);
}

// CHECK-LABEL: define{{.*}} void @test_memcpy_inline_aligned_buffers(i64* %dst, i64* %src)
void test_memcpy_inline_aligned_buffers(unsigned long long *dst, const unsigned long long *src) {
  // CHECK:   call void @llvm.memcpy.inline.p0i8.p0i8.i64(i8* align 8 %2, i8* align 8 %3, i64 4, i1 false)
  __builtin_memcpy_inline(dst, src, 4);
}