mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-01 22:02:45 +01:00
Adds min-preludes more tests which were seen as slow and their surrounding neighbours. This drops the file_test runtime on my machine from about 6s to about 4.5s. For a few files that are clearly only testing diagnostics, we drop the if-present semir ranges and the associated TODO.
60 lines
2.0 KiB
Plaintext
60 lines
2.0 KiB
Plaintext
// 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
|
|
//
|
|
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/uint.carbon
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/choice/params.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/choice/params.carbon
|
|
|
|
// --- fail_todo_empty_params.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
choice Always {
|
|
// CHECK:STDERR: fail_todo_empty_params.carbon:[[@LINE+4]]:8: error: semantics TODO: `empty parameter list should make a member function` [SemanticsTodo]
|
|
// CHECK:STDERR: Sunny()
|
|
// CHECK:STDERR: ^~
|
|
// CHECK:STDERR:
|
|
Sunny()
|
|
}
|
|
|
|
let mood: Always = Always.Sunny;
|
|
|
|
// --- fail_todo_params.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
choice C {
|
|
Alt1,
|
|
// CHECK:STDERR: fail_todo_params.carbon:[[@LINE+4]]:7: error: semantics TODO: `choice alternatives with parameters are not yet supported` [SemanticsTodo]
|
|
// CHECK:STDERR: Alt2(a: i32, b: i64),
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
|
// CHECK:STDERR:
|
|
Alt2(a: i32, b: i64),
|
|
Alt3,
|
|
}
|
|
|
|
// --- fail_todo_generic_params.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
choice C(T:! type) {
|
|
// CHECK:STDERR: fail_todo_generic_params.carbon:[[@LINE+4]]:6: error: semantics TODO: `choice alternatives with parameters are not yet supported` [SemanticsTodo]
|
|
// CHECK:STDERR: Alt(a: T)
|
|
// CHECK:STDERR: ^~~~~~
|
|
// CHECK:STDERR:
|
|
Alt(a: T)
|
|
}
|
|
|
|
// --- fail_todo_self_param.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
choice C {
|
|
// CHECK:STDERR: fail_todo_self_param.carbon:[[@LINE+4]]:6: error: semantics TODO: `choice alternatives with parameters are not yet supported` [SemanticsTodo]
|
|
// CHECK:STDERR: Alt(a: Self*)
|
|
// CHECK:STDERR: ^~~~~~~~~~
|
|
// CHECK:STDERR:
|
|
Alt(a: Self*)
|
|
}
|