Files
clang-p2996/clang/test/CodeGen/assignment-tracking/nested-scope.cpp
OCHyams 78b0689ff2 [Assignment Tracking] Follow up for D147129 - fix broken clang tests
D147129 causes the assignment tracking pass to skip optnone functions, which
ends up overriding the "-fexperimental-assignment-tracking=forced" option at
O0. Add -disable-O0-optnone to the tests so that optnone doesn't interfere.

Buildbot example: https://lab.llvm.org/buildbot/#/builders/216/builds/18986
2023-03-29 13:54:10 +01:00

21 lines
740 B
C++

// RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone -O0 \
// RUN: -emit-llvm -fexperimental-assignment-tracking=forced %s -o - \
// RUN: -disable-O0-optnone \
// RUN: | FileCheck %s
// Check that dbg.assign intrinsics get a !dbg with with the same scope as
// their variable.
// CHECK: call void @llvm.dbg.assign({{.+}}, metadata [[local:![0-9]+]], {{.+}}, {{.+}}, {{.+}}), !dbg [[dbg:![0-9]+]]
// CHECK-DAG: [[local]] = !DILocalVariable(name: "local", scope: [[scope:![0-9]+]],
// CHECK-DAG: [[dbg]] = !DILocation({{.+}}, scope: [[scope]])
// CHECK-DAG: [[scope]] = distinct !DILexicalBlock
void ext(int*);
void fun() {
{
int local;
}
}