Allow entry points without args: Array<String> (#2049)
This commit is contained in:
committed by
Nikolay Igotti
parent
b6a01a86f1
commit
30f5eb0bfa
@@ -546,6 +546,17 @@ task entry2(type: LinkKonanTest) {
|
||||
flags = ["-entry", "foo"]
|
||||
}
|
||||
|
||||
task entry3(type: RunStandaloneKonanTest) {
|
||||
goldValue = "Hello, without args.\n"
|
||||
source = "runtime/basic/entry1.kt"
|
||||
flags = ["-entry", "bar"]
|
||||
}
|
||||
|
||||
task entry4(type: RunStandaloneKonanTest) {
|
||||
goldValue = "This is main without args\n"
|
||||
source = "runtime/basic/entry4.kt"
|
||||
}
|
||||
|
||||
task readline0(type: RunStandaloneKonanTest) {
|
||||
goldValue = "41"
|
||||
testData = "41\r\n"
|
||||
|
||||
@@ -11,6 +11,10 @@ fun foo(args: Array<String>) {
|
||||
println("Hello.")
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
println("Hello, without args.")
|
||||
}
|
||||
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
fail()
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fun main() {
|
||||
println("This is main without args")
|
||||
}
|
||||
Reference in New Issue
Block a user