Files
swift-mirror/test/IRGen/referenced_global.swift
Erik Eckstein 3e8921e1ec IRGen: remove a wrong assert for global variable initialization
The assert was wrong because in case a global variable reference another global variable, it can be the case that the other variable is first generated as declaration and then "converted" to a definition by adding the constant initializer.

rdar://117189962
2023-10-19 20:29:58 +02:00

10 lines
385 B
Swift

// RUN: %target-swift-frontend -parse-as-library -primary-file %s -O -emit-ir -o - | %FileCheck %s
// REQUIRES: swift_in_compiler
// Check that IRGen doesn't crash when a global variable reference another private global.
// CHECK-LABEL: @"$s17referenced_global1bSPySiGvp" ={{.*}} global {{.*}} ptr @"$s17referenced_global1x{{.*}}"
public var b = UnsafePointer(&x)
private var x = 1