about summary refs log tree commit diff
path: root/tests/ui/parallel-rustc/export-symbols-deadlock-issue-118205.rs
blob: 65f99c3064399a03dda533d8aaabc959a35a4aca (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
// Test for #118205, which causes a deadlock bug
//
//@ compile-flags: -Z threads=16
//@ build-pass
//@ compare-output-by-lines

pub static GLOBAL: isize = 3;

static GLOBAL0: isize = 4;

pub static GLOBAL2: &'static isize = &GLOBAL0;

pub fn verify_same(a: &'static isize) {
    let a = a as *const isize as usize;
    let b = &GLOBAL as *const isize as usize;
    assert_eq!(a, b);
}

pub fn verify_same2(a: &'static isize) {
    let a = a as *const isize as usize;
    let b = GLOBAL2 as *const isize as usize;
    assert_eq!(a, b);
}

fn main() {}