mirror of
https://github.com/apple/swift.git
synced 2026-10-06 12:37:28 +02:00
This was my silly mistake, looking at the wrong module. Fixes rdar://177629126.
29 lines
1.0 KiB
Swift
29 lines
1.0 KiB
Swift
// RUN: %empty-directory(%t/src)
|
|
// RUN: split-file %s %t/src
|
|
|
|
// RUN: %target-swift-frontend -typecheck -module-name os %t/src/missing.swift 2>&1 | %FileCheck %s
|
|
// RUN: %target-swift-frontend -typecheck -verify -module-name os %t/src/noinit.swift
|
|
// RUN: %target-swift-frontend -typecheck -verify -module-name os %t/src/badinit.swift
|
|
// RUN: %target-swift-frontend -typecheck -verify -module-name os %t/src/goodinit.swift
|
|
|
|
//--- missing.swift
|
|
|
|
// CHECK: global variable 'osLogStringSectionName' is missing from the 'os' module; defaulting to '__TEXT,__oslogstring,cstring_literals'
|
|
|
|
//--- noinit.swift
|
|
|
|
// expected-error@+1{{global variable 'osLogStringSectionName' requires a string literal initializer}}
|
|
var osLogStringSectionName: String {
|
|
"hello"
|
|
}
|
|
|
|
//--- badinit.swift
|
|
|
|
func getSection() -> String { "hello" }
|
|
|
|
// expected-error@+1{{global variable 'osLogStringSectionName' requires a string literal initializer}}
|
|
let osLogStringSectionName: String = getSection()
|
|
|
|
//--- goodinit.swift
|
|
let osLogStringSectionName = "hello"
|