Debian Codegraph @

libcxx/test/libcxx-03/vendor/apple/system-install-properties.sh.cpp

raw
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 // REQUIRES: stdlib=apple-libc++
10
11 // This file checks various properties of the installation of libc++ when built as
12 // a system library on Apple platforms.
13
14 // Make sure we install the libc++ headers in the right location.
15 //
16 // RUN: stat "%{include-dir}/__config"
17
18 // Make sure we install libc++.1.dylib and libc++experimental.a in the right location.
19 //
20 // RUN: stat "%{lib-dir}/libc++.1.dylib"
21 // RUN: stat "%{lib-dir}/libc++experimental.a"
22
23 // Make sure we install a symlink from libc++.dylib to libc++.1.dylib.
24 //
25 // RUN: stat "%{lib-dir}/libc++.dylib"
26 // RUN: readlink "%{lib-dir}/libc++.dylib" | grep "libc++.1.dylib"
27
28 // Make sure the install_name is /usr/lib.
29 //
30 // In particular, make sure we don't use any @rpath in the load commands. When building as
31 // a system library, it is important to hardcode the installation paths in the dylib, because
32 // various tools like dyld and ld64 will treat us specially if they recognize us as being a
33 // system library.
34 //
35 // RUN: otool -L "%{lib-dir}/libc++.1.dylib" | grep '/usr/lib/libc++.1.dylib'
36 // RUN: otool -l "%{lib-dir}/libc++.1.dylib" | grep -vE "LC_RPATH|@loader_path|@rpath"
37
38 // Make sure the compatibility_version of libc++ is 1.0.0.
39 // Failure to respect this can result in applications not being able to find libc++
40 // when they are loaded by dyld, if the compatibility version was bumped.
41 //
42 // RUN: otool -L "%{lib-dir}/libc++.1.dylib" | grep "libc++.1.dylib" | grep "compatibility version 1.0.0"
43
44 // Make sure we use the libdispatch backend for the PSTL.
45 //
46 // RUN: grep "%{include-dir}/__config_site" -e '#define _LIBCPP_PSTL_BACKEND_LIBDISPATCH'