Skip to content

Commit 5ce5252

Browse files
committed
Add tests
1 parent 390ba41 commit 5ce5252

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

test/SIL/Serialization/effectsattr.sil

+6
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ bb0:
2727
return %0 : $()
2828
}
2929

30+
//CHECK: [releasenone] @function4
31+
sil [releasenone] @function4 : $@convention(thin) () -> () {
32+
bb0:
33+
%0 = tuple ()
34+
return %0 : $()
35+
}

test/SILGen/effectsattr.swift

+2
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@
1010
//CHECK: [readwrite] @func3
1111
@effects(readwrite) @_silgen_name("func3") func func3() { }
1212

13+
//CHECK: [releasenone] @func4
14+
@effects(releasenone) @_silgen_name("func4") func func4() { }

test/SILOptimizer/side-effect.sil

+12
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class X {
3535

3636
sil [_semantics "arc.programtermination_point"] @exitfunc : $@convention(thin) () -> Never
3737
sil [readnone] @pure_func : $@convention(thin) () -> ()
38+
sil [releasenone] @releasenone_func : $@convention(thin) () -> ()
3839
sil [readonly] @readonly_owned : $@convention(thin) (@owned X) -> ()
3940
sil [readonly] @readonly_guaranteed : $@convention(thin) (@guaranteed X) -> ()
4041

@@ -449,6 +450,17 @@ bb0:
449450
return %r : $()
450451
}
451452

453+
// CHECK-LABEL: sil @call_releasenone
454+
// CHECK: <func=rw>
455+
sil @call_releasenone : $@convention(thin) () -> () {
456+
bb0:
457+
%u = function_ref @releasenone_func : $@convention(thin) () -> ()
458+
%a = apply %u() : $@convention(thin) () -> ()
459+
%r = tuple ()
460+
return %r : $()
461+
}
462+
463+
452464
// CHECK-LABEL: sil @call_readonly_owned
453465
// CHECK: <func=rw+-,param0=;alloc;trap;readrc>
454466
sil @call_readonly_owned : $@convention(thin) (@owned X) -> () {

0 commit comments

Comments
 (0)