Files
swift-mirror/test/DebugInfo/irgen_void_tuple.sil
T
Emil Pedersen e25938e8d0 [Tests] [DebugInfo] Update all tests to use op_deref on address types
All SIL tests now use op_deref correctly on debug_values on address
types, such as alloc_stack. All tests are now conforming to the new
model of always using op_deref for addresses.

Assisted-by: Claude
2026-05-12 11:24:47 +01:00

37 lines
1.3 KiB
Plaintext

// RUN: %target-swiftc_driver -Xfrontend -disable-debugger-shadow-copies -g -emit-ir %s | %FileCheck %s
sil_stage canonical
import Builtin
import Swift
// CHECK-LABEL: define {{.*}} @couple_of_voids
sil hidden @couple_of_voids : $@convention(thin) () -> () {
bb0:
%3 = tuple ()
// CHECK-NOT: #dbg_value
debug_value %3 : $(), let, (name "success", loc "void.swift":3:1), type $((), ()), expr op_tuple_fragment:$((), ()):0
return %3 : $()
} // end sil function 'couple_of_voids'
// CHECK-LABEL: define {{.*}} @one_existing
sil hidden @one_existing : $@convention(thin) () -> Builtin.Int64 {
bb0:
%1 = integer_literal $Builtin.Int64, 0
// CHECK: #dbg_value
// CHECK-SAME: ![[RESULT_VAR:[0-9]+]]
debug_value %1 : $Builtin.Int64, let, (name "result", loc "void.swift":3:1), type $(Builtin.Int64, ()), expr op_tuple_fragment:$(Builtin.Int64, ()):0
return %1 : $Builtin.Int64
} // end sil function 'one_existing'
// CHECK-LABEL: define {{.*}} @one_empty
sil hidden @one_empty : $@convention(thin) () -> () {
bb0:
%3 = tuple ()
// CHECK-NOT: #dbg_value
debug_value %3 : $(), let, (name "failure", loc "void.swift":3:1), type $(Builtin.Int64, ()), expr op_tuple_fragment:$(Builtin.Int64, ()):1
return %3 : $()
} // end sil function 'one_empty'
// CHECK: ![[RESULT_VAR]] = !DILocalVariable
// CHECK-SAME: name: "result"