[libc] Switch to using the generic `<gpuintrin.h>` implementations (#121810)
[llvm-project.git] / clang / test / CodeGen / memcpy-nobuiltin.c
blob6129c530d434046f43390797fd1e87b5b6567d5f
1 // RUN: %clang_cc1 -verify -emit-llvm -o- %s -isystem %S -DWITH_DECL | FileCheck --check-prefix=CHECK-WITH-DECL %s
2 // RUN: %clang_cc1 -verify -emit-llvm -o- %s -isystem %S -UWITH_DECL | FileCheck --check-prefix=CHECK-NO-DECL %s
3 // RUN: %clang_cc1 -verify -emit-llvm -o- %s -isystem %S -disable-llvm-passes -DWITH_SELF_REFERENCE_DECL | FileCheck --check-prefix=CHECK-SELF-REF-DECL %s
4 //
5 // CHECK-WITH-DECL-NOT: @llvm.memcpy
6 // CHECK-NO-DECL: @llvm.memcpy
7 // CHECK-SELF-REF-DECL-LABEL: define {{.*}}ptr @memcpy.inline
8 // CHECK-SELF-REF-DECL: @llvm.memcpy.{{.*}}(
9 //
10 #include <memcpy-nobuiltin.inc>
11 void test(void *dest, void const *from, size_t n) {
12 memcpy(dest, from, n);
14 static char buffer[1];
15 memcpy(buffer, from, 2); // expected-warning {{'memcpy' will always overflow; destination buffer has size 1, but size argument is 2}}