|
| 1 | +// RUN: %target-swiftc_driver -Xfrontend -disable-debugger-shadow-copies -g -emit-ir %s | %FileCheck %s |
| 2 | +sil_stage canonical |
| 3 | + |
| 4 | +import Builtin |
| 5 | +import Swift |
| 6 | + |
| 7 | +// CHECK-LABEL: define {{.*}} @couple_of_voids |
| 8 | +sil hidden @couple_of_voids : $@convention(thin) () -> () { |
| 9 | +bb0: |
| 10 | + %3 = tuple () |
| 11 | + // CHECK-NOT: call void @llvm.dbg.value |
| 12 | + debug_value %3 : $(), let, (name "success", loc "void.swift":3:1), type $*((), ()), expr op_tuple_fragment:$((), ()):0 |
| 13 | + return %3 : $() |
| 14 | +} // end sil function 'couple_of_voids' |
| 15 | + |
| 16 | +// CHECK-LABEL: define {{.*}} @one_existing |
| 17 | +sil hidden @one_existing : $@convention(thin) () -> Builtin.Int64 { |
| 18 | +bb0: |
| 19 | + %1 = integer_literal $Builtin.Int64, 0 |
| 20 | + // CHECK: call void @llvm.dbg.value |
| 21 | + // CHECK-SAME: metadata ![[RESULT_VAR:[0-9]+]] |
| 22 | + debug_value %1 : $Builtin.Int64, let, (name "result", loc "void.swift":3:1), type $*(Builtin.Int64, ()), expr op_tuple_fragment:$(Builtin.Int64, ()):0 |
| 23 | + return %1 : $Builtin.Int64 |
| 24 | +} // end sil function 'one_existing' |
| 25 | + |
| 26 | +// CHECK-LABEL: define {{.*}} @one_empty |
| 27 | +sil hidden @one_empty : $@convention(thin) () -> () { |
| 28 | +bb0: |
| 29 | + %3 = tuple () |
| 30 | + // CHECK-NOT: call void @llvm.dbg.value |
| 31 | + debug_value %3 : $(), let, (name "failure", loc "void.swift":3:1), type $*(Builtin.Int64, ()), expr op_tuple_fragment:$(Builtin.Int64, ()):1 |
| 32 | + return %3 : $() |
| 33 | +} // end sil function 'one_empty' |
| 34 | + |
| 35 | +// CHECK: ![[RESULT_VAR]] = !DILocalVariable |
| 36 | +// CHECK-SAME: name: "result" |
0 commit comments