definition.carbon 1.3 KB

123456789101112131415161718192021222324252627282930313233
  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 Add(a: i32, b: i32) -> i32 = "int.sadd";
  7. // CHECK:STDOUT: --- definition.carbon
  8. // CHECK:STDOUT:
  9. // CHECK:STDOUT: constants {
  10. // CHECK:STDOUT: %Add: type = fn_type @Add [template]
  11. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  12. // CHECK:STDOUT: %struct: Add = struct_value () [template]
  13. // CHECK:STDOUT: }
  14. // CHECK:STDOUT:
  15. // CHECK:STDOUT: file {
  16. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  17. // CHECK:STDOUT: .Core = %Core
  18. // CHECK:STDOUT: .Add = %Add.decl
  19. // CHECK:STDOUT: }
  20. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  21. // CHECK:STDOUT: %Add.decl: Add = fn_decl @Add [template = constants.%struct] {
  22. // CHECK:STDOUT: %a.loc7_8.1: i32 = param a
  23. // CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc7_8.1
  24. // CHECK:STDOUT: %b.loc7_16.1: i32 = param b
  25. // CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc7_16.1
  26. // CHECK:STDOUT: @Add.%return: ref i32 = var <return slot>
  27. // CHECK:STDOUT: }
  28. // CHECK:STDOUT: }
  29. // CHECK:STDOUT:
  30. // CHECK:STDOUT: fn @Add(%a: i32, %b: i32) -> i32 = "int.sadd";
  31. // CHECK:STDOUT: