[PATCH] D95513: [llvm-objdump][test] Fix --prefix tests for system-windows

Vinicius Tinti via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 02:14:03 PST 2021


tinti created this revision.
tinti added reviewers: rengolin, jhenderson, MaskRay, kula, Bigcheese, thakis.
Herald added a subscriber: rupprecht.
tinti requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Some '/' in warnings are converted to '\' on system-windows.

      

Fixes D85024 <https://reviews.llvm.org/D85024>.
Fixes PR46368.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95513

Files:
  llvm/test/tools/llvm-objdump/X86/source-interleave-prefix-windows.test
  llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test


Index: llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test
===================================================================
--- llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test
+++ llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test
@@ -1,5 +1,4 @@
 ;; Test --prefix option.
-;; UNSUPPORTED: system-windows
 
 ;; Test prefix option ignored for relative paths.
 
@@ -7,7 +6,7 @@
 ; RUN: llc -o %t-relative-path.o -filetype=obj -mtriple=x86_64-pc-linux %t-relative-path.ll
 ; RUN: llvm-objdump --prefix myprefix --source %t-relative-path.o 2>&1 | \
 ; RUN:   FileCheck %s --check-prefix=CHECK-BROKEN-PREFIX -DFILE=%t-relative-path.o -DPREFIX=.
-; CHECK-BROKEN-PREFIX: warning: '[[FILE]]': failed to find source [[PREFIX]]/Inputs/source-interleave-x86_64.c
+; CHECK-BROKEN-PREFIX: warning: '[[FILE]]': failed to find source [[PREFIX]]/Inputs{{[/\\]}}source-interleave-x86_64.c
 
 ;; Test invalid source interleave fixed by adding the correct prefix.
 
@@ -42,4 +41,4 @@
 ;; The prefix 'myprefix//' is converted to 'myprefix'.
 
 ; RUN: llvm-objdump --prefix myprefix// --source %t-missing-prefix.o 2>&1 | \
-; RUN:   FileCheck %s --check-prefix=CHECK-BROKEN-PREFIX -DFILE=%t-missing-prefix.o -DPREFIX=myprefix
+; RUN:   FileCheck %s --check-prefix=CHECK-BROKEN-PREFIX -DFILE=%t-missing-prefix.o -DPREFIX=myprefix
\ No newline at end of file
Index: llvm/test/tools/llvm-objdump/X86/source-interleave-prefix-windows.test
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-objdump/X86/source-interleave-prefix-windows.test
@@ -0,0 +1,10 @@
+;; Test --prefix option platform specific behavior.
+; REQUIRES: system-windows
+
+;; Test removal of trailing separators (both '/' and '\').
+;; The prefix 'myprefix/\' is changed to 'myprefix'.
+
+; RUN: sed -e "s,SRC_COMPDIR,/Inputs,g" %p/Inputs/source-interleave.ll > %t.ll
+; RUN: llc -o %t.o -filetype=obj -mtriple=x86_64-pc-linux %t.ll
+; RUN: llvm-objdump --prefix 'myprefix/\' --source %t.o 2>&1 | FileCheck %s -DFILE=%t.o -DPREFIX='myprefix'
+; CHECK: warning: '[[FILE]]': failed to find source [[PREFIX]]/Inputs\source-interleave-x86_64.c
\ No newline at end of file


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95513.319503.patch
Type: text/x-patch
Size: 2208 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210127/881a13aa/attachment.bin>


More information about the llvm-commits mailing list