1 // PR debug/58150
2 // { dg-do compile }
3 // { dg-options "-std=c++11 -gdwarf-4 -dA -fno-merge-debug-strings" }
4 // { dg-final { scan-assembler-times "DIE\[^\n\r\]*DW_TAG_enumeration_type" 3 } }
5 // { dg-final { scan-assembler-times " DW_AT_enum_class" 3 } }
6 // { dg-final { scan-assembler-times " DW_AT_declaration" 1 } }
7 // { dg-final { scan-assembler-times "\"E1..\"\[^\n\]*DW_AT_name" 1 } }
8 // { dg-final { scan-assembler-times "\"E2..\"\[^\n\]*DW_AT_name" 1 } }
9 // { dg-final { scan-assembler-times "\"F1..\"\[^\n\]*DW_AT_name" 1 } }
10 // { dg-final { scan-assembler-times "\"F2..\"\[^\n\]*DW_AT_name" 1 } }
11
12 enum class E : int;
13 enum class F : int;
14 enum class G : int;
15 struct S { E s; };
16 struct T { G t; };
17 enum class E : int
18 {
19 E1, E2
20 };
21 enum class F : int
22 {
23 F1, F2
24 };
25
26 bool
foo(E e,F f,G g)27 foo (E e, F f, G g)
28 {
29 return e == E::E1 && f == F::F1 && (int) g == 0;
30 }
31