147 lines · plain
1; REQUIRES: x86-registered-target2 3; Incorrect function matching during comparison.4; https://github.com/llvm/llvm-project/issues/570405 6; Output generated by g++ (Debian 11.3.0-3) 11.3.07 8; .debug_info contents:9; format = DWARF32, version = 0x0005, unit_type = DW_UT_compile10;11; DW_TAG_compile_unit12; DW_TAG_subprogram ("foo")13; DW_AT_decl_file (1)14;15; DW_TAG_formal_parameter ("ParamPtr")16; DW_AT_decl_file (1)17;18; .debug_line contents:19; Line table prologue:20; format: DWARF32, version: 521; include_directories[0] = "/usr/local/google/home/aheejin/test/llvm-dva"22; file_names[0]: name: "test.cpp" dir_index: 023; file_names[1]: name: "test.cpp" dir_index: 024 25; The values for DW_AT_decl_file are 1-indexed.26 27; test.cpp28; 1 using INTPTR = const int *;29; 2 int foo(INTPTR ParamPtr, unsigned ParamUnsigned, bool ParamBool) {30; 3 if (ParamBool) {31; 4 typedef int INTEGER;32; 5 const INTEGER CONSTANT = 7;33; 6 return CONSTANT;34; 7 }35; 8 return ParamUnsigned;36; 9 }37 38; RUN: llvm-debuginfo-analyzer --attribute=language,level,producer \39; RUN: --compare=types \40; RUN: --report=view \41; RUN: --print=symbols,types \42; RUN: %p/Inputs/pr-57040-test-dwarf-clang.o \43; RUN: %p/Inputs/pr-57040-test-dwarf-gcc.o 2>&1 | \44; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s45 46; ONE: Reference: 'pr-57040-test-dwarf-clang.o'47; ONE-NEXT: Target: 'pr-57040-test-dwarf-gcc.o'48; ONE-EMPTY:49; ONE-NEXT: Logical View:50; ONE-NEXT: [000] {File} 'pr-57040-test-dwarf-clang.o'51; ONE-EMPTY:52; ONE-NEXT: [001] {CompileUnit} 'test.cpp'53; ONE-NEXT: [002] {Producer} 'clang version 14.0.6'54; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus_14'55; ONE-NEXT: [002] 1 {TypeAlias} 'INTPTR' -> '* const int'56; ONE-NEXT: [002] 2 {Function} extern not_inlined 'foo' -> 'int'57; ONE-NEXT: [003] {Block}58; ONE-NEXT: +[004] 4 {TypeAlias} 'INTEGER' -> 'int'59; ONE-NEXT: [004] 5 {Variable} 'CONSTANT' -> 'const INTEGER'60; ONE-NEXT: [003] 2 {Parameter} 'ParamBool' -> 'bool'61; ONE-NEXT: [003] 2 {Parameter} 'ParamPtr' -> 'INTPTR'62; ONE-NEXT: [003] 2 {Parameter} 'ParamUnsigned' -> 'unsigned int'63; ONE-NEXT: -[003] 4 {TypeAlias} 'INTEGER' -> 'int'64 65; RUN: llvm-debuginfo-analyzer --attribute=level \66; RUN: --compare=types \67; RUN: --report=list \68; RUN: --print=symbols,types,summary \69; RUN: %p/Inputs/pr-57040-test-dwarf-clang.o \70; RUN: %p/Inputs/pr-57040-test-dwarf-gcc.o 2>&1 | \71; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s72 73; TWO: Reference: 'pr-57040-test-dwarf-clang.o'74; TWO-NEXT: Target: 'pr-57040-test-dwarf-gcc.o'75; TWO-EMPTY:76; TWO-NEXT: (1) Missing Types:77; TWO-NEXT: -[003] 4 {TypeAlias} 'INTEGER' -> 'int'78; TWO-EMPTY:79; TWO-NEXT: (1) Added Types:80; TWO-NEXT: +[004] 4 {TypeAlias} 'INTEGER' -> 'int'81; TWO-EMPTY:82; TWO-NEXT: ----------------------------------------83; TWO-NEXT: Element Expected Missing Added84; TWO-NEXT: ----------------------------------------85; TWO-NEXT: Scopes 4 0 086; TWO-NEXT: Symbols 0 0 087; TWO-NEXT: Types 2 1 188; TWO-NEXT: Lines 0 0 089; TWO-NEXT: ----------------------------------------90; TWO-NEXT: Total 6 1 191 92; Changing the 'Reference' and 'Target' order:93 94; RUN: llvm-debuginfo-analyzer --attribute=language,level,producer \95; RUN: --compare=types \96; RUN: --report=view \97; RUN: --print=symbols,types \98; RUN: %p/Inputs/pr-57040-test-dwarf-gcc.o \99; RUN: %p/Inputs/pr-57040-test-dwarf-clang.o 2>&1 | \100; RUN: FileCheck --strict-whitespace -check-prefix=THR %s101 102; THR: Reference: 'pr-57040-test-dwarf-gcc.o'103; THR-NEXT: Target: 'pr-57040-test-dwarf-clang.o'104; THR-EMPTY:105; THR-NEXT: Logical View:106; THR-NEXT: [000] {File} 'pr-57040-test-dwarf-gcc.o'107; THR-EMPTY:108; THR-NEXT: [001] {CompileUnit} 'test.cpp'109; THR-NEXT: [002] {Producer} 'GNU C++17 11.3.0 {{.*}}'110; THR-NEXT: [002] {Language} 'DW_LANG_C_plus_plus_14'111; THR-NEXT: [002] 1 {TypeAlias} 'INTPTR' -> '* const int'112; THR-NEXT: [002] 2 {Function} extern not_inlined 'foo' -> 'int'113; THR-NEXT: [003] {Block}114; THR-NEXT: -[004] 4 {TypeAlias} 'INTEGER' -> 'int'115; THR-NEXT: [004] 5 {Variable} 'CONSTANT' -> 'const INTEGER'116; THR-NEXT: [003] 2 {Parameter} 'ParamBool' -> 'bool'117; THR-NEXT: [003] 2 {Parameter} 'ParamPtr' -> 'INTPTR'118; THR-NEXT: [003] 2 {Parameter} 'ParamUnsigned' -> 'unsigned int'119; THR-NEXT: +[003] 4 {TypeAlias} 'INTEGER' -> 'int'120 121; RUN: llvm-debuginfo-analyzer --attribute=level \122; RUN: --compare=types \123; RUN: --report=list \124; RUN: --print=symbols,types,summary \125; RUN: %p/Inputs/pr-57040-test-dwarf-gcc.o \126; RUN: %p/Inputs/pr-57040-test-dwarf-clang.o 2>&1 | \127; RUN: FileCheck --strict-whitespace -check-prefix=FOU %s128 129; FOU: Reference: 'pr-57040-test-dwarf-gcc.o'130; FOU-NEXT: Target: 'pr-57040-test-dwarf-clang.o'131; FOU-EMPTY:132; FOU-NEXT: (1) Missing Types:133; FOU-NEXT: -[004] 4 {TypeAlias} 'INTEGER' -> 'int'134; FOU-EMPTY:135; FOU-NEXT: (1) Added Types:136; FOU-NEXT: +[003] 4 {TypeAlias} 'INTEGER' -> 'int'137; FOU-EMPTY:138; FOU-NEXT: ----------------------------------------139; FOU-NEXT: Element Expected Missing Added140; FOU-NEXT: ----------------------------------------141; FOU-NEXT: Scopes 4 0 0142; FOU-NEXT: Symbols 0 0 0143; FOU-NEXT: Types 2 1 1144; FOU-NEXT: Lines 0 0 0145; FOU-NEXT: ----------------------------------------146; FOU-NEXT: Total 6 1 1147