[AMDGPU][True16][CodeGen] true16 codegen pattern for f16 canonicalize (#122000)
[llvm-project.git] / lldb / test / API / lang / c / conflicting-symbol / TestConflictingSymbol.py
blob6e29796ed58be5b5d97c62b0b1ba6e4e5a0f6d33
1 """Test that conflicting symbols in different shared libraries work correctly"""
4 import lldb
5 from lldbsuite.test.decorators import *
6 from lldbsuite.test.lldbtest import *
7 from lldbsuite.test import lldbutil
10 class TestConflictingSymbols(TestBase):
11 NO_DEBUG_INFO_TESTCASE = True
13 def setUp(self):
14 TestBase.setUp(self)
15 lldbutil.mkdir_p(self.getBuildArtifact("One"))
16 lldbutil.mkdir_p(self.getBuildArtifact("Two"))
18 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489")
19 def test_conflicting_symbols(self):
20 self.build()
21 exe = self.getBuildArtifact("a.out")
22 target = self.dbg.CreateTarget(exe)
23 self.assertTrue(target, VALID_TARGET)
25 # Register our shared libraries for remote targets so they get
26 # automatically uploaded
27 environment = self.registerSharedLibrariesWithTarget(target, ["One", "Two"])
29 lldbutil.run_break_set_by_source_regexp(
30 self, "// break here", extra_options="-f One.c", num_expected_locations=-2
32 lldbutil.run_break_set_by_source_regexp(
33 self, "// break here", extra_options="-f Two.c", num_expected_locations=-2
35 lldbutil.run_break_set_by_source_regexp(
36 self, "// break here", extra_options="-f main.c", num_expected_locations=1
39 process = target.LaunchSimple(
40 None, environment, self.get_process_working_directory()
42 self.assertTrue(process, PROCESS_IS_VALID)
44 # The stop reason of the thread should be breakpoint.
45 self.expect(
46 "thread list",
47 STOPPED_DUE_TO_BREAKPOINT,
48 substrs=["stopped", "stop reason = breakpoint"],
51 lldbutil.check_breakpoint(self, bpno=1, expected_hit_count=1)
53 # This should display correctly.
54 self.expect(
55 "expr (unsigned long long)conflicting_symbol",
56 "Symbol from One should be found",
57 substrs=["11111"],
60 self.runCmd("continue", RUN_SUCCEEDED)
62 # The stop reason of the thread should be breakpoint.
63 self.expect(
64 "thread list",
65 STOPPED_DUE_TO_BREAKPOINT,
66 substrs=["stopped", "stop reason = breakpoint"],
69 lldbutil.check_breakpoint(self, bpno=1, expected_hit_count=1)
71 self.expect(
72 "expr (unsigned long long)conflicting_symbol",
73 "Symbol from Two should be found",
74 substrs=["22222"],
77 self.runCmd("continue", RUN_SUCCEEDED)
79 # The stop reason of the thread should be breakpoint.
80 self.expect(
81 "thread list",
82 STOPPED_DUE_TO_BREAKPOINT,
83 substrs=["stopped", "stop reason = breakpoint"],
86 lldbutil.check_breakpoint(self, bpno=1, expected_hit_count=1)
88 self.expect(
89 "expr (unsigned long long)conflicting_symbol",
90 "An error should be printed when symbols can't be ordered",
91 error=True,
92 substrs=["Multiple internal symbols"],
95 @expectedFailureAll(bugnumber="llvm.org/pr35043")
96 @skipIfWindows # This test is "passing" on Windows, but it is a false positive.
97 def test_shadowed(self):
98 self.build()
99 exe = self.getBuildArtifact("a.out")
100 target = self.dbg.CreateTarget(exe)
101 self.assertTrue(target, VALID_TARGET)
103 # Register our shared libraries for remote targets so they get
104 # automatically uploaded
105 environment = self.registerSharedLibrariesWithTarget(target, ["One", "Two"])
107 lldbutil.run_break_set_by_source_regexp(
108 self, "// break here", extra_options="-f main.c", num_expected_locations=1
111 process = target.LaunchSimple(
112 None, environment, self.get_process_working_directory()
114 self.assertTrue(process, PROCESS_IS_VALID)
116 # The stop reason of the thread should be breakpoint.
117 self.expect(
118 "thread list",
119 STOPPED_DUE_TO_BREAKPOINT,
120 substrs=["stopped", "stop reason = breakpoint"],
123 # As we are shadowing the conflicting symbol, there should be no
124 # ambiguity in this expression.
125 self.expect(
126 "expr int conflicting_symbol = 474747; conflicting_symbol",
127 substrs=["474747"],