brintos

brintos / llvm-project-archived public Read only

0
0
Text · 929 B · 17d3d0b Raw
31 lines · c
1// RUN: %clang_cc1 -O1 -triple x86_64-none-linux-gnu -emit-llvm -debug-info-kind=line-tables-only %s -o - | FileCheck %s2// RUN: %clang_cc1 -O1 -triple x86_64-none-linux-gnu -emit-llvm -debug-info-kind=line-directives-only %s -o - | FileCheck %s3 4// Inserting lifetime markers should not affect debuginfo: lifetime.end is not5// a destructor, but instrumentation for the compiler. Ensure the debug info for6// the return statement (in the IR) does not point to the function closing '}'7// which is used to show some destructors have been called before leaving the8// function.9 10extern int f(int);11extern int g(int);12 13// CHECK-LABEL: define{{.*}} i32 @test14int test(int a, int b) {15  int res;16 17  if (a==2) {18    int r = f(b);19    res = r + b;20    a += 2;21  } else {22    int r = f(a);23    res = r + a;24    b += 1;25  }26 27  return res;28// CHECK: ret i32 %{{.*}}, !dbg [[DI:![0-9]+]]29// CHECK: [[DI]] = !DILocation(line: [[@LINE-2]]30}31