Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / scoped-enums-debug-info.cpp
blob131e31b021aeb3bbc3b5dbc822633bccc40748bb
1 // RUN: %clang_cc1 -std=c++11 -emit-llvm -debug-info-kind=limited -o - %s | FileCheck %s
2 // Test that we are emitting debug info and base types for scoped enums.
4 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Color"
5 // CHECK-SAME: baseType: ![[INT:[0-9]+]]
6 // CHECK: ![[INT]] = !DIBasicType(name: "int"
7 enum class Color { gray };
9 void f(Color);
10 void g() {
11 f(Color::gray);
14 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Colour"
15 // CHECK-SAME: baseType: ![[INT]]
16 enum struct Colour { grey };
18 void h(Colour);
19 void i() {
20 h(Colour::grey);
23 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Couleur"
24 // CHECK-SAME: baseType: ![[UCHAR:[0-9]+]]
25 // CHECK: ![[UCHAR]] = !DIBasicType(name: "unsigned char"
26 enum class Couleur : unsigned char { gris };
28 void j(Couleur);
29 void k() {
30 j(Couleur::gris);