Files
swift-mirror/test/DebugInfo/enum.swift
Adrian Prantl f5325f9cf4 Debug Info: Do a marginally better job of supporting enums by emitting
the argument types and underlying raw types.
In the long run we'd really want to emit them as DW_TAG_variant_types.

<rdar://problem/14845818> Support enums

Swift SVN r18170
2014-05-16 03:51:08 +00:00

25 lines
851 B
Swift

// RUN: %swift -target x86_64-apple-darwin %s -emit-ir -g -o - | FileCheck %s
// CHECK: [ DW_TAG_union_type ] [_TtO4enum5Color] [line [[@LINE+1]], size 8, align 8,
enum Color : UInt {
// CHECK: [ DW_TAG_member ] [Red] [line 0, size 8, align 8, offset 0] [from _TtSu]
case Red, Green, Blue
}
// CHECK: [ DW_TAG_union_type ] [_TtO4enum12MaybeIntPair] [line [[@LINE+1]], size 136, align 64,
enum MaybeIntPair {
// CHECK: [ DW_TAG_member ] [None] [line 0, size 136, align 64, offset 0] [from _TtSi]
case None
// CHECK: [ DW_TAG_member ] [Just] [line 0, size 136, align 64, offset 0] [from _TtTSiSi_]
case Just(Int, Int)
}
enum Maybe<T> {
case None
case Just(T)
}
let r = Color.Red
let c = MaybeIntPair.Just(74, 75)
// CHECK: [ DW_TAG_union_type ] [_TtGO4enum5MaybeOS_5Color_] [line [[@LINE-7]], size 8, align 8
let movie : Maybe<Color> = .None