File: broken-modules.swift

package info (click to toggle)
swiftlang 6.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,532 kB
  • sloc: cpp: 9,901,743; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (40 lines) | stat: -rw-r--r-- 2,580 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// RUN: %empty-directory(%t)

// RUN: not %target-swift-frontend -enable-objc-interop -typecheck %/s -I %S/Inputs/broken-modules/ -enable-source-import -show-diagnostics-after-fatal -diagnostic-style llvm -o /dev/null 2>&1 | %FileCheck -check-prefix CHECK -check-prefix CLANG-CHECK %s

// RUN: not %target-swift-frontend -typecheck %/s -enable-objc-interop -import-objc-header %S/Inputs/broken-modules/BrokenClangModule.h -enable-source-import -diagnostic-style llvm -o /dev/null 2>&1 | %FileCheck -check-prefix CHECK-BRIDGING-HEADER -check-prefix CLANG-CHECK %s

// RUN: not %target-swift-frontend -typecheck %s -enable-objc-interop -import-objc-header %S/../../Inputs/empty.swift -diagnostic-style llvm 2>&1 | %FileCheck -check-prefix=EMPTY-HEADER %s

// EMPTY-HEADER-NOT: header

import Nonexistent
// CHECK-NOT: not found
// CHECK: broken-modules.swift:[[@LINE-2]]:8: error: no such module 'Nonexistent'

import MissingDependencyFromSwift
// CHECK-NOT: not found
// CHECK: MissingDependencyFromSwift.swift:1:8: error: no such module 'Dependency'
// CHECK-NOT: no such module 'MissingDependencyFromSwift'

import MissingDependencyFromClang
// CHECK: {{.+}}{{/|\\}}Inputs{{/|\\}}broken-modules{{/|\\}}MissingDependencyFromClang.h:1:9: error: module 'Dependency' not found
// CHECK: broken-modules.swift:[[@LINE-2]]:8: error: could not build Objective-C module 'MissingDependencyFromClang'
// CHECK: error: no such module 'MissingDependencyFromClang'

import BrokenClangModule
// CLANG-CHECK: {{.+}}{{/|\\}}Inputs{{/|\\}}broken-modules{{/|\\}}BrokenClangModule.h:2:13: error: redefinition of 'conflict' as different kind of symbol
// CLANG-CHECK: {{.+}}{{/|\\}}Inputs{{/|\\}}broken-modules{{/|\\}}BrokenClangModule.h:1:5: note: previous definition is here
// CLANG-CHECK: a-fake-file.h:43:13: error: redefinition of 'conflict2' as different kind of symbol
// CLANG-CHECK: a-fake-file.h:42:5: note: previous definition is here
// CLANG-CHECK: a-fake-file.h:46:5: error: expected identifier or '('
// CLANG-CHECK: a-fake-file.h:45:11: note: expanded from macro 'I'
// CLANG-CHECK: {{.+}}{{/|\\}}Inputs{{/|\\}}broken-modules{{/|\\}}BrokenClangModule.h:11:35: error: expected ';' after top level declarator

// CHECK: broken-modules.swift:[[@LINE-9]]:8: error: could not build Objective-C module 'BrokenClangModule'
// CHECK: error: no such module 'BrokenClangModule'
// CHECK-BRIDGING-HEADER: error: failed to import bridging header '{{.*}}/BrokenClangModule.h'


_ = BrokenClangModule.x
// CHECK: broken-modules.swift:[[@LINE-1]]:5: error: cannot find 'BrokenClangModule' in scope