param_same_name.carbon 3.1 KB

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