26 lines · python
1import lldb2from lldbsuite.test.decorators import *3from lldbsuite.test.lldbtest import *4from lldbsuite.test import lldbutil5 6 7class TestCPP20Standard(TestBase):8 @add_test_categories(["libc++"])9 @skipIf(compiler="clang", compiler_version=["<", "11.0"])10 def test_cpp20(self):11 """12 Tests that we can evaluate an expression in C++20 mode13 """14 self.build()15 lldbutil.run_to_source_breakpoint(self, "Foo{}", lldb.SBFileSpec("main.cpp"))16 17 self.expect(18 "expr -l c++11 -- Foo{} <=> Foo{}",19 error=True,20 substrs=[21 "'<=>' is a single token in C++20; add a space to avoid a change in behavior"22 ],23 )24 25 self.expect("expr -l c++20 -- Foo{} <=> Foo{}", substrs=["(bool) $0 = true"])26