From d59ce7d0eaada995e1a8f262f1ff33888575332c Mon Sep 17 00:00:00 2001 From: Archibald Elliott Date: Tue, 1 Nov 2022 14:52:37 +0000 Subject: [PATCH] [ARM] Specify Triple in DebugInfo Tests When the host's target triple ends in `-windows-msvc`, `%llc_dwarf` contains an explicit `-windows-gnu` triple which ensures that dwarf will be used. This is useful in target-independent tests, where no triple is specified, and no target-specific features are used. However, this is not compatible with target-dependent tests (such as those in llvm/test/DebugInfo/ARM), as the command-line triple will override the triple in the LLVM IR program, causing test issues on windows. This change switches these tests to use an explicit triple, so the tests test what was expected, and there is no flakiness on windows. Fixes #58053 Differential Revision: https://reviews.llvm.org/D136066 --- llvm/test/DebugInfo/ARM/bitfield.ll | 5 +---- llvm/test/DebugInfo/ARM/float-args.ll | 7 ++----- llvm/test/DebugInfo/ARM/split-complex.ll | 5 +---- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/llvm/test/DebugInfo/ARM/bitfield.ll b/llvm/test/DebugInfo/ARM/bitfield.ll index c33fc36..f1a98c3 100644 --- a/llvm/test/DebugInfo/ARM/bitfield.ll +++ b/llvm/test/DebugInfo/ARM/bitfield.ll @@ -1,4 +1,4 @@ -; RUN: %llc_dwarf -O0 -filetype=obj -o %t.o %s +; RUN: llc -mtriple=thumbv7-apple-ios -O0 -filetype=obj -o %t.o %s ; RUN: llvm-dwarfdump -v -debug-info %t.o | FileCheck %s ; ; Generated from: @@ -14,9 +14,6 @@ ; CHECK: DW_AT_bit_size {{.*}} (0x1c) ; CHECK: DW_AT_bit_offset {{.*}} (0xfffffffffffffff8) ; CHECK: DW_AT_data_member_location {{.*}} (DW_OP_plus_uconst 0x0) -source_filename = "test/DebugInfo/ARM/bitfield.ll" -target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32" -target triple = "thumbv7-apple-ios" %struct.anon = type { i8, [5 x i8] } diff --git a/llvm/test/DebugInfo/ARM/float-args.ll b/llvm/test/DebugInfo/ARM/float-args.ll index 56a7c89..859a1d5 100644 --- a/llvm/test/DebugInfo/ARM/float-args.ll +++ b/llvm/test/DebugInfo/ARM/float-args.ll @@ -1,5 +1,5 @@ -; RUN: %llc_dwarf -filetype=obj -mattr=+vfp2 -float-abi=hard < %s | llvm-dwarfdump -debug-info - | FileCheck %s -; RUN: %llc_dwarf -filetype=obj -mattr=-vfp2 -float-abi=soft < %s | llvm-dwarfdump -debug-info - | FileCheck %s +; RUN: llc -mtriple=armv7--none-eabi -filetype=obj -mattr=+vfp2 -float-abi=hard < %s | llvm-dwarfdump -debug-info - | FileCheck %s +; RUN: llc -mtriple=armv7--none-eabi -filetype=obj -mattr=-vfp2 -float-abi=soft < %s | llvm-dwarfdump -debug-info - | FileCheck %s ; Generated by clang -O1 -g from the following C source: ; float foo(float p) { @@ -12,9 +12,6 @@ ; CHECK: 0x{{[0-9a-f]*}}: DW_TAG_formal_parameter ; CHECK-NEXT: DW_AT_location -target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" -target triple = "armv7--none-eabi" - define float @foo(float %p) !dbg !4 { entry: tail call void @llvm.dbg.value(metadata float %p, metadata !9, metadata !15), !dbg !16 diff --git a/llvm/test/DebugInfo/ARM/split-complex.ll b/llvm/test/DebugInfo/ARM/split-complex.ll index 6de3406..5ac25c5 100644 --- a/llvm/test/DebugInfo/ARM/split-complex.ll +++ b/llvm/test/DebugInfo/ARM/split-complex.ll @@ -1,8 +1,5 @@ -; XFAIL: aarch64-pc-windows-msvc -; RUN: %llc_dwarf -O0 -filetype=obj -o %t.o %s +; RUN: llc -mtriple=thumbv7-apple-unknown-macho -O0 -filetype=obj -o %t.o %s ; RUN: llvm-dwarfdump -v -debug-info %t.o | FileCheck %s -target datalayout = "e-m:o-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" -target triple = "thumbv7-apple-unknown-macho" ; generated from (-triple thumbv7-apple-unknown-macho -Os): ; void f(_Complex double c) { c = 0; } -- 2.7.4