2 Test that debug symbols have the correct order as specified by the order file.
5 from __future__ import print_function
12 from lldbsuite.test.decorators import *
13 from lldbsuite.test.lldbtest import *
14 from lldbsuite.test import lldbutil
16 class OrderFileTestCase(TestBase):
18 mydir = TestBase.compute_mydir(__file__)
22 """Test debug symbols follow the correct order by the order file."""
24 exe = os.path.join(os.getcwd(), "a.out")
25 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
27 # Test that the debug symbols have Function f3 before Function f1.
28 # Use "-s address" option to sort by address.
29 self.runCmd("image dump symtab -s address a.out")
30 output = self.res.GetOutput()
31 mo_f3 = re.search("Code +.+f3", output)
32 mo_f1 = re.search("Code +.+f1", output)
34 # Match objects for f3 and f1 must exist and f3 must come before f1.
35 self.assertTrue(mo_f3 and mo_f1 and mo_f3.start() < mo_f1.start(),
36 "Symbols have correct order by the order file")
38 self.runCmd("run", RUN_COMPLETED)