[lldb] Skip TestCoroutineHandle.py on libstdc++<11
authorPavel Labath <pavel@labath.sk>
Fri, 26 Aug 2022 12:03:27 +0000 (14:03 +0200)
committerPavel Labath <pavel@labath.sk>
Fri, 26 Aug 2022 12:04:04 +0000 (14:04 +0200)
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/coroutine_handle/TestCoroutineHandle.py
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/coroutine_handle/main.cpp

index 50cac6e..8288fcf 100644 (file)
@@ -23,6 +23,10 @@ class TestCoroutineHandle(TestBase):
         # Run until the initial suspension point
         lldbutil.run_to_source_breakpoint(self, '// Break at initial_suspend',
                 lldb.SBFileSpec("main.cpp", False))
+
+        if self.frame().FindVariable("is_supported").GetValueAsUnsigned(1) == 0:
+            self.skipTest("c++ library not supported")
+
         # Check that we show the correct function pointers and the `promise`. 
         self.expect_expr("gen.hdl",
             result_summary=re.compile("^coro frame = 0x[0-9a-f]*$"),
index 6a54912..439a258 100644 (file)
@@ -1,5 +1,13 @@
 #include <coroutine>
 
+bool is_implementation_supported() {
+#ifdef _GLIBCXX_RELEASE
+  return _GLIBCXX_RELEASE >= 11;
+#else
+  return true;
+#endif
+}
+
 // `int_generator` is a stripped down, minimal coroutine generator
 // type.
 struct int_generator {
@@ -32,6 +40,7 @@ int_generator my_generator_func() { co_yield 42; }
 void empty_function_so_we_can_set_a_breakpoint() {}
 
 int main() {
+  bool is_supported = is_implementation_supported();
   int_generator gen = my_generator_func();
   std::coroutine_handle<> type_erased_hdl = gen.hdl;
   gen.hdl.resume();                            // Break at initial_suspend