Files
swift-mirror/test/DebugInfo/generic_enum.swift
Saleem Abdulrasool 4bfdc5c4d4 test: apply some fix-its to DebugInfo tests
These tests were causing the current swift compiler to emit fix-it hints for
changes since the tests were written.  NFC.
2016-05-05 10:24:19 -07:00

26 lines
806 B
Swift

// RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s
func markUsed<T>(_ t: T) {}
enum TrivialGeneric<T, U> {
case x(T, U)
}
func unwrapTrivialGeneric<T, U>(_ tg: TrivialGeneric<T, U>) -> (T, U) {
switch tg {
case .x(let t, let u):
return (t, u)
}
}
func wrapTrivialGeneric<T, U>(_ t: T, u: U) -> TrivialGeneric<T, U> {
return .x(t, u)
}
// CHECK-DAG: !DIGlobalVariable(name: "tg",{{.*}} line: [[@LINE+2]],{{.*}} type: !"_TtGO12generic_enum14TrivialGenericVs5Int64SS_",{{.*}} isLocal: false, isDefinition: true
// CHECK-DAG: !DICompositeType(tag: DW_TAG_union_type, name: "TrivialGeneric", {{.*}}identifier: "_TtGO12generic_enum14TrivialGenericVs5Int64SS_"
var tg : TrivialGeneric<Int64, String> = .x(23, "skidoo")
switch tg {
case .x(var t, var u):
markUsed("\(t) \(u)")
}