Index: lib/CodeGen/CGCall.cpp =================================================================== --- lib/CodeGen/CGCall.cpp +++ lib/CodeGen/CGCall.cpp @@ -4394,8 +4394,8 @@ // Strip away the noreturn attribute to better diagnose unreachable UB. if (SanOpts.has(SanitizerKind::Unreachable)) { - // Also remove from function since CI->hasFnAttr(..) also checks attributes - // of the called function. + // Also remove from function since CallBase::hasFnAttr additionally checks + // attributes of the called function. if (auto *F = CI->getCalledFunction()) F->removeFnAttr(llvm::Attribute::NoReturn); CI->removeAttribute(llvm::AttributeList::FunctionIndex, Index: test/CodeGen/ubsan-asan-noreturn.c =================================================================== --- test/CodeGen/ubsan-asan-noreturn.c +++ test/CodeGen/ubsan-asan-noreturn.c @@ -9,8 +9,7 @@ my_longjmp(); // CHECK: @__asan_handle_no_return{{.*}} !nosanitize // CHECK-NEXT: @my_longjmp(){{[^#]*}} - // CHECK: @__asan_handle_no_return() - // CHECK-NEXT: @__ubsan_handle_builtin_unreachable{{.*}} !nosanitize + // CHECK: @__ubsan_handle_builtin_unreachable{{.*}} !nosanitize // CHECK-NEXT: unreachable }