xref: /llvm-project/libcxx/test/libcxx/feature_test_macro/std_dialects.sh.py (revision d2dd4b55e67e333d9253abeeacac5d3de1a094db)
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# RUN: %{python} %s %{libcxx-dir}/utils %{libcxx-dir}/test/libcxx/feature_test_macro/test_data.json
10
11import sys
12
13sys.path.append(sys.argv[1])
14from generate_feature_test_macro_components import FeatureTestMacros
15
16
17def test(output, expected):
18    assert output == expected, f"expected\n{expected}\n\noutput\n{output}"
19
20
21ftm = FeatureTestMacros(sys.argv[2])
22test(
23    ftm.std_dialects,
24    [
25        "c++17",
26        "c++20",
27        "c++23",
28        "c++26",
29    ],
30)
31