]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGenCXX/scoped-enums-debug-info.cpp
Vendor import of clang trunk r238337:
[FreeBSD/FreeBSD.git] / test / CodeGenCXX / scoped-enums-debug-info.cpp
1 // RUN: %clang_cc1 -std=c++11 -emit-llvm -g -o - %s | FileCheck %s
2 // Test that we are emitting debug info and base types for scoped enums.
3
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 };
8
9 void f(Color);
10 void g() {
11   f(Color::gray);
12 }
13
14 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Colour"
15 // CHECK-SAME:             baseType: ![[INT]]
16 enum struct Colour { grey };
17
18 void h(Colour);
19 void i() {
20   h(Colour::grey);
21 }
22
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 };
27
28 void j(Couleur);
29 void k() {
30   j(Couleur::gris);
31 }