mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
LoadableByAddress in lowered SIL can insert `copy_addr`s inside read-only access scope. rdar://163248403
18 lines
348 B
Plaintext
18 lines
348 B
Plaintext
// RUN: not --crash %target-sil-opt %s -o /dev/null
|
|
|
|
// REQUIRES: asserts
|
|
|
|
sil_stage canonical
|
|
|
|
import Builtin
|
|
import Swift
|
|
|
|
sil [ossa] @write_in_read_only_scope : $@convention(thin) (@inout Int, Int) -> () {
|
|
bb0(%0 : $*Int, %1 : $Int):
|
|
%2 = begin_access [read] [static] %0
|
|
store %1 to [trivial] %0
|
|
end_access %2
|
|
%5 = tuple()
|
|
return %5
|
|
}
|