fail_bool_value.carbon 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. // CHECK:STDERR: fail_bool_value.carbon:[[@LINE+3]]:11: ERROR: Alias initializer must be a name reference.
  7. // CHECK:STDERR: alias a = false;
  8. // CHECK:STDERR: ^~~~~
  9. alias a = false;
  10. let a_test: bool = a;
  11. // CHECK:STDOUT: --- fail_bool_value.carbon
  12. // CHECK:STDOUT:
  13. // CHECK:STDOUT: constants {
  14. // CHECK:STDOUT: %.1: bool = bool_literal false [template]
  15. // CHECK:STDOUT: %Bool: type = fn_type @Bool [template]
  16. // CHECK:STDOUT: %.2: type = tuple_type () [template]
  17. // CHECK:STDOUT: %struct: Bool = struct_value () [template]
  18. // CHECK:STDOUT: }
  19. // CHECK:STDOUT:
  20. // CHECK:STDOUT: file {
  21. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  22. // CHECK:STDOUT: .Core = %Core
  23. // CHECK:STDOUT: .a = %a
  24. // CHECK:STDOUT: }
  25. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  26. // CHECK:STDOUT: %.loc10: bool = bool_literal false [template = constants.%.1]
  27. // CHECK:STDOUT: %a: <error> = bind_alias a, <error> [template = <error>]
  28. // CHECK:STDOUT: %import_ref: Bool = import_ref ir7, inst+2, loaded [template = constants.%struct]
  29. // CHECK:STDOUT: %bool.make_type: init type = call constants.%struct() [template = bool]
  30. // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %bool.make_type [template = bool]
  31. // CHECK:STDOUT: %.loc11_13.2: type = converted %bool.make_type, %.loc11_13.1 [template = bool]
  32. // CHECK:STDOUT: %a.ref: <error> = name_ref a, %a [template = <error>]
  33. // CHECK:STDOUT: %a_test: bool = bind_name a_test, <error>
  34. // CHECK:STDOUT: }
  35. // CHECK:STDOUT:
  36. // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type";
  37. // CHECK:STDOUT: