Files
swift-mirror/test/Frontend/print-sil-debug-info.swift
Min-Yih Hsu d00a6cc0e3 [SIL][Frontend] Simplify debug info generation flow for SIL files
- If any of the `-g<kind>` flag is given -- except `-gnone`, debug
   info will be printed into every generated SIL files.
 - The `-gsil` is deprecated in favor of `-sil-based-debuginfo`. The
   SILDebugInfoGenerator Pass now generates intermediate SIL file with
   name "<output file>.sil_dbg_<n>.sil". Other functionalities of that
   Pass remain the same.
2021-06-30 17:21:58 -07:00

14 lines
601 B
Swift

// Just a simple test to see whether debug info is printed to SIL
// if any of the '-g<kind>' (except '-gnone') is given.
// RUN: %target-swift-frontend -emit-sil -gnone %s | %FileCheck --check-prefix=CHECK-GNONE %s
// RUN: %target-swift-frontend -emit-sil -gline-tables-only %s | %FileCheck %s
// RUN: %target-swift-frontend -emit-sil -g %s | %FileCheck %s
func foo(x: Int, y: Int) -> Int {
// CHECK: struct_extract
// CHECK-SAME: loc "{{.*}}.swift":{{[0-9]+}}:{{[0-9]+}}, scope {{[0-9]+}}
// CHECK-GNONE-NOT: loc "{{.*}}.swift":{{[0-9]+}}:{{[0-9]+}}, scope {{[0-9]+}}
x + y
}