Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / debug-info-enum-case-val.c
blobf39de0d7323758f8e40ac077bd46220b4619d691
1 // RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
3 enum { A = 1 };
4 int func1(int a) {
5 switch(a) {
6 case A: return 10;
7 default: break;
9 return 0;
11 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type
12 // CHECK-SAME: elements: [[TEST1_ENUMS:![0-9]*]]
13 // CHECK: [[TEST1_ENUMS]] = !{[[TEST1_E:![0-9]*]]}
14 // CHECK: [[TEST1_E]] = !DIEnumerator(name: "A", value: 1)
16 // Test ImplicitCast of switch case enum value
17 enum { B = 2 };
18 typedef unsigned long long __t1;
19 typedef __t1 __t2;
20 int func2(__t2 a) {
21 switch(a) {
22 case B: return 10;
23 default: break;
25 return 0;
27 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type
28 // CHECK-SAME: elements: [[TEST2_ENUMS:![0-9]*]]
29 // CHECK: [[TEST2_ENUMS]] = !{[[TEST2_E:![0-9]*]]}
30 // CHECK: [[TEST2_E]] = !DIEnumerator(name: "B", value: 2)