Skip to content

Commit c0416b1

Browse files
committed
[cxx-interop] Tests for the recent diganostics and fix-its.
1 parent 1b0ee8e commit c0416b1

13 files changed

+208
-114
lines changed

include/swift/AST/DiagnosticsClangImporter.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ NOTE(macro_not_imported_nested_cast, none, "non-null nested casts not supported"
149149

150150
NOTE(macro_not_imported_function_like, none, "macro '%0' unavailable: function like macros not supported", (StringRef))
151151
NOTE(macro_not_imported_unsupported_structure, none, "macro '%0' unavailable: structure not supported", (StringRef))
152-
NOTE(macro_not_imported, none, "macro '%0' unavailable", (StringRef))
152+
NOTE(macro_not_imported, none, "macro '%0' unavailable (cannot import)", (StringRef))
153153

154154
NOTE(return_type_not_imported, none, "return type unavailable (cannot import)", ())
155155
NOTE(parameter_type_not_imported, none, "parameter %0 unavailable (cannot import)", (const clang::NamedDecl*))

test/ClangImporter/experimental_clang_importer_diagnostics_bridging_header.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ s.c = 5
55
// CHECK: experimental_clang_importer_diagnostics_bridging_header.swift:{{[0-9]+}}:3: error: value of type 'PartialImport' has no member 'c'
66
// CHECK-NEXT: s.c = 5
77
// CHECK-NEXT: ~ ^
8-
// CHECK-NEXT: experimental_clang_importer_diagnostics_bridging_header.h:{{[0-9]+}}:3: note: field 'c' not imported
8+
// CHECK-NEXT: experimental_clang_importer_diagnostics_bridging_header.h:{{[0-9]+}}:3: note: field 'c' unavailable (cannot import)
99
// CHECK-NEXT: int _Complex c;
1010
// CHECK-NEXT: ^
1111
// CHECK-NEXT: experimental_clang_importer_diagnostics_bridging_header.h:{{[0-9]+}}:3: note: built-in type 'Complex' not supported
@@ -16,10 +16,10 @@ _ = CFunctionReturningAForwardDeclaredInterface()
1616
// CHECK: experimental_clang_importer_diagnostics_bridging_header.swift:{{[0-9]+}}:5: error: cannot find 'CFunctionReturningAForwardDeclaredInterface' in scope
1717
// CHECK-NEXT: _ = CFunctionReturningAForwardDeclaredInterface()
1818
// CHECK-NEXT: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19-
// CHECK-NEXT: experimental_clang_importer_diagnostics_bridging_header.h:{{[0-9]+}}:1: note: function 'CFunctionReturningAForwardDeclaredInterface' not imported
19+
// CHECK-NEXT: experimental_clang_importer_diagnostics_bridging_header.h:{{[0-9]+}}:1: note: function 'CFunctionReturningAForwardDeclaredInterface' unavailable (cannot import)
2020
// CHECK-NEXT: ForwardDeclaredInterface* CFunctionReturningAForwardDeclaredInterface();
2121
// CHECK-NEXT: ^
22-
// CHECK-NEXT: experimental_clang_importer_diagnostics_bridging_header.h:{{[0-9]+}}:1: note: return type not imported
22+
// CHECK-NEXT: experimental_clang_importer_diagnostics_bridging_header.h:{{[0-9]+}}:1: note: return type unavailable (cannot import)
2323
// CHECK-NEXT: ForwardDeclaredInterface* CFunctionReturningAForwardDeclaredInterface();
2424
// CHECK-NEXT: ^
2525
// CHECK-NEXT: experimental_clang_importer_diagnostics_bridging_header.h:{{[0-9]+}}:1: note: interface 'ForwardDeclaredInterface' is incomplete
@@ -33,18 +33,18 @@ _ = FUNC_LIKE_MACRO()
3333
// CHECK: experimental_clang_importer_diagnostics_bridging_header.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'FUNC_LIKE_MACRO' in scope
3434
// CHECK-NEXT: _ = FUNC_LIKE_MACRO()
3535
// CHECK-NEXT: ^~~~~~~~~~~~~~~
36-
// CHECK-NEXT: experimental_clang_importer_diagnostics_bridging_header.h:{{[0-9]+}}:9: note: macro 'FUNC_LIKE_MACRO' not imported: function like macros not supported
36+
// CHECK-NEXT: experimental_clang_importer_diagnostics_bridging_header.h:{{[0-9]+}}:9: note: macro 'FUNC_LIKE_MACRO' unavailable: function like macros not supported
3737
// CHECK-NEXT: #define FUNC_LIKE_MACRO() 0
3838
// CHECK-NEXT: {{^}} ^
3939

4040
unsupported_return_type()
4141
// CHECK: experimental_clang_importer_diagnostics_bridging_header.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'unsupported_return_type' in scope
4242
// CHECK-NEXT: unsupported_return_type()
4343
// CHECK-NEXT: ^~~~~~~~~~~~~~~~~~~~~~~
44-
// CHECK-NEXT: experimental_clang_importer_diagnostics_bridging_header.h:{{[0-9]+}}:1: note: function 'unsupported_return_type' not imported
44+
// CHECK-NEXT: experimental_clang_importer_diagnostics_bridging_header.h:{{[0-9]+}}:1: note: function 'unsupported_return_type' unavailable (cannot import)
4545
// CHECK-NEXT: _Complex int unsupported_return_type();
4646
// CHECK-NEXT: {{^}}^
47-
// CHECK-NEXT: experimental_clang_importer_diagnostics_bridging_header.h:{{[0-9]+}}:1: note: return type not imported
47+
// CHECK-NEXT: experimental_clang_importer_diagnostics_bridging_header.h:{{[0-9]+}}:1: note: return type unavailable (cannot import)
4848
// CHECK-NEXT: _Complex int unsupported_return_type();
4949
// CHECK-NEXT: {{^}}^
5050
// CHECK-NEXT: experimental_clang_importer_diagnostics_bridging_header.h:{{[0-9]+}}:1: note: built-in type 'Complex' not supported

test/ClangImporter/experimental_diagnostics_cfuncs.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ unsupported_parameter_type(1,2)
66
// CHECK: experimental_diagnostics_cfuncs.swift:5:1: error: cannot find 'unsupported_parameter_type' in scope
77
// CHECK-NEXT: unsupported_parameter_type(1,2)
88
// CHECK-NEXT: ^~~~~~~~~~~~~~~~~~~~~~~~~~
9-
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:1: note: function 'unsupported_parameter_type' not imported
9+
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:1: note: function 'unsupported_parameter_type' unavailable (cannot import)
1010
// CHECK-NEXT: int unsupported_parameter_type(int param1, _Complex int param2);
1111
// CHECK-NEXT: {{^}}^
12-
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:44: note: parameter 'param2' not imported
12+
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:44: note: parameter 'param2' unavailable (cannot import)
1313
// CHECK-NEXT: int unsupported_parameter_type(int param1, _Complex int param2);
1414
// CHECK-NEXT: {{^}} ^
1515
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:44: note: built-in type 'Complex' not supported
@@ -20,10 +20,10 @@ unsupported_return_type()
2020
// CHECK: experimental_diagnostics_cfuncs.swift:19:1: error: cannot find 'unsupported_return_type' in scope
2121
// CHECK-NEXT: unsupported_return_type()
2222
// CHECK-NEXT: ^~~~~~~~~~~~~~~~~~~~~~~
23-
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:1: note: function 'unsupported_return_type' not imported
23+
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:1: note: function 'unsupported_return_type' unavailable (cannot import)
2424
// CHECK-NEXT: _Complex int unsupported_return_type();
2525
// CHECK-NEXT: {{^}}^
26-
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:1: note: return type not imported
26+
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:1: note: return type unavailable (cannot import)
2727
// CHECK-NEXT: _Complex int unsupported_return_type();
2828
// CHECK-NEXT: {{^}}^
2929
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:1: note: built-in type 'Complex' not supported
@@ -34,10 +34,10 @@ unsupported_parameter_type(1,2)
3434
// CHECK: experimental_diagnostics_cfuncs.swift:33:1: error: cannot find 'unsupported_parameter_type' in scope
3535
// CHECK-NEXT: unsupported_parameter_type(1,2)
3636
// CHECK-NEXT: ^~~~~~~~~~~~~~~~~~~~~~~~~~
37-
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:1: note: function 'unsupported_parameter_type' not imported
37+
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:1: note: function 'unsupported_parameter_type' unavailable (cannot import)
3838
// CHECK-NEXT: int unsupported_parameter_type(int param1, _Complex int param2);
3939
// CHECK-NEXT: {{^}}^
40-
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:44: note: parameter 'param2' not imported
40+
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:44: note: parameter 'param2' unavailable (cannot import)
4141
// CHECK-NEXT: int unsupported_parameter_type(int param1, _Complex int param2);
4242
// CHECK-NEXT: {{^}} ^
4343
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:44: note: built-in type 'Complex' not supported
@@ -48,10 +48,10 @@ unsupported_return_type()
4848
// CHECK: experimental_diagnostics_cfuncs.swift:47:1: error: cannot find 'unsupported_return_type' in scope
4949
// CHECK-NEXT: unsupported_return_type()
5050
// CHECK-NEXT: ^~~~~~~~~~~~~~~~~~~~~~~
51-
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:1: note: function 'unsupported_return_type' not imported
51+
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:1: note: function 'unsupported_return_type' unavailable (cannot import)
5252
// CHECK-NEXT: _Complex int unsupported_return_type();
5353
// CHECK-NEXT: {{^}}^
54-
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:1: note: return type not imported
54+
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:1: note: return type unavailable (cannot import)
5555
// CHECK-NEXT: _Complex int unsupported_return_type();
5656
// CHECK-NEXT: {{^}}^
5757
// CHECK-NEXT: cfuncs.h:{{[0-9]+}}:1: note: built-in type 'Complex' not supported

test/ClangImporter/experimental_diagnostics_cmacros.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ _ = INVALID_INTEGER_LITERAL_2
66
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'INVALID_INTEGER_LITERAL_2' in scope
77
// CHECK-NEXT: _ = INVALID_INTEGER_LITERAL_2
88
// CHECK-NEXT: ^~~~~~~~~~~~~~~~~~~~~~~~~
9-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_INTEGER_LITERAL_2' not imported
9+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_INTEGER_LITERAL_2' unavailable (cannot import)
1010
// CHECK-NEXT: #define INVALID_INTEGER_LITERAL_2 10abc
1111
// CHECK-NEXT: {{^}} ^
1212
// CHECK-NEXT: macros.h:{{[0-9]+}}:35: note: invalid numeric literal
@@ -17,14 +17,14 @@ _ = FUNC_LIKE_MACRO()
1717
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'FUNC_LIKE_MACRO' in scope
1818
// CHECK-NEXT: _ = FUNC_LIKE_MACRO()
1919
// CHECK-NEXT: ^~~~~~~~~~~~~~~
20-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'FUNC_LIKE_MACRO' not imported: function like macros not supported
20+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'FUNC_LIKE_MACRO' unavailable: function like macros not supported
2121
// CHECK-NEXT: #define FUNC_LIKE_MACRO() 0
2222
// CHECK-NEXT: {{^}} ^
2323
_ = FUNC_LIKE_MACRO()
2424
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'FUNC_LIKE_MACRO' in scope
2525
// CHECK-NEXT: _ = FUNC_LIKE_MACRO()
2626
// CHECK-NEXT: ^~~~~~~~~~~~~~~
27-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'FUNC_LIKE_MACRO' not imported: function like macros not supported
27+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'FUNC_LIKE_MACRO' unavailable: function like macros not supported
2828
// CHECK-NEXT: #define FUNC_LIKE_MACRO() 0
2929
// CHECK-NEXT: {{^}} ^
3030

@@ -33,55 +33,55 @@ _ = INVALID_ARITHMETIC_1
3333
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'INVALID_ARITHMETIC_1' in scope
3434
// CHECK-NEXT: _ = INVALID_ARITHMETIC_1
3535
// CHECK-NEXT: ^~~~~~~~~~~~~~~~~~~~
36-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_ARITHMETIC_1' not imported: structure not supported
36+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_ARITHMETIC_1' unavailable: structure not supported
3737
// CHECK-NEXT: #define INVALID_ARITHMETIC_1 5 + INVALID_INTEGER_LITERAL_1
3838
// CHECK-NEXT: {{^}} ^
3939

4040
_ = INVALID_ARITHMETIC_2
4141
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'INVALID_ARITHMETIC_2' in scope
4242
// CHECK-NEXT: _ = INVALID_ARITHMETIC_2
4343
// CHECK-NEXT: ^~~~~~~~~~~~~~~~~~~~
44-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_ARITHMETIC_2' not imported: structure not supported
44+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_ARITHMETIC_2' unavailable: structure not supported
4545
// CHECK-NEXT: #define INVALID_ARITHMETIC_2 INVALID_INTEGER_LITERAL_1 + ADD_TWO
4646
// CHECK-NEXT: {{^}} ^
4747

4848
_ = INVALID_ARITHMETIC_3
4949
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'INVALID_ARITHMETIC_3' in scope
5050
// CHECK-NEXT: _ = INVALID_ARITHMETIC_3
5151
// CHECK-NEXT: ^~~~~~~~~~~~~~~~~~~~
52-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_ARITHMETIC_3' not imported: structure not supported
52+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_ARITHMETIC_3' unavailable: structure not supported
5353
// CHECK-NEXT: #define INVALID_ARITHMETIC_3 ADD_TWO + INVALID_INTEGER_LITERAL_1
5454
// CHECK-NEXT: {{^}} ^
5555

5656
_ = INVALID_ARITHMETIC_4
5757
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'INVALID_ARITHMETIC_4' in scope
5858
// CHECK-NEXT: _ = INVALID_ARITHMETIC_4
5959
// CHECK-NEXT: ^~~~~~~~~~~~~~~~~~~~
60-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_ARITHMETIC_4' not imported: structure not supported
60+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_ARITHMETIC_4' unavailable: structure not supported
6161
// CHECK-NEXT: #define INVALID_ARITHMETIC_4 \
6262
// CHECK-NEXT: {{^}} ^
6363

6464
_ = INVALID_ARITHMETIC_5
6565
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'INVALID_ARITHMETIC_5' in scope
6666
// CHECK-NEXT: _ = INVALID_ARITHMETIC_5
6767
// CHECK-NEXT: ^~~~~~~~~~~~~~~~~~~~
68-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_ARITHMETIC_5' not imported: structure not supported
68+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_ARITHMETIC_5' unavailable: structure not supported
6969
// CHECK-NEXT: #define INVALID_ARITHMETIC_5 1 + VERSION_STRING
7070
// CHECK-NEXT: {{^}} ^
7171

7272
_ = INVALID_ARITHMETIC_6
7373
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'INVALID_ARITHMETIC_6' in scope
7474
// CHECK-NEXT: _ = INVALID_ARITHMETIC_6
7575
// CHECK-NEXT: ^~~~~~~~~~~~~~~~~~~~
76-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_ARITHMETIC_6' not imported: structure not supported
76+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_ARITHMETIC_6' unavailable: structure not supported
7777
// CHECK-NEXT: #define INVALID_ARITHMETIC_6 1 + 'c'
7878
// CHECK-NEXT: {{^}} ^
7979

8080
_ = INVALID_ARITHMETIC_7
8181
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'INVALID_ARITHMETIC_7' in scope
8282
// CHECK-NEXT: _ = INVALID_ARITHMETIC_7
8383
// CHECK-NEXT: ^~~~~~~~~~~~~~~~~~~~
84-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_ARITHMETIC_7' not imported
84+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'INVALID_ARITHMETIC_7' unavailable (cannot import)
8585
// CHECK-NEXT: #define INVALID_ARITHMETIC_7 3 % 2
8686
// CHECK-NEXT: {{^}} ^
8787
// CHECK-NEXT: macros.h:{{[0-9]+}}:32: note: operator '%' not supported in macro arithmetic
@@ -93,7 +93,7 @@ _ = CHAR_LITERAL
9393
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'CHAR_LITERAL' in scope
9494
// CHECK-NEXT: _ = CHAR_LITERAL
9595
// CHECK-NEXT: ^~~~~~~~~~~~
96-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'CHAR_LITERAL' not imported
96+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'CHAR_LITERAL' unavailable (cannot import)
9797
// CHECK-NEXT: #define CHAR_LITERAL 'a'
9898
// CHECK-NEXT: {{^}} ^
9999
// CHECK-NEXT: macros.h:{{[0-9]+}}:22: note: only numeric and string macro literals supported
@@ -105,38 +105,38 @@ UNSUPPORTED_1
105105
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'UNSUPPORTED_1' in scope
106106
// CHECK-NEXT: UNSUPPORTED_1
107107
// CHECK-NEXT: ^~~~~~~~~~~~~
108-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'UNSUPPORTED_1' not imported: structure not supported
108+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'UNSUPPORTED_1' unavailable: structure not supported
109109
// CHECK-NEXT: #define UNSUPPORTED_1 FUNC_LIKE_MACRO()
110110
// CHECK-NEXT: {{^}} ^
111111

112112
UNSUPPORTED_2
113113
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'UNSUPPORTED_2' in scope
114114
// CHECK-NEXT: UNSUPPORTED_2
115115
// CHECK-NEXT: ^~~~~~~~~~~~~
116-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'UNSUPPORTED_2' not imported: structure not supported
116+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'UNSUPPORTED_2' unavailable: structure not supported
117117
// CHECK-NEXT: #define UNSUPPORTED_2 FUNC_LIKE_MACRO_2(1)
118118
// CHECK-NEXT: {{^}} ^
119119

120120
UNSUPPORTED_3
121121
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'UNSUPPORTED_3' in scope
122122
// CHECK-NEXT: UNSUPPORTED_3
123123
// CHECK-NEXT: ^~~~~~~~~~~~~
124-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'UNSUPPORTED_3' not imported: structure not supported
124+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'UNSUPPORTED_3' unavailable: structure not supported
125125
// CHECK-NEXT: #define UNSUPPORTED_3 1 + FUNC_LIKE_MACRO_2(1)
126126
// CHECK-NEXT: {{^}} ^
127127

128128
UNSUPPORTED_4
129129
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'UNSUPPORTED_4' in scope
130130
// CHECK-NEXT: UNSUPPORTED_4
131131
// CHECK-NEXT: ^~~~~~~~~~~~~
132-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'UNSUPPORTED_4' not imported: structure not supported
132+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'UNSUPPORTED_4' unavailable: structure not supported
133133
// CHECK-NEXT: #define UNSUPPORTED_4 \
134134
// CHECK-NEXT: {{^}} ^
135135

136136
UNSUPPORTED_5
137137
// CHECK: experimental_diagnostics_cmacros.swift:{{[0-9]+}}:{{[0-9]+}}: error: cannot find 'UNSUPPORTED_5' in scope
138138
// CHECK-NEXT: UNSUPPORTED_5
139139
// CHECK-NEXT: ^~~~~~~~~~~~~
140-
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'UNSUPPORTED_5' not imported: structure not supported
140+
// CHECK-NEXT: macros.h:{{[0-9]+}}:9: note: macro 'UNSUPPORTED_5' unavailable: structure not supported
141141
// CHECK-NEXT: #define UNSUPPORTED_5 1 + 1 + 1
142142
// CHECK-NEXT: {{^}} ^

test/ClangImporter/experimental_diagnostics_cstructs.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ s.c = 5
77
// CHECK: experimental_diagnostics_cstructs.swift:{{[0-9]+}}:3: error: value of type 'PartialImport' has no member 'c'
88
// CHECK-NEXT: s.c = 5
99
// CHECK-NEXT: ~ ^
10-
// CHECK-NEXT: ctypes.h:{{[0-9]+}}:3: note: field 'c' not imported
10+
// CHECK-NEXT: ctypes.h:{{[0-9]+}}:3: note: field 'c' unavailable (cannot import)
1111
// CHECK-NEXT: int _Complex c;
1212
// CHECK-NEXT: ^
1313
// CHECK-NEXT: ctypes.h:{{[0-9]+}}:3: note: built-in type 'Complex' not supported
@@ -18,7 +18,7 @@ partialImport.c = 5
1818
// CHECK: experimental_diagnostics_cstructs.swift:{{[0-9]+}}:15: error: value of type 'PartialImport' has no member 'c'
1919
// CHECK-NEXT: partialImport.c = 5
2020
// CHECK-NEXT: ~~~~~~~~~~~~~ ^
21-
// CHECK-NEXT: ctypes.h:{{[0-9]+}}:3: note: field 'c' not imported
21+
// CHECK-NEXT: ctypes.h:{{[0-9]+}}:3: note: field 'c' unavailable (cannot import)
2222
// CHECK-NEXT: int _Complex c;
2323
// CHECK-NEXT: ^
2424
// CHECK-NEXT: ctypes.h:{{[0-9]+}}:3: note: built-in type 'Complex' not supported
@@ -32,7 +32,7 @@ newPartialImport.d = 5
3232
// CHECK: experimental_diagnostics_cstructs.swift:{{[0-9]+}}:18: error: value of type 'PartialImport' has no member 'd'
3333
// CHECK-NEXT: newPartialImport.d = 5
3434
// CHECK-NEXT: ~~~~~~~~~~~~~~~~ ^
35-
// CHECK-NEXT: ctypes.h:{{[0-9]+}}:3: note: field 'd' not imported
35+
// CHECK-NEXT: ctypes.h:{{[0-9]+}}:3: note: field 'd' unavailable (cannot import)
3636
// CHECK-NEXT: int _Complex d;
3737
// CHECK-NEXT: ^
3838
// CHECK-NEXT: ctypes.h:{{[0-9]+}}:3: note: built-in type 'Complex' not supported

0 commit comments

Comments
 (0)