comments.carbon 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/format/testdata/basics/comments.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/format/testdata/basics/comments.carbon
  10. // --- test.carbon
  11. // A comment
  12. fn F() {}
  13. // Another comment
  14. // Block
  15. // comment
  16. class C {
  17. // Internal comment
  18. }
  19. // Another
  20. // Block
  21. //
  22. // Comment
  23. // --- AUTOUPDATE-SPLIT
  24. // CHECK:STDOUT:
  25. // CHECK:STDOUT: // A comment
  26. // CHECK:STDOUT:
  27. // CHECK:STDOUT: fn F ( ) { }
  28. // CHECK:STDOUT: // Another comment
  29. // CHECK:STDOUT:
  30. // CHECK:STDOUT:
  31. // CHECK:STDOUT: // Block
  32. // CHECK:STDOUT: // comment
  33. // CHECK:STDOUT:
  34. // CHECK:STDOUT: class C {
  35. // CHECK:STDOUT: // Internal comment
  36. // CHECK:STDOUT:
  37. // CHECK:STDOUT: }
  38. // CHECK:STDOUT: // Another
  39. // CHECK:STDOUT: // Block
  40. // CHECK:STDOUT: //
  41. // CHECK:STDOUT: // Comment
  42. // CHECK:STDOUT:
  43. // CHECK:STDOUT: