================ @@ -0,0 +1,61 @@ +// RUN: %clang_cc1 %s -O0 -disable-O0-optnone -emit-llvm -fextend-lifetimes -fsanitize=null -fsanitize-trap=null -o - | FileCheck --check-prefixes=CHECK,NULL --implicit-check-not=ubsantrap %s +// RUN: %clang_cc1 %s -O0 -disable-O0-optnone -emit-llvm -fextend-lifetimes -o - | FileCheck %s + +// With -fextend-lifetimes, the compiler previously generated a fake.use of any +// reference variable at the end of the scope in which its alloca exists. This +// caused two issues, where we would get fake uses for uninitialized variables +// if that variable was declared after an early-return, and UBSan's null checks +// would complain about this. +// This test verifies that UBSan does not produce null-checks for arguments to +// llvm.fake.use, and that fake uses are not emitted for a variable on paths +// it has not been declared. ---------------- SLTozer wrote:
Correct, it turns on sanitizer checks for null values - I was confused at first, especially since the comment previously referenced the Address Sanitizer. In short, we're simply testing that we don't try to sanitize fake uses, for obvious reasons. https://github.com/llvm/llvm-project/pull/110102 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits