xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/debug-info-scope.c (revision 340f5e56603e4275faeb89a9aacace41ba22d661)
1 // RUN: %clang_cc1 -g -emit-llvm < %s | FileCheck %s
2 // RUN: %clang_cc1 -gline-tables-only -emit-llvm < %s | FileCheck --check-prefix=GMLT %s
3 // Two variables with same name in separate scope.
4 // Radar 8330217.
5 int main() {
6 	int j = 0;
7 	int k = 0;
8 // CHECK: DW_TAG_auto_variable ] [i]
9 // CHECK-NEXT: DW_TAG_lexical_block
10 
11 // FIXME: Looks like we don't actually need both these lexical blocks (disc 2
12 // just refers to disc 1, nothing actually uses disc 2).
13 // GMLT-NOT: DW_TAG_lexical_block
14 // GMLT: "0xb\002", {{.*}}} ; [ DW_TAG_lexical_block ]
15 // GMLT-NOT: DW_TAG_lexical_block
16 // GMLT: "0xb\001", {{.*}}} ; [ DW_TAG_lexical_block ]
17 // Make sure we don't have any more lexical blocks because we don't need them in
18 // -gmlt.
19 // GMLT-NOT: DW_TAG_lexical_block
20 	for (int i = 0; i < 10; i++)
21 		j++;
22 // CHECK: DW_TAG_auto_variable ] [i]
23 // CHECK-NEXT: DW_TAG_lexical_block
24 // GMLT-NOT: DW_TAG_lexical_block
25 	for (int i = 0; i < 10; i++)
26 		k++;
27 	return 0;
28 }
29