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