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++abi when built
12// as a system library on Apple platforms.
13
14// Make sure we install the libc++abi headers in the right location.
15// TODO: We don't currently install them, but we should.
16//
17// XRUNX: stat "%{include}/cxxabi.h"
18
19// Make sure we install libc++abi.dylib in the right location.
20//
21// RUN: stat "%{lib}/libc++abi.dylib"
22
23// Make sure we don't install a symlink from libc++abi.dylib to libc++abi.1.dylib,
24// unlike what we do for libc++.dylib.
25// TODO: We currently don't do that correctly in the CMake build.
26//
27// XRUNX: ! readlink "%{lib}/libc++abi.dylib"
28// XRUNX: ! stat "%{lib}/libc++abi.1.dylib"
29
30// Make sure the install_name is /usr/lib.
31//
32// In particular, make sure we don't use any @rpath in the load commands. When building as
33// a system library, it is important to hardcode the installation paths in the dylib, because
34// various tools like dyld and ld64 will treat us specially if they recognize us as being a
35// system library.
36//
37// TODO: We currently don't do that correctly in the CMake build.
38//
39// XRUNX: otool -L "%{lib}/libc++abi.dylib" | grep '/usr/lib/libc++abi.dylib'
40// XRUNX: ! otool -l "%{lib}/libc++abi.dylib" | grep -E "LC_RPATH|@loader_path|@rpath"
41
42// Make sure the compatibility_version of libc++abi is 1.0.0. Failure to respect this can result
43// in applications not being able to find libc++abi when they are loaded by dyld, if the
44// compatibility version was bumped.
45//
46// RUN: otool -L "%{lib}/libc++abi.dylib" | grep "libc++abi.1.dylib" | grep "compatibility version 1.0.0"
47

source code of libcxxabi/test/vendor/apple/system-install-properties.sh.cpp