]> git.proxmox.com Git - rustc.git/blob - src/test/ui/ast-json/ast-json-ice.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / ast-json / ast-json-ice.rs
1 // Test that AST json serialization doesn't ICE (#63728).
2
3 // revisions: expand noexpand
4
5 //[expand] compile-flags: -Zast-json
6 //[noexpand] compile-flags: -Zast-json-noexpand
7
8 // check-pass
9 // dont-check-compiler-stdout - don't check for any AST change.
10
11 #![feature(llvm_asm)]
12
13 enum V {
14 A(i32),
15 B { f: [i64; 3 + 4] }
16 }
17
18 trait X {
19 type Output;
20 fn read(&self) -> Self::Output;
21 fn write(&mut self, _: Self::Output);
22 }
23
24 macro_rules! call_println {
25 ($y:ident) => { println!("{}", $y) }
26 }
27
28 fn main() {
29 #[cfg(any(target_arch = "x86",
30 target_arch = "x86_64",
31 target_arch = "arm",
32 target_arch = "aarch64"))]
33 unsafe { llvm_asm!(""::::); }
34
35 let x: (i32) = 35;
36 let y = x as i64<> + 5;
37
38 call_println!(y);
39
40 struct A;
41 }