params_two.carbon 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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/params_two.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/params_two.carbon
  10. fn Foo(a: i32, b: i32) {}
  11. // CHECK:STDOUT: --- params_two.carbon
  12. // CHECK:STDOUT:
  13. // CHECK:STDOUT: constants {
  14. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  15. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  16. // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template]
  17. // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template]
  18. // CHECK:STDOUT: }
  19. // CHECK:STDOUT:
  20. // CHECK:STDOUT: imports {
  21. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  22. // CHECK:STDOUT: .Int = %Core.Int
  23. // CHECK:STDOUT: import Core//prelude
  24. // CHECK:STDOUT: import Core//prelude/...
  25. // CHECK:STDOUT: }
  26. // CHECK:STDOUT: }
  27. // CHECK:STDOUT:
  28. // CHECK:STDOUT: file {
  29. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  30. // CHECK:STDOUT: .Core = imports.%Core
  31. // CHECK:STDOUT: .Foo = %Foo.decl
  32. // CHECK:STDOUT: }
  33. // CHECK:STDOUT: %Core.import = import Core
  34. // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {
  35. // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a
  36. // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0
  37. // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b
  38. // CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1
  39. // CHECK:STDOUT: } {
  40. // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0
  41. // CHECK:STDOUT: %.loc11_11: type = splice_block %i32.loc11_11 [template = constants.%i32] {
  42. // CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  43. // CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  44. // CHECK:STDOUT: }
  45. // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
  46. // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1
  47. // CHECK:STDOUT: %.loc11_19: type = splice_block %i32.loc11_19 [template = constants.%i32] {
  48. // CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  49. // CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  50. // CHECK:STDOUT: }
  51. // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param
  52. // CHECK:STDOUT: }
  53. // CHECK:STDOUT: }
  54. // CHECK:STDOUT:
  55. // CHECK:STDOUT: fn @Foo(%a.param_patt: %i32, %b.param_patt: %i32) {
  56. // CHECK:STDOUT: !entry:
  57. // CHECK:STDOUT: return
  58. // CHECK:STDOUT: }
  59. // CHECK:STDOUT: