collapse.carbon 928 B

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