gramanas created this revision. gramanas added a reviewer: vsk. Herald added subscribers: cfe-commits, JDevlieghere, eraman, aprantl.
This test is a strip down version of a function inside the amalgamated sqlite source. When converted to IR clang produces a phi instruction without debug location. It is a continuation of https://reviews.llvm.org/D47097 focusing on a different problem of similar structure. This was found while investigating instructions with missing DebugLoc after running SROA on the amalgamated sqlite source, in an attempt to try and preserve as much debug information as possible during the early stage passes. Repository: rC Clang https://reviews.llvm.org/D47720 Files: test/CodeGen/debug-info-inline-for.c Index: test/CodeGen/debug-info-inline-for.c =================================================================== --- /dev/null +++ test/CodeGen/debug-info-inline-for.c @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -debug-info-kind=limited -emit-llvm -o - %s | FileCheck %s + +int func(int n) { + int a; + for(a = 10; a>0 && n++; a--); + return n; +} + +// CHECK: land.end: +// CHECK-NEXT: {{.*}} = phi i1 {{.*}} !dbg ![[DbgLoc:[0-9]+]] + +// CHECK: ![[DbgLoc]] = !DILocation(
Index: test/CodeGen/debug-info-inline-for.c =================================================================== --- /dev/null +++ test/CodeGen/debug-info-inline-for.c @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -debug-info-kind=limited -emit-llvm -o - %s | FileCheck %s + +int func(int n) { + int a; + for(a = 10; a>0 && n++; a--); + return n; +} + +// CHECK: land.end: +// CHECK-NEXT: {{.*}} = phi i1 {{.*}} !dbg ![[DbgLoc:[0-9]+]] + +// CHECK: ![[DbgLoc]] = !DILocation(
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits