File: debuginfo-lto.rs

package info (click to toggle)
rustc 1.88.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 934,128 kB
  • sloc: xml: 158,127; python: 36,062; javascript: 19,855; sh: 19,700; cpp: 18,947; ansic: 12,993; asm: 4,792; makefile: 690; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (24 lines) | stat: -rw-r--r-- 725 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//@ run-pass
// This test case makes sure that we don't run into LLVM's dreaded
// "possible ODR violation" assertion when compiling with LTO + Debuginfo.
// It covers cases that have traditionally been prone to cause this error.
// If new cases emerge, add them to this file.

//@ aux-build:debuginfo-lto-aux.rs
//@ compile-flags: -C lto -g
//@ no-prefer-dynamic

extern crate debuginfo_lto_aux;

fn some_fn(x: i32) -> i32 {
    x + 1
}

fn main() {
    let i = 0;
    let _ = debuginfo_lto_aux::mk_struct_with_lt(&i);
    let _ = debuginfo_lto_aux::mk_regular_struct(1);
    let _ = debuginfo_lto_aux::take_fn(some_fn, 1);
    let _ = debuginfo_lto_aux::with_closure(22);
    let _ = debuginfo_lto_aux::generic_fn(0f32);
}