2020-11-17 07:04:55 +08:00
|
|
|
// RUN: %clang_cc1 -S -emit-llvm -o - -triple=x86_64-linux-gnu %s | FileCheck %s -check-prefix=CHECK-YES
|
|
|
|
// RUN: %clang_cc1 -S -emit-llvm -o - -fno-delete-null-pointer-checks -triple=x86_64-linux-gnu %s | FileCheck %s -check-prefix=CHECK-NO
|
|
|
|
|
|
|
|
struct Struct {
|
|
|
|
int many;
|
|
|
|
int member;
|
|
|
|
int fields;
|
|
|
|
void ReturnsVoid();
|
|
|
|
};
|
|
|
|
|
|
|
|
void TestReturnsVoid(Struct &s) {
|
|
|
|
s.ReturnsVoid();
|
|
|
|
|
2021-10-15 18:45:30 +08:00
|
|
|
// CHECK-YES: call void @_ZN6Struct11ReturnsVoidEv(%struct.Struct* noundef %0)
|
2020-12-01 04:44:35 +08:00
|
|
|
/// FIXME Use dereferenceable after dereferenceable respects NullPointerIsValid.
|
2021-10-15 18:45:30 +08:00
|
|
|
// CHECK-NO: call void @_ZN6Struct11ReturnsVoidEv(%struct.Struct* noundef %0)
|
2020-11-17 07:04:55 +08:00
|
|
|
}
|
|
|
|
|
2021-10-15 18:45:30 +08:00
|
|
|
// CHECK-YES: declare void @_ZN6Struct11ReturnsVoidEv(%struct.Struct* noundef)
|
|
|
|
// CHECK-NO: declare void @_ZN6Struct11ReturnsVoidEv(%struct.Struct* noundef)
|