params_one.carbon 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. fn Foo(a: i32) {}
  7. fn Main() {
  8. Foo(1);
  9. }
  10. // CHECK:STDOUT: --- params_one.carbon
  11. // CHECK:STDOUT:
  12. // CHECK:STDOUT: constants {
  13. // CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
  14. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  15. // CHECK:STDOUT: %struct.1: Foo = struct_value () [template]
  16. // CHECK:STDOUT: %Main: type = fn_type @Main [template]
  17. // CHECK:STDOUT: %struct.2: Main = struct_value () [template]
  18. // CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
  19. // CHECK:STDOUT: }
  20. // CHECK:STDOUT:
  21. // CHECK:STDOUT: file {
  22. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  23. // CHECK:STDOUT: .Core = %Core
  24. // CHECK:STDOUT: .Foo = %Foo.decl
  25. // CHECK:STDOUT: .Main = %Main.decl
  26. // CHECK:STDOUT: }
  27. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  28. // CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.1] {
  29. // CHECK:STDOUT: %a.loc7_8.1: i32 = param a
  30. // CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
  31. // CHECK:STDOUT: }
  32. // CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
  33. // CHECK:STDOUT: }
  34. // CHECK:STDOUT:
  35. // CHECK:STDOUT: fn @Foo(%a: i32) {
  36. // CHECK:STDOUT: !entry:
  37. // CHECK:STDOUT: return
  38. // CHECK:STDOUT: }
  39. // CHECK:STDOUT:
  40. // CHECK:STDOUT: fn @Main() {
  41. // CHECK:STDOUT: !entry:
  42. // CHECK:STDOUT: %Foo.ref: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
  43. // CHECK:STDOUT: %.loc10: i32 = int_literal 1 [template = constants.%.2]
  44. // CHECK:STDOUT: %Foo.call: init () = call %Foo.ref(%.loc10)
  45. // CHECK:STDOUT: return
  46. // CHECK:STDOUT: }
  47. // CHECK:STDOUT: