Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / debug-info-scope.c
blob26d98d08aeacc80b6e2480daccbeabf495c1b70b
1 // RUN: %clang_cc1 -dwarf-version=4 -debug-info-kind=limited -disable-llvm-passes -emit-llvm < %s | FileCheck %s
2 // RUN: %clang_cc1 -dwarf-version=4 -debug-info-kind=line-tables-only -disable-llvm-passes -emit-llvm < %s | FileCheck --check-prefix=GMLT %s
3 // RUN: %clang_cc1 -dwarf-version=4 -debug-info-kind=line-directives-only -disable-llvm-passes -emit-llvm < %s | FileCheck --check-prefix=GMLT %s
4 // Two variables with same name in separate scope.
5 int main(void) {
6 int j = 0;
7 int k = 0;
8 // CHECK: !DILocalVariable(name: "i"
9 // CHECK-NEXT: !DILexicalBlock(
11 // Make sure we don't have any more lexical blocks because we don't need them in
12 // -gmlt.
13 // GMLT-NOT: !DILexicalBlock
14 for (int i = 0; i < 10; i++)
15 j++;
16 // CHECK: !DILocalVariable(name: "i"
17 // CHECK-NEXT: !DILexicalBlock(
18 // GMLT-NOT: !DILexicalBlock
19 for (int i = 0; i < 10; i++)
20 k++;
21 return 0;