Skip to content

Commit 69ab4fc

Browse files
committed
Use LLVM diagnostic style for a number of Clang importer tests
These tests are checking the printed outpout of the diagnostic formatter in ways that change with the Swift formatter, but are not consequential.
1 parent e3c2162 commit 69ab4fc

25 files changed

+53
-49
lines changed

test/ClangImporter/AllowErrors/invalid-pch-bridging-header.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ struct InnerTy {
4545

4646
//--- use.swift
4747
func use(s: SomeTy, s2: InnerTy) {}
48+
49+
50+
51+
4852
// MISSING_HMAP-NOT: cannot find type 'SomeTy' in scope
4953
// MISSING_HMAP: cannot find type 'InnerTy' in scope
5054
// MISSING_HMAP-NOT: cannot find type 'SomeTy' in scope

test/ClangImporter/Inputs/custom-modules/ImportAsMember.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ typedef float MNInnerFloat __attribute__((swift_name("IAMMultipleNested.Inner"))
7171
typedef int IAMBadInnerInt
7272
__attribute__((swift_name("IAMNonexistent.Inner")));
7373
// CHECK: ImportAsMember.h:[[@LINE-1]]:{{[0-9]+}}: warning: imported declaration 'IAMBadInnerInt' could not be mapped to 'IAMNonexistent.Inner'
74-
// CHECK: ImportAsMember.h:[[@LINE-2]]:{{[0-9]+}}: note: please report this issue to the owners of 'ImportAsMember'
74+
// CHECK: note: please report this issue to the owners of 'ImportAsMember'
7575
typedef int IAMBadInnerIntAPINotes;
7676
// CHECK: ImportAsMember.h:[[@LINE-1]]:{{[0-9]+}}: warning: imported declaration 'IAMBadInnerIntAPINotes' could not be mapped to 'IAMNonexistent.Inner2'
77-
// CHECK: ImportAsMember.h:[[@LINE-2]]:{{[0-9]+}}: note: please report this issue to the owners of 'ImportAsMember'
77+
// CHECK: note: please report this issue to the owners of 'ImportAsMember'
7878

7979
@interface IAMPrivateParent @end
8080
@interface IAMPrivateChild

test/ClangImporter/MixedSource/broken-bridging-header.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: not %target-swift-frontend -typecheck %S/../../Inputs/empty.swift -enable-objc-interop -import-objc-header %t/fake.h 2>&1 | %FileCheck -check-prefix=MISSING-HEADER %s
2+
// RUN: not %target-swift-frontend -typecheck %S/../../Inputs/empty.swift -enable-objc-interop -import-objc-header %t/fake.h -diagnostic-style llvm 2>&1 | %FileCheck -check-prefix=MISSING-HEADER %s
33

44
// RUN: cp %S/Inputs/error-on-define.h %t
5-
// RUN: not %target-swift-frontend -typecheck %S/../../Inputs/empty.swift -enable-objc-interop -import-objc-header %t/error-on-define.h 2>&1 | %FileCheck -check-prefix=MISSING-OTHER-HEADER %s
5+
// RUN: not %target-swift-frontend -typecheck %S/../../Inputs/empty.swift -enable-objc-interop -import-objc-header %t/error-on-define.h -diagnostic-style llvm 2>&1 | %FileCheck -check-prefix=MISSING-OTHER-HEADER %s
66

77
// RUN: cp %S/Inputs/error-on-define-impl.h %t
8-
// RUN: not %target-swift-frontend -typecheck %S/../../Inputs/empty.swift -enable-objc-interop -import-objc-header %t/error-on-define.h -Xcc -DERROR 2>&1 | %FileCheck -check-prefix=HEADER-ERROR %s
8+
// RUN: not %target-swift-frontend -typecheck %S/../../Inputs/empty.swift -enable-objc-interop -import-objc-header %t/error-on-define.h -Xcc -DERROR -diagnostic-style llvm 2>&1 | %FileCheck -check-prefix=HEADER-ERROR %s
99

1010

11-
// RUN: %target-swift-frontend -emit-module -o %t -module-name HasBridgingHeader %S/../../Inputs/empty.swift -enable-objc-interop -import-objc-header %t/error-on-define.h
11+
// RUN: %target-swift-frontend -emit-module -o %t -module-name HasBridgingHeader %S/../../Inputs/empty.swift -enable-objc-interop -import-objc-header %t/error-on-define.h -diagnostic-style llvm
1212

1313
// RUN: %target-swift-frontend -typecheck %s -I %t -Xcc -DERROR -verify -show-diagnostics-after-fatal
14-
// RUN: not %target-swift-frontend -typecheck %s -I %t -Xcc -DERROR 2>&1 | %FileCheck -check-prefix=HEADER-ERROR %s
14+
// RUN: not %target-swift-frontend -typecheck %s -I %t -Xcc -DERROR 2>&1 -diagnostic-style llvm | %FileCheck -check-prefix=HEADER-ERROR %s
1515

1616
// RUN: rm %t/error-on-define-impl.h
17-
// RUN: %target-swift-frontend -typecheck %s -I %t -verify -show-diagnostics-after-fatal
18-
// RUN: not %target-swift-frontend -typecheck %s -I %t 2>&1 | %FileCheck -check-prefix=MISSING-OTHER-HEADER %s
17+
// RUN: %target-swift-frontend -typecheck %s -I %t -verify -show-diagnostics-after-fatal -diagnostic-style llvm
18+
// RUN: not %target-swift-frontend -typecheck %s -I %t -diagnostic-style llvm 2>&1 | %FileCheck -check-prefix=MISSING-OTHER-HEADER %s
1919

2020
import HasBridgingHeader // expected-error {{failed to import bridging header}} expected-error {{failed to load module 'HasBridgingHeader'}}
2121

test/ClangImporter/MixedSource/broken-modules.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// RUN: %empty-directory(%t)
22

3-
// RUN: not %target-swift-frontend -enable-objc-interop -typecheck %/s -I %S/Inputs/broken-modules/ -enable-source-import -show-diagnostics-after-fatal -o /dev/null 2>&1 | %FileCheck -check-prefix CHECK -check-prefix CLANG-CHECK %s
3+
// 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
44

5-
// RUN: not %target-swift-frontend -typecheck %/s -enable-objc-interop -import-objc-header %S/Inputs/broken-modules/BrokenClangModule.h -enable-source-import -o /dev/null 2>&1 | %FileCheck -check-prefix CHECK-BRIDGING-HEADER -check-prefix CLANG-CHECK %s
5+
// 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
66

7-
// RUN: not %target-swift-frontend -typecheck %s -enable-objc-interop -import-objc-header %S/../../Inputs/empty.swift 2>&1 | %FileCheck -check-prefix=EMPTY-HEADER %s
7+
// 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
88

99
// EMPTY-HEADER-NOT: header
1010

test/ClangImporter/diags_from_module.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: not %target-swift-frontend -module-cache-path %t -enable-objc-interop -typecheck %s -F %S/Inputs/frameworks -serialize-diagnostics-path %t.dia -Xcc -D -Xcc FOO 2>&1 | %FileCheck %s
2+
// RUN: not %target-swift-frontend -module-cache-path %t -enable-objc-interop -typecheck %s -F %S/Inputs/frameworks -serialize-diagnostics-path %t.dia -Xcc -D -Xcc FOO -diagnostic-style llvm 2>&1 | %FileCheck %s
33
// RUN: test -s %t.dia
44
// RUN: c-index-test -read-diagnostics %t.dia 2>&1 | %FileCheck %s
55

66
// RUN: %empty-directory(%t)
7-
// RUN: %target-swift-frontend -module-cache-path %t -enable-objc-interop -typecheck %s -F %S/Inputs/frameworks -serialize-diagnostics-path %t.warn.dia 2>&1 | %FileCheck %s -check-prefix CHECK-WARN
7+
// RUN: %target-swift-frontend -module-cache-path %t -enable-objc-interop -typecheck %s -F %S/Inputs/frameworks -serialize-diagnostics-path %t.warn.dia -diagnostic-style llvm 2>&1 | %FileCheck %s -check-prefix CHECK-WARN
88
// RUN: test -s %t.warn.dia
99
// RUN: c-index-test -read-diagnostics %t.warn.dia 2>&1 | %FileCheck %s -check-prefix CHECK-WARN
1010

1111

1212
// Also check batch mode (multiple primary files).
1313
// RUN: %empty-directory(%t)
14-
// RUN: not %target-swift-frontend -module-cache-path %t -enable-objc-interop -typecheck -primary-file %s -primary-file %S/../Inputs/empty.swift -F %S/Inputs/frameworks -serialize-diagnostics-path %t.1.dia -serialize-diagnostics-path %t.2.dia -Xcc -D -Xcc FOO 2>&1 | %FileCheck %s
14+
// RUN: not %target-swift-frontend -module-cache-path %t -enable-objc-interop -typecheck -primary-file %s -primary-file %S/../Inputs/empty.swift -F %S/Inputs/frameworks -serialize-diagnostics-path %t.1.dia -serialize-diagnostics-path %t.2.dia -Xcc -D -Xcc FOO -diagnostic-style llvm 2>&1 | %FileCheck %s
1515
// RUN: test -s %t.1.dia
1616
// RUN: c-index-test -read-diagnostics %t.1.dia 2>&1 | %FileCheck %s
1717
// RUN: c-index-test -read-diagnostics %t.1.dia 2>&1 | %FileCheck %s -check-prefix CHECK-PRIMARY
1818
// RUN: test -s %t.2.dia
1919
// RUN: c-index-test -read-diagnostics %t.2.dia 2>&1 | %FileCheck %s
2020

2121
// RUN: %empty-directory(%t)
22-
// RUN: %target-swift-frontend -module-cache-path %t -enable-objc-interop -typecheck -primary-file %s -primary-file %S/../Inputs/empty.swift -F %S/Inputs/frameworks -serialize-diagnostics-path %t.warn.1.dia -serialize-diagnostics-path %t.warn.2.dia 2>&1 | %FileCheck %s -check-prefix CHECK-WARN
22+
// RUN: %target-swift-frontend -module-cache-path %t -enable-objc-interop -typecheck -primary-file %s -primary-file %S/../Inputs/empty.swift -F %S/Inputs/frameworks -serialize-diagnostics-path %t.warn.1.dia -serialize-diagnostics-path %t.warn.2.dia -diagnostic-style llvm 2>&1 | %FileCheck %s -check-prefix CHECK-WARN
2323
// RUN: test -s %t.1.dia
2424
// RUN: c-index-test -read-diagnostics %t.warn.1.dia 2>&1 | %FileCheck %s -check-prefix=CHECK-WARN
2525
// RUN: test -s %t.2.dia
@@ -28,7 +28,7 @@
2828

2929
// Verify that -Wno-* options are applied.
3030
// RUN: %empty-directory(%t)
31-
// RUN: %target-swift-frontend -module-cache-path %t -enable-objc-interop -typecheck %s -F %S/Inputs/frameworks -Xcc -Wno-#warnings 2>&1 | %FileCheck -check-prefix CHECK-NO-WARN -allow-empty %s
31+
// RUN: %target-swift-frontend -module-cache-path %t -enable-objc-interop -typecheck %s -F %S/Inputs/frameworks -Xcc -Wno-#warnings -diagnostic-style llvm 2>&1 | %FileCheck -check-prefix CHECK-NO-WARN -allow-empty %s
3232

3333
import Module
3434

test/ClangImporter/enum-error.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ func testError() {
9090
let terr = getErr()
9191
switch (terr) { case .TENone, .TEOne, .TETwo: break }
9292
// EXHAUSTIVE: [[@LINE-1]]:{{.+}}: warning: switch covers known cases, but 'TestError.Code' may have additional unknown values
93-
// EXHAUSTIVE: [[@LINE-2]]:{{.+}}: note: handle unknown values using "@unknown default"
93+
// EXHAUSTIVE: {{.+}}: note: handle unknown values using "@unknown default"
9494

9595
switch (terr) { case .TENone, .TEOne: break }
9696
// EXHAUSTIVE: [[@LINE-1]]:{{.+}}: error: switch must be exhaustive
97-
// EXHAUSTIVE: [[@LINE-2]]:{{.+}}: note: add missing case: '.TETwo'
97+
// EXHAUSTIVE: {{.+}}: note: add missing case: '.TETwo'
9898

9999
let _ = TestError.Code(rawValue: 2)!
100100

@@ -110,7 +110,7 @@ func testError() {
110110

111111
switch eerr { case .EENone, .EEOne: break }
112112
// EXHAUSTIVE: [[@LINE-1]]:{{.+}}: error: switch must be exhaustive
113-
// EXHAUSTIVE: [[@LINE-2]]:{{.+}}: note: add missing case: '.EETwo'
113+
// EXHAUSTIVE: {{.+}}: note: add missing case: '.EETwo'
114114

115115
#endif
116116

test/ClangImporter/experimental_clang_importer_diagnostics_bridging_header.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: not %target-swift-frontend -enable-objc-interop -swift-version 5 -import-objc-header %S/Inputs/experimental_clang_importer_diagnostics_bridging_header.h -typecheck %s 2>&1 | %FileCheck %s
1+
// RUN: not %target-swift-frontend -enable-objc-interop -swift-version 5 -import-objc-header %S/Inputs/experimental_clang_importer_diagnostics_bridging_header.h -typecheck %s -diagnostic-style llvm 2>&1 | %FileCheck %s
22

33
let s: PartialImport
44
s.c = 5

test/ClangImporter/experimental_diagnostics_cfuncs.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s 2>&1 | %FileCheck %s --strict-whitespace
1+
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s 2>&1 -diagnostic-style llvm | %FileCheck %s --strict-whitespace
22

33
import cfuncs
44

test/ClangImporter/experimental_diagnostics_cmacros.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s 2>&1 | %FileCheck %s --strict-whitespace
1+
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -diagnostic-style llvm 2>&1 | %FileCheck %s --strict-whitespace
22

33
import macros
44

test/ClangImporter/experimental_diagnostics_cstructs.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s 2>&1 | %FileCheck %s --strict-whitespace
1+
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -diagnostic-style llvm 2>&1 | %FileCheck %s --strict-whitespace
22

33
import ctypes
44

0 commit comments

Comments
 (0)