]> git.proxmox.com Git - rustc.git/blame - src/test/codegen-units/partitioning/extern-drop-glue.rs
New upstream version 1.23.0+dfsg1
[rustc.git] / src / test / codegen-units / partitioning / extern-drop-glue.rs
CommitLineData
a7813a04
XL
1// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
11// ignore-tidy-linelength
12
13// We specify -Z incremental here because we want to test the partitioning for
14// incremental compilation
15// compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp/partitioning-tests/extern-drop-glue
ea8adc8c 16// compile-flags:-Zinline-in-all-cgus
a7813a04
XL
17
18#![allow(dead_code)]
abe05a73 19#![crate_type="rlib"]
a7813a04
XL
20
21// aux-build:cgu_extern_drop_glue.rs
22extern crate cgu_extern_drop_glue;
23
cc61c64b 24//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<cgu_extern_drop_glue::Struct[0]> @@ extern_drop_glue[Internal] extern_drop_glue-mod1[Internal]
a7813a04
XL
25
26struct LocalStruct(cgu_extern_drop_glue::Struct);
27
abe05a73
XL
28//~ TRANS_ITEM fn extern_drop_glue::user[0] @@ extern_drop_glue[External]
29pub fn user()
a7813a04 30{
cc61c64b 31 //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<extern_drop_glue::LocalStruct[0]> @@ extern_drop_glue[Internal]
a7813a04
XL
32 let _ = LocalStruct(cgu_extern_drop_glue::Struct(0));
33}
34
abe05a73 35pub mod mod1 {
a7813a04
XL
36 use cgu_extern_drop_glue;
37
38 struct LocalStruct(cgu_extern_drop_glue::Struct);
39
abe05a73
XL
40 //~ TRANS_ITEM fn extern_drop_glue::mod1[0]::user[0] @@ extern_drop_glue-mod1[External]
41 pub fn user()
a7813a04 42 {
cc61c64b 43 //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<extern_drop_glue::mod1[0]::LocalStruct[0]> @@ extern_drop_glue-mod1[Internal]
a7813a04
XL
44 let _ = LocalStruct(cgu_extern_drop_glue::Struct(0));
45 }
46}