|
| 1 | +// RUN: %target-sil-opt -enable-sil-verify-all %s -inline -dce | %FileCheck %s -check-prefix=REGULAR |
| 2 | +// RUN: %target-sil-opt -enable-sil-verify-all %s -inline -dce -ignore-always-inline | %FileCheck %s -check-prefix=IGNORED |
| 3 | + |
| 4 | +sil_stage canonical |
| 5 | + |
| 6 | +// REGULAR: sil [Osize] @caller |
| 7 | +// IGNORED: sil [Osize] @caller |
| 8 | +sil [Osize] @caller : $@convention(thin) () -> () { |
| 9 | +bb0: |
| 10 | + // REGULAR-NOT: function_ref @callee |
| 11 | + // REGULAR: function_ref @foobar |
| 12 | + // IGNORED: function_ref @callee |
| 13 | + %d1 = function_ref @callee : $@convention(thin) () -> () |
| 14 | + apply %d1() : $@convention(thin) () -> () |
| 15 | + |
| 16 | + %9999 = tuple() |
| 17 | + return %9999 : $() |
| 18 | +} |
| 19 | + |
| 20 | +sil @foobar : $@convention(thin) () -> () |
| 21 | + |
| 22 | +// callee is "expensive" enough to not get inlined unless [always_inline] is used |
| 23 | +// REGULAR: sil [always_inline] [Osize] @callee |
| 24 | +// IGNORED: sil [always_inline] [Osize] @callee |
| 25 | +sil [always_inline] [Osize] @callee : $@convention(thin) () -> () { |
| 26 | +bb0: |
| 27 | + %d1 = function_ref @foobar : $@convention(thin) () -> () |
| 28 | + apply %d1() : $@convention(thin) () -> () |
| 29 | + apply %d1() : $@convention(thin) () -> () |
| 30 | + apply %d1() : $@convention(thin) () -> () |
| 31 | + apply %d1() : $@convention(thin) () -> () |
| 32 | + apply %d1() : $@convention(thin) () -> () |
| 33 | + apply %d1() : $@convention(thin) () -> () |
| 34 | + apply %d1() : $@convention(thin) () -> () |
| 35 | + apply %d1() : $@convention(thin) () -> () |
| 36 | + apply %d1() : $@convention(thin) () -> () |
| 37 | + apply %d1() : $@convention(thin) () -> () |
| 38 | + apply %d1() : $@convention(thin) () -> () |
| 39 | + apply %d1() : $@convention(thin) () -> () |
| 40 | + apply %d1() : $@convention(thin) () -> () |
| 41 | + apply %d1() : $@convention(thin) () -> () |
| 42 | + apply %d1() : $@convention(thin) () -> () |
| 43 | + apply %d1() : $@convention(thin) () -> () |
| 44 | + apply %d1() : $@convention(thin) () -> () |
| 45 | + apply %d1() : $@convention(thin) () -> () |
| 46 | + apply %d1() : $@convention(thin) () -> () |
| 47 | + apply %d1() : $@convention(thin) () -> () |
| 48 | + apply %d1() : $@convention(thin) () -> () |
| 49 | + apply %d1() : $@convention(thin) () -> () |
| 50 | + apply %d1() : $@convention(thin) () -> () |
| 51 | + apply %d1() : $@convention(thin) () -> () |
| 52 | + apply %d1() : $@convention(thin) () -> () |
| 53 | + apply %d1() : $@convention(thin) () -> () |
| 54 | + apply %d1() : $@convention(thin) () -> () |
| 55 | + apply %d1() : $@convention(thin) () -> () |
| 56 | + apply %d1() : $@convention(thin) () -> () |
| 57 | + apply %d1() : $@convention(thin) () -> () |
| 58 | + apply %d1() : $@convention(thin) () -> () |
| 59 | + apply %d1() : $@convention(thin) () -> () |
| 60 | + apply %d1() : $@convention(thin) () -> () |
| 61 | + apply %d1() : $@convention(thin) () -> () |
| 62 | + apply %d1() : $@convention(thin) () -> () |
| 63 | + apply %d1() : $@convention(thin) () -> () |
| 64 | + apply %d1() : $@convention(thin) () -> () |
| 65 | + apply %d1() : $@convention(thin) () -> () |
| 66 | + apply %d1() : $@convention(thin) () -> () |
| 67 | + apply %d1() : $@convention(thin) () -> () |
| 68 | + |
| 69 | + %9999 = tuple() |
| 70 | + return %9999 : $() |
| 71 | +} |
0 commit comments