13e66bd29SRaphael Isemannimport lldb 23e66bd29SRaphael Isemannfrom lldbsuite.test.decorators import * 33e66bd29SRaphael Isemannfrom lldbsuite.test.lldbtest import * 43e66bd29SRaphael Isemannfrom lldbsuite.test import lldbutil 53e66bd29SRaphael Isemann 63e66bd29SRaphael Isemannclass TestCase(TestBase): 73e66bd29SRaphael Isemann 83e66bd29SRaphael Isemann mydir = TestBase.compute_mydir(__file__) 93e66bd29SRaphael Isemann 103e66bd29SRaphael Isemann @no_debug_info_test 11*6331c7d0SRaphael Isemann @skipIfWindows 123e66bd29SRaphael Isemann def test(self): 133e66bd29SRaphael Isemann self.build() 143e66bd29SRaphael Isemann lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.c")) 153e66bd29SRaphael Isemann 163e66bd29SRaphael Isemann self.expect_expr("complex_float", result_type="_Complex float", result_value="-1.5 + -2.5i") 173e66bd29SRaphael Isemann self.expect_expr("complex_float + (2.0f + 3.5fi)", result_type="_Complex float", result_value="0.5 + 1i") 183e66bd29SRaphael Isemann 193e66bd29SRaphael Isemann self.expect_expr("complex_double", result_type="_Complex double", result_value="-1.5 + -2.5i") 203e66bd29SRaphael Isemann self.expect_expr("complex_double + (2.0 + 3.5i)", result_type="_Complex double", result_value="0.5 + 1i") 213e66bd29SRaphael Isemann 223e66bd29SRaphael Isemann @no_debug_info_test 233e66bd29SRaphael Isemann # FIXME: LLDB fails to read the imaginary part of the number. 243e66bd29SRaphael Isemann @expectedFailureAll() 25*6331c7d0SRaphael Isemann @skipIfWindows 263e66bd29SRaphael Isemann def test_long_double(self): 273e66bd29SRaphael Isemann self.build() 283e66bd29SRaphael Isemann lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.c")) 293e66bd29SRaphael Isemann 303e66bd29SRaphael Isemann self.expect_expr("complex_long_double", result_type="_Complex long double", result_value="-1.5 + 1i") 313e66bd29SRaphael Isemann self.expect_expr("complex_long_double + (2.0L + 3.5Li)", result_type="_Complex long double", result_value="0.5 + 1i") 32