1 # Ensure that a nonexistent path is ignored with a syslibroot
2 # Don't use %lld to not pick up the default syslibroot flag.
4 RUN: %no-arg-lld -arch x86_64 -platform_version macos 10 11 -v -dylib \
5 RUN: -o /dev/null -syslibroot /var/empty 2>&1 \
6 RUN: | FileCheck %s -check-prefix CHECK-NONEXISTENT-SYSLIBROOT
8 CHECK-NONEXISTENT-SYSLIBROOT: Library search paths:
9 CHECK-NONEXISTENT-SYSLIBROOT-NEXT: Framework search paths:
11 RUN: mkdir -p %t/usr/lib
12 RUN: %no-arg-lld -arch x86_64 -platform_version macos 10 11 -v -dylib \
13 RUN: -o /dev/null -syslibroot %t 2>&1 \
14 RUN: | FileCheck %s -check-prefix CHECK-SYSLIBROOT -DROOT=%t
16 CHECK-SYSLIBROOT-NOT: directory not found{{.*}}usr/local/lib
17 CHECK-SYSLIBROOT: Library search paths:
18 CHECK-SYSLIBROOT-NEXT: [[ROOT]]/usr/lib
20 RUN: mkdir -p %t/Library/libxml2-development
21 RUN: %no-arg-lld -arch x86_64 -platform_version macos 10 11 -v -dylib \
22 RUN: -o /dev/null -syslibroot %t -L /Library/libxml2-development 2>&1 \
23 RUN: | FileCheck %s -check-prefix CHECK-ABSOLUTE-PATH-REROOTED -DROOT=%t
25 CHECK-ABSOLUTE-PATH-REROOTED: Library search paths:
26 CHECK-ABSOLUTE-PATH-REROOTED: [[ROOT]]/Library/libxml2-development
27 CHECK-ABSOLUTE-PATH-REROOTED: [[ROOT]]/usr/lib
29 RUN: %no-arg-lld -arch x86_64 -platform_version macos 10 11 -v -dylib \
30 RUN: -o /dev/null -syslibroot %t -L %t/Library/libxml2-development 2>&1 \
31 RUN: | FileCheck %s -check-prefix CHECK-PATH-WITHOUT-REROOT -DPATH=%t/Library/libxml2-development
32 CHECK-PATH-WITHOUT-REROOT: Library search paths:
33 CHECK-PATH-WITHOUT-REROOT-NEXT: [[PATH]]
35 RUN: mkdir -p %t.2/usr/lib
36 RUN: %no-arg-lld -arch x86_64 -platform_version macos 10 11 -v -dylib \
37 RUN: -o /dev/null -syslibroot %t -syslibroot %t.2 2>&1 \
38 RUN: | FileCheck %s -check-prefix CHECK-SYSLIBROOT-MATRIX -DROOT=%t
40 CHECK-SYSLIBROOT-MATRIX: Library search paths:
41 CHECK-SYSLIBROOT-MATRIX: [[ROOT]]/usr/lib
42 CHECK-SYSLIBROOT-MATRIX: [[ROOT]].2/usr/lib
44 RUN: %no-arg-lld -arch x86_64 -platform_version macos 10 11 -v -dylib \
45 RUN: -o /dev/null -syslibroot %t -syslibroot %t.2 -syslibroot / 2>&1 \
46 RUN: | FileCheck %s -check-prefix CHECK-SYSLIBROOT-IGNORED -DROOT=%t
48 CHECK-SYSLIBROOT-IGNORED: Library search paths:
49 CHECK-SYSLIBROOT-IGNORED-NOT: [[ROOT]]/usr/lib
50 CHECK-SYSLIBROOT-IGNORED-NOT: [[ROOT]].2/usr/lib
52 RUN: mkdir -p %t/System/Library/Frameworks
53 RUN: %no-arg-lld -arch x86_64 -platform_version macos 10 11 -v -dylib \
54 RUN: -o /dev/null -syslibroot %t 2>&1 \
55 RUN: | FileCheck %s -check-prefix CHECK-SYSLIBROOT-FRAMEWORK -DROOT=%t
57 CHECK-SYSLIBROOT-FRAMEWORK: Framework search paths:
58 CHECK-SYSLIBROOT-FRAMEWORK: [[ROOT]]/System/Library/Frameworks
60 RUN: mkdir -p %t/Library/Frameworks
61 RUN: mkdir -p %t.2/Library/Frameworks
62 RUN: %no-arg-lld -arch x86_64 -platform_version macos 10 11 -v -dylib \
63 RUN: -o /dev/null -syslibroot %t -syslibroot %t.2 \
64 RUN: -F /Library/Frameworks 2>&1 \
65 RUN: | FileCheck %s -check-prefix CHECK-SYSLIBROOT-FRAMEWORK-MATRIX -DROOT=%t
67 CHECK-SYSLIBROOT-FRAMEWORK-MATRIX: Framework search paths:
68 CHECK-SYSLIBROOT-FRAMEWORK-MATRIX: [[ROOT]]/Library/Frameworks
69 CHECK-SYSLIBROOT-FRAMEWORK-MATRIX: [[ROOT]].2/Library/Frameworks
71 RUN: %no-arg-lld -arch x86_64 -platform_version macos 10 11 -v -dylib \
72 RUN: -o /dev/null -syslibroot %t -syslibroot %t.2 -syslibroot / \
73 RUN: -F /Library/Frameworks 2>&1 \
74 RUN: | FileCheck %s -check-prefix CHECK-SYSLIBROOT-FRAMEWORK-IGNORED -DROOT=%t
76 CHECK-SYSLIBROOT-FRAMEWORK-IGNORED: Framework search paths:
77 CHECK-SYSLIBROOT-FRAMEWORK-IGNORED-NOT: [[ROOT]]/Library/Frameworks
78 CHECK-SYSLIBROOT-FRAMEWORK-IGNORED-NOT: [[ROOT]].2/Library/Frameworks