[PATCH] D61996: [llvm-objdump]Improve testing of some switches #2

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 17:59:55 PDT 2019


rupprecht accepted this revision.
rupprecht added inline comments.
This revision is now accepted and ready to land.


================
Comment at: test/tools/llvm-objdump/X86/Inputs/source-interleave.ll:17
+define i32 @main() #0 !dbg !14 {
+entry:
+  %retval = alloca i32, align 4
----------------
MaskRay wrote:
> I don't know how you feel about it, but I think these functions can just be empty. That is sufficient to emit debug info entries which will be used by the line table parser.
I think having the real implementation (even if it's relatively short) will be a more realistic test of interleaved source. But maybe I don't understand your comment?


================
Comment at: test/tools/llvm-objdump/X86/Inputs/source-interleave.ll:41
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3)
+!1 = !DIFile(filename: "source-interleave-x86_64.c", directory: "SRC_COMPDIR")
+!2 = !{}
----------------
Mind adding a comment here (or maybe at the top) that tests using this file need to run sed to fix this? Took me longer than I would like to admit to realize that.


================
Comment at: test/tools/llvm-objdump/X86/source-interleave-x86_64.test:1
-;  RUN: sed -e "s,SRC_COMPDIR,%/p/Inputs,g" %s > %t.ll
-;  RUN: llc  -o %t.o -filetype=obj -mtriple=x86_64-pc-linux  %t.ll
-;  RUN: llvm-objdump -d -l %t.o >%t0
-;  RUN: llvm-objdump -dl %t.o >%t1
-;  RUN: llvm-objdump -d -S %t.o >%t2
-;  RUN: llvm-objdump -dS %t.o >%t3
-;  RUN: cmp %t0 %t1
-;  RUN: cmp %t2 %t3
-;  RUN: FileCheck --check-prefix=LINES %t.ll < %t0
-;  RUN: FileCheck --check-prefix=SOURCE --strict-whitespace %t.ll < %t2
-; ModuleID = 'source-interleave-x86_64.bc'
-source_filename = "source-interleave-x86_64.c"
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
+; RUN: sed -e "s,SRC_COMPDIR,%/p/Inputs,g" %p/Inputs/source-interleave.ll > %t.ll
+; RUN: llc  -o %t.o -filetype=obj -mtriple=x86_64-pc-linux  %t.ll
----------------
Change ; to # for the test now that it doesn't have to parse as a `.ll` file


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61996/new/

https://reviews.llvm.org/D61996





More information about the llvm-commits mailing list