mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Most tests were using %swift or similar substitutions, which did not include the target triple and SDK. The driver was defaulting to the host OS. Thus, we could not run the tests when the standard library was not built for OS X. Swift SVN r24504
25 lines
1.4 KiB
Swift
25 lines
1.4 KiB
Swift
// RUN: rm -f %t.*
|
|
|
|
// Test swift executable
|
|
// RUN: %target-swift-frontend -parse -serialize-diagnostics-path %t.dia %s -verify
|
|
// RUN: c-index-test -read-diagnostics %t.dia > %t.deserialized_diagnostics.txt 2>&1
|
|
// RUN: FileCheck --input-file=%t.deserialized_diagnostics.txt %s
|
|
|
|
// Test swift_driver integrated frontend
|
|
// RUN: %target-swift-frontend -parse -serialize-diagnostics -serialize-diagnostics-path %t.integrated_frontend.dia %s -verify
|
|
// RUN: c-index-test -read-diagnostics %t.integrated_frontend.dia > %t.integrated_frontend.deserialized_diagnostics.txt 2>&1
|
|
// RUN: FileCheck --input-file=%t.integrated_frontend.deserialized_diagnostics.txt %s
|
|
|
|
var x = 1 x = 2 // expected-error {{consecutive statements on a line must be separated by ';'}}
|
|
var z : Int // expected-note {{previously declared here}}
|
|
var z : Int // expected-error {{invalid redeclaration}}
|
|
|
|
// CHECK: 13:10: error: consecutive statements on a line must be separated by ';' [] []
|
|
// CHECK-NEXT: Number FIXITs = 1
|
|
// CHECK-NEXT: FIXIT: ({{.*[/\\]}}serialized-diagnostics.swift:13:10 - {{.*[/\\]}}serialized-diagnostics.swift:13:10): ";"
|
|
// CHECK-NEXT: 15:5: error: invalid redeclaration of 'z' [] []
|
|
// CHECK-NEXT: Number FIXITs = 0
|
|
// CHECK-NEXT: +-{{.*[/\\]}}serialized-diagnostics.swift:14:5: note: 'z' previously declared here [] []
|
|
// CHECK-NEXT: Number FIXITs = 0
|
|
// CHECK-NEXT: Number of diagnostics: 2
|