1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/test/tools/llvm-readobj/codeview-inlining.test
Fangrui Song b2d3b0af04 [llvm-readobj] Change -long-option to --long-option in tests. NFC
We use both -long-option and --long-option in tests. Switch to --long-option for consistency.

In the "llvm-readelf" mode, -long-option is discouraged as it conflicts with grouped short options and it is not accepted by GNU readelf.

While updating the tests, change llvm-readobj -s to llvm-readobj -S to reduce confusion ("s" is --section-headers in llvm-readobj but --symbols in llvm-readelf).

llvm-svn: 359649
2019-05-01 05:27:20 +00:00

66 lines
1.8 KiB
Plaintext

; The following two object files were generated using the following command:
; $ cl /d2Zi+ /Zc:inline /O2 /Z7 /c t.cpp
; The contents of t.cpp follow:
; static void bar() {
; __asm nop
; }
; static void baz() {
; __asm nop
; }
; static __forceinline void foo() {
; __asm nop
; #include "a.h"
; #include "b.h"
; __asm nop
; goto forwards;
;
; backwards:
; __asm nop
; return;
;
; forwards:
; __asm rep nop
; goto backwards;
; }
; int main() {
; bar();
; baz();
; foo();
; }
;
; Both a.h and b.h contain "__asm nop".
RUN: llvm-readobj -S --codeview --section-symbols %p/Inputs/codeview-inlining.obj.coff | FileCheck %s
; FIXME: If we were more clever, we could turn FileIDs into paths.
; CHECK: SubSectionType: InlineeLines (0xF6)
; CHECK-NEXT: SubSectionSize: 0x3C
; CHECK-NEXT: InlineeSourceLine {
; CHECK-NEXT: Inlinee: bar (0x1002)
; CHECK-NEXT: FileID: d:\src\llvm\build\t.cpp (0x30)
; CHECK-NEXT: SourceLineNum: 2
; CHECK-NEXT: ExtraFileCount: 0
; CHECK-NEXT: ExtraFiles [
; CHECK-NEXT: ]
; CHECK-NEXT: }
; CHECK-NEXT: InlineeSourceLine {
; CHECK-NEXT: Inlinee: baz (0x1003)
; CHECK-NEXT: FileID: d:\src\llvm\build\t.cpp (0x30)
; CHECK-NEXT: SourceLineNum: 5
; CHECK-NEXT: ExtraFileCount: 0
; CHECK-NEXT: ExtraFiles [
; CHECK-NEXT: ]
; CHECK-NEXT: }
; The 'foo' inline site has extra files due to includes.
; CHECK-NEXT: InlineeSourceLine {
; CHECK-NEXT: Inlinee: foo (0x1004)
; CHECK-NEXT: FileID: d:\src\llvm\build\a.h (0x0)
; CHECK-NEXT: SourceLineNum: 1
; CHECK-NEXT: ExtraFileCount: 2
; CHECK-NEXT: ExtraFiles [
; CHECK-NEXT: FileID: d:\src\llvm\build\b.h (0x18)
; CHECK-NEXT: FileID: d:\src\llvm\build\t.cpp (0x30)
; CHECK-NEXT: ]
; CHECK-NEXT: }