mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +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
31 lines
1.2 KiB
Swift
31 lines
1.2 KiB
Swift
// RUN: not %target-swift-frontend -dump-parse %s 2>&1 | FileCheck %s
|
|
// RUN: not %target-swift-frontend -dump-ast %s 2>&1 | FileCheck %s -check-prefix=CHECK-AST
|
|
|
|
// CHECK-LABEL: (func_decl "foo(_:)"
|
|
// CHECK-AST-LABEL: (func_decl "foo(_:)"
|
|
func foo(n: Int) -> Int {
|
|
// CHECK: (brace_stmt
|
|
// CHECK: (return_stmt
|
|
// CHECK: (integer_literal_expr type='<null>' value=42)))
|
|
// CHECK-AST: (brace_stmt
|
|
// CHECK-AST: (return_stmt
|
|
// CHECK-AST: (call_expr implicit type='Int'
|
|
// CHECK-AST: (integer_literal_expr type='{{[^']+}}' {{.*}} value=42)
|
|
return 42
|
|
}
|
|
|
|
// -dump-parse should print an AST even though this code is invalid.
|
|
// CHECK-LABEL: (func_decl "bar()"
|
|
// CHECK-AST-LABEL: (func_decl "bar()"
|
|
func bar() {
|
|
// CHECK: (brace_stmt
|
|
// CHECK-NEXT: (unresolved_decl_ref_expr type='{{[^']+}}' name=foo
|
|
// CHECK-NEXT: (unresolved_decl_ref_expr type='{{[^']+}}' name=foo
|
|
// CHECK-NEXT: (unresolved_decl_ref_expr type='{{[^']+}}' name=foo
|
|
// CHECK-AST: (brace_stmt
|
|
// CHECK-AST-NEXT: (declref_expr type='{{[^']+}}' {{.*}} decl=main.(file).foo
|
|
// CHECK-AST-NEXT: (declref_expr type='{{[^']+}}' {{.*}} decl=main.(file).foo
|
|
// CHECK-AST-NEXT: (declref_expr type='{{[^']+}}' {{.*}} decl=main.(file).foo
|
|
foo foo foo
|
|
}
|