| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
- // Exceptions. See /LICENSE for license information.
- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/where_expr/no_prelude/fail_designator.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/where_expr/no_prelude/fail_designator.carbon
- // --- fail_designator_matches_var.carbon
- library "[[@TEST_NAME]]";
- fn Foo() -> () {
- var x: ();
- // CHECK:STDERR: fail_designator_matches_var.carbon:[[@LINE+4]]:10: error: semantics TODO: `HandleDesignatorExpr`
- // CHECK:STDERR: return .x;
- // CHECK:STDERR: ^~
- // CHECK:STDERR:
- return .x;
- }
- // --- fail_unknown_designator.carbon
- library "[[@TEST_NAME]]";
- fn Bar() -> () {
- // CHECK:STDERR: fail_unknown_designator.carbon:[[@LINE+4]]:10: error: semantics TODO: `HandleDesignatorExpr`
- // CHECK:STDERR: return .undef;
- // CHECK:STDERR: ^~~~~~
- // CHECK:STDERR:
- return .undef;
- }
- // --- fail_dot_self_method_return_value.carbon
- library "[[@TEST_NAME]]";
- class C {
- // CHECK:STDERR: fail_dot_self_method_return_value.carbon:[[@LINE+4]]:28: error: semantics TODO: `HandleSelfTypeName`
- // CHECK:STDERR: fn F() -> Self { return .Self; }
- // CHECK:STDERR: ^~~~
- // CHECK:STDERR:
- fn F() -> Self { return .Self; }
- }
- // --- fail_dot_self_method_return_type.carbon
- library "[[@TEST_NAME]]";
- class D {
- // CHECK:STDERR: fail_dot_self_method_return_type.carbon:[[@LINE+3]]:14: error: semantics TODO: `HandleSelfTypeName`
- // CHECK:STDERR: fn G() -> .Self { return Self; }
- // CHECK:STDERR: ^~~~
- fn G() -> .Self { return Self; }
- }
- // CHECK:STDOUT: --- fail_designator_matches_var.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template]
- // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Foo() -> %.1 {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_unknown_designator.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %Bar.type: type = fn_type @Bar [template]
- // CHECK:STDOUT: %Bar: %Bar.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Bar() -> %.1 {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_dot_self_method_return_value.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [template]
- // CHECK:STDOUT: %F.type: type = fn_type @F [template]
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %F: %F.type = struct_value () [template]
- // CHECK:STDOUT: %.2: type = struct_type {} [template]
- // CHECK:STDOUT: %.3: <witness> = complete_type_witness %.2 [template]
- // CHECK:STDOUT: %.4: type = ptr_type %.2 [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C {
- // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
- // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C]
- // CHECK:STDOUT: %return.var: ref %C = var <return slot>
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %.loc10: <witness> = complete_type_witness %.2 [template = constants.%.3]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%C
- // CHECK:STDOUT: .F = %F.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F() -> @C.%return.var: %C {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_dot_self_method_return_type.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %D: type = class_type @D [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @D {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%D
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|