Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / memcpy-nobuiltin.c
blobc08212f6810f1f7061115d61c78ae5d0bd6bf9b4
1 // RUN: %clang_cc1 -verify -S -emit-llvm -o- %s -isystem %S -DWITH_DECL | FileCheck --check-prefix=CHECK-WITH-DECL %s
2 // RUN: %clang_cc1 -verify -S -emit-llvm -o- %s -isystem %S -UWITH_DECL | FileCheck --check-prefix=CHECK-NO-DECL %s
3 // RUN: %clang_cc1 -verify -S -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}}