From c74ffa9cab4681845ad801828ffea262957486b8 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 5 Aug 2014 16:20:25 +0000 Subject: [PATCH] Improve test for merged global debug info by using llvm-dwarfdump. It's a bit of a tradeoff, since llvm-dwarfdump doesn't print the name of the global symbol being used as an address in the addressing mode, but this avoids the dependence on hardcoded set labels that keep changing (5+ commits over the last few years that each update the set label as it changes due to other, unrelated differences in output). This could've, instead, been changed to match the set name then match the name in the string pool but that would present other issues (needing to skip over the sets that weren't of interest, etc) and checking that the addresses (granted, without relocations applied - so it's not the whole story) match in the two variable location descriptions seems sufficient and fairly stable here. There are a few similar other tests with similar label dependence that I'll update soonish. llvm-svn: 214878 --- .../test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/llvm/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll b/llvm/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll index b1d59aa..902c9cbb 100644 --- a/llvm/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll +++ b/llvm/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s | FileCheck %s +; RUN: llc -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32" target triple = "thumbv7-apple-darwin10" @@ -11,22 +11,22 @@ target triple = "thumbv7-apple-darwin10" ; Check debug info output for merged global. ; DW_AT_location -; DW_OP_addr -; DW_OP_plus -; .long __MergedGlobals -; DW_OP_constu -; offset +; 0x03 DW_OP_addr +; 0x.. .long __MergedGlobals +; 0x10 DW_OP_constu +; 0x.. offset +; 0x22 DW_OP_plus -;CHECK: .long Lset7 -;CHECK-NEXT: @ DW_AT_type -;CHECK-NEXT: @ DW_AT_decl_file -;CHECK-NEXT: @ DW_AT_decl_line -;CHECK-NEXT: @ DW_AT_location -;CHECK-NEXT: .byte 3 -;CHECK-NEXT: .long __MergedGlobals -;CHECK-NEXT: .byte 16 -;CHECK-NEXT: .byte 1 -;CHECK-NEXT: .byte 34 +; CHECK: DW_TAG_variable +; CHECK-NOT: DW_TAG +; CHECK: DW_AT_name {{.*}} "x1" +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x8> 03 [[ADDR:.. .. .. ..]] 10 00 22 ) +; CHECK: DW_TAG_variable +; CHECK-NOT: DW_TAG +; CHECK: DW_AT_name {{.*}} "x2" +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x8> 03 [[ADDR]] 10 01 22 ) define zeroext i8 @get1(i8 zeroext %a) nounwind optsize { entry: -- 2.7.4