mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-24 12:26:07 +00:00

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
37 lines
1.0 KiB
C++
37 lines
1.0 KiB
C++
// RUN: %clang_cc1 -emit-llvm -o - %s -triple %itanium_abi_triple | FileCheck %s
|
|
// RUN: %clang_cc1 -emit-llvm -o - %s -triple %itanium_abi_triple -std=c++98 -fexceptions -fcxx-exceptions | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-EH
|
|
|
|
struct A {
|
|
A();
|
|
~A();
|
|
};
|
|
|
|
struct B {
|
|
B(A = A());
|
|
~B();
|
|
};
|
|
|
|
void f();
|
|
// CHECK-LABEL: define {{(dso_local )?}}void @_Z1gv()
|
|
void g() {
|
|
// CHECK: br label %[[LOOP:.*]]
|
|
|
|
// [[LOOP]]:
|
|
// CHECK: {{call|invoke}} {{.*}} @_ZN1AC1Ev({{.*}} [[TEMPORARY:%.*]])
|
|
// CHECK-EH: unwind label %[[PARTIAL_ARRAY_LPAD:.*]]
|
|
// CHECK: {{call|invoke}} {{.*}} @_ZN1BC1E1A({{.*}} [[TEMPORARY]])
|
|
// CHECK-EH: unwind label %[[A_AND_PARTIAL_ARRAY_LPAD:.*]]
|
|
// CHECK: {{call|invoke}} {{.*}} @_ZN1AD1Ev({{.*}} [[TEMPORARY]])
|
|
// CHECK-EH: unwind label %[[PARTIAL_ARRAY_LPAD]]
|
|
// CHECK: getelementptr {{.*}}, i{{[0-9]*}} 1
|
|
// CHECK: icmp eq
|
|
// CHECK: br i1 {{.*}} label %[[LOOP]]
|
|
B b[5];
|
|
|
|
// CHECK: {{call|invoke}} void @_Z1fv()
|
|
f();
|
|
|
|
// CHECK-NOT: @_ZN1AD1Ev(
|
|
// CHECK: {{call|invoke}} {{.*}} @_ZN1BD1Ev(
|
|
}
|