Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion clang/lib/AST/TextNodeDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,10 @@ void TextNodeDumper::Visit(const APValue &Value, QualType Ty) {
return;
}
case APValue::AddrLabelDiff:
OS << "AddrLabelDiff <todo>";
OS << "AddrLabelDiff ";
OS << "&&" << Value.getAddrLabelDiffLHS()->getLabel()->getName();
OS << " - ";
OS << "&&" << Value.getAddrLabelDiffRHS()->getLabel()->getName();
return;
}
llvm_unreachable("Unknown APValue kind!");
Expand Down
22 changes: 22 additions & 0 deletions clang/test/AST/ast-dump-APValue-addrlabeldiff.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Test without serialization:
// RUN: %clang_cc1 -std=c23 -ast-dump %s -ast-dump-filter Test \
// RUN: | FileCheck --strict-whitespace --match-full-lines %s
//
// Test with serialization:
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-unused-value -std=c23 -emit-pch -o %t %s
// RUN: %clang_cc1 -x c -triple x86_64-unknown-unknown -Wno-unused-value -std=c23 \
// RUN: -include-pch %t -ast-dump-all -ast-dump-filter Test /dev/null \
// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
// RUN: | FileCheck --strict-whitespace --match-full-lines %s


// CHECK: | |-value: AddrLabelDiff &&l2 - &&l1
int Test(void) {
constexpr char ar = &&l2 - &&l1;
l1:
return 10;
l2:
return 11;
}