fail_collapse.carbon 1.0 KB

12345678910111213141516171819202122232425262728
  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_collapse.carbon:[[@LINE+3]]:9: `const` applied repeatedly to the same type has no additional effect.
  7. // CHECK:STDERR: fn G(p: const (const i32)**) -> i32** {
  8. // CHECK:STDERR: ^~~~~
  9. fn G(p: const (const i32)**) -> i32** {
  10. // CHECK:STDERR: fail_collapse.carbon:[[@LINE+3]]:11: ERROR: Cannot implicitly convert from `const i32**` to `i32**`.
  11. // CHECK:STDERR: return p;
  12. // CHECK:STDERR: ^
  13. return p;
  14. }
  15. // CHECK:STDOUT: --- fail_collapse.carbon
  16. // CHECK:STDOUT:
  17. // CHECK:STDOUT: file {
  18. // CHECK:STDOUT: %G: <function> = fn_decl @G
  19. // CHECK:STDOUT: }
  20. // CHECK:STDOUT:
  21. // CHECK:STDOUT: fn @G(%p: const i32**) -> i32** {
  22. // CHECK:STDOUT: !entry:
  23. // CHECK:STDOUT: %p.ref: const i32** = name_ref p, %p
  24. // CHECK:STDOUT: return <error>
  25. // CHECK:STDOUT: }
  26. // CHECK:STDOUT: