[OpenACC] Enable 'attach' clause for combined constructs
[llvm-project.git] / clang / test / CodeGen / lifetime-debuginfo-2.c
blob17d3d0b094972483ee9d6f87b72dca2f820f60bd
1 // RUN: %clang_cc1 -O1 -triple x86_64-none-linux-gnu -emit-llvm -debug-info-kind=line-tables-only %s -o - | FileCheck %s
2 // RUN: %clang_cc1 -O1 -triple x86_64-none-linux-gnu -emit-llvm -debug-info-kind=line-directives-only %s -o - | FileCheck %s
4 // Inserting lifetime markers should not affect debuginfo: lifetime.end is not
5 // a destructor, but instrumentation for the compiler. Ensure the debug info for
6 // 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 the
8 // function.
10 extern int f(int);
11 extern int g(int);
13 // CHECK-LABEL: define{{.*}} i32 @test
14 int test(int a, int b) {
15 int res;
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;
27 return res;
28 // CHECK: ret i32 %{{.*}}, !dbg [[DI:![0-9]+]]
29 // CHECK: [[DI]] = !DILocation(line: [[@LINE-2]]