Add tests

This commit is contained in:
Kuba Mracek
2025-03-03 11:13:08 -08:00
committed by Artem Chikin
parent d484ec7c1f
commit a925d6af20
17 changed files with 212 additions and 0 deletions

View 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()