braces.carbon 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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/braces.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/format/testdata/basics/braces.carbon
  10. // --- test.carbon
  11. fn F() {
  12. }
  13. fn G() -> i32 {
  14. return 3;
  15. }
  16. fn H(x: i32, y: i32) -> i32 {
  17. var z: i32 = x + y;
  18. return z;
  19. }
  20. class C {
  21. class D {
  22. class E {}
  23. }
  24. }
  25. // --- AUTOUPDATE-SPLIT
  26. // CHECK:STDOUT: fn F () {}
  27. // CHECK:STDOUT: fn G () -> i32 {
  28. // CHECK:STDOUT: return 3;
  29. // CHECK:STDOUT: }
  30. // CHECK:STDOUT: fn H (x: i32, y: i32) -> i32 {
  31. // CHECK:STDOUT: var z: i32 = x + y;
  32. // CHECK:STDOUT: return z;
  33. // CHECK:STDOUT: }
  34. // CHECK:STDOUT: class C {
  35. // CHECK:STDOUT: class D {
  36. // CHECK:STDOUT: class E {}
  37. // CHECK:STDOUT: }
  38. // CHECK:STDOUT: }