mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add tests
This commit is contained in:
committed by
Artem Chikin
parent
d484ec7c1f
commit
a925d6af20
20
test/ConstValues/Modules.swift
Normal file
20
test/ConstValues/Modules.swift
Normal file
@@ -0,0 +1,20 @@
|
||||
// Constant values should be able to call "const" functions from other modules
|
||||
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: split-file %s %t
|
||||
|
||||
// RUN: %target-swift-frontend -emit-module -o %t/MyModule.swiftmodule %t/MyModule.swift -parse-as-library
|
||||
// RUN: %target-swift-frontend -emit-ir -I %t %t/Main.swift
|
||||
|
||||
//--- MyModule.swift
|
||||
|
||||
_const
|
||||
public func foo() -> Int {
|
||||
return 42
|
||||
}
|
||||
|
||||
//--- Main.swift
|
||||
|
||||
import MyModule
|
||||
|
||||
_const let constGlobal1: Int = foo()
|
||||
Reference in New Issue
Block a user