cpp_diagnostics.carbon 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/cpp_diagnostics.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/cpp_diagnostics.carbon
  12. // ============================================================================
  13. // One error
  14. // ============================================================================
  15. // --- one_error.h
  16. #error "error1"
  17. // --- fail_import_cpp_file_with_one_error.carbon
  18. library "[[@TEST_NAME]]";
  19. // CHECK:STDERR: fail_import_cpp_file_with_one_error.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
  20. // CHECK:STDERR: ./one_error.h:2:2: error: "error1" [CppInteropParseError]
  21. // CHECK:STDERR: 2 | #error "error1"
  22. // CHECK:STDERR: | ^
  23. // CHECK:STDERR:
  24. import Cpp library "one_error.h";
  25. // ============================================================================
  26. // Multiple errors
  27. // ============================================================================
  28. // --- multiple_errors.h
  29. #error "error1"
  30. #error "error2"
  31. // --- fail_import_cpp_file_with_multiple_errors.carbon
  32. library "[[@TEST_NAME]]";
  33. // CHECK:STDERR: fail_import_cpp_file_with_multiple_errors.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
  34. // CHECK:STDERR: ./multiple_errors.h:2:2: error: "error1" [CppInteropParseError]
  35. // CHECK:STDERR: 2 | #error "error1"
  36. // CHECK:STDERR: | ^
  37. // CHECK:STDERR:
  38. // CHECK:STDERR: fail_import_cpp_file_with_multiple_errors.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
  39. // CHECK:STDERR: ./multiple_errors.h:3:2: error: "error2" [CppInteropParseError]
  40. // CHECK:STDERR: 3 | #error "error2"
  41. // CHECK:STDERR: | ^
  42. // CHECK:STDERR:
  43. import Cpp library "multiple_errors.h";
  44. // ============================================================================
  45. // One warning
  46. // ============================================================================
  47. // --- one_warning.h
  48. #warning "warning1"
  49. // --- import_cpp_file_with_one_warning.carbon
  50. library "[[@TEST_NAME]]";
  51. //@dump-sem-ir-begin
  52. // CHECK:STDERR: import_cpp_file_with_one_warning.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
  53. // CHECK:STDERR: ./one_warning.h:2:2: warning: "warning1" [CppInteropParseWarning]
  54. // CHECK:STDERR: 2 | #warning "warning1"
  55. // CHECK:STDERR: | ^
  56. // CHECK:STDERR:
  57. import Cpp library "one_warning.h";
  58. //@dump-sem-ir-end
  59. // ============================================================================
  60. // Multiple warnings
  61. // ============================================================================
  62. // --- multiple_warnings.h
  63. #warning "warning1"
  64. #warning "warning2"
  65. #warning "warning3"
  66. // --- import_cpp_file_with_multiple_warnings.carbon
  67. library "[[@TEST_NAME]]";
  68. //@dump-sem-ir-begin
  69. // CHECK:STDERR: import_cpp_file_with_multiple_warnings.carbon:[[@LINE+15]]:10: in file included here [InCppInclude]
  70. // CHECK:STDERR: ./multiple_warnings.h:2:2: warning: "warning1" [CppInteropParseWarning]
  71. // CHECK:STDERR: 2 | #warning "warning1"
  72. // CHECK:STDERR: | ^
  73. // CHECK:STDERR:
  74. // CHECK:STDERR: import_cpp_file_with_multiple_warnings.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
  75. // CHECK:STDERR: ./multiple_warnings.h:3:2: warning: "warning2" [CppInteropParseWarning]
  76. // CHECK:STDERR: 3 | #warning "warning2"
  77. // CHECK:STDERR: | ^
  78. // CHECK:STDERR:
  79. // CHECK:STDERR: import_cpp_file_with_multiple_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
  80. // CHECK:STDERR: ./multiple_warnings.h:4:2: warning: "warning3" [CppInteropParseWarning]
  81. // CHECK:STDERR: 4 | #warning "warning3"
  82. // CHECK:STDERR: | ^
  83. // CHECK:STDERR:
  84. import Cpp library "multiple_warnings.h";
  85. //@dump-sem-ir-end
  86. // ============================================================================
  87. // One error and one warning
  88. // ============================================================================
  89. // --- one_error_and_one_warning.h
  90. #error "error1"
  91. #warning "warning1"
  92. // --- fail_import_cpp_file_with_one_error_and_one_warning.carbon
  93. library "[[@TEST_NAME]]";
  94. // CHECK:STDERR: fail_import_cpp_file_with_one_error_and_one_warning.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
  95. // CHECK:STDERR: ./one_error_and_one_warning.h:2:2: error: "error1" [CppInteropParseError]
  96. // CHECK:STDERR: 2 | #error "error1"
  97. // CHECK:STDERR: | ^
  98. // CHECK:STDERR:
  99. // CHECK:STDERR: fail_import_cpp_file_with_one_error_and_one_warning.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
  100. // CHECK:STDERR: ./one_error_and_one_warning.h:3:2: warning: "warning1" [CppInteropParseWarning]
  101. // CHECK:STDERR: 3 | #warning "warning1"
  102. // CHECK:STDERR: | ^
  103. // CHECK:STDERR:
  104. import Cpp library "one_error_and_one_warning.h";
  105. // ============================================================================
  106. // Multiple errors and multiple warnings
  107. // ============================================================================
  108. // --- multiple_errors_and_multiple_warnings.h
  109. #error "error1"
  110. #error "error2"
  111. #warning "warning1"
  112. #warning "warning2"
  113. #warning "warning3"
  114. // --- fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon
  115. library "[[@TEST_NAME]]";
  116. // CHECK:STDERR: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+25]]:10: in file included here [InCppInclude]
  117. // CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:2:2: error: "error1" [CppInteropParseError]
  118. // CHECK:STDERR: 2 | #error "error1"
  119. // CHECK:STDERR: | ^
  120. // CHECK:STDERR:
  121. // CHECK:STDERR: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+20]]:10: in file included here [InCppInclude]
  122. // CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:3:2: error: "error2" [CppInteropParseError]
  123. // CHECK:STDERR: 3 | #error "error2"
  124. // CHECK:STDERR: | ^
  125. // CHECK:STDERR:
  126. // CHECK:STDERR: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+15]]:10: in file included here [InCppInclude]
  127. // CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:4:2: warning: "warning1" [CppInteropParseWarning]
  128. // CHECK:STDERR: 4 | #warning "warning1"
  129. // CHECK:STDERR: | ^
  130. // CHECK:STDERR:
  131. // CHECK:STDERR: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
  132. // CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:5:2: warning: "warning2" [CppInteropParseWarning]
  133. // CHECK:STDERR: 5 | #warning "warning2"
  134. // CHECK:STDERR: | ^
  135. // CHECK:STDERR:
  136. // CHECK:STDERR: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
  137. // CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:6:2: warning: "warning3" [CppInteropParseWarning]
  138. // CHECK:STDERR: 6 | #warning "warning3"
  139. // CHECK:STDERR: | ^
  140. // CHECK:STDERR:
  141. import Cpp library "multiple_errors_and_multiple_warnings.h";
  142. // ============================================================================
  143. // Multiple files with warnings
  144. // ============================================================================
  145. // --- import_multiple_cpp_files_with_warnings.carbon
  146. library "[[@TEST_NAME]]";
  147. //@dump-sem-ir-begin
  148. // CHECK:STDERR: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
  149. // CHECK:STDERR: ./one_warning.h:2:2: warning: "warning1" [CppInteropParseWarning]
  150. // CHECK:STDERR: 2 | #warning "warning1"
  151. // CHECK:STDERR: | ^
  152. // CHECK:STDERR:
  153. import Cpp library "one_warning.h";
  154. // CHECK:STDERR: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+15]]:10: in file included here [InCppInclude]
  155. // CHECK:STDERR: ./multiple_warnings.h:2:2: warning: "warning1" [CppInteropParseWarning]
  156. // CHECK:STDERR: 2 | #warning "warning1"
  157. // CHECK:STDERR: | ^
  158. // CHECK:STDERR:
  159. // CHECK:STDERR: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
  160. // CHECK:STDERR: ./multiple_warnings.h:3:2: warning: "warning2" [CppInteropParseWarning]
  161. // CHECK:STDERR: 3 | #warning "warning2"
  162. // CHECK:STDERR: | ^
  163. // CHECK:STDERR:
  164. // CHECK:STDERR: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
  165. // CHECK:STDERR: ./multiple_warnings.h:4:2: warning: "warning3" [CppInteropParseWarning]
  166. // CHECK:STDERR: 4 | #warning "warning3"
  167. // CHECK:STDERR: | ^
  168. // CHECK:STDERR:
  169. import Cpp library "multiple_warnings.h";
  170. //@dump-sem-ir-end
  171. // ============================================================================
  172. // Multiple files with errors and warnings
  173. // ============================================================================
  174. // --- fail_import_multiple_cpp_files_with_errors_and_warnings.carbon
  175. library "[[@TEST_NAME]]";
  176. // CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
  177. // CHECK:STDERR: ./one_error_and_one_warning.h:2:2: error: "error1" [CppInteropParseError]
  178. // CHECK:STDERR: 2 | #error "error1"
  179. // CHECK:STDERR: | ^
  180. // CHECK:STDERR:
  181. // CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
  182. // CHECK:STDERR: ./one_error_and_one_warning.h:3:2: warning: "warning1" [CppInteropParseWarning]
  183. // CHECK:STDERR: 3 | #warning "warning1"
  184. // CHECK:STDERR: | ^
  185. // CHECK:STDERR:
  186. import Cpp library "one_error_and_one_warning.h";
  187. // CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+25]]:10: in file included here [InCppInclude]
  188. // CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:2:2: error: "error1" [CppInteropParseError]
  189. // CHECK:STDERR: 2 | #error "error1"
  190. // CHECK:STDERR: | ^
  191. // CHECK:STDERR:
  192. // CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+20]]:10: in file included here [InCppInclude]
  193. // CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:3:2: error: "error2" [CppInteropParseError]
  194. // CHECK:STDERR: 3 | #error "error2"
  195. // CHECK:STDERR: | ^
  196. // CHECK:STDERR:
  197. // CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+15]]:10: in file included here [InCppInclude]
  198. // CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:4:2: warning: "warning1" [CppInteropParseWarning]
  199. // CHECK:STDERR: 4 | #warning "warning1"
  200. // CHECK:STDERR: | ^
  201. // CHECK:STDERR:
  202. // CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
  203. // CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:5:2: warning: "warning2" [CppInteropParseWarning]
  204. // CHECK:STDERR: 5 | #warning "warning2"
  205. // CHECK:STDERR: | ^
  206. // CHECK:STDERR:
  207. // CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
  208. // CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:6:2: warning: "warning3" [CppInteropParseWarning]
  209. // CHECK:STDERR: 6 | #warning "warning3"
  210. // CHECK:STDERR: | ^
  211. // CHECK:STDERR:
  212. import Cpp library "multiple_errors_and_multiple_warnings.h";
  213. // ============================================================================
  214. // Indirect error
  215. // ============================================================================
  216. // --- indirect_error.h
  217. #include "one_error.h"
  218. // --- fail_import_indirect_error.carbon
  219. library "[[@TEST_NAME]]";
  220. // CHECK:STDERR: fail_import_indirect_error.carbon:[[@LINE+6]]:10: in file included here [InCppInclude]
  221. // CHECK:STDERR: ./indirect_error.h:2:10: in file included here [InCppInclude]
  222. // CHECK:STDERR: ./one_error.h:2:2: error: "error1" [CppInteropParseError]
  223. // CHECK:STDERR: 2 | #error "error1"
  224. // CHECK:STDERR: | ^
  225. // CHECK:STDERR:
  226. import Cpp library "indirect_error.h";
  227. // ============================================================================
  228. // Indirect warning
  229. // ============================================================================
  230. // --- indirect_warning.h
  231. #include "one_warning.h"
  232. // --- import_indirect_warning.carbon
  233. library "[[@TEST_NAME]]";
  234. //@dump-sem-ir-begin
  235. // CHECK:STDERR: import_indirect_warning.carbon:[[@LINE+6]]:10: in file included here [InCppInclude]
  236. // CHECK:STDERR: ./indirect_warning.h:2:10: in file included here [InCppInclude]
  237. // CHECK:STDERR: ./one_warning.h:2:2: warning: "warning1" [CppInteropParseWarning]
  238. // CHECK:STDERR: 2 | #warning "warning1"
  239. // CHECK:STDERR: | ^
  240. // CHECK:STDERR:
  241. import Cpp library "indirect_warning.h";
  242. //@dump-sem-ir-end
  243. // ============================================================================
  244. // Lexer error before import
  245. // ============================================================================
  246. // --- fail_import_cpp_library_lexer_error.carbon
  247. library "[[@TEST_NAME]]"; // Trailing comment
  248. // TODO: Move this warning to be after the lexer trailing comment error.
  249. // CHECK:STDERR: fail_import_cpp_library_lexer_error.carbon:[[@LINE+9]]:10: in file included here [InCppInclude]
  250. // CHECK:STDERR: ./one_warning.h:2:2: warning: "warning1" [CppInteropParseWarning]
  251. // CHECK:STDERR: 2 | #warning "warning1"
  252. // CHECK:STDERR: | ^
  253. // CHECK:STDERR:
  254. // CHECK:STDERR: fail_import_cpp_library_lexer_error.carbon:[[@LINE-8]]:44: error: trailing comments are not permitted [TrailingComment]
  255. // CHECK:STDERR: library "import_cpp_library_lexer_error"; // Trailing comment
  256. // CHECK:STDERR: ^
  257. // CHECK:STDERR:
  258. import Cpp library "one_warning.h";
  259. // ============================================================================
  260. // Diagnostic with fix-it hints
  261. // ============================================================================
  262. // --- fix_it_hints.h
  263. double score = 0.1
  264. // --- fail_import_fix_it_hints.carbon
  265. library "[[@TEST_NAME]]";
  266. // CHECK:STDERR: fail_import_fix_it_hints.carbon:[[@LINE+6]]:10: in file included here [InCppInclude]
  267. // CHECK:STDERR: ./fix_it_hints.h:2:19: error: expected ';' after top level declarator [CppInteropParseError]
  268. // CHECK:STDERR: 2 | double score = 0.1
  269. // CHECK:STDERR: | ^
  270. // CHECK:STDERR: | ;
  271. // CHECK:STDERR:
  272. import Cpp library "fix_it_hints.h";
  273. fn F() {
  274. // CHECK:STDERR: fail_import_fix_it_hints.carbon:[[@LINE+4]]:3: error: member name `foo` not found in `Cpp` [MemberNameNotFoundInInstScope]
  275. // CHECK:STDERR: Cpp.foo();
  276. // CHECK:STDERR: ^~~~~~~
  277. // CHECK:STDERR:
  278. Cpp.foo();
  279. }
  280. // ============================================================================
  281. // Diagnostic with notes
  282. // ============================================================================
  283. // --- with_notes.h
  284. void foobar(int);
  285. inline void call_foobar() {
  286. foobar(1, 2);
  287. }
  288. // --- fail_with_notes.carbon
  289. library "[[@TEST_NAME]]";
  290. // CHECK:STDERR: fail_with_notes.carbon:[[@LINE+9]]:10: in file included here [InCppInclude]
  291. // CHECK:STDERR: ./with_notes.h:5:3: error: no matching function for call to 'foobar' [CppInteropParseError]
  292. // CHECK:STDERR: 5 | foobar(1, 2);
  293. // CHECK:STDERR: | ^~~~~~
  294. // CHECK:STDERR: fail_with_notes.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
  295. // CHECK:STDERR: ./with_notes.h:2:6: note: candidate function not viable: requires 1 argument, but 2 were provided [CppInteropParseNote]
  296. // CHECK:STDERR: 2 | void foobar(int);
  297. // CHECK:STDERR: | ^ ~~~
  298. // CHECK:STDERR:
  299. import Cpp library "with_notes.h";
  300. fn F() {
  301. Cpp.call_foobar();
  302. }
  303. // ============================================================================
  304. // Context stacks
  305. // ============================================================================
  306. // --- indirect_include.h
  307. #define FOO BAR
  308. #define BAZ void f(error);
  309. FOO
  310. // --- direct_include.h
  311. #define BAR BAZ
  312. #include "indirect_include.h"
  313. // --- fail_use_context_stack.carbon
  314. library "[[@TEST_NAME]]";
  315. // CHECK:STDERR: fail_use_context_stack.carbon:[[@LINE+15]]:10: in file included here [InCppInclude]
  316. // CHECK:STDERR: ./direct_include.h:4:10: in file included here [InCppInclude]
  317. // CHECK:STDERR: ./indirect_include.h:2:13: in expansion of macro defined here [InCppMacroExpansion]
  318. // CHECK:STDERR: ./direct_include.h:2:13: in expansion of macro defined here [InCppMacroExpansion]
  319. // CHECK:STDERR: ./indirect_include.h:3:20: in expansion of macro defined here [InCppMacroExpansion]
  320. // CHECK:STDERR: ./indirect_include.h:5:1: error: unknown type name 'error' [CppInteropParseError]
  321. // CHECK:STDERR: 5 | FOO
  322. // CHECK:STDERR: | ^
  323. // CHECK:STDERR: 2 | #define FOO BAR
  324. // CHECK:STDERR: | ^
  325. // CHECK:STDERR: 2 | #define BAR BAZ
  326. // CHECK:STDERR: | ^
  327. // CHECK:STDERR: 3 | #define BAZ void f(error);
  328. // CHECK:STDERR: | ^
  329. // CHECK:STDERR:
  330. import Cpp library "direct_include.h";
  331. // ============================================================================
  332. // Diagnostic location in inline code.
  333. // ============================================================================
  334. // --- fail_loc_in_inline_simple.carbon
  335. library "[[@TEST_NAME]]";
  336. // CHECK:STDERR: fail_loc_in_inline_simple.carbon:[[@LINE+4]]:9: error: use of undeclared identifier 'banana' [CppInteropParseError]
  337. // CHECK:STDERR: 8 | int n = banana;
  338. // CHECK:STDERR: | ^~~~~~
  339. // CHECK:STDERR:
  340. import Cpp inline "int n = banana;";
  341. // --- fail_loc_in_inline_block.carbon
  342. import Cpp inline '''c++
  343. void f(const int n) {
  344. // CHECK:STDERR: fail_loc_in_inline_block.carbon:[[@LINE+7]]:3: error: cannot assign to variable 'n' with const-qualified type 'const int' [CppInteropParseError]
  345. // CHECK:STDERR: 11 | ++n;
  346. // CHECK:STDERR: | ^ ~
  347. // CHECK:STDERR: fail_loc_in_inline_block.carbon:[[@LINE-4]]:18: note: variable 'n' declared const here [CppInteropParseNote]
  348. // CHECK:STDERR: 3 | void f(const int n) {
  349. // CHECK:STDERR: | ~~~~~~~~~~^
  350. // CHECK:STDERR:
  351. ++n;
  352. }
  353. ''';
  354. // CHECK:STDOUT: --- import_cpp_file_with_one_warning.carbon
  355. // CHECK:STDOUT:
  356. // CHECK:STDOUT: file {
  357. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  358. // CHECK:STDOUT: import Cpp "one_warning.h"
  359. // CHECK:STDOUT: }
  360. // CHECK:STDOUT: }
  361. // CHECK:STDOUT:
  362. // CHECK:STDOUT: --- import_cpp_file_with_multiple_warnings.carbon
  363. // CHECK:STDOUT:
  364. // CHECK:STDOUT: file {
  365. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  366. // CHECK:STDOUT: import Cpp "multiple_warnings.h"
  367. // CHECK:STDOUT: }
  368. // CHECK:STDOUT: }
  369. // CHECK:STDOUT:
  370. // CHECK:STDOUT: --- import_multiple_cpp_files_with_warnings.carbon
  371. // CHECK:STDOUT:
  372. // CHECK:STDOUT: file {
  373. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  374. // CHECK:STDOUT: import Cpp "one_warning.h"
  375. // CHECK:STDOUT: import Cpp "multiple_warnings.h"
  376. // CHECK:STDOUT: }
  377. // CHECK:STDOUT: }
  378. // CHECK:STDOUT:
  379. // CHECK:STDOUT: --- import_indirect_warning.carbon
  380. // CHECK:STDOUT:
  381. // CHECK:STDOUT: file {
  382. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  383. // CHECK:STDOUT: import Cpp "indirect_warning.h"
  384. // CHECK:STDOUT: }
  385. // CHECK:STDOUT: }
  386. // CHECK:STDOUT: