xref: /llvm-project/clang/test/CodeGen/assignment-tracking/nested-scope.cpp (revision 094572701dce4aaf36f4521d6cf750420d39f206)
1 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone -O0 \
2 // RUN:     -emit-llvm  -fexperimental-assignment-tracking=forced %s -o -        \
3 // RUN:     -disable-O0-optnone                                                  \
4 // RUN: | FileCheck %s
5 
6 // Check that dbg.assign intrinsics get a !dbg with with the same scope as
7 // their variable.
8 
9 // CHECK: #dbg_assign({{.+}}, [[local:![0-9]+]], {{.+}}, {{.+}}, {{.+}},  [[dbg:![0-9]+]]
10 // CHECK-DAG: [[local]] = !DILocalVariable(name: "local", scope: [[scope:![0-9]+]],
11 // CHECK-DAG: [[dbg]] = !DILocation({{.+}}, scope: [[scope]])
12 // CHECK-DAG: [[scope]] = distinct !DILexicalBlock
13 
14 void ext(int*);
fun()15 void fun() {
16   {
17     int local;
18   }
19 }
20 
21