Skip to content

Commit 447ba68

Browse files
jiel-nvgmarkall
authored andcommitted
Add a test for the boolean type fix
1 parent 735fcd2 commit 447ba68

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
@@ -90,6 +90,25 @@ def f(cond):
9090
match = re.compile(pat).search(llvm_ir)
9191
self.assertIsNone(match, msg=llvm_ir)
9292

93+
def test_bool_type(self):
94+
sig = (types.int32, types.int32)
95+
@cuda.jit("void(int32, int32)", debug=True, opt=False)
96+
def f(x, y):
97+
z = x == y
98+
99+
llvm_ir = f.inspect_llvm(sig)
100+
101+
# extract the metadata node id from `type` field of DILocalVariable
102+
pat = r'!DILocalVariable\(.*name:\s+"z".*type:\s+!(\d+)'
103+
match = re.compile(pat).search(llvm_ir)
104+
self.assertIsNotNone(match, msg=llvm_ir)
105+
mdnode_id = match.group(1)
106+
107+
# verify the DIBasicType has correct encoding attribute DW_ATE_boolean
108+
pat = f'!{mdnode_id}\s+=\s+!DIBasicType\(.*DW_ATE_boolean'
109+
match = re.compile(pat).search(llvm_ir)
110+
self.assertIsNotNone(match, msg=llvm_ir)
111+
93112
@unittest.skip("Wrappers no longer exist")
94113
def test_wrapper_has_debuginfo(self):
95114
sig = (types.int32[::1],)

0 commit comments

Comments
 (0)