Files
swift-mirror/test/DebugInfo/self.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

25 lines
995 B
Swift

// RUN: %target-swift-frontend -primary-file %s -emit-ir -g -o - | FileCheck %s
public struct stuffStruct {
var a: Int64 = 6
var b: String = "Nothing"
}
public func f() {
var _: stuffStruct = stuffStruct()
}
// In the constructor, self has a type of "inout stuffStruct", but it
// is constructed in an alloca. The debug info for the alloca should not
// describe a reference type as we would normally do with inout arguments.
//
// CHECK: define {{.*}} @_TFV4self11stuffStructCfT_S0_(
// CHECK-NEXT: entry:
// CHECK-NEXT: %[[ALLOCA:.*]] = alloca %V4self11stuffStruct, align {{(4|8)}}
// CHECK: call void @llvm.dbg.declare(metadata %V4self11stuffStruct* %[[ALLOCA]], metadata ![[SELF:.*]], metadata !{{[0-9]+}}), !dbg
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "stuffStruct",
// CHECK-SAME: identifier: [[STUFFSTRUCT:"[^"]+"]]
// CHECK: ![[SELF]] = !DILocalVariable(name: "self", arg: 1,
// CHECK-SAME: type: ![[STUFFSTRUCT]]