mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Clang IR-generation can fail. When it does this, it destroys the module. Previously, we were blithely assuming this couldn't happen, and so we would crash on the deallocated module. Delay the finalization of the Clang code generator until our own module finalization, which is a more appropriate place for it anyway, and then just bail out of the last few steps if Clang fails.
10 lines
252 B
Swift
10 lines
252 B
Swift
// RUN: not %target-swift-frontend -Xcc -mno-sse -import-objc-header %S/Inputs/c_functions_error.h -primary-file %s -emit-ir
|
|
|
|
// This should fail, but not crash.
|
|
|
|
// REQUIRES: CPU=x86_64
|
|
|
|
func call_buggy_builtin() {
|
|
produce_error_in_clang_irgen();
|
|
}
|