[IRGen] Reject enums with inaccessible tpye metadata in layout string… (#65016)
* [IRGen] Reject enums with inaccessible tpye metadata in layout string generation
rdar://107679697
Because we are currently handling most enums in layout strings by going through the metadata, we have to ensure that the metadata is accessible from the current module and reject the enum otherwise.
* Use proper mechanism to create and reference dylib in test
* Fix linking
* Add rpath to test dylib