@@ -5,7 +5,7 @@ import CodeDiffs.Cleanup as CDC
55is_removed (needle, present_there, not_there) =
66 occursin (needle, present_there) && ! occursin (needle, not_there)
77
8- has_trailling_spaces (str) = occursin (r" \h +(\n |$)" m , str)
8+ has_trailing_spaces (str) = occursin (r" \h +(\n |$)" m , str)
99
1010
1111@testset " Demangling" begin
@@ -200,10 +200,10 @@ end
200200 @test is_removed (r" \t @%" , ptx_sample, cleaned_ptx)
201201
202202 # Reformat function calls
203- @test is_removed (r" call.+?, \R " , ptx_sample, cleaned_ptx)
203+ @test is_removed (r" call\S + \s + \R " , ptx_sample, cleaned_ptx)
204204
205205 # Others
206- @test ! has_trailling_spaces (cleaned_ptx)
206+ @test ! has_trailing_spaces (cleaned_ptx)
207207 @test count (r" \R {2,}" , cleaned_ptx) == 0 # no empty lines
208208
209209 # Make sure we didn't remove any instruction by mistake
@@ -220,15 +220,17 @@ end
220220 println (TEST_IO, cleaned_ptx)
221221
222222 # Proper cleanup of each parameter name
223- @test count (func_name * r" \d +_param_\d +\b " , ptx_sample) == 3
224- @test count (func_name * r" _param_\d +\b " , cleaned_ptx) == 3
223+ @test count (func_name * r" _\d +_param_\d +\b " , ptx_sample) == 6
224+ @test count (r" \b param_\d +\b " , cleaned_ptx) == 6
225+
226+ # Others
227+ @test ! has_trailing_spaces (cleaned_ptx)
228+ @test count (r" \R {2,}" , cleaned_ptx) == 0 # no empty lines
229+ @test ! endswith (cleaned_ptx, r" \R " ) # no trailing newlines
225230
226231 # Make sure we didn't remove any instruction by mistake
227232 @test count (' ;' , ptx_sample) == count (' ;' , cleaned_ptx)
228233 end
229-
230-
231- # TODO : calls with 0 parameters are not reformatted correctly
232234end
233235
234236
257259 # Code-gen comments are all removed
258260 @test is_removed (r" ; %L\d +" , gcn_sample, cleaned_gcn)
259261 @test is_removed (r" ; %bb\.\d +:" , gcn_sample, cleaned_gcn)
260- @test is_removed (" divergent unreachable" , gcn_sample, cleaned_gcn)
262+ @test is_removed (" ; divergent unreachable" , gcn_sample, cleaned_gcn)
261263 @test is_removed (" ; -- Begin function" , gcn_sample, cleaned_gcn)
262264 @test is_removed (" ; -- End function" , gcn_sample, cleaned_gcn)
265+
266+ # Others
267+ @test ! has_trailing_spaces (cleaned_gcn)
268+ @test count (r" \R {2,}" , cleaned_gcn) == 0 # no empty lines
269+ @test ! endswith (cleaned_gcn, r" \R " ) # no trailing newlines
263270 end
264271end
265272
0 commit comments