Index: lib/CodeGen/CGCall.cpp =================================================================== --- lib/CodeGen/CGCall.cpp +++ lib/CodeGen/CGCall.cpp @@ -4403,7 +4403,8 @@ // Avoid incompatibility with ASan which relies on the `noreturn` // attribute to insert handler calls. - if (SanOpts.has(SanitizerKind::Address)) { + if (SanOpts.hasOneOf(SanitizerKind::Address | + SanitizerKind::KernelAddress)) { SanitizerScope SanScope(this); llvm::IRBuilder<>::InsertPointGuard IPGuard(Builder); Builder.SetInsertPoint(CI); Index: test/CodeGen/ubsan-asan-noreturn.c =================================================================== --- test/CodeGen/ubsan-asan-noreturn.c +++ test/CodeGen/ubsan-asan-noreturn.c @@ -1,6 +1,7 @@ // Ensure compatiblity of UBSan unreachable with ASan in the presence of // noreturn functions. -// RUN: %clang_cc1 -fsanitize=unreachable,address -triple x86_64-linux -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -fsanitize=unreachable,address -triple x86_64-linux -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -fsanitize=unreachable,kernel-address -triple x86_64-linux -emit-llvm -o - %s | FileCheck %s void my_longjmp(void) __attribute__((noreturn));