blob: 5a51f1be4e82312c8c3c916102af5d74e3f88d62 [file] [log] [blame]
// -*- C++ -*-
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// Test that _LIBCPP_FREESTANDING is not defined when -ffreestanding is not passed
// to the compiler but defined when -ffreestanding is passed to the compiler.
// RUN: %{cxx} %{flags} %{compile_flags} -fsyntax-only %s
// RUN: %{cxx} %{flags} %{compile_flags} -fsyntax-only -ffreestanding -DFREESTANDING %s
#include <__config>
#error _LIBCPP_FREESTANDING should be defined in freestanding mode and not \
defined in non-freestanding mode