From e3d8ee35e4adca664a9149536e0f0b3b0ceaeaeb Mon Sep 17 00:00:00 2001 From: Yonghong Song Date: Fri, 22 Nov 2019 08:45:37 -0800 Subject: reland "[DebugInfo] Support to emit debugInfo for extern variables" Commit d77ae1552fc21a9f3877f3ed7e13d631f517c825 ("[DebugInfo] Support to emit debugInfo for extern variables") added deebugInfo for extern variables for BPF target. The commit is reverted by 891e25b02d760d0de18c7d46947913b3166047e7 as the committed tests using %clang instead of %clang_cc1 causing test failed in certain scenarios as reported by Reid Kleckner. This patch fixed the tests by using %clang_cc1. Differential Revision: https://reviews.llvm.org/D71818 --- clang/test/CodeGen/debug-info-extern-duplicate.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 clang/test/CodeGen/debug-info-extern-duplicate.c (limited to 'clang/test/CodeGen/debug-info-extern-duplicate.c') diff --git a/clang/test/CodeGen/debug-info-extern-duplicate.c b/clang/test/CodeGen/debug-info-extern-duplicate.c new file mode 100644 index 00000000000..1c6d86f4cc0 --- /dev/null +++ b/clang/test/CodeGen/debug-info-extern-duplicate.c @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -x c -debug-info-kind=limited -triple bpf-linux-gnu -emit-llvm %s -o - | FileCheck %s + +extern char ch; +extern char ch; +int test() { + return ch; +} + +// CHECK: distinct !DIGlobalVariable(name: "ch",{{.*}} type: ![[T:[0-9]+]], isLocal: false, isDefinition: false +// CHECK-NOT: distinct !DIGlobalVariable(name: "ch" -- cgit v1.2.3