[clang] [clang] Don't omit null pointer checks with -fms-compatibility (PR #204658)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 9 06:06:12 PDT 2026


================
@@ -0,0 +1,35 @@
+// Check that null pointer checks are not optimized out if -fms-compatibility is set
+// RUN: %clang_cc1 -fms-kernel -O2 -triple x86_64-pc-windows-msvc %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -O2 -triple x86_64-pc-windows-msvc %s -emit-llvm -o - | FileCheck %s --check-prefix=NOCHECK
+// RUN: %clang_cc1 -fms-kernel -O2 -triple x86_64-pc-windows-msvc -fdelete-null-pointer-checks %s -emit-llvm -o - | FileCheck %s --check-prefix=NOCHECK
----------------
AaronBallman wrote:

Thank you for verifying! That's a bit fragile for my tastes, but seems defensible.

https://github.com/llvm/llvm-project/pull/204658


More information about the cfe-commits mailing list