@@ -6,6 +6,7 @@ package test
6
6
7
7
import (
8
8
"bufio"
9
+ "internal/buildcfg"
9
10
"internal/testenv"
10
11
"io"
11
12
"math/bits"
@@ -205,11 +206,7 @@ func TestIntendedInlining(t *testing.T) {
205
206
"(*Uintptr).Load" ,
206
207
"(*Uintptr).Store" ,
207
208
"(*Uintptr).Swap" ,
208
- // TODO(rsc): Why are these not reported as inlined?
209
- // "(*Pointer[T]).CompareAndSwap",
210
- // "(*Pointer[T]).Load",
211
- // "(*Pointer[T]).Store",
212
- // "(*Pointer[T]).Swap",
209
+ // (*Pointer[T])'s methods' handled below.
213
210
},
214
211
}
215
212
@@ -235,6 +232,14 @@ func TestIntendedInlining(t *testing.T) {
235
232
// (*Bool).CompareAndSwap is just over budget on 32-bit systems (386, arm).
236
233
want ["sync/atomic" ] = append (want ["sync/atomic" ], "(*Bool).CompareAndSwap" )
237
234
}
235
+ if buildcfg .Experiment .Unified {
236
+ // Non-unified IR does not report "inlining call ..." for atomic.Pointer[T]'s methods.
237
+ // TODO(cuonglm): remove once non-unified IR frontend gone.
238
+ want ["sync/atomic" ] = append (want ["sync/atomic" ], "(*Pointer[go.shape.int]).CompareAndSwap" )
239
+ want ["sync/atomic" ] = append (want ["sync/atomic" ], "(*Pointer[go.shape.int]).Load" )
240
+ want ["sync/atomic" ] = append (want ["sync/atomic" ], "(*Pointer[go.shape.int]).Store" )
241
+ want ["sync/atomic" ] = append (want ["sync/atomic" ], "(*Pointer[go.shape.int]).Swap" )
242
+ }
238
243
239
244
switch runtime .GOARCH {
240
245
case "386" , "wasm" , "arm" :
0 commit comments