Merge pull request #8151 from hughbe/permissive-msvc

diff --git a/include/swift/AST/DiagnosticsClangImporter.def b/include/swift/AST/DiagnosticsClangImporter.def
index 9907c19..383ce9f 100644
--- a/include/swift/AST/DiagnosticsClangImporter.def
+++ b/include/swift/AST/DiagnosticsClangImporter.def
@@ -44,7 +44,7 @@
   "%0", (StringRef))
 
 ERROR(clang_cannot_build_module,Fatal,
-  "could not build Objective-C module '%0'", (StringRef))
+  "could not build %select{C|Objective-C}0 module '%1'", (bool, StringRef))
 
 ERROR(bridging_header_missing,Fatal,
   "bridging header '%0' does not exist", (StringRef))
diff --git a/lib/ClangImporter/ClangDiagnosticConsumer.cpp b/lib/ClangImporter/ClangDiagnosticConsumer.cpp
index aac06c0..2b334bc 100644
--- a/lib/ClangImporter/ClangDiagnosticConsumer.cpp
+++ b/lib/ClangImporter/ClangDiagnosticConsumer.cpp
@@ -173,6 +173,7 @@
                                   clangDiag.getLocation());
 
     ctx.Diags.diagnose(loc, diag::clang_cannot_build_module,
+                       ctx.LangOpts.EnableObjCInterop,
                        CurrentImport->getName());
     return;
   }
diff --git a/test/ClangImporter/non-modular-include.swift b/test/ClangImporter/non-modular-include.swift
index 8e4eab4..e3a44c4 100644
--- a/test/ClangImporter/non-modular-include.swift
+++ b/test/ClangImporter/non-modular-include.swift
@@ -1,8 +1,9 @@
 // RUN: rm -rf %t && mkdir -p %t
-// RUN: not %target-swift-frontend -typecheck %s -I %S/Inputs/non-modular -F %S/Inputs/non-modular 2>&1 | %FileCheck %s
+// RUN: not %target-swift-frontend -typecheck %s -I %S/Inputs/non-modular -F %S/Inputs/non-modular 2>&1 | %FileCheck --check-prefix=CHECK --check-prefix=CHECK-%target-runtime %s
 
 // CHECK: {{.+}}/non-modular/Foo.framework/Headers/Foo.h:1:9: error: include of non-modular header inside framework module 'Foo'
-// CHECK: error: could not build Objective-C module 'Foo'
+// CHECK-objc: error: could not build Objective-C module 'Foo'
+// CHECK-native: error: could not build C module 'Foo'
 // CHECK-NOT: error
 
 import Foo
diff --git a/validation-test/compiler_crashers/28722-swift-genericsignaturebuilder-resolvearchetype-swift-type.swift b/validation-test/compiler_crashers_fixed/28722-swift-genericsignaturebuilder-resolvearchetype-swift-type.swift
similarity index 81%
rename from validation-test/compiler_crashers/28722-swift-genericsignaturebuilder-resolvearchetype-swift-type.swift
rename to validation-test/compiler_crashers_fixed/28722-swift-genericsignaturebuilder-resolvearchetype-swift-type.swift
index f6b44b2..1cd2530 100644
--- a/validation-test/compiler_crashers/28722-swift-genericsignaturebuilder-resolvearchetype-swift-type.swift
+++ b/validation-test/compiler_crashers_fixed/28722-swift-genericsignaturebuilder-resolvearchetype-swift-type.swift
@@ -5,6 +5,5 @@
 // See https://swift.org/LICENSE.txt for license information
 // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
 
-// REQUIRES: deterministic-behavior
-// RUN: not --crash %target-swift-frontend %s -emit-ir
+// RUN: not %target-swift-frontend %s -emit-ir
 protocol P{typealias e:a}extension P{var f={}typealias e:_