Skip to content

Commit b3be298

Browse files
authored
Fix test that used i32 in a no_prelude directory (carbon-language#5086)
Exclude SemIR since the point of the test is that it diagnoses something invalid, not that any particular SemIR is produced. Co-authored-by: Josh L <[email protected]>
1 parent 7fd54ed commit b3be298

File tree

1 file changed

+4
-40
lines changed

1 file changed

+4
-40
lines changed

toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,24 @@
22
// Exceptions. See /LICENSE for license information.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
//
5+
// EXTRA-ARGS: --no-dump-sem-ir
6+
//
57
// AUTOUPDATE
68
// TIP: To test this file alone, run:
79
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon
810
// TIP: To dump output, run:
911
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon
1012

1113
interface I {
12-
// CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+8]]:10: error: `Core.Int` implicitly referenced here, but package `Core` not found [CoreNotFound]
13-
// CHECK:STDERR: let a: i32;
14-
// CHECK:STDERR: ^~~
15-
// CHECK:STDERR:
1614
// CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+4]]:7: error: pattern in associated constant declaration must be a single `:!` binding [ExpectedSymbolicBindingInAssociatedConstant]
17-
// CHECK:STDERR: let a: i32;
15+
// CHECK:STDERR: let a: {.b: ()};
1816
// CHECK:STDERR: ^
1917
// CHECK:STDERR:
20-
let a: i32;
18+
let a: {.b: ()};
2119
}
2220

2321
// We shouldn't issue further errors on uses of the invalid name.
2422
alias UseA = I.a;
2523

2624
// Ideally we would still diagnose this, but it's OK that we don't.
2725
alias UseOther = I.other;
28-
29-
// CHECK:STDOUT: --- fail_assoc_const_not_constant.carbon
30-
// CHECK:STDOUT:
31-
// CHECK:STDOUT: constants {
32-
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
33-
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
34-
// CHECK:STDOUT: }
35-
// CHECK:STDOUT:
36-
// CHECK:STDOUT: file {
37-
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
38-
// CHECK:STDOUT: .I = %I.decl
39-
// CHECK:STDOUT: .UseA = %UseA
40-
// CHECK:STDOUT: .UseOther = %UseOther
41-
// CHECK:STDOUT: }
42-
// CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
43-
// CHECK:STDOUT: %I.ref.loc24: type = name_ref I, %I.decl [concrete = constants.%I.type]
44-
// CHECK:STDOUT: %a.ref: <error> = name_ref a, <unexpected>.inst19.loc20_7 [concrete = <error>]
45-
// CHECK:STDOUT: %UseA: <error> = bind_alias UseA, <unexpected>.inst19.loc20_7 [concrete = <error>]
46-
// CHECK:STDOUT: %I.ref.loc27: type = name_ref I, %I.decl [concrete = constants.%I.type]
47-
// CHECK:STDOUT: %other.ref: <error> = name_ref other, <error> [concrete = <error>]
48-
// CHECK:STDOUT: %UseOther: <error> = bind_alias UseOther, <error> [concrete = <error>]
49-
// CHECK:STDOUT: }
50-
// CHECK:STDOUT:
51-
// CHECK:STDOUT: interface @I {
52-
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
53-
// CHECK:STDOUT:
54-
// CHECK:STDOUT: !members:
55-
// CHECK:STDOUT: .Self = %Self
56-
// CHECK:STDOUT: .a = <unexpected>.inst19.loc20_7
57-
// CHECK:STDOUT: .other = <poisoned>
58-
// CHECK:STDOUT: has_error
59-
// CHECK:STDOUT: witness = ()
60-
// CHECK:STDOUT: }
61-
// CHECK:STDOUT:

0 commit comments

Comments
 (0)