aboutsummaryrefslogtreecommitdiff
path: root/libcxx/test/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp
blob: 561d77c569473c38b1d57d1f7788f5abd8f327b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// This test greps for %t, which is expanded to a path with backslashes. When
// that is passed to grep, those backslashes must be escaped. We escape those
// within the pattern into a file and use this file with 'grep'.

// Make sure that substitutions are performed inside additional compiler flags.

// ADDITIONAL_COMPILE_FLAGS: -I %t.1
// ADDITIONAL_COMPILE_FLAGS: -isystem %t.2 -isysroot %t.3
// RUN: echo "-I %t.1 -isystem %t.2 -isysroot %t.3" | sed "s/\\\/\\\\\\\/g" > %t.escaped.grep
// RUN: echo "%{compile_flags}" | grep -e -f %t.escaped.grep