fail_qualifier_unsupported.carbon 2.3 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. var x: i32;
  7. // CHECK:STDERR: fail_qualifier_unsupported.carbon:[[@LINE+3]]:14: ERROR: Type `i32` does not support qualified expressions.
  8. // CHECK:STDERR: var y: i32 = x.b;
  9. // CHECK:STDERR: ^~~
  10. var y: i32 = x.b;
  11. // CHECK:STDOUT: --- fail_qualifier_unsupported.carbon
  12. // CHECK:STDOUT:
  13. // CHECK:STDOUT: constants {
  14. // CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
  15. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  16. // CHECK:STDOUT: %struct: Int32 = struct_value () [template]
  17. // CHECK:STDOUT: }
  18. // CHECK:STDOUT:
  19. // CHECK:STDOUT: file {
  20. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  21. // CHECK:STDOUT: .Core = %Core
  22. // CHECK:STDOUT: .x = %x
  23. // CHECK:STDOUT: .y = %y
  24. // CHECK:STDOUT: }
  25. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  26. // CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct]
  27. // CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%struct() [template = i32]
  28. // CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32]
  29. // CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32]
  30. // CHECK:STDOUT: %x.var: ref i32 = var x
  31. // CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var
  32. // CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct]
  33. // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%struct() [template = i32]
  34. // CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32]
  35. // CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32.loc11, %.loc11_8.1 [template = i32]
  36. // CHECK:STDOUT: %y.var: ref i32 = var y
  37. // CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var
  38. // CHECK:STDOUT: }
  39. // CHECK:STDOUT:
  40. // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
  41. // CHECK:STDOUT:
  42. // CHECK:STDOUT: fn @__global_init() {
  43. // CHECK:STDOUT: !entry:
  44. // CHECK:STDOUT: %x.ref: ref i32 = name_ref x, file.%x
  45. // CHECK:STDOUT: assign file.%y.var, <error>
  46. // CHECK:STDOUT: return
  47. // CHECK:STDOUT: }
  48. // CHECK:STDOUT: