arguments. * Adds 'nonnull' and 'dereferenceable(N)' to 'this' pointer arguments * Gates 'nonnull' on -f(no-)delete-null-pointer-checks * Introduces this-nonnull.cpp and microsoft-abi-this-nullable.cpp tests to explicitly test the behavior of this change * Refactors hundreds of over-constrained clang tests to permit these attributes, where needed * Updates Clang12 patch notes mentioning this change Reviewed-by: rsmith, jdoerfert Differential Revision: https://reviews.llvm.org/D17993
14 lines
243 B
C++
14 lines
243 B
C++
// RUN: %clang_cc1 %s -triple i386-unknown-unknown -emit-llvm -o - | FileCheck %s
|
|
|
|
struct A {
|
|
virtual int operator-();
|
|
};
|
|
|
|
void f(A a, A *ap) {
|
|
// CHECK: call i32 @_ZN1AngEv(%struct.A* {{[^,]*}} %a)
|
|
-a;
|
|
|
|
// CHECK: call i32 %
|
|
-*ap;
|
|
}
|