mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-25 08:30:10 +01:00
* Naive pointer implementation * Bug fixes and better pointer tests * Remove debug print statement * Implement changes suggested by @geoffromer Also add a failing test case that tests applying the address-of operator to an rvalue.
19 lines
743 B
Plaintext
19 lines
743 B
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
|
|
//
|
|
// RUN: %{not} %{executable_semantics} %s 2>&1 | \
|
|
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s
|
|
// RUN: %{not} %{executable_semantics} --trace %s 2>&1 | \
|
|
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s
|
|
// AUTOUPDATE: %{executable_semantics} %s
|
|
// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/pointer/fail_rvalue_addressof.carbon:16: Argument to & should be an lvalue.
|
|
|
|
package ExecutableSemanticsTest api;
|
|
|
|
fn Main() -> i32 {
|
|
var x: i32 = 5;
|
|
var p: i32* = &5;
|
|
return 0;
|
|
}
|