param_same_name.carbon 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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: %Int32.type: type = fn_type @Int32 [template]
  16. // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [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: .Int32 = %import_ref
  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: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  43. // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32]
  44. // CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32, %.loc11_9.1 [template = i32]
  45. // CHECK:STDOUT: %a.param: i32 = value_param runtime_param0
  46. // CHECK:STDOUT: %a: i32 = bind_name a, %a.param
  47. // CHECK:STDOUT: }
  48. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
  49. // CHECK:STDOUT: %a.patt: i32 = binding_pattern a
  50. // CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0
  51. // CHECK:STDOUT: } {
  52. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  53. // CHECK:STDOUT: %.loc13_9.1: type = value_of_initializer %int.make_type_32 [template = i32]
  54. // CHECK:STDOUT: %.loc13_9.2: type = converted %int.make_type_32, %.loc13_9.1 [template = i32]
  55. // CHECK:STDOUT: %a.param: i32 = value_param runtime_param0
  56. // CHECK:STDOUT: %a: i32 = bind_name a, %a.param
  57. // CHECK:STDOUT: }
  58. // CHECK:STDOUT: }
  59. // CHECK:STDOUT:
  60. // CHECK:STDOUT: fn @F(%a.param_patt: i32);
  61. // CHECK:STDOUT:
  62. // CHECK:STDOUT: fn @G(%a.param_patt: i32);
  63. // CHECK:STDOUT: