[llvm] r361479 - [llvm-objdump][test] Improve testing of some switches #2

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu May 23 03:17:11 PDT 2019


Author: jhenderson
Date: Thu May 23 03:17:10 2019
New Revision: 361479

URL: http://llvm.org/viewvc/llvm-project?rev=361479&view=rev
Log:
[llvm-objdump][test] Improve testing of some switches #2

This patch focuses on adding additional testing for the --source switch.
For reference, the source-interleave-x86_64.ll test file has been split
into two parts - the input (shared with the other tests) and the test
itself.

Reviewed by: MaskRay, rupprecht, grimar

Differential Revision: https://reviews.llvm.org/D61996

Added:
    llvm/trunk/test/tools/llvm-objdump/X86/Inputs/source-interleave.ll
    llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-invalid-source.test
    llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-missing-source.test
    llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-no-debug-info.test
    llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-relative-paths.test
    llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-x86_64.test
      - copied, changed from r361469, llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-x86_64.ll
Removed:
    llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-x86_64.ll

Added: llvm/trunk/test/tools/llvm-objdump/X86/Inputs/source-interleave.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/Inputs/source-interleave.ll?rev=361479&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/Inputs/source-interleave.ll (added)
+++ llvm/trunk/test/tools/llvm-objdump/X86/Inputs/source-interleave.ll Thu May 23 03:17:10 2019
@@ -0,0 +1,66 @@
+; NOTE: To be able to use this file as an input, the string SRC_CMPDIR needs
+;       replacing with a directory path by using sed or similar.
+
+; 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"
+
+ at a = global i32 1, align 4, !dbg !4
+
+; Function Attrs: nounwind uwtable
+define i32 @foo() #0 !dbg !9 {
+entry:
+  %0 = load i32, i32* @a, align 4, !dbg !12
+  ret i32 %0, !dbg !13
+}
+
+; Function Attrs: nounwind uwtable
+define i32 @main() #0 !dbg !14 {
+entry:
+  %retval = alloca i32, align 4
+  %b = alloca i32*, align 8
+  store i32 0, i32* %retval, align 4
+  call void @llvm.dbg.declare(metadata i32** %b, metadata !15, metadata !17), !dbg !18
+  store i32* @a, i32** %b, align 8, !dbg !18
+  %0 = load i32*, i32** %b, align 8, !dbg !19
+  %1 = load i32, i32* %0, align 4, !dbg !20
+  %call = call i32 @foo(), !dbg !21
+  %add = add nsw i32 %1, %call, !dbg !22
+  ret i32 %add, !dbg !23
+}
+
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
+
+attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #1 = { nounwind readnone }
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!6, !7}
+!llvm.ident = !{!8}
+
+!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 = !{}
+!3 = !{!4}
+!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true), expr: !DIExpression())
+!5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!6 = !{i32 2, !"Dwarf Version", i32 4}
+!7 = !{i32 2, !"Debug Info Version", i32 3}
+!8 = !{!"clang version 4.0.0"}
+!9 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, type: !10, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, retainedNodes: !2)
+!10 = !DISubroutineType(types: !11)
+!11 = !{!5}
+!12 = !DILocation(line: 3, column: 10, scope: !9)
+!13 = !DILocation(line: 3, column: 3, scope: !9)
+!14 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 6, type: !10, isLocal: false, isDefinition: true, scopeLine: 6, isOptimized: false, unit: !0, retainedNodes: !2)
+!15 = !DILocalVariable(name: "b", scope: !14, file: !1, line: 7, type: !16)
+!16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64, align: 64)
+!17 = !DIExpression()
+!18 = !DILocation(line: 7, column: 8, scope: !14)
+!19 = !DILocation(line: 8, column: 11, scope: !14)
+!20 = !DILocation(line: 8, column: 10, scope: !14)
+!21 = !DILocation(line: 8, column: 15, scope: !14)
+!22 = !DILocation(line: 8, column: 13, scope: !14)
+!23 = !DILocation(line: 8, column: 3, scope: !14)

Added: llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-invalid-source.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-invalid-source.test?rev=361479&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-invalid-source.test (added)
+++ llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-invalid-source.test Thu May 23 03:17:10 2019
@@ -0,0 +1,16 @@
+## Test llvm-objdump's --source behaviour when a line number is greater than the
+## file length.
+
+# RUN: sed -e "s,SRC_COMPDIR,%/p/Inputs,g" %p/Inputs/source-interleave.ll > %t.ll
+# RUN: sed -e "s,line: 7,line: 9999,g" %t.ll > %t2.ll
+
+# RUN: llc -o %t.o -filetype=obj -mtriple=x86_64-pc-linux %t.ll
+# RUN: llc -o %t2.o -filetype=obj -mtriple=x86_64-pc-linux %t2.ll
+
+# RUN: llvm-objdump --source %t.o | FileCheck %s --check-prefixes=CHECK,GOOD
+# RUN: llvm-objdump --source %t2.o | FileCheck %s --implicit-check-not="int *b = &a;"
+
+# CHECK:      main:
+# CHECK-NEXT: ; int main() {
+# GOOD:       ;   int *b = &a;
+# CHECK:      ;   return *b + foo();

Added: llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-missing-source.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-missing-source.test?rev=361479&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-missing-source.test (added)
+++ llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-missing-source.test Thu May 23 03:17:10 2019
@@ -0,0 +1,15 @@
+## Test that if the source cannot be found that disassembly is still printed,
+## and that no source is printed.
+
+# RUN: sed -e "s,SRC_COMPDIR,%/t,g" %p/Inputs/source-interleave.ll > %t.ll
+# RUN: sed -e "s,SRC_COMPDIR,%/p/Inputs,g" %p/Inputs/source-interleave.ll > %t2.ll
+
+# RUN: llc -o %t.o -filetype=obj -mtriple=x86_64-pc-linux %t.ll
+# RUN: llc -o %t2.o -filetype=obj -mtriple=x86_64-pc-linux %t2.ll
+
+# RUN: llvm-objdump --source %t.o | FileCheck %s --implicit-check-not=main
+# RUN: llvm-objdump --source %t2.o | FileCheck %s --check-prefixes=CHECK,SOURCE
+
+# CHECK:       0000000000000010 main:
+# SOURCE-NEXT: ; int main() {
+# CHECK-NEXT:   10:   55                      pushq   %rbp

Added: llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-no-debug-info.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-no-debug-info.test?rev=361479&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-no-debug-info.test (added)
+++ llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-no-debug-info.test Thu May 23 03:17:10 2019
@@ -0,0 +1,13 @@
+## Test that if an object has no debug information, only the disassembly is
+## printed when --source is specified.
+
+# 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
+# RUN: llvm-objcopy --strip-debug %t.o %t2.o
+
+# RUN: llvm-objdump --source %t.o | FileCheck %s --check-prefixes=CHECK,SOURCE
+# RUN: llvm-objdump --source %t2.o | FileCheck %s --implicit-check-not=main
+
+# CHECK:       0000000000000010 main:
+# SOURCE-NEXT: ; int main() {
+# CHECK-NEXT:   10:   55                      pushq   %rbp

Added: llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-relative-paths.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-relative-paths.test?rev=361479&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-relative-paths.test (added)
+++ llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-relative-paths.test Thu May 23 03:17:10 2019
@@ -0,0 +1,36 @@
+## Test that llvm-objdump prints source and disassembly for relative directory
+## paths for appropriate working directories. We also test that when the directory
+## string is empty the behaviour is the same as the current working directory.
+
+# RUN: mkdir -p %t/a/b
+# RUN: cp %p/Inputs/source-interleave-x86_64.c %t/a/source-interleave-x86_64.c
+
+# RUN: sed -e "s,SRC_COMPDIR,a,g" %p/Inputs/source-interleave.ll > %t.ll
+# RUN: sed -e "s,SRC_COMPDIR,,g" %p/Inputs/source-interleave.ll > %t2.ll
+# RUN: sed -e "s,SRC_COMPDIR,.,g" %p/Inputs/source-interleave.ll > %t3.ll
+# RUN: sed -e "s,SRC_COMPDIR,..,g" %p/Inputs/source-interleave.ll > %t4.ll
+
+# RUN: llc -o %t/a/a.o -filetype=obj -mtriple=x86_64-pc-linux %t.ll
+# RUN: llc -o %t/a/b.o -filetype=obj -mtriple=x86_64-pc-linux %t2.ll
+# RUN: llc -o %t/a/c.o -filetype=obj -mtriple=x86_64-pc-linux %t3.ll
+# RUN: llc -o %t/a/d.o -filetype=obj -mtriple=x86_64-pc-linux %t4.ll
+
+# RUN: cd %t
+# RUN: llvm-objdump --source a/a.o | FileCheck %s --check-prefixes=CHECK,SOURCE
+# RUN: llvm-objdump --source a/b.o | FileCheck %s --implicit-check-not=main
+# RUN: llvm-objdump --source a/c.o | FileCheck %s --implicit-check-not=main
+# RUN: llvm-objdump --source a/d.o | FileCheck %s --implicit-check-not=main
+# RUN: cd a
+# RUN: llvm-objdump --source a.o | FileCheck %s --implicit-check-not=main
+# RUN: llvm-objdump --source b.o | FileCheck %s --check-prefixes=CHECK,SOURCE
+# RUN: llvm-objdump --source c.o | FileCheck %s --check-prefixes=CHECK,SOURCE
+# RUN: llvm-objdump --source d.o | FileCheck %s --implicit-check-not=main
+# RUN: cd b
+# RUN: llvm-objdump --source ../a.o | FileCheck %s --implicit-check-not=main
+# RUN: llvm-objdump --source ../b.o | FileCheck %s --implicit-check-not=main
+# RUN: llvm-objdump --source ../c.o | FileCheck %s --implicit-check-not=main
+# RUN: llvm-objdump --source ../d.o | FileCheck %s --check-prefixes=CHECK,SOURCE
+
+# CHECK:       0000000000000010 main:
+# SOURCE-NEXT: ; int main() {
+# CHECK-NEXT:   10:   55                      pushq   %rbp

