84 tests fail when ObjC interop is enforced

Hello,

I have a tiny patch that changes Sema to diagnose when ObjC is used but ObjC interop is disabled. Surprisingly, this is not diagnosed today. How should most tests be fixed? For reference, here is what is failing:

********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
Testing Time: 19.64s
********************
Failing Tests (84):
    Swift(linux-x86_64) :: Compatibility/attr_objc.swift
    Swift(linux-x86_64) :: Constraints/casts.swift
    Swift(linux-x86_64) :: Compatibility/override.swift
    Swift(linux-x86_64) :: Constraints/members_objc.swift
    Swift(linux-x86_64) :: IDE/complete_override.swift
    Swift(linux-x86_64) :: IDE/comment_to_xml.swift
    Swift(linux-x86_64) :: IDE/complete_override_access_control_protocol.swift
    Swift(linux-x86_64) :: IDE/complete_override_access_control_class.swift
    Swift(linux-x86_64) :: IDE/complete_members_optional.swift
    Swift(linux-x86_64) :: Parse/objc_enum.swift
    Swift(linux-x86_64) :: Sema/objc_attr_requires_module_3.swift
    Swift(linux-x86_64) :: Sema/dynamic_attr_requires_module.swift
    Swift(linux-x86_64) :: decl/func/functions.swift
    Swift(linux-x86_64) :: decl/inherit/override.swift
    Swift(linux-x86_64) :: decl/protocol/conforms/near_miss_objc.swift
    Swift(linux-x86_64) :: decl/protocol/req/func.swift
    Swift(linux-x86_64) :: decl/objc_override_multi.swift
    Swift(linux-x86_64) :: decl/objc_redeclaration_multi.swift
    Swift(linux-x86_64) :: decl/protocol/req/optionality.swift
    Swift(linux-x86_64) :: decl/protocol/req/associated_type_objc.swift
    Swift(linux-x86_64) :: decl/protocol/req/unavailable.swift
    Swift(linux-x86_64) :: decl/protocol/objc.swift
    Swift(linux-x86_64) :: expr/dynamic_lookup.swift
    Swift(linux-x86_64) :: type/subclass_composition_objc.swift
    Swift(linux-x86_64) :: Generics/existential_restrictions.swift
    Swift(linux-x86_64) :: expr/cast/as_coerce.swift
    Swift(linux-x86_64) :: decl/class/override.swift
    Swift(linux-x86_64) :: Serialization/override.swift
    Swift(linux-x86_64) :: Serialization/class.swift
    Swift(linux-x86_64) :: Serialization/class-roundtrip-module.swift
    Swift(linux-x86_64) :: IRGen/witness_table_objc_associated_type.swift
    Swift(linux-x86_64) :: SILOptimizer/definite_init_failable_initializers_objc.swift
    Swift(linux-x86_64) :: Serialization/objc.swift
    Swift(linux-x86_64) :: decl/protocol/req/optional.swift
    Swift(linux-x86_64) :: attr/attr_dynamic.swift
    Swift(linux-x86_64) :: IDE/print_usrs.swift
    Swift(linux-x86_64) :: Interpreter/enum-nonexhaustivity.swift
    Swift(linux-x86_64) :: Serialization/class-determinism.swift
    Swift(linux-x86_64) :: IRGen/objc_enum_multi_file.swift
    Swift(linux-x86_64) :: decl/func/dynamic_self.swift
    Swift(linux-x86_64) :: Constraints/generics.swift
    Swift(linux-x86_64) :: attr/attr_cdecl.swift
    Swift(linux-x86_64) :: IRGen/builtins.swift
    Swift(linux-x86_64) :: attr/attr_discardableResult.swift
    Swift(linux-x86_64) :: attr/attributes.swift
    Swift(linux-x86_64) :: decl/protocol/protocols.swift
    Swift(linux-x86_64) :: IRGen/protocol_metadata.swift
    Swift(linux-x86_64) :: SILGen/builtins.swift
    Swift(linux-x86_64) :: SILGen/dynamic_self.swift
    Swift(linux-x86_64) :: SILGen/initializers.swift
    Swift(linux-x86_64) :: SILGen/init_ref_delegation.swift
    Swift(linux-x86_64) :: SILGen/guaranteed_self.swift
    Swift(linux-x86_64) :: SILGen/generic_property_base_lifetime.swift
    Swift(linux-x86_64) :: SILGen/properties.swift
    Swift(linux-x86_64) :: SILGen/protocol_extensions.swift
    Swift(linux-x86_64) :: SILGen/protocol_optional.swift
    Swift(linux-x86_64) :: SILGen/witness_tables.swift
    Swift(linux-x86_64) :: SILGen/vtable_thunks.swift
    Swift(linux-x86_64) :: SILGen/witnesses.swift
    Swift(linux-x86_64) :: SILOptimizer/sil_combine.sil
    Swift(linux-x86_64) :: SIL/Parser/basic.sil
    Swift(linux-x86_64) :: SILOptimizer/simplify_cfg.sil
    Swift(linux-x86_64) :: IRGen/enum.sil
    Swift(linux-x86_64) :: Serialization/Recovery/typedefs.swift
    Swift(linux-x86_64) :: SILOptimizer/sil_simplify_instrs.sil
    Swift(linux-x86_64) :: Serialization/basic_sil.swift
    Swift(linux-x86_64) :: SILOptimizer/cast_promote.sil
    Swift(linux-x86_64) :: SILOptimizer/mandatory_inlining.sil
    Swift(linux-x86_64) :: SILOptimizer/functionsigopts_sroa.sil
    Swift(linux-x86_64) :: IRGen/exactcast.sil
    Swift(linux-x86_64) :: SILOptimizer/existential_type_propagation.sil
    Swift(linux-x86_64) :: SILOptimizer/inlinecaches_objc.sil
    Swift(linux-x86_64) :: SIL/ownership-verifier/use_verifier.sil
    Swift(linux-x86_64) :: SIL/Parser/overloaded_member.sil
    Swift(linux-x86_64) :: SILOptimizer/devirt_access.sil
    Swift(linux-x86_64) :: SILOptimizer/devirt_jump_thread.sil
    Swift(linux-x86_64) :: SILOptimizer/cast_foldings.sil
    Swift(linux-x86_64) :: SILOptimizer/devirt_access_serialized.sil
    Swift(linux-x86_64) :: SILOptimizer/sink.sil
    Swift(linux-x86_64) :: SILOptimizer/looprotate.sil
    Swift(linux-x86_64) :: SILOptimizer/split_critical_edges.sil
    Swift(linux-x86_64) :: SILOptimizer/devirt_speculative.sil
    Swift(linux-x86_64) :: IRGen/exactcast2.sil
    Swift(linux-x86_64) :: SIL/Parser/undef.sil

  Expected Passes    : 3139
  Expected Failures  : 56
  Unsupported Tests  : 1154
  Unexpected Failures: 84

I imagine that this mostly matters for the SIL tests, which are excused from importing Foundation.

Hey!

Thanks for working on this. That is a useful diagnostic to have. I think that if possible, we should just enable the interop via the -enable-objc-interop frontend flag.