This adds -no-opaque-pointers to clang tests whose output will change when opaque pointers are enabled by default. This is intended to be part of the migration approach described in https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9. The patch has been produced by replacing %clang_cc1 with %clang_cc1 -no-opaque-pointers for tests that fail with opaque pointers enabled. Worth noting that this doesn't cover all tests, there's a remaining ~40 tests not using %clang_cc1 that will need a followup change. Differential Revision: https://reviews.llvm.org/D123115
17 lines
912 B
C
17 lines
912 B
C
// RUN: %clang_cc1 -no-opaque-pointers -verify -S -emit-llvm -o- %s -isystem %S -DWITH_DECL | FileCheck --check-prefix=CHECK-WITH-DECL %s
|
|
// RUN: %clang_cc1 -no-opaque-pointers -verify -S -emit-llvm -o- %s -isystem %S -UWITH_DECL | FileCheck --check-prefix=CHECK-NO-DECL %s
|
|
// RUN: %clang_cc1 -no-opaque-pointers -verify -S -emit-llvm -o- %s -isystem %S -disable-llvm-passes -DWITH_SELF_REFERENCE_DECL | FileCheck --check-prefix=CHECK-SELF-REF-DECL %s
|
|
//
|
|
// CHECK-WITH-DECL-NOT: @llvm.memcpy
|
|
// CHECK-NO-DECL: @llvm.memcpy
|
|
// CHECK-SELF-REF-DECL-LABEL: define {{.*}}i8* @memcpy.inline
|
|
// CHECK-SELF-REF-DECL: @llvm.memcpy.{{.*}}(
|
|
//
|
|
#include <memcpy-nobuiltin.inc>
|
|
void test(void *dest, void const *from, size_t n) {
|
|
memcpy(dest, from, n);
|
|
|
|
static char buffer[1];
|
|
memcpy(buffer, from, 2); // expected-warning {{'memcpy' will always overflow; destination buffer has size 1, but size argument is 2}}
|
|
}
|