params_zero.carbon 2.0 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. // 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/call/params_zero.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/params_zero.carbon
  14. fn Foo() {}
  15. fn Main() {
  16. Foo();
  17. }
  18. // CHECK:STDOUT: --- params_zero.carbon
  19. // CHECK:STDOUT:
  20. // CHECK:STDOUT: constants {
  21. // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [concrete]
  22. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  23. // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [concrete]
  24. // CHECK:STDOUT: %Main.type: type = fn_type @Main [concrete]
  25. // CHECK:STDOUT: %Main: %Main.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: .Main = %Main.decl
  32. // CHECK:STDOUT: }
  33. // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [concrete = constants.%Foo] {} {}
  34. // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [concrete = constants.%Main] {} {}
  35. // CHECK:STDOUT: }
  36. // CHECK:STDOUT:
  37. // CHECK:STDOUT: fn @Foo() {
  38. // CHECK:STDOUT: !entry:
  39. // CHECK:STDOUT: return
  40. // CHECK:STDOUT: }
  41. // CHECK:STDOUT:
  42. // CHECK:STDOUT: fn @Main() {
  43. // CHECK:STDOUT: !entry:
  44. // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [concrete = constants.%Foo]
  45. // CHECK:STDOUT: %Foo.call: init %empty_tuple.type = call %Foo.ref()
  46. // CHECK:STDOUT: return
  47. // CHECK:STDOUT: }
  48. // CHECK:STDOUT: