order.carbon 1.9 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/check/testdata/function/definition/no_prelude/order.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/order.carbon
  10. fn Foo() {}
  11. fn Bar() {}
  12. fn Baz() {}
  13. // CHECK:STDOUT: --- order.carbon
  14. // CHECK:STDOUT:
  15. // CHECK:STDOUT: constants {
  16. // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [concrete]
  17. // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [concrete]
  18. // CHECK:STDOUT: %Bar.type: type = fn_type @Bar [concrete]
  19. // CHECK:STDOUT: %Bar: %Bar.type = struct_value () [concrete]
  20. // CHECK:STDOUT: %Baz.type: type = fn_type @Baz [concrete]
  21. // CHECK:STDOUT: %Baz: %Baz.type = struct_value () [concrete]
  22. // CHECK:STDOUT: }
  23. // CHECK:STDOUT:
  24. // CHECK:STDOUT: file {
  25. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  26. // CHECK:STDOUT: .Foo = %Foo.decl
  27. // CHECK:STDOUT: .Bar = %Bar.decl
  28. // CHECK:STDOUT: .Baz = %Baz.decl
  29. // CHECK:STDOUT: }
  30. // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [concrete = constants.%Foo] {} {}
  31. // CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [concrete = constants.%Bar] {} {}
  32. // CHECK:STDOUT: %Baz.decl: %Baz.type = fn_decl @Baz [concrete = constants.%Baz] {} {}
  33. // CHECK:STDOUT: }
  34. // CHECK:STDOUT:
  35. // CHECK:STDOUT: fn @Foo() {
  36. // CHECK:STDOUT: !entry:
  37. // CHECK:STDOUT: return
  38. // CHECK:STDOUT: }
  39. // CHECK:STDOUT:
  40. // CHECK:STDOUT: fn @Bar() {
  41. // CHECK:STDOUT: !entry:
  42. // CHECK:STDOUT: return
  43. // CHECK:STDOUT: }
  44. // CHECK:STDOUT:
  45. // CHECK:STDOUT: fn @Baz() {
  46. // CHECK:STDOUT: !entry:
  47. // CHECK:STDOUT: return
  48. // CHECK:STDOUT: }
  49. // CHECK:STDOUT: