Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / this-nonnull.cpp
blobd1f8e0b2e34a8f78607eddfe9de3638e532f9d7e
1 // RUN: %clang_cc1 -S -emit-llvm -o - -triple=x86_64-linux-gnu %s | FileCheck %s -check-prefix=CHECK-YES
2 // RUN: %clang_cc1 -S -emit-llvm -o - -fno-delete-null-pointer-checks -triple=x86_64-linux-gnu %s | FileCheck %s -check-prefix=CHECK-NO
4 struct Struct {
5 int many;
6 int member;
7 int fields;
8 void ReturnsVoid();
9 };
11 void TestReturnsVoid(Struct &s) {
12 s.ReturnsVoid();
14 // CHECK-YES: call void @_ZN6Struct11ReturnsVoidEv(ptr noundef nonnull align 4 dereferenceable(12) %0)
15 /// FIXME Use dereferenceable after dereferenceable respects NullPointerIsValid.
16 // CHECK-NO: call void @_ZN6Struct11ReturnsVoidEv(ptr noundef align 4 dereferenceable_or_null(12) %0)
19 // CHECK-YES: declare void @_ZN6Struct11ReturnsVoidEv(ptr noundef nonnull align 4 dereferenceable(12))
20 // CHECK-NO: declare void @_ZN6Struct11ReturnsVoidEv(ptr noundef align 4 dereferenceable_or_null(12))