Files
swift-mirror/test/DebugInfo/any.swift
Joe Groff cac5807ae2 SILGen: Emit "main" as a SIL function.
Eliminate the intermediate top_level_code function. Now that SIL is expressive enough to express a "main" function, there's no reason for it, and this eliminates a bunch of mystery code in IRGen to thunk from main to top_level_code by reaching for hardcoded symbol names. Demystify the special code for setting up C_ARGC and C_ARGV by having SILGen look for a transparent "_didEnterMain" hook in the stdlib and emit a call to it.

Swift SVN r22525
2014-10-05 04:13:24 +00:00

14 lines
594 B
Swift

// RUN: %swift -target x86_64-apple-macosx10.9 %s -emit-ir -g -o - | FileCheck %s
func main() {
// CHECK: call void @llvm.dbg.declare(metadata !{%"protocol<>"* {{.*}}}, metadata ![[S:.*]], metadata !{{[0-9]+}}), !dbg ![[DBG:.*]]
// CHECK: ![[S]] ={{.*}}[ DW_TAG_auto_variable ] [s] [line [[@LINE+3]]]
// CHECK: ![[SCOPE:.*]] = metadata !{metadata !"0xb\002\0013\001"{{.*}}} ; [ DW_TAG_lexical_block ]
// CHECK: ![[DBG]] = metadata !{i32 [[@LINE+1]], i32 6, metadata ![[SCOPE]], null}
var s : Any = "hello world"
var n : Any = 12
var t : Any = (1,2)
println("hello world")
}
main()