/src/test/codegen-units/partitioning/extern-drop-glue.rs

https://gitlab.com/alx741/rust · Rust · 46 lines · 16 code · 10 blank · 20 comment · 0 complexity · 79097b12d8aff7c0a259103251d1084f MD5 · raw file

  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. // ignore-tidy-linelength
  11. // We specify -Z incremental here because we want to test the partitioning for
  12. // incremental compilation
  13. // compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp/partitioning-tests/extern-drop-glue
  14. #![allow(dead_code)]
  15. #![crate_type="lib"]
  16. // aux-build:cgu_extern_drop_glue.rs
  17. extern crate cgu_extern_drop_glue;
  18. //~ TRANS_ITEM drop-glue cgu_extern_drop_glue::Struct[0] @@ extern_drop_glue[OnceODR] extern_drop_glue-mod1[OnceODR]
  19. //~ TRANS_ITEM drop-glue-contents cgu_extern_drop_glue::Struct[0] @@ extern_drop_glue[OnceODR] extern_drop_glue-mod1[OnceODR]
  20. struct LocalStruct(cgu_extern_drop_glue::Struct);
  21. //~ TRANS_ITEM fn extern_drop_glue::user[0] @@ extern_drop_glue[WeakODR]
  22. fn user()
  23. {
  24. //~ TRANS_ITEM drop-glue extern_drop_glue::LocalStruct[0] @@ extern_drop_glue[OnceODR]
  25. let _ = LocalStruct(cgu_extern_drop_glue::Struct(0));
  26. }
  27. mod mod1 {
  28. use cgu_extern_drop_glue;
  29. struct LocalStruct(cgu_extern_drop_glue::Struct);
  30. //~ TRANS_ITEM fn extern_drop_glue::mod1[0]::user[0] @@ extern_drop_glue-mod1[WeakODR]
  31. fn user()
  32. {
  33. //~ TRANS_ITEM drop-glue extern_drop_glue::mod1[0]::LocalStruct[0] @@ extern_drop_glue-mod1[OnceODR]
  34. let _ = LocalStruct(cgu_extern_drop_glue::Struct(0));
  35. }
  36. }