Skip to content

Commit 4492c38

Browse files
jiel-nvgmarkall
authored andcommitted
Add a test for the boolean type fix
1 parent ad04a60 commit 4492c38

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

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

75+
def test_bool_type(self):
76+
sig = (types.int32, types.int32)
77+
@cuda.jit("void(int32, int32)", debug=True, opt=False)
78+
def f(x, y):
79+
z = x == y
80+
81+
llvm_ir = f.inspect_llvm(sig)
82+
83+
# extract the metadata node id from `type` field of DILocalVariable
84+
pat = r'!DILocalVariable\(.*name:\s+"z".*type:\s+!(\d+)'
85+
match = re.compile(pat).search(llvm_ir)
86+
self.assertIsNotNone(match, msg=llvm_ir)
87+
mdnode_id = match.group(1)
88+
89+
# verify the DIBasicType has correct encoding attribute DW_ATE_boolean
90+
pat = f'!{mdnode_id}\s+=\s+!DIBasicType\(.*DW_ATE_boolean'
91+
match = re.compile(pat).search(llvm_ir)
92+
self.assertIsNotNone(match, msg=llvm_ir)
93+
7594
@unittest.skip("Wrappers no longer exist")
7695
def test_wrapper_has_debuginfo(self):
7796
sig = (types.int32[::1],)

0 commit comments

Comments
 (0)