params_zero.carbon 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  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. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  6. // EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present
  7. //
  8. // AUTOUPDATE
  9. // TIP: To test this file alone, run:
  10. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/params_zero.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/params_zero.carbon
  13. fn Foo() {}
  14. // CHECK:STDOUT: --- params_zero.carbon
  15. // CHECK:STDOUT:
  16. // CHECK:STDOUT: constants {
  17. // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [concrete]
  18. // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [concrete]
  19. // CHECK:STDOUT: }
  20. // CHECK:STDOUT:
  21. // CHECK:STDOUT: file {
  22. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  23. // CHECK:STDOUT: .Foo = %Foo.decl
  24. // CHECK:STDOUT: }
  25. // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [concrete = constants.%Foo] {} {}
  26. // CHECK:STDOUT: }
  27. // CHECK:STDOUT:
  28. // CHECK:STDOUT: fn @Foo() {
  29. // CHECK:STDOUT: !entry:
  30. // CHECK:STDOUT: return
  31. // CHECK:STDOUT: }
  32. // CHECK:STDOUT: