File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
numba_cuda/numba/cuda/tests/cudapy Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff 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 ],)
You can’t perform that action at this time.
0 commit comments