about summary refs log tree commit diff
path: root/src/test/ui/ast-json/ast-json-ice.rs
blob: e8a622e1b8772691e146931479e7b708ec8316da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Test that AST json serialization doesn't ICE (#63728).

// revisions: expand noexpand

//[expand] compile-flags: -Zast-json
//[noexpand] compile-flags: -Zast-json-noexpand

// check-pass
// dont-check-compiler-stdout - don't check for any AST change.

#![feature(asm)]

enum V {
    A(i32),
    B { f: [i64; 3 + 4] }
}

trait X {
    type Output;
    fn read(&self) -> Self::Output;
    fn write(&mut self, _: Self::Output);
}

macro_rules! call_println {
    ($y:ident) => { println!("{}", $y) }
}

fn main() {
    #[cfg(any(target_arch = "x86",
        target_arch = "x86_64",
        target_arch = "arm",
        target_arch = "aarch64"))]
    unsafe { asm!(""::::); }

    let x: (i32) = 35;
    let y = x as i64<> + 5;

    call_println!(y);

    struct A;
}