Removed: llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-x86_64.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-x86_64.ll?rev=361478&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-x86_64.ll (original)
+++ llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-x86_64.ll (removed)
@@ -1,79 +0,0 @@
-;  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"
-
- at a = global i32 1, align 4, !dbg !4
-
-; Function Attrs: nounwind uwtable
-define i32 @foo() #0 !dbg !9 {
-entry:
-  %0 = load i32, i32* @a, align 4, !dbg !12
-  ret i32 %0, !dbg !13
-}
-
-; Function Attrs: nounwind uwtable
-define i32 @main() #0 !dbg !14 {
-entry:
-  %retval = alloca i32, align 4
-  %b = alloca i32*, align 8
-  store i32 0, i32* %retval, align 4
-  call void @llvm.dbg.declare(metadata i32** %b, metadata !15, metadata !17), !dbg !18
-  store i32* @a, i32** %b, align 8, !dbg !18
-  %0 = load i32*, i32** %b, align 8, !dbg !19
-  %1 = load i32, i32* %0, align 4, !dbg !20
-  %call = call i32 @foo(), !dbg !21
-  %add = add nsw i32 %1, %call, !dbg !22
-  ret i32 %add, !dbg !23
-}
-
-; Function Attrs: nounwind readnone
-declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
-
-attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { nounwind readnone }
-
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!6, !7}
-!llvm.ident = !{!8}
-
-!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 = !{}
-!3 = !{!4}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true), expr: !DIExpression())
-!5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!6 = !{i32 2, !"Dwarf Version", i32 4}
-!7 = !{i32 2, !"Debug Info Version", i32 3}
-!8 = !{!"clang version 4.0.0"}
-!9 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, type: !10, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, retainedNodes: !2)
-!10 = !DISubroutineType(types: !11)
-!11 = !{!5}
-!12 = !DILocation(line: 3, column: 10, scope: !9)
-!13 = !DILocation(line: 3, column: 3, scope: !9)
-!14 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 6, type: !10, isLocal: false, isDefinition: true, scopeLine: 6, isOptimized: false, unit: !0, retainedNodes: !2)
-!15 = !DILocalVariable(name: "b", scope: !14, file: !1, line: 7, type: !16)
-!16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64, align: 64)
-!17 = !DIExpression()
-!18 = !DILocation(line: 7, column: 8, scope: !14)
-!19 = !DILocation(line: 8, column: 11, scope: !14)
-!20 = !DILocation(line: 8, column: 10, scope: !14)
-!21 = !DILocation(line: 8, column: 15, scope: !14)
-!22 = !DILocation(line: 8, column: 13, scope: !14)
-!23 = !DILocation(line: 8, column: 3, scope: !14)
-; LINES: main:
-; LINES-NEXT: ; {{[ -\(\)_A-Za-z0-9.\\/:]+}}source-interleave-x86_64.c:6
-
-; SOURCE: main:
-; SOURCE-NEXT: ; int main() {
-; SOURCE:      ;   int *b = &a;

Copied: llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-x86_64.test (from r361469, llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-x86_64.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-x86_64.test?p2=llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-x86_64.test&p1=llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-x86_64.ll&r1=361469&r2=361479&rev=361479&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-x86_64.ll (original)
+++ llvm/trunk/test/tools/llvm-objdump/X86/source-interleave-x86_64.test Thu May 23 03:17:10 2019
@@ -1,79 +1,17 @@
-;  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"
-
- at a = global i32 1, align 4, !dbg !4
-
-; Function Attrs: nounwind uwtable
-define i32 @foo() #0 !dbg !9 {
-entry:
-  %0 = load i32, i32* @a, align 4, !dbg !12
-  ret i32 %0, !dbg !13
-}
-
-; Function Attrs: nounwind uwtable
-define i32 @main() #0 !dbg !14 {
-entry:
-  %retval = alloca i32, align 4
-  %b = alloca i32*, align 8
-  store i32 0, i32* %retval, align 4
-  call void @llvm.dbg.declare(metadata i32** %b, metadata !15, metadata !17), !dbg !18
-  store i32* @a, i32** %b, align 8, !dbg !18
-  %0 = load i32*, i32** %b, align 8, !dbg !19
-  %1 = load i32, i32* %0, align 4, !dbg !20
-  %call = call i32 @foo(), !dbg !21
-  %add = add nsw i32 %1, %call, !dbg !22
-  ret i32 %add, !dbg !23
-}
-
-; Function Attrs: nounwind readnone
-declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
-
-attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { nounwind readnone }
-
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!6, !7}
-!llvm.ident = !{!8}
-
-!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 = !{}
-!3 = !{!4}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true), expr: !DIExpression())
-!5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!6 = !{i32 2, !"Dwarf Version", i32 4}
-!7 = !{i32 2, !"Debug Info Version", i32 3}
-!8 = !{!"clang version 4.0.0"}
-!9 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, type: !10, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, retainedNodes: !2)
-!10 = !DISubroutineType(types: !11)
-!11 = !{!5}
-!12 = !DILocation(line: 3, column: 10, scope: !9)
-!13 = !DILocation(line: 3, column: 3, scope: !9)
-!14 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 6, type: !10, isLocal: false, isDefinition: true, scopeLine: 6, isOptimized: false, unit: !0, retainedNodes: !2)
-!15 = !DILocalVariable(name: "b", scope: !14, file: !1, line: 7, type: !16)
-!16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64, align: 64)
-!17 = !DIExpression()
-!18 = !DILocation(line: 7, column: 8, scope: !14)
-!19 = !DILocation(line: 8, column: 11, scope: !14)
-!20 = !DILocation(line: 8, column: 10, scope: !14)
-!21 = !DILocation(line: 8, column: 15, scope: !14)
-!22 = !DILocation(line: 8, column: 13, scope: !14)
-!23 = !DILocation(line: 8, column: 3, scope: !14)
-; LINES: main:
-; LINES-NEXT: ; {{[ -\(\)_A-Za-z0-9.\\/:]+}}source-interleave-x86_64.c:6
-
-; SOURCE: main:
-; SOURCE-NEXT: ; int main() {
-; SOURCE:      ;   int *b = &a;
+# 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
+# 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 %s < %t0
+# RUN: FileCheck --check-prefix=SOURCE --strict-whitespace %s < %t2
+
+# LINES: main:
+# LINES-NEXT: ; {{[ -\(\)_A-Za-z0-9.\\/:]+}}source-interleave-x86_64.c:6
+
+# SOURCE: main:
+# SOURCE-NEXT: ; int main() {
+# SOURCE:      ;   int *b = &a;




More information about the llvm-commits mailing list