Files
swift-mirror/test/Frontend/missing_files.swift
Rintaro Ishizaki 055dc66d3b [Frontend] Recover missing input file by dummy input buffer.
Also, continue trying opening files even if any of primary files are
missing so that the caller can know all files failed to open.

rdar://problem/33757793
2020-12-04 15:23:29 -08:00

19 lines
1.1 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: not %target-swift-frontend -c -parse-as-library /tmp/SOMETHING_DOES_NOT_EXIST_1.swift -primary-file %s /tmp/SOMETHING_DOES_NOT_EXIST_2.swift -o %t/out.o 2> %t/error1.output
// RUN: not test -f %t/out.o
// RUN: %FileCheck %s -input-file %t/error1.output --check-prefixes=CHECK,CHECK_RECOVER
// RUN: not %target-swift-frontend -c -parse-as-library -primary-file /tmp/SOMETHING_DOES_NOT_EXIST_1.swift -primary-file %s /tmp/SOMETHING_DOES_NOT_EXIST_2.swift -o %t/out1.o -o %t/out2.o 2> %t/error2.output
// RUN: not test -f %t/out1.o
// RUN: not test -f %t/out2.o
// RUN: %FileCheck %s -input-file %t/error2.output --check-prefixes=CHECK,CHECK_FAIL
// CHECK-DAG: <unknown>:0: error: error opening input file '{{[/\\]}}tmp{{[/\\]}}SOMETHING_DOES_NOT_EXIST_1.swift' ({{.*}})
// CHECK-DAG: <unknown>:0: error: error opening input file '{{[/\\]}}tmp{{[/\\]}}SOMETHING_DOES_NOT_EXIST_2.swift' ({{.*}})
public var x = INVALID_DECL
// CHECK_RECOVER-DAG: test{{[/\\]}}Frontend{{[/\\]}}missing_files.swift:[[@LINE-1]]:16: error: cannot find 'INVALID_DECL' in scope
// CHECK_FAIL-NOT: INVALID_DECL