]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/enum-debug-clike.rs
Enable emission of alignment attrs for pointer params
[rust.git] / src / test / codegen / enum-debug-clike.rs
1 // Copyright 2018 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 // This test depends on a patch that was committed to upstream LLVM
12 // before 7.0, then backported to the Rust LLVM fork.  It tests that
13 // debug info for "c-like" enums is properly emitted.
14
15 // ignore-tidy-linelength
16 // ignore-windows
17 // min-system-llvm-version 7.0
18
19 // compile-flags: -g -C no-prepopulate-passes
20
21 // CHECK-LABEL: @main
22 // CHECK: {{.*}}DICompositeType{{.*}}tag: DW_TAG_enumeration_type,{{.*}}name: "E",{{.*}}flags: DIFlagFixedEnum,{{.*}}
23 // CHECK: {{.*}}DIEnumerator{{.*}}name: "A",{{.*}}value: {{[0-9].*}}
24 // CHECK: {{.*}}DIEnumerator{{.*}}name: "B",{{.*}}value: {{[0-9].*}}
25 // CHECK: {{.*}}DIEnumerator{{.*}}name: "C",{{.*}}value: {{[0-9].*}}
26
27 #![allow(dead_code)]
28 #![allow(unused_variables)]
29 #![allow(unused_assignments)]
30
31 enum E { A, B, C }
32
33 pub fn main() {
34     let e = E::C;
35 }