fail_cycle.carbon 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. // AUTOUPDATE
  6. // --- a.carbon
  7. package A api;
  8. // CHECK:STDERR: a.carbon:[[@LINE+3]]:1: ERROR: Import cannot be used due to a cycle. Cycle must be fixed to import.
  9. // CHECK:STDERR: import B;
  10. // CHECK:STDERR: ^
  11. import B;
  12. // --- b.carbon
  13. package B api;
  14. // CHECK:STDERR: b.carbon:[[@LINE+3]]:1: ERROR: Import cannot be used due to a cycle. Cycle must be fixed to import.
  15. // CHECK:STDERR: import C;
  16. // CHECK:STDERR: ^
  17. import C;
  18. // --- c.carbon
  19. package C api;
  20. // CHECK:STDERR: c.carbon:[[@LINE+3]]:1: ERROR: Import cannot be used due to a cycle. Cycle must be fixed to import.
  21. // CHECK:STDERR: import A;
  22. // CHECK:STDERR: ^
  23. import A;
  24. // --- c_impl.carbon
  25. // CHECK:STDERR: c_impl.carbon:[[@LINE+3]]:1: ERROR: Import cannot be used due to a cycle. Cycle must be fixed to import.
  26. // CHECK:STDERR: package C impl;
  27. // CHECK:STDERR: ^
  28. package C impl;
  29. // --- cycle_child.carbon
  30. package CycleChild api;
  31. // CHECK:STDERR: cycle_child.carbon:[[@LINE+3]]:1: ERROR: Import cannot be used due to a cycle. Cycle must be fixed to import.
  32. // CHECK:STDERR: import B;
  33. // CHECK:STDERR: ^
  34. import B;
  35. // CHECK:STDOUT: file "a.carbon" {
  36. // CHECK:STDOUT: }
  37. // CHECK:STDOUT: file "b.carbon" {
  38. // CHECK:STDOUT: }
  39. // CHECK:STDOUT: file "c.carbon" {
  40. // CHECK:STDOUT: }
  41. // CHECK:STDOUT: file "c_impl.carbon" {
  42. // CHECK:STDOUT: }
  43. // CHECK:STDOUT: file "cycle_child.carbon" {
  44. // CHECK:STDOUT: }