Files
swift-mirror/test/IRGen/c_functions_error.swift
John McCall 06c65464cf Don't crash if an error is emitted by Clang IR-generation.
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.
2016-05-17 12:38:53 -07:00

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();
}