1 // RUN: %clang_cc1 %s -debug-info-kind=line-tables-only -emit-llvm -o - | FileCheck %s
2 // RUN: %clang_cc1 %s -debug-info-kind=line-directives-only -emit-llvm -o - | FileCheck %s
3 // Checks that clang with "-gline-tables-only" or "-gline-directives-only" doesn't emit debug info
4 // for variables and types.
5
6 // CHECK-NOT: DW_TAG_variable
7 int global = 42;
8
9 // CHECK-NOT: DW_TAG_typedef
10 // CHECK-NOT: DW_TAG_const_type
11 // CHECK-NOT: DW_TAG_pointer_type
12 // CHECK-NOT: DW_TAG_array_type
13 typedef const char* constCharPtrArray[10];
14
15 // CHECK-NOT: DW_TAG_structure_type
16 struct S {
17 // CHECK-NOT: DW_TAG_member
18 char a;
19 double b;
20 constCharPtrArray c;
21 };
22
23 // CHECK-NOT: DW_TAG_enumerator
24 // CHECK-NOT: DW_TAG_enumeration_type
25 enum E { ZERO = 0, ONE = 1 };
26
27 // CHECK-NOT: DILocalVariable
sum(int p,int q)28 int sum(int p, int q) {
29 int r = p + q;
30 struct S s;
31 enum E e;
32 return r;
33 }
34