Skip to content

Commit

Permalink
Update test cases based on latest changes to DWARF generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Diptorup Deb committed Apr 27, 2024
1 parent 9231e1a commit 0f64099
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
6 changes: 2 additions & 4 deletions numba_dpex/tests/debugging/test_backtraces.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,5 @@ def test_backtrace(app):

app.backtrace()

app.expect(
r"#0.*__main__::func_sum.* at simple_dpex_func.py:12", with_eol=True
)
app.expect(r"#1.*__main__::kernel_sum", with_eol=True)
app.expect(r"#0.*func_sum.* at simple_dpex_func.py:12", with_eol=True)
app.expect(r"#1.*kernel_sum", with_eol=True)
5 changes: 0 additions & 5 deletions numba_dpex/tests/debugging/test_breakpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ def test_device_func_breakpoint(
SAT-4449
"""

if api == "numba-ndpx-kernel" and breakpoint != "side-by-side.py:15":
pytest.skip(
"Breakpoint by function name not working for numba-dpex."
) # TODO: https://github.com/IntelPython/numba-dpex/issues/1242

app.breakpoint(breakpoint, condition=condition)
app.run(f"side-by-side.py --api={api}")
app.expect_hit_breakpoint("side-by-side.py:15")
Expand Down
2 changes: 1 addition & 1 deletion numba_dpex/tests/debugging/test_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_info_functions(app):

app.info_functions("data_parallel_sum")

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


@pytest.mark.parametrize(
Expand Down
4 changes: 2 additions & 2 deletions numba_dpex/tests/debugging/test_stepping.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_next(app: gdb):
)
# checking that we did not step in
app.next()
app.expect(r"in _ZN8__main__21kernel_sum_", with_eol=True)
app.expect(r"in _ZN8__main__14kernel_sum_", with_eol=True)


def test_step(app: gdb):
Expand All @@ -44,7 +44,7 @@ def test_step(app: gdb):
)
app.set_scheduler_lock()
app.step()
app.expect(r"__main__::func_sum.* at simple_dpex_func.py:12", with_eol=True)
app.expect(r"func_sum.* at simple_dpex_func.py:12", with_eol=True)
app.expect(r"12\s+result = a_in_func \+ b_in_func", with_eol=True)
app.step()
app.expect(
Expand Down
10 changes: 5 additions & 5 deletions numba_dpex/tests/test_debuginfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ def data_parallel_sum(item, a, b, c):
c[i] = func_sum(a[i], b[i])

ir_tags = [
r'\!DISubprogram\(name: ".*func_sum\$?\d*"',
r'\!DISubprogram\(name: ".*data_parallel_sum\$?\d*"',
r'\!DISubprogram\(name: ".*func_sum*"',
r'\!DISubprogram\(name: ".*data_parallel_sum*"',
]

sig = (itemty, f32arrty, f32arrty, f32arrty)
Expand Down Expand Up @@ -156,8 +156,8 @@ def data_parallel_sum(item, a, b, c):
c[i] = func_sum(a[i], b[i])

ir_tags = [
r'\!DISubprogram\(name: ".*func_sum\$?\d*"',
r'\!DISubprogram\(name: ".*data_parallel_sum\$\d*"',
r'\!DISubprogram\(name: ".*func_sum*"',
r'\!DISubprogram\(name: ".*data_parallel_sum"',
]

sig = (itemty, f32arrty, f32arrty, f32arrty)
Expand Down Expand Up @@ -190,7 +190,7 @@ def foo(item, a, b):
kernel_ir = kcres.library.get_llvm_str()

for tag in ir_tags:
assert make_check(kernel_ir, tag)
assert not make_check(kernel_ir, tag)


def test_debuginfo_DICompileUnit_language_and_producer():
Expand Down

0 comments on commit 0f64099

Please sign in to comment.