mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
13 lines
471 B
Swift
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
|