[lld] bbe6f51 - [lld/mac] Make framework symlinks in tests more realistic

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 9 17:39:56 PDT 2021


Author: Nico Weber
Date: 2021-06-09T20:39:39-04:00
New Revision: bbe6f51b726f9d4265df4407736772dd68ac6f98

URL: https://github.com/llvm/llvm-project/commit/bbe6f51b726f9d4265df4407736772dd68ac6f98
DIFF: https://github.com/llvm/llvm-project/commit/bbe6f51b726f9d4265df4407736772dd68ac6f98.diff

LOG: [lld/mac] Make framework symlinks in tests more realistic

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

Added: 
    

Modified: 
    lld/test/MachO/framework.s
    lld/test/MachO/implicit-dylibs.s

Removed: 
    


################################################################################
diff  --git a/lld/test/MachO/framework.s b/lld/test/MachO/framework.s
index 7244387a022b..38925847935b 100644
--- a/lld/test/MachO/framework.s
+++ b/lld/test/MachO/framework.s
@@ -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

diff  --git a/lld/test/MachO/implicit-dylibs.s b/lld/test/MachO/implicit-dylibs.s
index ae96f979cdd1..f46924010351 100644
--- a/lld/test/MachO/implicit-dylibs.s
+++ b/lld/test/MachO/implicit-dylibs.s
@@ -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 \


        


More information about the llvm-commits mailing list