================ @@ -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 ---------------- eleviant wrote:
Actually everything will work as expected in this case (`-fdelete-null-pointer-checks` will override `-fns-kernel`), because lang options (`-fms-kernel`) are parsed before codegen options (`-fdelete-null-pointer-checks`), so the default value of `true` of `CodeGenOptions.NullPointerIsValid` will always be overridden. https://github.com/llvm/llvm-project/pull/204658 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
