Skip to content

Commit 56aad6e

Browse files
jiel-nvgmarkall
authored andcommitted
Add a test for the bool name fix
1 parent bca956d commit 56aad6e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

numba_cuda/numba/cuda/tests/cudapy/test_debuginfo.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,23 @@ def test_issue_5835(self):
7272
def f(x):
7373
x[0] = 0
7474

75+
def test_issue_9888(self):
76+
# Compiler created symbol should not be emitted in DILocalVariable
77+
# See Numba Issue #9888 https://github.com/numba/numba/pull/9888
78+
sig = (types.boolean,)
79+
@cuda.jit(sig, debug=True, opt=False)
80+
def f(cond):
81+
if cond:
82+
x = 1
83+
else:
84+
x = 0
85+
86+
llvm_ir = f.inspect_llvm(sig)
87+
# A varible name starting with "bool" in the debug metadata
88+
pat = r'!DILocalVariable\(.*name:\s+\"bool'
89+
match = re.compile(pat).search(llvm_ir)
90+
self.assertIsNone(match, msg=llvm_ir)
91+
7592
@unittest.skip("Wrappers no longer exist")
7693
def test_wrapper_has_debuginfo(self):
7794
sig = (types.int32[::1],)

0 commit comments

Comments
 (0)