@@ -42,7 +42,7 @@ def test_assign_attribute():
4242 scalar = 11
4343 pair = Pair (tl .arange (0 , 4 ), scalar )
4444 # CHECK: %c42_i32 = arith.constant 42 : i32
45- # CHECK-NEXT: call @" anchor{{.*}}" ([[RANGE]], %c42_i32)
45+ # CHECK-NEXT: call @{{.*}} anchor{{.*}}([[RANGE]], %c42_i32)
4646 pair .second = 42
4747 anchor (pair )
4848
@@ -58,7 +58,7 @@ def test_augassign_attribute():
5858 # CHECK: %c42_i32 = arith.constant 42 : i32
5959 # CHECK: [[VALUE:%.*]] = arith.addi %c11_i32, %c42_i32
6060 pair .second += 42
61- # CHECK-NEXT: call @" anchor{{.*}}" ([[RANGE]], [[VALUE]])
61+ # CHECK-NEXT: call @{{.*}} anchor{{.*}}([[RANGE]], [[VALUE]])
6262 anchor (pair )
6363
6464
@@ -69,12 +69,12 @@ def test_jit_method():
6969 # CHECK: %c11_i32 = arith.constant 11 : i32
7070 # CHECK: [[RANGE:%.*]] = tt.make_range {end = 4 : i32, start = 0 : i32}
7171 scalar = 11
72- # CHECK: [[V:%.*]]:2 = tt.call @" unpack{{.*}}" ([[RANGE]], %c11_i32)
72+ # CHECK: [[V:%.*]]:2 = tt.call @{{.*}} unpack{{.*}}([[RANGE]], %c11_i32)
7373 pair = Pair (tl .arange (0 , 4 ), scalar )
7474 a , b = pair .unpack ()
75- # CHECK: call @anchor{{.*}}([[V]]#0)
75+ # CHECK: call @{{.*}} anchor{{.*}}([[V]]#0)
7676 anchor (a )
77- # CHECK: call @anchor{{.*}}([[V]]#1)
77+ # CHECK: call @{{.*}} anchor{{.*}}([[V]]#1)
7878 anchor (b )
7979
8080
@@ -95,10 +95,10 @@ def test_aggregate_initializers():
9595 # CHECK-LABEL: test_aggregate_initializers
9696 value = TypeWithBuiltinInitializer ()
9797 # CHECK: [[RANGE:%.*]] = tt.make_range {end = 4 : i32, start = 0 : i32}
98- # CHECK: call @" anchor{{.*}}" ([[RANGE]])
98+ # CHECK: call @{{.*}} anchor{{.*}}([[RANGE]])
9999 anchor (value )
100100 # CHECK: [[RANGE:%.*]] = tt.make_range {end = 8 : i32, start = 4 : i32}
101- # CHECK: call @" anchor{{.*}}" ([[RANGE]])
101+ # CHECK: call @{{.*}} anchor{{.*}}([[RANGE]])
102102 value .modify (tl .arange (4 , 8 ))
103103 anchor (value )
104104
@@ -118,11 +118,11 @@ def list_of_functions_constexpr(arg, fns: tl.constexpr):
118118@triton .jit
119119def test_list_of_functions ():
120120 # CHECK-LABEL: test_list_of_functions
121- # CHECK: call @" list_of_functions_constexpr{{.*}}cJITFunction(test_frontend:anchor){{.*}}cJITFunction(test_frontend:forward)"
121+ # CHECK: call @{{.*}} list_of_functions_constexpr{{.*}}cJITFunction(test_frontend:anchor){{.*}}cJITFunction(test_frontend:forward)
122122
123- # CHECK-LABEL : tt.func private @" list_of_functions_constexpr
124- # CHECK-NEXT: call @anchor
125- # CHECK-NEXT: call @forward
123+ # CHECK: tt.func private @{{.*}} list_of_functions_constexpr
124+ # CHECK-NEXT: call @{{.*}} anchor
125+ # CHECK-NEXT: call @{{.*}} forward
126126 list_of_functions_constexpr (tl .arange (0 , 4 ), [anchor , forward ])
127127
128128
@@ -138,11 +138,34 @@ def test_call_in_loop():
138138 # CHECK-LABEL: test_call_in_loop
139139 acc = 0
140140 # CHECK: scf.for
141- # CHECK: call @accumulate
141+ # CHECK: call @{{.*}} accumulate
142142 for i in range (10 ):
143143 acc = accumulate (acc , i )
144144
145145
146+ @tl .core ._aggregate
147+ class FunctionParent :
148+
149+ @triton .jit
150+ def function_with_name ():
151+ pass
152+
153+
154+ @triton .jit
155+ def function_with_name ():
156+ pass
157+
158+
159+ @filecheck_test
160+ @triton .jit
161+ def test_function_name_mangling ():
162+ # CHECK-LABEL: test_function_name_mangling
163+ # CHECK: call @test_frontend.function_with_name
164+ # CHECK: call @test_frontend.FunctionParent.function_with_name
165+ function_with_name ()
166+ FunctionParent .function_with_name ()
167+
168+
146169@tl .core ._aggregate
147170class AggregateWithConstexpr :
148171 a : tl .tensor
@@ -166,10 +189,10 @@ def add_rhs_constexpr(agg):
166189@triton .jit
167190def test_aggregate_with_constexpr ():
168191 # CHECK-LABEL: test_aggregate_with_constexpr
169- # CHECK: tt.call @"add_rhs_constexpr__test_frontend.AggregateWithConstexpr<i32S4S, constexpr[42]>
192+ # CHECK: tt.call @"test_frontend. add_rhs_constexpr__test_frontend.AggregateWithConstexpr<i32S4S, constexpr[42]>
170193 agg = AggregateWithConstexpr .create (tl .arange (0 , 4 ))
171194 add_rhs_constexpr (agg )
172195
173- # CHECK: tt.func private @"add_rhs_constexpr__test_frontend.AggregateWithConstexpr<i32S4S, constexpr[42]>
196+ # CHECK: tt.func private @"test_frontend. add_rhs_constexpr__test_frontend.AggregateWithConstexpr<i32S4S, constexpr[42]>
174197 # CHECK: %cst = arith.constant dense<42> : tensor<4xi32>
175198 # CHECK: arith.addi %arg0, %cst : tensor<4xi32>
0 commit comments