Files
carbon-lang/toolchain/check/fuzzer_corpus/852bf7ffb5136d7be49f858d8d73f8e2bb1936ce
T
Jon Ross-Perkins 1c748c0f14 Split semantics into check and sem_ir directories (#3176)
Continuing along with #3070. Note this is just a file rename, with BUILD
edits; every file previously in semantics/ should show as moved (except
maybe BUILDs, which split).
2023-08-31 19:54:32 +00:00

28 lines
612 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
//
// AUTOUPDATE
// CHECK:STDOUT: 5
// CHECK:STDOUT: 4
// CHECK:STDOUT: 0
// CHECK:STDOUT: result: 0
package ExplorerTest api;
class A { var n: i32; }
impl A as BitAndWith(i32) where .Result = A {
fn Op[self: Self](rhs: i32) -> A { return {.n = self.n & rhs}; }
}
fn Main() -> i32 {
var a: A = {.n = 13};
a = a & 7;
Print("{0}", a.n);
a &= -2;
Print("{0}", a.n);
Print("{0}", (a & 3).n);
return 0;
}