Files
swift-mirror/test/DebugInfo/top_level_var.swift
2015-09-09 04:37:34 +00:00

13 lines
471 B
Swift

// RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s
func markUsed<T>(t: T) {}
var a = 1
markUsed(a)
// Verify that global variables are emitted once in main, once as
// global variable.
// CHECK: ![[MAIN:.*]] = distinct !DISubprogram(name: "main",{{.*}} line: 1
// CHECK: ![[MOD:.*]] = !DIModule({{.*}}, name: "top_level_var"
// CHECK: !DIGlobalVariable(name: "a",
// CHECK-SAME: scope: ![[MOD]]
// CHECK-SAME: isDefinition: true