59 lines · plain
1; REQUIRES: x86-registered-target2 3; Test case 2 - Assembler instructions.4 5; hello-world.cpp6; 1 extern int printf(const char * format, ... );7; 28; 3 int main()9; 4 {10; 5 printf("Hello, World\n");11; 6 return 0;12; 7 }13 14; Logical lines.15; The logical views shows the intermixed lines and assembler instructions,16; allowing to compare the code generated by the different toolchains.17 18; RUN: llvm-debuginfo-analyzer --attribute=language,level,format,producer \19; RUN: --print=lines,instructions \20; RUN: %p/Inputs/hello-world-codeview-clang.o \21; RUN: %p/Inputs/hello-world-codeview-msvc.o 2>&1 | \22; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s23 24; ONE: Logical View:25; ONE-NEXT: [000] {File} 'hello-world-codeview-clang.o' -> COFF-x86-6426; ONE-EMPTY:27; ONE-NEXT: [001] {CompileUnit} 'hello-world.cpp'28; ONE-NEXT: [002] {Producer} 'clang version 15.0.0 {{.*}}'29; ONE-NEXT: [002] {Language} 'Cpp'30; ONE-NEXT: [002] {Function} extern not_inlined 'main' -> 'int'31; ONE-NEXT: [003] 4 {Line}32; ONE-NEXT: [003] {Code} 'subq $0x28, %rsp'33; ONE-NEXT: [003] {Code} 'movl $0x0, 0x24(%rsp)'34; ONE-NEXT: [003] 5 {Line}35; ONE-NEXT: [003] {Code} 'leaq (%rip), %rcx'36; ONE-NEXT: [003] {Code} 'callq 0x0'37; ONE-NEXT: [003] 6 {Line}38; ONE-NEXT: [003] {Code} 'xorl %eax, %eax'39; ONE-NEXT: [003] {Code} 'addq $0x28, %rsp'40; ONE-NEXT: [003] {Code} 'retq'41; ONE-EMPTY:42; ONE-NEXT: Logical View:43; ONE-NEXT: [000] {File} 'hello-world-codeview-msvc.o' -> COFF-x86-6444; ONE-EMPTY:45; ONE-NEXT: [001] {CompileUnit} 'hello-world.cpp'46; ONE-NEXT: [002] {Producer} 'Microsoft (R) Optimizing Compiler'47; ONE-NEXT: [002] {Language} 'Cpp'48; ONE-NEXT: [002] {Function} extern not_inlined 'main' -> 'int'49; ONE-NEXT: [003] 4 {Line}50; ONE-NEXT: [003] {Code} 'subq $0x28, %rsp'51; ONE-NEXT: [003] 5 {Line}52; ONE-NEXT: [003] {Code} 'leaq (%rip), %rcx'53; ONE-NEXT: [003] {Code} 'callq 0x0'54; ONE-NEXT: [003] 6 {Line}55; ONE-NEXT: [003] {Code} 'xorl %eax, %eax'56; ONE-NEXT: [003] 7 {Line}57; ONE-NEXT: [003] {Code} 'addq $0x28, %rsp'58; ONE-NEXT: [003] {Code} 'retq'59