2010-08-25 08:28:56 +08:00
|
|
|
// RUN: %clang_cc1 -g -emit-llvm < %s | FileCheck %s
|
2014-10-23 03:34:33 +08:00
|
|
|
// RUN: %clang_cc1 -gline-tables-only -emit-llvm < %s | FileCheck --check-prefix=GMLT %s
|
2010-08-25 08:28:56 +08:00
|
|
|
// Two variables with same name in separate scope.
|
|
|
|
// Radar 8330217.
|
|
|
|
int main() {
|
|
|
|
int j = 0;
|
|
|
|
int k = 0;
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK: !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i"
|
|
|
|
// CHECK-NEXT: !MDLexicalBlock(
|
2014-10-23 03:34:33 +08:00
|
|
|
|
|
|
|
// FIXME: Looks like we don't actually need both these lexical blocks (disc 2
|
|
|
|
// just refers to disc 1, nothing actually uses disc 2).
|
2015-03-04 01:25:55 +08:00
|
|
|
// GMLT-NOT: !MDLexicalBlock
|
|
|
|
// GMLT: !MDLexicalBlockFile({{.*}}, discriminator: 2)
|
|
|
|
// GMLT-NOT: !MDLexicalBlock
|
|
|
|
// GMLT: !MDLexicalBlockFile({{.*}}, discriminator: 1)
|
2014-10-23 03:34:33 +08:00
|
|
|
// Make sure we don't have any more lexical blocks because we don't need them in
|
|
|
|
// -gmlt.
|
2015-03-04 01:25:55 +08:00
|
|
|
// GMLT-NOT: !MDLexicalBlock
|
2010-08-25 08:28:56 +08:00
|
|
|
for (int i = 0; i < 10; i++)
|
|
|
|
j++;
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK: !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i"
|
|
|
|
// CHECK-NEXT: !MDLexicalBlock(
|
|
|
|
// GMLT-NOT: !MDLexicalBlock
|
2010-08-25 08:28:56 +08:00
|
|
|
for (int i = 0; i < 10; i++)
|
|
|
|
k++;
|
2013-08-30 16:53:09 +08:00
|
|
|
return 0;
|
2010-08-25 08:28:56 +08:00
|
|
|
}
|