]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/enum-debug-clike.rs
Rollup merge of #69800 - tmiasko:address-g, r=nikic
[rust.git] / src / test / codegen / enum-debug-clike.rs
1 // This test depends on a patch that was committed to upstream LLVM
2 // before 7.0, then backported to the Rust LLVM fork.  It tests that
3 // debug info for "c-like" enums is properly emitted.
4
5 // ignore-tidy-linelength
6 // ignore-windows
7 // min-system-llvm-version 8.0
8
9 // compile-flags: -g -C no-prepopulate-passes
10
11 // DIFlagFixedEnum was deprecated in 8.0, renamed to DIFlagEnumClass.
12 // We match either for compatibility.
13
14 // CHECK-LABEL: @main
15 // CHECK: {{.*}}DICompositeType{{.*}}tag: DW_TAG_enumeration_type,{{.*}}name: "E",{{.*}}flags: {{(DIFlagEnumClass|DIFlagFixedEnum)}},{{.*}}
16 // CHECK: {{.*}}DIEnumerator{{.*}}name: "A",{{.*}}value: {{[0-9].*}}
17 // CHECK: {{.*}}DIEnumerator{{.*}}name: "B",{{.*}}value: {{[0-9].*}}
18 // CHECK: {{.*}}DIEnumerator{{.*}}name: "C",{{.*}}value: {{[0-9].*}}
19
20 #![allow(dead_code)]
21 #![allow(unused_variables)]
22 #![allow(unused_assignments)]
23
24 enum E { A, B, C }
25
26 pub fn main() {
27     let e = E::C;
28 }