order.carbon 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/order.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/order.carbon
  14. fn Foo() {}
  15. fn Bar() {}
  16. fn Baz() {}
  17. // CHECK:STDOUT: --- order.carbon
  18. // CHECK:STDOUT:
  19. // CHECK:STDOUT: constants {
  20. // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [concrete]
  21. // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [concrete]
  22. // CHECK:STDOUT: %Bar.type: type = fn_type @Bar [concrete]
  23. // CHECK:STDOUT: %Bar: %Bar.type = struct_value () [concrete]
  24. // CHECK:STDOUT: %Baz.type: type = fn_type @Baz [concrete]
  25. // CHECK:STDOUT: %Baz: %Baz.type = struct_value () [concrete]
  26. // CHECK:STDOUT: }
  27. // CHECK:STDOUT:
  28. // CHECK:STDOUT: file {
  29. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  30. // CHECK:STDOUT: .Foo = %Foo.decl
  31. // CHECK:STDOUT: .Bar = %Bar.decl
  32. // CHECK:STDOUT: .Baz = %Baz.decl
  33. // CHECK:STDOUT: }
  34. // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [concrete = constants.%Foo] {} {}
  35. // CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [concrete = constants.%Bar] {} {}
  36. // CHECK:STDOUT: %Baz.decl: %Baz.type = fn_decl @Baz [concrete = constants.%Baz] {} {}
  37. // CHECK:STDOUT: }
  38. // CHECK:STDOUT:
  39. // CHECK:STDOUT: fn @Foo() {
  40. // CHECK:STDOUT: !entry:
  41. // CHECK:STDOUT: return
  42. // CHECK:STDOUT: }
  43. // CHECK:STDOUT:
  44. // CHECK:STDOUT: fn @Bar() {
  45. // CHECK:STDOUT: !entry:
  46. // CHECK:STDOUT: return
  47. // CHECK:STDOUT: }
  48. // CHECK:STDOUT:
  49. // CHECK:STDOUT: fn @Baz() {
  50. // CHECK:STDOUT: !entry:
  51. // CHECK:STDOUT: return
  52. // CHECK:STDOUT: }
  53. // CHECK:STDOUT: