Skip to content

Commit

Permalink
[lld/mac] Make framework symlinks in tests more realistic
Browse files Browse the repository at this point in the history
In a framework Foo.framework, Foo.framework/Foo is usually a relative
symbolic link to Foo.framework/Versions/Current/Foo,
and Foo.framework/Versions/Current is usually a relative symbolic
link to A.

Our tests used absolute symbolic links. Now they use relative symbolic links.

No behavior change, just makes the tests more representative of the real world.

(implicit-dylib.s omits the "Current" folder too, but I'm not changing that
here.)

Differential Revision: https://reviews.llvm.org/D103998
  • Loading branch information
nico committed Jun 10, 2021
1 parent 0e399eb commit bbe6f51
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lld/test/MachO/framework.s
Expand Up @@ -4,8 +4,8 @@
# RUN: mkdir -p %t/Foo.framework/Versions/A
# RUN: %lld -dylib -install_name %t/Foo.framework/Versions/A/Foo %t/foo.o -o %t/Foo.framework/Versions/A/Foo
# RUN: %lld -dylib -install_name %t/Foo.framework/Versions/A/Foobar %t/foo.o -o %t/Foo.framework/Versions/A/Foobar
# RUN: ln -sf %t/Foo.framework/Versions/A %t/Foo.framework/Versions/Current
# RUN: ln -sf %t/Foo.framework/Versions/Current/Foo %t/Foo.framework/Foo
# RUN: ln -sf A %t/Foo.framework/Versions/Current
# RUN: ln -sf Versions/Current/Foo %t/Foo.framework/Foo

# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o
# RUN: %lld -lSystem -F%t -framework Foo %t/test.o -o %t/test
Expand Down
6 changes: 3 additions & 3 deletions lld/test/MachO/implicit-dylibs.s
Expand Up @@ -26,18 +26,18 @@
## Bar.framework is nested within Foo.framework.
# RUN: %lld -dylib -lSystem %t/framework-bar.o -o %t/System/Library/Frameworks/Foo.framework/Frameworks/Bar.framework/Versions/A/Bar \
# RUN: -install_name /System/Library/Frameworks/Foo.framework/Frameworks/Bar.framework/Versions/A/Bar
# RUN: ln -sf %t/System/Library/Frameworks/Foo.framework/Frameworks/Bar.framework/Versions/A/Bar \
# RUN: ln -sf Versions/A/Bar \
# RUN: %t/System/Library/Frameworks/Foo.framework/Frameworks/Bar.framework/Bar

## Have Foo re-export Bar.
# RUN: %lld -dylib -F %t/System/Library/Frameworks/Foo.framework/Frameworks \
# RUN: -framework Bar -sub_umbrella Bar -lSystem %t/framework-foo.o -o %t/System/Library/Frameworks/Foo.framework/Versions/A/Foo \
# RUN: -install_name /System/Library/Frameworks/Foo.framework/Versions/A/Foo
# RUN: ln -sf %t/System/Library/Frameworks/Foo.framework/Versions/A/Foo %t/System/Library/Frameworks/Foo.framework/Foo
# RUN: ln -sf Versions/A/Foo %t/System/Library/Frameworks/Foo.framework/Foo

# RUN: %lld -dylib -lSystem %t/framework-baz.o -o %t/Baz.framework/Versions/A/Baz \
# RUN: -install_name %t/Baz.framework/Versions/A/Baz
# RUN: ln -sf %t/Baz.framework/Versions/A/Baz %t/Baz.framework/Baz
# RUN: ln -sf Versions/A/Baz %t/Baz.framework/Baz

# RUN: %lld -dylib -syslibroot %t -framework Foo -F %t -framework Baz \
# RUN: -lc++ -ltoplevel -lunused %t/usr/lib/system/libsublevel.dylib %t/libfoo.dylib \
Expand Down

0 comments on commit bbe6f51

Please sign in to comment.