Skip to content

Commit 71cc99f

Browse files
author
Diptorup Deb
committed
Update test cases based on latest changes to DWARF generation.
1 parent 0287101 commit 71cc99f

File tree

5 files changed

+14
-17
lines changed

5 files changed

+14
-17
lines changed

numba_dpex/tests/debugging/test_backtraces.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,5 @@ def test_backtrace(app):
2525

2626
app.backtrace()
2727

28-
app.expect(
29-
r"#0.*__main__::func_sum.* at simple_dpex_func.py:12", with_eol=True
30-
)
31-
app.expect(r"#1.*__main__::kernel_sum", with_eol=True)
28+
app.expect(r"#0.*func_sum.* at simple_dpex_func.py:12", with_eol=True)
29+
app.expect(r"#1.*kernel_sum", with_eol=True)

numba_dpex/tests/debugging/test_breakpoints.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ def test_device_func_breakpoint(
5656
SAT-4449
5757
"""
5858

59-
if api == "numba-ndpx-kernel" and breakpoint != "side-by-side.py:15":
60-
pytest.skip(
61-
"Breakpoint by function name not working for numba-dpex."
62-
) # TODO: https://github.com/IntelPython/numba-dpex/issues/1242
63-
6459
app.breakpoint(breakpoint, condition=condition)
6560
app.run(f"side-by-side.py --api={api}")
6661
app.expect_hit_breakpoint("side-by-side.py:15")

numba_dpex/tests/debugging/test_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def test_info_functions(app):
104104

105105
app.info_functions("data_parallel_sum")
106106

107-
app.child.expect(r"11:\s+[a-z 0-9\*]+__main__::data_parallel_sum")
107+
app.child.expect(r"11:\s+[a-z 0-9\*]+data_parallel_sum")
108108

109109

110110
@pytest.mark.parametrize(

numba_dpex/tests/debugging/test_stepping.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_next(app: gdb):
3131
)
3232
# checking that we did not step in
3333
app.next()
34-
app.expect(r"in _ZN8__main__21kernel_sum_", with_eol=True)
34+
app.expect(r"in _ZN8__main__14kernel_sum_", with_eol=True)
3535

3636

3737
def test_step(app: gdb):
@@ -44,7 +44,7 @@ def test_step(app: gdb):
4444
)
4545
app.set_scheduler_lock()
4646
app.step()
47-
app.expect(r"__main__::func_sum.* at simple_dpex_func.py:12", with_eol=True)
47+
app.expect(r"func_sum.* at simple_dpex_func.py:12", with_eol=True)
4848
app.expect(r"12\s+result = a_in_func \+ b_in_func", with_eol=True)
4949
app.step()
5050
app.expect(

numba_dpex/tests/test_debuginfo.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ def data_parallel_sum(item, a, b, c):
126126
c[i] = func_sum(a[i], b[i])
127127

128128
ir_tags = [
129-
r'\!DISubprogram\(name: ".*func_sum\$?\d*"',
130-
r'\!DISubprogram\(name: ".*data_parallel_sum\$?\d*"',
129+
r'\!DISubprogram\(name: ".*func_sum*"',
130+
r'\!DISubprogram\(name: ".*data_parallel_sum*"',
131131
]
132132

133133
sig = (itemty, f32arrty, f32arrty, f32arrty)
@@ -156,8 +156,8 @@ def data_parallel_sum(item, a, b, c):
156156
c[i] = func_sum(a[i], b[i])
157157

158158
ir_tags = [
159-
r'\!DISubprogram\(name: ".*func_sum\$?\d*"',
160-
r'\!DISubprogram\(name: ".*data_parallel_sum\$\d*"',
159+
r'\!DISubprogram\(name: ".*func_sum*"',
160+
r'\!DISubprogram\(name: ".*data_parallel_sum"',
161161
]
162162

163163
sig = (itemty, f32arrty, f32arrty, f32arrty)
@@ -176,6 +176,8 @@ def data_parallel_sum(item, a, b, c):
176176

177177

178178
def test_debuginfo_DISubprogram_linkageName():
179+
"""Tests to check that the linkagename tag is not set by numba-dpex."""
180+
179181
def foo(item, a, b):
180182
i = item.get_id(0)
181183
b[i] = a[i]
@@ -190,7 +192,9 @@ def foo(item, a, b):
190192
kernel_ir = kcres.library.get_llvm_str()
191193

192194
for tag in ir_tags:
193-
assert make_check(kernel_ir, tag)
195+
# Ensure that linkagename (DW_AT_linkagename) tag is not present for
196+
# the DISubprogram attribute.
197+
assert not make_check(kernel_ir, tag)
194198

195199

196200
def test_debuginfo_DICompileUnit_language_and_producer():

0 commit comments

Comments
 (0)