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
37 lines
1.5 KiB
C++
37 lines
1.5 KiB
C++
// RUN: %clang_cc1 -no-opaque-pointers %s -std=c++11 -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK,NULL-INVALID
|
|
// RUN: %clang_cc1 -no-opaque-pointers %s -std=c++11 -triple=x86_64-apple-darwin10 -fno-delete-null-pointer-checks -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK,NULL-VALID
|
|
|
|
// For a reference to a complete type, output the dereferenceable attribute (in
|
|
// any address space).
|
|
|
|
typedef int a __attribute__((address_space(1)));
|
|
|
|
a & foo(a &x, a & y) {
|
|
return x;
|
|
}
|
|
|
|
// CHECK: define{{.*}} align 4 dereferenceable(4) i32 addrspace(1)* @_Z3fooRU3AS1iS0_(i32 addrspace(1)* noundef align 4 dereferenceable(4) %x, i32 addrspace(1)* noundef align 4 dereferenceable(4) %y)
|
|
|
|
// For a reference to an incomplete type in an alternate address space, output
|
|
// neither dereferenceable nor nonnull.
|
|
|
|
class bc;
|
|
typedef bc b __attribute__((address_space(1)));
|
|
|
|
b & bar(b &x, b & y) {
|
|
return x;
|
|
}
|
|
|
|
// CHECK: define{{.*}} align 1 %class.bc addrspace(1)* @_Z3barRU3AS12bcS1_(%class.bc addrspace(1)* noundef align 1 %x, %class.bc addrspace(1)* noundef align 1 %y)
|
|
|
|
// For a reference to an incomplete type in addrspace(0), output nonnull.
|
|
|
|
bc & bar2(bc &x, bc & y) {
|
|
return x;
|
|
}
|
|
|
|
// NULL-INVALID: define{{.*}} nonnull align 1 %class.bc* @_Z4bar2R2bcS0_(%class.bc* noundef nonnull align 1 %x, %class.bc* noundef nonnull align 1 %y)
|
|
// NULL-VALID: define{{.*}} align 1 %class.bc* @_Z4bar2R2bcS0_(%class.bc* noundef align 1 %x, %class.bc* noundef align 1 %y)
|
|
|
|
|