Files
clang-p2996/lldb/test/API/lang/cpp/standards/cpp20/TestCPP20Standard.py
Michael Buch 52882de0e6 [lldb][test] TestCPP20Standard.py: make it a libc++ test
We just want to test whether the language switch works.
This is easier to control for libc++, since for bots building
the tests against libstdc++ we might not have the necessary
`<compare>` header available currently.
2023-05-02 07:38:53 -04:00

19 lines
726 B
Python

import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestCPP20Standard(TestBase):
@add_test_categories(["libc++"])
@skipIf(compiler="clang", compiler_version=['<', '11.0'])
def test_cpp20(self):
"""
Tests that we can evaluate an expression in C++20 mode
"""
self.build()
lldbutil.run_to_source_breakpoint(self, "Foo{}", lldb.SBFileSpec("main.cpp"))
self.expect("expr -l c++11 -- Foo{} <=> Foo{}", error=True, substrs=["'<=>' is a single token in C++20; add a space to avoid a change in behavior"])
self.expect("expr -l c++20 -- Foo{} <=> Foo{}", substrs=["(bool) $0 = true"])