order.carbon 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 [template]
  17. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  18. // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template]
  19. // CHECK:STDOUT: %Bar.type: type = fn_type @Bar [template]
  20. // CHECK:STDOUT: %Bar: %Bar.type = struct_value () [template]
  21. // CHECK:STDOUT: %Baz.type: type = fn_type @Baz [template]
  22. // CHECK:STDOUT: %Baz: %Baz.type = struct_value () [template]
  23. // CHECK:STDOUT: }
  24. // CHECK:STDOUT:
  25. // CHECK:STDOUT: file {
  26. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  27. // CHECK:STDOUT: .Foo = %Foo.decl
  28. // CHECK:STDOUT: .Bar = %Bar.decl
  29. // CHECK:STDOUT: .Baz = %Baz.decl
  30. // CHECK:STDOUT: }
  31. // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} {}
  32. // CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] {} {}
  33. // CHECK:STDOUT: %Baz.decl: %Baz.type = fn_decl @Baz [template = constants.%Baz] {} {}
  34. // CHECK:STDOUT: }
  35. // CHECK:STDOUT:
  36. // CHECK:STDOUT: fn @Foo() {
  37. // CHECK:STDOUT: !entry:
  38. // CHECK:STDOUT: return
  39. // CHECK:STDOUT: }
  40. // CHECK:STDOUT:
  41. // CHECK:STDOUT: fn @Bar() {
  42. // CHECK:STDOUT: !entry:
  43. // CHECK:STDOUT: return
  44. // CHECK:STDOUT: }
  45. // CHECK:STDOUT:
  46. // CHECK:STDOUT: fn @Baz() {
  47. // CHECK:STDOUT: !entry:
  48. // CHECK:STDOUT: return
  49. // CHECK:STDOUT: }
  50. // CHECK:STDOUT: