diff --git a/llvm/test/tools/llvm-cov/Inputs/branch-c-general-single.yaml b/llvm/test/tools/llvm-cov/Inputs/branch-c-general-single.yaml index 9d23dcb67ad2a..7d7f714353a88 100644 --- a/llvm/test/tools/llvm-cov/Inputs/branch-c-general-single.yaml +++ b/llvm/test/tools/llvm-cov/Inputs/branch-c-general-single.yaml @@ -11,72 +11,525 @@ Sections: Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: D7878914FBE99B074D000000D136449C106D04004C551E9517F40F4F0101000D010715080205020F0016090018001B0D001C009D808080080D001D0104110203040215000A000F19001001858080800819010500081D01030202210006000825001000181001010001 + CovFun: + - FuncName: simple_loops + FuncHash: 0x46D109C4436D1 + FilenamesRef: 0x4F0FF417951E554C + Expressions: [] + Files: + - Index: 0 + Filename: branch-c-general.c + Regions: + - { dLoc: [ 7, 21, 8, 2 ], Ref: 0 } + - { dLoc: [ 2, 15, 0, 22 ], Ref: 1 } + - { dLoc: [ 0, 24, 0, 27 ], Ref: 2 } + - { dLoc: [ 0, 28, 0, 29 ], isGap: true, Ref: 3 } + - { dLoc: [ 0, 29, 1, 4 ], Ref: 3 } + - { dLoc: [ 2, 3, 4, 2 ], Ref: 4 } + - { dLoc: [ 0, 10, 0, 15 ], Ref: 5 } + - { dLoc: [ 0, 16, 1, 5 ], isGap: true, Ref: 6 } + - { dLoc: [ 1, 5, 0, 8 ], Ref: 6 } + - { dLoc: [ 1, 3, 2, 2 ], Ref: 7 } + - { dLoc: [ 0, 6, 0, 8 ], Ref: 8 } + - { dLoc: [ 0, 16, 0, 24 ], Ref: 9 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } - Name: '__llvm_covfun (1)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 83AD05A5F1438E68EA00000052D33558163C11444C551E9517F40F4F010100260111150E02050113001A09001C001F0D002000A1808080080D00210B040D0109000E15000F009080808008150010020615010B000C21000D008E8080800821000E0010310106008C8080800831000C04063100100015290016009780808008290017020629010B000C35000D008E8080800835000E00102D0106008C808080082D000C02062D010B000C3D000D008E808080083D000E0010100201005B1D010502041D0009000A1D0009000F4D000E000F45001000918080800845001100134901050104490009000A490009000F5D000E000F55001000918080800855001100131002010001 + CovFun: + - FuncName: conditionals + FuncHash: 0x44113C165835D352 + FilenamesRef: 0x4F0FF417951E554C + Expressions: [] + Files: + - Index: 0 + Filename: branch-c-general.c + Regions: + - { dLoc: [ 17, 21, 14, 2 ], Ref: 0 } + - { dLoc: [ 1, 19, 0, 26 ], Ref: 1 } + - { dLoc: [ 0, 28, 0, 31 ], Ref: 2 } + - { dLoc: [ 0, 32, 0, 33 ], isGap: true, Ref: 3 } + - { dLoc: [ 0, 33, 11, 4 ], Ref: 3 } + - { dLoc: [ 1, 9, 0, 14 ], Ref: 3 } + - { dLoc: [ 0, 15, 0, 16 ], isGap: true, Ref: 5 } + - { dLoc: [ 0, 16, 2, 6 ], Ref: 5 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 5 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 8 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 8 } + - { dLoc: [ 1, 6, 0, 12 ], isGap: true, Ref: 12 } + - { dLoc: [ 0, 12, 4, 6 ], Ref: 12 } + - { dLoc: [ 0, 16, 0, 21 ], Ref: 12 } + - { dLoc: [ 0, 22, 0, 23 ], isGap: true, Ref: 10 } + - { dLoc: [ 0, 23, 2, 6 ], Ref: 10 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 10 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 13 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 13 } + - { dLoc: [ 1, 6, 0, 12 ], isGap: true, Ref: 11 } + - { dLoc: [ 0, 12, 2, 6 ], Ref: 11 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 11 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 15 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 15 } + - { dLoc: [ 2, 1, 0, 98 ], ExtTag: Skip } + - { dLoc: [ 1, 5, 2, 4 ], Ref: 7 } + - { dLoc: [ 0, 9, 0, 10 ], Ref: 7 } + - { dLoc: [ 0, 9, 0, 15 ], Ref: 7 } + - { dLoc: [ 0, 14, 0, 15 ], Ref: 19 } + - { dLoc: [ 0, 16, 0, 17 ], isGap: true, Ref: 17 } + - { dLoc: [ 0, 17, 0, 19 ], Ref: 17 } + - { dLoc: [ 1, 5, 1, 4 ], Ref: 18 } + - { dLoc: [ 0, 9, 0, 10 ], Ref: 18 } + - { dLoc: [ 0, 9, 0, 15 ], Ref: 18 } + - { dLoc: [ 0, 14, 0, 15 ], Ref: 23 } + - { dLoc: [ 0, 16, 0, 17 ], isGap: true, Ref: 21 } + - { dLoc: [ 0, 17, 0, 19 ], Ref: 21 } + - { dLoc: [ 2, 1, 0, 1 ], ExtTag: Skip } - Name: '__llvm_covfun (2)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 0449C70428C57369F80000003D5C2D0E4B13F9274C551E9517F40F4F01010028012114180210020100010101070008050009008A8080800805000A000C100101000109010313020D000A00111100120093808080081100130604110209000F190010018780808008190107000C1D000D0185808080081D010502041D0009000E21000F018780808008210107000F15010402838080800810010100011501030B021500070008290009008A8080800829000A000C10010100012D010309023100060504310109000F3D00100187808080083D0107000D41000E028780808008410207000A35010C0013390015028380808008100101000139010302023900070008490009008A8080800849000A000C1001010001 + CovFun: + - FuncName: early_exits + FuncHash: 0x27F9134B0E2D5C3D + FilenamesRef: 0x4F0FF417951E554C + Expressions: [] + Files: + - Index: 0 + Filename: branch-c-general.c + Regions: + - { dLoc: [ 33, 20, 24, 2 ], Ref: 0 } + - { dLoc: [ 2, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 7, 0, 8 ], Ref: 0 } + - { dLoc: [ 0, 9, 0, 10 ], isGap: true, Ref: 1 } + - { dLoc: [ 0, 10, 0, 12 ], Ref: 1 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 19, 2 ], Ref: 2 } + - { dLoc: [ 0, 10, 0, 17 ], Ref: 3 } + - { dLoc: [ 0, 18, 0, 19 ], isGap: true, Ref: 4 } + - { dLoc: [ 0, 19, 6, 4 ], Ref: 4 } + - { dLoc: [ 2, 9, 0, 15 ], Ref: 4 } + - { dLoc: [ 0, 16, 1, 7 ], isGap: true, Ref: 6 } + - { dLoc: [ 1, 7, 0, 12 ], Ref: 6 } + - { dLoc: [ 0, 13, 1, 5 ], isGap: true, Ref: 7 } + - { dLoc: [ 1, 5, 2, 4 ], Ref: 7 } + - { dLoc: [ 0, 9, 0, 14 ], Ref: 7 } + - { dLoc: [ 0, 15, 1, 7 ], isGap: true, Ref: 8 } + - { dLoc: [ 1, 7, 0, 15 ], Ref: 8 } + - { dLoc: [ 1, 4, 2, 3 ], isGap: true, Ref: 5 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 11, 2 ], Ref: 5 } + - { dLoc: [ 0, 7, 0, 8 ], Ref: 5 } + - { dLoc: [ 0, 9, 0, 10 ], isGap: true, Ref: 10 } + - { dLoc: [ 0, 10, 0, 12 ], Ref: 10 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 9, 2 ], Ref: 11 } + - { dLoc: [ 0, 6, 5, 4 ], Ref: 12 } + - { dLoc: [ 1, 9, 0, 15 ], Ref: 12 } + - { dLoc: [ 0, 16, 1, 7 ], isGap: true, Ref: 15 } + - { dLoc: [ 1, 7, 0, 13 ], Ref: 15 } + - { dLoc: [ 0, 14, 2, 7 ], isGap: true, Ref: 16 } + - { dLoc: [ 2, 7, 0, 10 ], Ref: 16 } + - { dLoc: [ 1, 12, 0, 19 ], Ref: 13 } + - { dLoc: [ 0, 21, 2, 3 ], isGap: true, Ref: 14 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 2, 2 ], Ref: 14 } + - { dLoc: [ 0, 7, 0, 8 ], Ref: 14 } + - { dLoc: [ 0, 9, 0, 10 ], isGap: true, Ref: 18 } + - { dLoc: [ 0, 10, 0, 12 ], Ref: 18 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } - Name: '__llvm_covfun (3)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 55947829059F255EB80100001B9C495D3463E1D04C551E9517F40F4F01010046013B0E2F02100201000105010F001409001600190D001A009B808080080D001B040400011402858080800810010100230001050104000009000A15000B008C8080800815000C000E11010402818080800810010100011D010126021D01070008210009008A8080800821000A000C1001010001250103000D25000E0283808080081001010001000103210229000A000B2D000C008D808080082D000D03043501030204350109000A39000B008C8080800839000C000E1002010001310103000D31000E0181808080084101011B024501011A024901011902490207000C4D000D0185808080084D0105000F5100100283808080081001010001510103140255000A000F5900100091808080085900110A04610103090400011006918080800869010501110001120185808080086D0105011200011301858080800871010501115D030402838080800810010100015D0103080275000F0015790017001A7D001B009C808080087D001C0604000115028580808008100101003F0001050304000009000A8501000B008C808080088501000C000E8D01010302048D010109000A9101000B008C808080089101000C000E1002010001 + CovFun: + - FuncName: jumps + FuncHash: 0xD0E163345D499C1B + FilenamesRef: 0x4F0FF417951E554C + Expressions: [] + Files: + - Index: 0 + Filename: branch-c-general.c + Regions: + - { dLoc: [ 59, 14, 47, 2 ], Ref: 0 } + - { dLoc: [ 2, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 15, 0, 20 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 25 ], Ref: 2 } + - { dLoc: [ 0, 26, 0, 27 ], isGap: true, Ref: 3 } + - { dLoc: [ 0, 27, 4, 4 ], Ref: 3 } + - { dLoc: [ 1, 20, 2, 5 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 1, 0, 35 ], ExtTag: Skip } + - { dLoc: [ 1, 5, 1, 4 ], Tag: Zero } + - { dLoc: [ 0, 9, 0, 10 ], Tag: Zero } + - { dLoc: [ 0, 11, 0, 12 ], isGap: true, Ref: 5 } + - { dLoc: [ 0, 12, 0, 14 ], Ref: 5 } + - { dLoc: [ 1, 4, 2, 1 ], isGap: true, Ref: 4 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 1, 38, 2 ], Ref: 7 } + - { dLoc: [ 1, 7, 0, 8 ], Ref: 7 } + - { dLoc: [ 0, 9, 0, 10 ], isGap: true, Ref: 8 } + - { dLoc: [ 0, 10, 0, 12 ], Ref: 8 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 0, 13 ], Ref: 9 } + - { dLoc: [ 0, 14, 2, 3 ], isGap: true, Ref: 9 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 33, 2 ], Tag: Zero } + - { dLoc: [ 0, 10, 0, 11 ], Ref: 10 } + - { dLoc: [ 0, 12, 0, 13 ], isGap: true, Ref: 11 } + - { dLoc: [ 0, 13, 3, 4 ], Ref: 11 } + - { dLoc: [ 1, 3, 2, 4 ], Ref: 13 } + - { dLoc: [ 1, 9, 0, 10 ], Ref: 13 } + - { dLoc: [ 0, 11, 0, 12 ], isGap: true, Ref: 14 } + - { dLoc: [ 0, 12, 0, 14 ], Ref: 14 } + - { dLoc: [ 2, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 0, 13 ], Ref: 12 } + - { dLoc: [ 0, 14, 1, 1 ], isGap: true, Ref: 12 } + - { dLoc: [ 1, 1, 27, 2 ], Ref: 16 } + - { dLoc: [ 1, 1, 26, 2 ], Ref: 17 } + - { dLoc: [ 1, 1, 25, 2 ], Ref: 18 } + - { dLoc: [ 2, 7, 0, 12 ], Ref: 18 } + - { dLoc: [ 0, 13, 1, 5 ], isGap: true, Ref: 19 } + - { dLoc: [ 1, 5, 0, 15 ], Ref: 19 } + - { dLoc: [ 0, 16, 2, 3 ], isGap: true, Ref: 20 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 20, 2 ], Ref: 20 } + - { dLoc: [ 0, 10, 0, 15 ], Ref: 21 } + - { dLoc: [ 0, 16, 0, 17 ], isGap: true, Ref: 22 } + - { dLoc: [ 0, 17, 10, 4 ], Ref: 22 } + - { dLoc: [ 1, 3, 9, 4 ], Ref: 24 } + - { dLoc: [ 1, 16, 6, 17 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 5, 1, 17 ], Ref: 26 } + - { dLoc: [ 1, 18, 1, 5 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 5, 1, 18 ], Ref: 27 } + - { dLoc: [ 1, 19, 1, 5 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 5, 1, 17 ], Ref: 28 } + - { dLoc: [ 3, 4, 2, 3 ], isGap: true, Ref: 23 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 8, 2 ], Ref: 23 } + - { dLoc: [ 0, 15, 0, 21 ], Ref: 29 } + - { dLoc: [ 0, 23, 0, 26 ], Ref: 30 } + - { dLoc: [ 0, 27, 0, 28 ], isGap: true, Ref: 31 } + - { dLoc: [ 0, 28, 6, 4 ], Ref: 31 } + - { dLoc: [ 1, 21, 2, 5 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 1, 0, 63 ], ExtTag: Skip } + - { dLoc: [ 1, 5, 3, 4 ], Tag: Zero } + - { dLoc: [ 0, 9, 0, 10 ], Tag: Zero } + - { dLoc: [ 0, 11, 0, 12 ], isGap: true, Ref: 33 } + - { dLoc: [ 0, 12, 0, 14 ], Ref: 33 } + - { dLoc: [ 1, 3, 2, 4 ], Ref: 35 } + - { dLoc: [ 1, 9, 0, 10 ], Ref: 35 } + - { dLoc: [ 0, 11, 0, 12 ], isGap: true, Ref: 36 } + - { dLoc: [ 0, 12, 0, 14 ], Ref: 36 } + - { dLoc: [ 2, 1, 0, 1 ], ExtTag: Skip } - Name: '__llvm_covfun (4)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 7129CA3C268292BF4D0100003E688383C9A099004C551E9517F40F4F01010035016C112502100201011C000217028A80808008090103010A05020402838080800810010100620501031C020D003F0046110048004B15004C00CD8080800815004D1704000119148F80808008210105130F21010B000C25000D008E8080800825000E001010010100152D0105100F2D010B000C31000D008E8080800831000E0010350107000C35000D0185808080083901050D0F39010B000C3D000D008E808080083D000E0010410107000F4100100185808080084501050A0F45010B000C49000D008E8080800849000E00104D0107080F000012039180808008550107021155010D000E59000F00908080800859001000125D010900115101080285808080081001010001610105020F61010B0017650018018980808008650109000F1902040383808080081001010121190203020219000700116D00120093808080086D001300151001010001 + CovFun: + - FuncName: switches + FuncHash: 0x99A0C98383683E + FilenamesRef: 0x4F0FF417951E554C + Expressions: [] + Files: + - Index: 0 + Filename: branch-c-general.c + Regions: + - { dLoc: [ 108, 17, 37, 2 ], Ref: 0 } + - { dLoc: [ 2, 1, 1, 28 ], ExtTag: Skip } + - { dLoc: [ 2, 23, 2, 10 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 3, 1, 10 ], Ref: 2 } + - { dLoc: [ 2, 4, 2, 3 ], isGap: true, Ref: 1 } + - { dLoc: [ 1, 1, 0, 100 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 28, 2 ], Ref: 1 } + - { dLoc: [ 0, 63, 0, 70 ], Ref: 3 } + - { dLoc: [ 0, 72, 0, 75 ], Ref: 4 } + - { dLoc: [ 0, 76, 0, 77 ], isGap: true, Ref: 5 } + - { dLoc: [ 0, 77, 23, 4 ], Ref: 5 } + - { dLoc: [ 1, 25, 20, 15 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 5, 19, 15 ], Ref: 8 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 8 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 9 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 9 } + - { dLoc: [ 1, 1, 0, 21 ], ExtTag: Skip } + - { dLoc: [ 1, 5, 16, 15 ], Ref: 11 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 11 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 12 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 12 } + - { dLoc: [ 1, 7, 0, 12 ], Ref: 13 } + - { dLoc: [ 0, 13, 1, 5 ], isGap: true, Ref: 13 } + - { dLoc: [ 1, 5, 13, 15 ], Ref: 14 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 14 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 15 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 15 } + - { dLoc: [ 1, 7, 0, 15 ], Ref: 16 } + - { dLoc: [ 0, 16, 1, 5 ], isGap: true, Ref: 16 } + - { dLoc: [ 1, 5, 10, 15 ], Ref: 17 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 17 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 18 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 18 } + - { dLoc: [ 1, 7, 8, 15 ], Ref: 19 } + - { dLoc: [ 0, 18, 3, 17 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 7, 2, 17 ], Ref: 21 } + - { dLoc: [ 1, 13, 0, 14 ], Ref: 21 } + - { dLoc: [ 0, 15, 0, 16 ], isGap: true, Ref: 22 } + - { dLoc: [ 0, 16, 0, 18 ], Ref: 22 } + - { dLoc: [ 1, 9, 0, 17 ], Ref: 23 } + - { dLoc: [ 1, 8, 2, 5 ], isGap: true, Ref: 20 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 5, 2, 15 ], Ref: 24 } + - { dLoc: [ 1, 11, 0, 23 ], Ref: 24 } + - { dLoc: [ 0, 24, 1, 9 ], isGap: true, Ref: 25 } + - { dLoc: [ 1, 9, 0, 15 ], Ref: 25 } + - { dLoc: [ 2, 4, 3, 3 ], isGap: true, Ref: 6 } + - { dLoc: [ 1, 1, 1, 33 ], ExtTag: Skip } + - { dLoc: [ 2, 3, 2, 2 ], Ref: 6 } + - { dLoc: [ 0, 7, 0, 17 ], Ref: 6 } + - { dLoc: [ 0, 18, 0, 19 ], isGap: true, Ref: 27 } + - { dLoc: [ 0, 19, 0, 21 ], Ref: 27 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } - Name: '__llvm_covfun (5)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 3F4D1C6E6087417B32010000D6FF56B8865A69B64C551E9517F40F4F01010031019301131F02050113001909001B001E0D001F00A0808080080D00201C04000115198C80808008190105180C19010B000C1D000D008E808080081D000E00101001010015250105150C25010B000C29000D008E8080800829000E00102D0107000C2D000D018580808008310105120C31010B000C35000D008E8080800835000E0010390107000C39000D03858080800810010101013D02050D0C3D010B000C41000D008E8080800841000E0010450107000C45000D0185808080084901050A0C49010B000C4D000D008E808080084D000E0010510107000C51000D0385808080081001010101550205050C55010B000C59000D008E8080800859000E00105D0107000C5D000D018580808008610105020C61010B000C65000D008E8080800865000E0010690107000C1003010001 + CovFun: + - FuncName: big_switch + FuncHash: 0xB6695A86B856FFD6 + FilenamesRef: 0x4F0FF417951E554C + Expressions: [] + Files: + - Index: 0 + Filename: branch-c-general.c + Regions: + - { dLoc: [ 147, 19, 31, 2 ], Ref: 0 } + - { dLoc: [ 1, 19, 0, 25 ], Ref: 1 } + - { dLoc: [ 0, 27, 0, 30 ], Ref: 2 } + - { dLoc: [ 0, 31, 0, 32 ], isGap: true, Ref: 3 } + - { dLoc: [ 0, 32, 28, 4 ], Ref: 3 } + - { dLoc: [ 1, 21, 25, 12 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 5, 24, 12 ], Ref: 6 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 6 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 7 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 7 } + - { dLoc: [ 1, 1, 0, 21 ], ExtTag: Skip } + - { dLoc: [ 1, 5, 21, 12 ], Ref: 9 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 9 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 10 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 10 } + - { dLoc: [ 1, 7, 0, 12 ], Ref: 11 } + - { dLoc: [ 0, 13, 1, 5 ], isGap: true, Ref: 11 } + - { dLoc: [ 1, 5, 18, 12 ], Ref: 12 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 12 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 13 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 13 } + - { dLoc: [ 1, 7, 0, 12 ], Ref: 14 } + - { dLoc: [ 0, 13, 3, 5 ], isGap: true, Ref: 14 } + - { dLoc: [ 1, 1, 1, 1 ], ExtTag: Skip } + - { dLoc: [ 2, 5, 13, 12 ], Ref: 15 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 15 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 16 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 16 } + - { dLoc: [ 1, 7, 0, 12 ], Ref: 17 } + - { dLoc: [ 0, 13, 1, 5 ], isGap: true, Ref: 17 } + - { dLoc: [ 1, 5, 10, 12 ], Ref: 18 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 18 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 19 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 19 } + - { dLoc: [ 1, 7, 0, 12 ], Ref: 20 } + - { dLoc: [ 0, 13, 3, 5 ], isGap: true, Ref: 20 } + - { dLoc: [ 1, 1, 1, 1 ], ExtTag: Skip } + - { dLoc: [ 2, 5, 5, 12 ], Ref: 21 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 21 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 22 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 22 } + - { dLoc: [ 1, 7, 0, 12 ], Ref: 23 } + - { dLoc: [ 0, 13, 1, 5 ], isGap: true, Ref: 23 } + - { dLoc: [ 1, 5, 2, 12 ], Ref: 24 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 24 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 25 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 25 } + - { dLoc: [ 1, 7, 0, 12 ], Ref: 26 } + - { dLoc: [ 3, 1, 0, 1 ], ExtTag: Skip } - Name: '__llvm_covfun (6)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 59A48AA8899AA3587200000091E33C8FF36C04004C551E9517F40F4F0101001501B4011A0C02050213001A09001C001F0D002000A1808080080D002108040D0109000E1500120013100101005D0D0109000E1D00120013100101005D0D0109000E0D000900172D0012001725001B001C10010100630D0109000E0D000900173D0012001735001B001C1002010063 + CovFun: + - FuncName: boolean_operators + FuncHash: 0x46CF38F3CE391 + FilenamesRef: 0x4F0FF417951E554C + Expressions: [] + Files: + - Index: 0 + Filename: branch-c-general.c + Regions: + - { dLoc: [ 180, 26, 12, 2 ], Ref: 0 } + - { dLoc: [ 2, 19, 0, 26 ], Ref: 1 } + - { dLoc: [ 0, 28, 0, 31 ], Ref: 2 } + - { dLoc: [ 0, 32, 0, 33 ], isGap: true, Ref: 3 } + - { dLoc: [ 0, 33, 8, 4 ], Ref: 3 } + - { dLoc: [ 1, 9, 0, 14 ], Ref: 3 } + - { dLoc: [ 0, 18, 0, 19 ], Ref: 5 } + - { dLoc: [ 1, 1, 0, 100 ], ExtTag: Skip } + - { dLoc: [ 1, 9, 0, 14 ], Ref: 3 } + - { dLoc: [ 0, 18, 0, 19 ], Ref: 7 } + - { dLoc: [ 1, 1, 0, 100 ], ExtTag: Skip } + - { dLoc: [ 1, 9, 0, 14 ], Ref: 3 } + - { dLoc: [ 0, 9, 0, 23 ], Ref: 3 } + - { dLoc: [ 0, 18, 0, 23 ], Ref: 11 } + - { dLoc: [ 0, 27, 0, 28 ], Ref: 9 } + - { dLoc: [ 1, 1, 0, 113 ], ExtTag: Skip } + - { dLoc: [ 1, 9, 0, 14 ], Ref: 3 } + - { dLoc: [ 0, 9, 0, 23 ], Ref: 3 } + - { dLoc: [ 0, 18, 0, 23 ], Ref: 15 } + - { dLoc: [ 0, 27, 0, 28 ], Ref: 13 } + - { dLoc: [ 2, 1, 0, 113 ], ExtTag: Skip } - Name: '__llvm_covfun (7)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: F5953D044B505D139E0000005FD132562FE71EAC4C551E9517F40F4F0101001D01C201150D02100201000111010A000B11000A001511000F0015090016018580808008090105000810010100010D0103070225000A001125000A001C250015001C1D001D0185808080081D01050008100101000121010304023D001100123D0011001C3D0016001C31001E002135002200231001010061390103020255000A001155000A001C550015001C49001E00214D002200231001010061 + CovFun: + - FuncName: boolop_loops + FuncHash: 0xAC1EE72F5632D15F + FilenamesRef: 0x4F0FF417951E554C + Expressions: [] + Files: + - Index: 0 + Filename: branch-c-general.c + Regions: + - { dLoc: [ 194, 21, 13, 2 ], Ref: 0 } + - { dLoc: [ 2, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 10, 0, 11 ], Ref: 4 } + - { dLoc: [ 0, 10, 0, 21 ], Ref: 4 } + - { dLoc: [ 0, 15, 0, 21 ], Ref: 4 } + - { dLoc: [ 0, 22, 1, 5 ], isGap: true, Ref: 2 } + - { dLoc: [ 1, 5, 0, 8 ], Ref: 2 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 7, 2 ], Ref: 3 } + - { dLoc: [ 0, 10, 0, 17 ], Ref: 9 } + - { dLoc: [ 0, 10, 0, 28 ], Ref: 9 } + - { dLoc: [ 0, 21, 0, 28 ], Ref: 9 } + - { dLoc: [ 0, 29, 1, 5 ], isGap: true, Ref: 7 } + - { dLoc: [ 1, 5, 0, 8 ], Ref: 7 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 4, 2 ], Ref: 8 } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 15 } + - { dLoc: [ 0, 17, 0, 28 ], Ref: 15 } + - { dLoc: [ 0, 22, 0, 28 ], Ref: 15 } + - { dLoc: [ 0, 30, 0, 33 ], Ref: 12 } + - { dLoc: [ 0, 34, 0, 35 ], Ref: 13 } + - { dLoc: [ 1, 1, 0, 104 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 2, 2 ], Ref: 14 } + - { dLoc: [ 0, 10, 0, 17 ], Ref: 21 } + - { dLoc: [ 0, 10, 0, 28 ], Ref: 21 } + - { dLoc: [ 0, 21, 0, 28 ], Ref: 21 } + - { dLoc: [ 0, 30, 0, 33 ], Ref: 18 } + - { dLoc: [ 0, 34, 0, 35 ], Ref: 19 } + - { dLoc: [ 1, 1, 0, 104 ], ExtTag: Skip } - Name: '__llvm_covfun (8)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 20E5C369BDF15C7940000000D0D60000000000004C551E9517F40F4F0101000B01D1011D0702100201000101010B001109001300948080800809001400150D001800191001010001050103020205000B000C01001000111001010001 + CovFun: + - FuncName: conditional_operator + FuncHash: 0xD6D0 + FilenamesRef: 0x4F0FF417951E554C + Expressions: [] + Files: + - Index: 0 + Filename: branch-c-general.c + Regions: + - { dLoc: [ 209, 29, 7, 2 ], Ref: 0 } + - { dLoc: [ 2, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 11, 0, 17 ], Ref: 0 } + - { dLoc: [ 0, 19, 0, 20 ], isGap: true, Ref: 2 } + - { dLoc: [ 0, 20, 0, 21 ], Ref: 2 } + - { dLoc: [ 0, 24, 0, 25 ], Ref: 3 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 2, 2 ], Ref: 1 } + - { dLoc: [ 0, 11, 0, 12 ], Ref: 1 } + - { dLoc: [ 0, 16, 0, 17 ], Ref: 0 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } - Name: '__llvm_covfun (9)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 7DE8E7C47096EB425200000092EAF0986287F0784C551E9517F40F4F0101000D01DA01170B02050113001909001B001E0D001F00A0808080080D002009041502080606100101024D15030B00102100110092808080082100120017250018018780808008250107010619010E0013 + CovFun: + - FuncName: do_fallthrough + FuncHash: 0x78F0876298F0EA92 + FilenamesRef: 0x4F0FF417951E554C + Expressions: [] + Files: + - Index: 0 + Filename: branch-c-general.c + Regions: + - { dLoc: [ 218, 23, 11, 2 ], Ref: 0 } + - { dLoc: [ 1, 19, 0, 25 ], Ref: 1 } + - { dLoc: [ 0, 27, 0, 30 ], Ref: 2 } + - { dLoc: [ 0, 31, 0, 32 ], isGap: true, Ref: 3 } + - { dLoc: [ 0, 32, 9, 4 ], Ref: 3 } + - { dLoc: [ 2, 8, 6, 6 ], Ref: 5 } + - { dLoc: [ 1, 1, 2, 77 ], ExtTag: Skip } + - { dLoc: [ 3, 11, 0, 16 ], Ref: 5 } + - { dLoc: [ 0, 17, 0, 18 ], isGap: true, Ref: 8 } + - { dLoc: [ 0, 18, 0, 23 ], Ref: 8 } + - { dLoc: [ 0, 24, 1, 7 ], isGap: true, Ref: 9 } + - { dLoc: [ 1, 7, 1, 6 ], Ref: 9 } + - { dLoc: [ 1, 14, 0, 19 ], Ref: 6 } - Name: '__llvm_covfun (10)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: FAD58DE7366495DB0A00000018000000000000004C551E9517F40F4F0101000101F501280F02 + CovFun: + - FuncName: main + FuncHash: 0x18 + FilenamesRef: 0x4F0FF417951E554C + Expressions: [] + Files: + - Index: 0 + Filename: branch-c-general.c + Regions: + - { dLoc: [ 245, 40, 15, 2 ], Ref: 0 } - Name: '__llvm_covfun (11)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 4CB4F49D6737EBF922000000D1460000000000004C551E9517F40F4F0101000501E7011B0302050113001909001B001E0D001F00A0808080080D00200104 + CovFun: + - FuncName: 'branch-c-general.c:static_func' + FuncHash: 0x46D1 + FilenamesRef: 0x4F0FF417951E554C + Expressions: [] + Files: + - Index: 0 + Filename: branch-c-general.c + Regions: + - { dLoc: [ 231, 27, 3, 2 ], Ref: 0 } + - { dLoc: [ 1, 19, 0, 25 ], Ref: 1 } + - { dLoc: [ 0, 27, 0, 30 ], Ref: 2 } + - { dLoc: [ 0, 31, 0, 32 ], isGap: true, Ref: 3 } + - { dLoc: [ 0, 32, 1, 4 ], Ref: 3 } - Name: __llvm_covmap Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 0000000017000000000000000600000002140000126272616E63682D632D67656E6572616C2E6300 + CovMap: + - FilenamesRef: 0x4F0FF417951E554C + Version: 6 - Name: __llvm_prf_names Type: SHT_PROGBITS Flags: [ SHF_ALLOC, SHF_GNU_RETAIN ] AddressAlign: 0x1 - Content: A6010073696D706C655F6C6F6F707301636F6E646974696F6E616C73016561726C795F6578697473016A756D7073017377697463686573016269675F73776974636801626F6F6C65616E5F6F70657261746F727301626F6F6C6F705F6C6F6F707301636F6E646974696F6E616C5F6F70657261746F7201646F5F66616C6C7468726F756768016D61696E016272616E63682D632D67656E6572616C2E633A7374617469635F66756E63 + PrfNames: + - - simple_loops + - conditionals + - early_exits + - jumps + - switches + - big_switch + - boolean_operators + - boolop_loops + - conditional_operator + - do_fallthrough + - main + - 'branch-c-general.c:static_func' - Type: SectionHeaderTable Sections: - Name: .strtab @@ -94,84 +547,4 @@ Sections: - Name: '__llvm_covfun (11)' - Name: __llvm_covmap - Name: __llvm_prf_names - - Name: .symtab -Symbols: - - Name: __llvm_covmap - Type: STT_SECTION - Section: __llvm_covmap - - Name: __llvm_prf_names - Type: STT_SECTION - Section: __llvm_prf_names - - Name: __covrec_79BE9FB148987D7u - Type: STT_OBJECT - Section: __llvm_covfun - Binding: STB_WEAK - Size: 0x69 - Other: [ STV_HIDDEN ] - - Name: __covrec_688E43F1A505AD83u - Type: STT_OBJECT - Section: '__llvm_covfun (1)' - Binding: STB_WEAK - Size: 0x106 - Other: [ STV_HIDDEN ] - - Name: __covrec_6973C52804C74904u - Type: STT_OBJECT - Section: '__llvm_covfun (2)' - Binding: STB_WEAK - Size: 0x114 - Other: [ STV_HIDDEN ] - - Name: __covrec_5E259F0529789455u - Type: STT_OBJECT - Section: '__llvm_covfun (3)' - Binding: STB_WEAK - Size: 0x1D4 - Other: [ STV_HIDDEN ] - - Name: __covrec_BF9282263CCA2971u - Type: STT_OBJECT - Section: '__llvm_covfun (4)' - Binding: STB_WEAK - Size: 0x169 - Other: [ STV_HIDDEN ] - - Name: __covrec_7B4187606E1C4D3Fu - Type: STT_OBJECT - Section: '__llvm_covfun (5)' - Binding: STB_WEAK - Size: 0x14E - Other: [ STV_HIDDEN ] - - Name: __covrec_58A39A89A88AA459u - Type: STT_OBJECT - Section: '__llvm_covfun (6)' - Binding: STB_WEAK - Size: 0x8E - Other: [ STV_HIDDEN ] - - Name: __covrec_135D504B043D95F5u - Type: STT_OBJECT - Section: '__llvm_covfun (7)' - Binding: STB_WEAK - Size: 0xBA - Other: [ STV_HIDDEN ] - - Name: __covrec_795CF1BD69C3E520u - Type: STT_OBJECT - Section: '__llvm_covfun (8)' - Binding: STB_WEAK - Size: 0x5C - Other: [ STV_HIDDEN ] - - Name: __covrec_42EB9670C4E7E87Du - Type: STT_OBJECT - Section: '__llvm_covfun (9)' - Binding: STB_WEAK - Size: 0x6E - Other: [ STV_HIDDEN ] - - Name: __covrec_DB956436E78DD5FAu - Type: STT_OBJECT - Section: '__llvm_covfun (10)' - Binding: STB_WEAK - Size: 0x26 - Other: [ STV_HIDDEN ] - - Name: __covrec_F9EB37679DF4B44Cu - Type: STT_OBJECT - Section: '__llvm_covfun (11)' - Binding: STB_WEAK - Size: 0x3E - Other: [ STV_HIDDEN ] ... diff --git a/llvm/test/tools/llvm-cov/Inputs/branch-c-general.o32l b/llvm/test/tools/llvm-cov/Inputs/branch-c-general.o similarity index 100% rename from llvm/test/tools/llvm-cov/Inputs/branch-c-general.o32l rename to llvm/test/tools/llvm-cov/Inputs/branch-c-general.o diff --git a/llvm/test/tools/llvm-cov/Inputs/branch-c-general.yaml b/llvm/test/tools/llvm-cov/Inputs/branch-c-general.yaml new file mode 100644 index 0000000000000..123fa63225749 --- /dev/null +++ b/llvm/test/tools/llvm-cov/Inputs/branch-c-general.yaml @@ -0,0 +1,757 @@ +--- !ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_ARM + Flags: [ EF_ARM_EABI_VER5 ] + SectionHeaderStringTable: .strtab +Sections: + - Name: __llvm_covfun + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: simple_loops + FuncHash: 0x46D109C4436D1 + FilenamesRef: 0x1A6D4D6FD974D39F + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + - [ { Ref: 0 }, { Ref: 2 } ] + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 0 }, { Ref: 3 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-c-general.c' + Regions: + - { dLoc: [ 7, 21, 8, 2 ], Ref: 0 } + - { dLoc: [ 2, 15, 0, 22 ], Add: 0 } + - { dLoc: [ 0, 15, 0, 22 ], Branch: [ { Ref: 1 }, { Ref: 0 } ] } + - { dLoc: [ 0, 24, 0, 27 ], Ref: 1 } + - { dLoc: [ 0, 28, 0, 29 ], isGap: true, Ref: 1 } + - { dLoc: [ 0, 29, 1, 4 ], Ref: 1 } + - { dLoc: [ 2, 10, 0, 15 ], Add: 1 } + - { dLoc: [ 0, 10, 0, 15 ], Branch: [ { Ref: 2 }, { Ref: 0 } ] } + - { dLoc: [ 0, 16, 1, 5 ], isGap: true, Ref: 2 } + - { dLoc: [ 1, 5, 0, 8 ], Ref: 2 } + - { dLoc: [ 1, 6, 0, 8 ], Add: 3 } + - { dLoc: [ 0, 16, 0, 24 ], Add: 3 } + - { dLoc: [ 0, 16, 0, 24 ], Branch: [ { Ref: 3 }, { Ref: 0 } ] } + - Name: '__llvm_covfun (1)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: conditionals + FuncHash: 0x44113C165835D352 + FilenamesRef: 0x1A6D4D6FD974D39F + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Ref: 2 }, { Ref: 3 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Sub: 17 }, { Ref: 4 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Ref: 4 }, { Ref: 5 } ] + - [ { Sub: 17 }, { Ref: 4 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Sub: 17 }, { Ref: 4 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Sub: 17 }, { Ref: 4 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Sub: 16 }, { Ref: 6 } ] + - [ { Sub: 17 }, { Ref: 4 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Ref: 8 }, { Ref: 9 } ] + - [ { Ref: 11 }, { Ref: 12 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-c-general.c' + Regions: + - { dLoc: [ 17, 21, 14, 2 ], Ref: 0 } + - { dLoc: [ 1, 19, 0, 26 ], Add: 0 } + - { dLoc: [ 0, 19, 0, 26 ], Branch: [ { Ref: 1 }, { Ref: 0 } ] } + - { dLoc: [ 0, 28, 0, 31 ], Ref: 1 } + - { dLoc: [ 0, 32, 0, 33 ], isGap: true, Ref: 1 } + - { dLoc: [ 0, 33, 11, 4 ], Ref: 1 } + - { dLoc: [ 1, 9, 0, 14 ], Ref: 1 } + - { dLoc: [ 0, 9, 0, 14 ], Branch: [ { Ref: 2 }, { Sub: 17 } ] } + - { dLoc: [ 0, 15, 0, 16 ], isGap: true, Ref: 2 } + - { dLoc: [ 0, 16, 2, 6 ], Ref: 2 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 2 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Ref: 3 }, { Sub: 2 } ] } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 3 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 3 } + - { dLoc: [ 1, 6, 0, 12 ], isGap: true, Sub: 17 } + - { dLoc: [ 0, 12, 4, 6 ], Sub: 17 } + - { dLoc: [ 0, 16, 0, 21 ], Sub: 17 } + - { dLoc: [ 0, 16, 0, 21 ], Branch: [ { Ref: 4 }, { Sub: 16 } ] } + - { dLoc: [ 0, 22, 0, 23 ], isGap: true, Ref: 4 } + - { dLoc: [ 0, 23, 2, 6 ], Ref: 4 } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 4 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Ref: 5 }, { Sub: 8 } ] } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 5 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 5 } + - { dLoc: [ 1, 6, 0, 12 ], isGap: true, Sub: 16 } + - { dLoc: [ 0, 12, 2, 6 ], Sub: 16 } + - { dLoc: [ 1, 11, 0, 12 ], Sub: 16 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Ref: 6 }, { Sub: 15 } ] } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 6 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 6 } + - { dLoc: [ 3, 9, 0, 10 ], Ref: 1 } + - { dLoc: [ 0, 9, 0, 15 ], Ref: 1 } + - { dLoc: [ 0, 9, 0, 10 ], Branch: [ { Tag: Zero }, { Tag: Zero } ] } + - { dLoc: [ 0, 14, 0, 15 ], Ref: 8 } + - { dLoc: [ 0, 14, 0, 15 ], Branch: [ { Ref: 9 }, { Sub: 18 } ] } + - { dLoc: [ 0, 16, 0, 17 ], isGap: true, Ref: 7 } + - { dLoc: [ 0, 17, 0, 19 ], Ref: 7 } + - { dLoc: [ 1, 9, 0, 10 ], Ref: 1 } + - { dLoc: [ 0, 9, 0, 15 ], Ref: 1 } + - { dLoc: [ 0, 9, 0, 10 ], Branch: [ { Tag: Zero }, { Tag: Zero } ] } + - { dLoc: [ 0, 14, 0, 15 ], Ref: 11 } + - { dLoc: [ 0, 14, 0, 15 ], Branch: [ { Sub: 19 }, { Ref: 12 } ] } + - { dLoc: [ 0, 16, 0, 17 ], isGap: true, Ref: 10 } + - { dLoc: [ 0, 17, 0, 19 ], Ref: 10 } + - Name: '__llvm_covfun (2)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: early_exits + FuncHash: 0x27F9134B0E2D5C3D + FilenamesRef: 0x1A6D4D6FD974D39F + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + - [ { Add: 2 }, { Ref: 3 } ] + - [ { Ref: 0 }, { Ref: 2 } ] + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 2 }, { Ref: 3 } ] + - [ { Ref: 2 }, { Ref: 3 } ] + - [ { Ref: 2 }, { Ref: 3 } ] + - [ { Ref: 2 }, { Ref: 3 } ] + - [ { Sub: 9 }, { Ref: 4 } ] + - [ { Ref: 2 }, { Ref: 3 } ] + - [ { Ref: 0 }, { Ref: 5 } ] + - [ { Ref: 0 }, { Ref: 6 } ] + - [ { Ref: 0 }, { Ref: 6 } ] + - [ { Add: 22 }, { Ref: 7 } ] + - [ { Ref: 0 }, { Ref: 6 } ] + - [ { Add: 22 }, { Ref: 7 } ] + - [ { Ref: 0 }, { Ref: 6 } ] + - [ { Add: 22 }, { Ref: 7 } ] + - [ { Ref: 0 }, { Ref: 6 } ] + - [ { Add: 22 }, { Ref: 7 } ] + - [ { Ref: 0 }, { Ref: 6 } ] + - [ { Add: 22 }, { Ref: 7 } ] + - [ { Ref: 0 }, { Ref: 6 } ] + - [ { Ref: 0 }, { Ref: 7 } ] + - [ { Ref: 0 }, { Ref: 7 } ] + - [ { Ref: 0 }, { Ref: 7 } ] + - [ { Sub: 27 }, { Ref: 8 } ] + - [ { Ref: 0 }, { Ref: 7 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-c-general.c' + Regions: + - { dLoc: [ 33, 20, 24, 2 ], Ref: 0 } + - { dLoc: [ 3, 7, 0, 8 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 8 ], Branch: [ { Ref: 1 }, { Sub: 0 } ] } + - { dLoc: [ 0, 9, 0, 10 ], isGap: true, Ref: 1 } + - { dLoc: [ 0, 10, 0, 12 ], Ref: 1 } + - { dLoc: [ 2, 10, 0, 17 ], Sub: 1 } + - { dLoc: [ 0, 10, 0, 17 ], Branch: [ { Ref: 2 }, { Sub: 3 } ] } + - { dLoc: [ 0, 18, 0, 19 ], isGap: true, Ref: 2 } + - { dLoc: [ 0, 19, 6, 4 ], Ref: 2 } + - { dLoc: [ 2, 9, 0, 15 ], Ref: 2 } + - { dLoc: [ 0, 9, 0, 15 ], Branch: [ { Ref: 3 }, { Sub: 9 } ] } + - { dLoc: [ 0, 16, 1, 7 ], isGap: true, Ref: 3 } + - { dLoc: [ 1, 7, 0, 12 ], Ref: 3 } + - { dLoc: [ 0, 12, 1, 5 ], isGap: true, Sub: 9 } + - { dLoc: [ 1, 5, 2, 4 ], Sub: 9 } + - { dLoc: [ 0, 9, 0, 14 ], Sub: 9 } + - { dLoc: [ 0, 9, 0, 14 ], Branch: [ { Ref: 4 }, { Sub: 8 } ] } + - { dLoc: [ 0, 15, 1, 7 ], isGap: true, Ref: 4 } + - { dLoc: [ 1, 7, 0, 15 ], Ref: 4 } + - { dLoc: [ 3, 7, 0, 8 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 8 ], Branch: [ { Ref: 5 }, { Sub: 10 } ] } + - { dLoc: [ 0, 9, 0, 10 ], isGap: true, Ref: 5 } + - { dLoc: [ 0, 10, 0, 12 ], Ref: 5 } + - { dLoc: [ 2, 6, 5, 4 ], Add: 22 } + - { dLoc: [ 1, 9, 0, 15 ], Add: 22 } + - { dLoc: [ 0, 9, 0, 15 ], Branch: [ { Ref: 7 }, { Sub: 21 } ] } + - { dLoc: [ 0, 16, 1, 7 ], isGap: true, Ref: 7 } + - { dLoc: [ 1, 7, 0, 13 ], Ref: 7 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Sub: 21 } + - { dLoc: [ 0, 14, 2, 7 ], isGap: true, Sub: 21 } + - { dLoc: [ 2, 7, 0, 10 ], Sub: 21 } + - { dLoc: [ 1, 12, 0, 19 ], Sub: 21 } + - { dLoc: [ 0, 12, 0, 19 ], Branch: [ { Ref: 6 }, { Sub: 27 } ] } + - { dLoc: [ 2, 3, 2, 2 ], Sub: 27 } + - { dLoc: [ 0, 7, 0, 8 ], Sub: 27 } + - { dLoc: [ 0, 7, 0, 8 ], Branch: [ { Ref: 8 }, { Sub: 26 } ] } + - { dLoc: [ 0, 9, 0, 10 ], isGap: true, Ref: 8 } + - { dLoc: [ 0, 10, 0, 12 ], Ref: 8 } + - Name: '__llvm_covfun (3)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: jumps + FuncHash: 0xD0E163345D499C1B + FilenamesRef: 0x1A6D4D6FD974D39F + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + - [ { Tag: Zero }, { Ref: 2 } ] + - [ { Ref: 3 }, { Ref: 4 } ] + - [ { Ref: 6 }, { Ref: 5 } ] + - [ { Ref: 6 }, { Ref: 7 } ] + - [ { Ref: 6 }, { Ref: 5 } ] + - [ { Ref: 10 }, { Ref: 11 } ] + - [ { Ref: 10 }, { Ref: 11 } ] + - [ { Ref: 10 }, { Ref: 11 } ] + - [ { Add: 28 }, { Ref: 11 } ] + - [ { Ref: 10 }, { Ref: 14 } ] + - [ { Sub: 18 }, { Ref: 12 } ] + - [ { Add: 28 }, { Ref: 11 } ] + - [ { Ref: 10 }, { Ref: 14 } ] + - [ { Ref: 16 }, { Ref: 17 } ] + - [ { Ref: 15 }, { Ref: 17 } ] + - [ { Ref: 15 }, { Ref: 16 } ] + - [ { Sub: 18 }, { Ref: 12 } ] + - [ { Add: 28 }, { Ref: 11 } ] + - [ { Ref: 10 }, { Ref: 14 } ] + - [ { Sub: 26 }, { Ref: 12 } ] + - [ { Add: 27 }, { Ref: 11 } ] + - [ { Add: 28 }, { Ref: 20 } ] + - [ { Ref: 10 }, { Ref: 14 } ] + - [ { Sub: 25 }, { Ref: 18 } ] + - [ { Sub: 26 }, { Ref: 12 } ] + - [ { Add: 27 }, { Ref: 11 } ] + - [ { Add: 28 }, { Ref: 20 } ] + - [ { Ref: 10 }, { Ref: 14 } ] + - [ { Tag: Zero }, { Ref: 19 } ] + - [ { Ref: 20 }, { Ref: 21 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-c-general.c' + Regions: + - { dLoc: [ 59, 14, 47, 2 ], Ref: 0 } + - { dLoc: [ 3, 15, 0, 20 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 20 ], Branch: [ { Ref: 1 }, { Sub: 0 } ] } + - { dLoc: [ 0, 22, 0, 25 ], Tag: Zero } + - { dLoc: [ 0, 26, 0, 27 ], isGap: true, Ref: 1 } + - { dLoc: [ 0, 27, 4, 4 ], Ref: 1 } + - { dLoc: [ 3, 5, 1, 4 ], Tag: Zero } + - { dLoc: [ 0, 9, 0, 10 ], Tag: Zero } + - { dLoc: [ 0, 9, 0, 10 ], Branch: [ { Ref: 2 }, { Sub: 1 } ] } + - { dLoc: [ 0, 11, 0, 12 ], isGap: true, Ref: 2 } + - { dLoc: [ 0, 12, 0, 14 ], Ref: 2 } + - { dLoc: [ 3, 1, 3, 13 ], Ref: 3 } + - { dLoc: [ 1, 7, 0, 8 ], Ref: 3 } + - { dLoc: [ 0, 7, 0, 8 ], Branch: [ { Ref: 4 }, { Sub: 2 } ] } + - { dLoc: [ 0, 9, 0, 10 ], isGap: true, Ref: 4 } + - { dLoc: [ 0, 10, 0, 12 ], Ref: 4 } + - { dLoc: [ 4, 3, 33, 2 ], Tag: Zero } + - { dLoc: [ 0, 10, 0, 11 ], Ref: 6 } + - { dLoc: [ 0, 10, 0, 11 ], Branch: [ { Ref: 5 }, { Sub: 5 } ] } + - { dLoc: [ 0, 12, 0, 13 ], isGap: true, Ref: 5 } + - { dLoc: [ 0, 13, 3, 4 ], Ref: 5 } + - { dLoc: [ 1, 3, 2, 4 ], Ref: 6 } + - { dLoc: [ 1, 9, 0, 10 ], Ref: 6 } + - { dLoc: [ 0, 9, 0, 10 ], Branch: [ { Ref: 7 }, { Sub: 4 } ] } + - { dLoc: [ 0, 11, 0, 12 ], isGap: true, Ref: 7 } + - { dLoc: [ 0, 12, 0, 14 ], Ref: 7 } + - { dLoc: [ 3, 3, 0, 13 ], Sub: 5 } + - { dLoc: [ 0, 13, 1, 1 ], isGap: true, Ref: 8 } + - { dLoc: [ 1, 1, 27, 2 ], Ref: 8 } + - { dLoc: [ 1, 1, 26, 2 ], Ref: 9 } + - { dLoc: [ 1, 1, 25, 2 ], Ref: 10 } + - { dLoc: [ 2, 7, 0, 12 ], Ref: 10 } + - { dLoc: [ 0, 7, 0, 12 ], Branch: [ { Ref: 11 }, { Sub: 8 } ] } + - { dLoc: [ 0, 13, 1, 5 ], isGap: true, Ref: 11 } + - { dLoc: [ 1, 5, 0, 15 ], Ref: 11 } + - { dLoc: [ 0, 15, 2, 3 ], isGap: true, Sub: 8 } + - { dLoc: [ 2, 3, 20, 2 ], Sub: 8 } + - { dLoc: [ 0, 10, 0, 15 ], Sub: 18 } + - { dLoc: [ 0, 10, 0, 15 ], Branch: [ { Ref: 12 }, { Sub: 17 } ] } + - { dLoc: [ 0, 16, 0, 17 ], isGap: true, Ref: 12 } + - { dLoc: [ 0, 17, 10, 4 ], Ref: 12 } + - { dLoc: [ 1, 3, 9, 4 ], Ref: 13 } + - { dLoc: [ 1, 16, 6, 17 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 5, 1, 17 ], Ref: 15 } + - { dLoc: [ 0, 5, 0, 11 ], Branch: [ { Ref: 15 }, { Add: 14 } ] } + - { dLoc: [ 2, 5, 1, 18 ], Ref: 16 } + - { dLoc: [ 0, 5, 0, 11 ], Branch: [ { Ref: 16 }, { Add: 15 } ] } + - { dLoc: [ 2, 5, 1, 17 ], Ref: 17 } + - { dLoc: [ 0, 5, 0, 11 ], Branch: [ { Ref: 17 }, { Add: 16 } ] } + - { dLoc: [ 5, 3, 8, 2 ], Sub: 17 } + - { dLoc: [ 0, 15, 0, 21 ], Sub: 25 } + - { dLoc: [ 0, 15, 0, 21 ], Branch: [ { Ref: 18 }, { Sub: 24 } ] } + - { dLoc: [ 0, 23, 0, 26 ], Ref: 20 } + - { dLoc: [ 0, 27, 0, 28 ], isGap: true, Ref: 18 } + - { dLoc: [ 0, 28, 6, 4 ], Ref: 18 } + - { dLoc: [ 1, 20, 3, 3 ], isGap: true, Ref: 20 } + - { dLoc: [ 2, 5, 3, 4 ], Tag: Zero } + - { dLoc: [ 0, 9, 0, 10 ], Tag: Zero } + - { dLoc: [ 0, 9, 0, 10 ], Branch: [ { Ref: 19 }, { Sub: 29 } ] } + - { dLoc: [ 0, 11, 0, 12 ], isGap: true, Ref: 19 } + - { dLoc: [ 0, 12, 0, 14 ], Ref: 19 } + - { dLoc: [ 1, 3, 2, 4 ], Ref: 20 } + - { dLoc: [ 1, 9, 0, 10 ], Ref: 20 } + - { dLoc: [ 0, 9, 0, 10 ], Branch: [ { Ref: 21 }, { Sub: 30 } ] } + - { dLoc: [ 0, 11, 0, 12 ], isGap: true, Ref: 21 } + - { dLoc: [ 0, 12, 0, 14 ], Ref: 21 } + - Name: '__llvm_covfun (4)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: switches + FuncHash: 0x99A0C98383683E + FilenamesRef: 0x1A6D4D6FD974D39F + Expressions: + - [ { Add: 1 }, { Ref: 14 } ] + - [ { Add: 2 }, { Ref: 9 } ] + - [ { Ref: 1 }, { Ref: 4 } ] + - [ { Add: 0 }, { Ref: 3 } ] + - [ { Add: 5 }, { Ref: 14 } ] + - [ { Ref: 4 }, { Ref: 9 } ] + - [ { Add: 7 }, { Ref: 16 } ] + - [ { Add: 8 }, { Ref: 11 } ] + - [ { Ref: 7 }, { Ref: 9 } ] + - [ { Ref: 5 }, { Ref: 6 } ] + - [ { Ref: 5 }, { Ref: 7 } ] + - [ { Add: 12 }, { Ref: 16 } ] + - [ { Add: 13 }, { Ref: 11 } ] + - [ { Ref: 5 }, { Ref: 9 } ] + - [ { Ref: 5 }, { Ref: 7 } ] + - [ { Add: 29 }, { Ref: 8 } ] + - [ { Ref: 5 }, { Ref: 7 } ] + - [ { Add: 18 }, { Ref: 16 } ] + - [ { Add: 29 }, { Ref: 11 } ] + - [ { Ref: 5 }, { Ref: 7 } ] + - [ { Ref: 9 }, { Ref: 10 } ] + - [ { Add: 28 }, { Ref: 16 } ] + - [ { Add: 29 }, { Ref: 9 } ] + - [ { Ref: 5 }, { Ref: 7 } ] + - [ { Ref: 11 }, { Ref: 12 } ] + - [ { Ref: 14 }, { Ref: 15 } ] + - [ { Ref: 13 }, { Ref: 16 } ] + - [ { Add: 28 }, { Ref: 11 } ] + - [ { Add: 29 }, { Ref: 9 } ] + - [ { Ref: 5 }, { Ref: 7 } ] + - [ { Ref: 13 }, { Ref: 16 } ] + - [ { Add: 32 }, { Ref: 17 } ] + - [ { Ref: 13 }, { Ref: 16 } ] + - [ { Add: 0 }, { Ref: 3 } ] + - [ { Add: 0 }, { Ref: 3 } ] + - [ { Sub: 36 }, { Ref: 18 } ] + - [ { Add: 0 }, { Ref: 3 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-c-general.c' + Regions: + - { dLoc: [ 108, 17, 37, 2 ], Ref: 0 } + - { dLoc: [ 4, 23, 2, 10 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 3, 1, 10 ], Ref: 2 } + - { dLoc: [ 0, 3, 0, 10 ], Branch: [ { Ref: 2 }, { Tag: Zero } ] } + - { dLoc: [ 1, 10, 3, 3 ], isGap: true, Ref: 1 } + - { dLoc: [ 3, 3, 28, 2 ], Ref: 1 } + - { dLoc: [ 0, 63, 0, 70 ], Add: 0 } + - { dLoc: [ 0, 63, 0, 70 ], Branch: [ { Ref: 3 }, { Sub: 36 } ] } + - { dLoc: [ 0, 72, 0, 75 ], Add: 4 } + - { dLoc: [ 0, 76, 0, 77 ], isGap: true, Ref: 3 } + - { dLoc: [ 0, 77, 23, 4 ], Ref: 3 } + - { dLoc: [ 1, 25, 20, 15 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 5, 19, 15 ], Ref: 5 } + - { dLoc: [ 0, 5, 0, 11 ], Branch: [ { Ref: 5 }, { Add: 6 } ] } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 5 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Ref: 6 }, { Sub: 9 } ] } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 6 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 6 } + - { dLoc: [ 2, 5, 2, 12 ], Add: 29 } + - { dLoc: [ 0, 5, 0, 11 ], Branch: [ { Ref: 7 }, { Add: 11 } ] } + - { dLoc: [ 1, 11, 0, 12 ], Add: 29 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Ref: 8 }, { Sub: 15 } ] } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 8 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 8 } + - { dLoc: [ 2, 5, 2, 15 ], Ref: 9 } + - { dLoc: [ 0, 5, 0, 11 ], Branch: [ { Ref: 9 }, { Add: 17 } ] } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 9 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Ref: 10 }, { Sub: 20 } ] } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 10 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 10 } + - { dLoc: [ 2, 5, 10, 15 ], Ref: 11 } + - { dLoc: [ 0, 5, 0, 11 ], Branch: [ { Ref: 11 }, { Add: 21 } ] } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 11 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Ref: 12 }, { Sub: 24 } ] } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 12 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 12 } + - { dLoc: [ 1, 18, 3, 17 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 7, 2, 17 ], Ref: 14 } + - { dLoc: [ 0, 7, 0, 19 ], Branch: [ { Ref: 14 }, { Tag: Zero } ] } + - { dLoc: [ 1, 13, 0, 14 ], Ref: 14 } + - { dLoc: [ 0, 13, 0, 14 ], Branch: [ { Ref: 15 }, { Sub: 25 } ] } + - { dLoc: [ 0, 15, 0, 16 ], isGap: true, Ref: 15 } + - { dLoc: [ 0, 16, 0, 18 ], Ref: 15 } + - { dLoc: [ 1, 17, 3, 5 ], isGap: true, Ref: 13 } + - { dLoc: [ 3, 5, 2, 15 ], Add: 32 } + - { dLoc: [ 0, 5, 2, 15 ], Ref: 13 } + - { dLoc: [ 0, 5, 0, 12 ], Branch: [ { Ref: 16 }, { Add: 27 } ] } + - { dLoc: [ 1, 11, 0, 23 ], Add: 32 } + - { dLoc: [ 0, 11, 0, 23 ], Branch: [ { Ref: 17 }, { Sub: 31 } ] } + - { dLoc: [ 0, 24, 1, 9 ], isGap: true, Ref: 17 } + - { dLoc: [ 1, 9, 0, 15 ], Ref: 17 } + - { dLoc: [ 5, 3, 2, 2 ], Sub: 36 } + - { dLoc: [ 0, 7, 0, 17 ], Sub: 36 } + - { dLoc: [ 0, 7, 0, 17 ], Branch: [ { Ref: 18 }, { Sub: 35 } ] } + - { dLoc: [ 0, 18, 0, 19 ], isGap: true, Ref: 18 } + - { dLoc: [ 0, 19, 0, 21 ], Ref: 18 } + - Name: '__llvm_covfun (5)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: big_switch + FuncHash: 0xB6695A86B856FFD6 + FilenamesRef: 0x1A6D4D6FD974D39F + Expressions: + - [ { Ref: 0 }, { Ref: 2 } ] + - [ { Add: 0 }, { Ref: 1 } ] + - [ { Add: 3 }, { Ref: 15 } ] + - [ { Add: 4 }, { Ref: 13 } ] + - [ { Add: 5 }, { Ref: 11 } ] + - [ { Add: 6 }, { Ref: 9 } ] + - [ { Ref: 5 }, { Ref: 7 } ] + - [ { Ref: 3 }, { Ref: 4 } ] + - [ { Ref: 3 }, { Ref: 5 } ] + - [ { Add: 10 }, { Ref: 15 } ] + - [ { Add: 11 }, { Ref: 13 } ] + - [ { Add: 12 }, { Ref: 11 } ] + - [ { Add: 13 }, { Ref: 9 } ] + - [ { Ref: 3 }, { Ref: 7 } ] + - [ { Ref: 3 }, { Ref: 5 } ] + - [ { Add: 45 }, { Ref: 6 } ] + - [ { Ref: 3 }, { Ref: 5 } ] + - [ { Add: 18 }, { Ref: 15 } ] + - [ { Add: 19 }, { Ref: 13 } ] + - [ { Add: 20 }, { Ref: 11 } ] + - [ { Add: 45 }, { Ref: 9 } ] + - [ { Ref: 3 }, { Ref: 5 } ] + - [ { Ref: 7 }, { Ref: 8 } ] + - [ { Add: 24 }, { Ref: 15 } ] + - [ { Add: 25 }, { Ref: 13 } ] + - [ { Add: 44 }, { Ref: 11 } ] + - [ { Add: 45 }, { Ref: 7 } ] + - [ { Ref: 3 }, { Ref: 5 } ] + - [ { Ref: 9 }, { Ref: 10 } ] + - [ { Add: 30 }, { Ref: 15 } ] + - [ { Add: 43 }, { Ref: 13 } ] + - [ { Add: 44 }, { Ref: 9 } ] + - [ { Add: 45 }, { Ref: 7 } ] + - [ { Ref: 3 }, { Ref: 5 } ] + - [ { Ref: 11 }, { Ref: 12 } ] + - [ { Add: 42 }, { Ref: 15 } ] + - [ { Add: 43 }, { Ref: 11 } ] + - [ { Add: 44 }, { Ref: 9 } ] + - [ { Add: 45 }, { Ref: 7 } ] + - [ { Ref: 3 }, { Ref: 5 } ] + - [ { Ref: 13 }, { Ref: 14 } ] + - [ { Add: 42 }, { Ref: 13 } ] + - [ { Add: 43 }, { Ref: 11 } ] + - [ { Add: 44 }, { Ref: 9 } ] + - [ { Add: 45 }, { Ref: 7 } ] + - [ { Ref: 3 }, { Ref: 5 } ] + - [ { Ref: 15 }, { Ref: 16 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-c-general.c' + Regions: + - { dLoc: [ 147, 19, 31, 2 ], Ref: 0 } + - { dLoc: [ 1, 19, 0, 25 ], Add: 0 } + - { dLoc: [ 0, 19, 0, 25 ], Branch: [ { Ref: 1 }, { Sub: 1 } ] } + - { dLoc: [ 0, 27, 0, 30 ], Ref: 2 } + - { dLoc: [ 0, 31, 0, 32 ], isGap: true, Ref: 1 } + - { dLoc: [ 0, 32, 28, 4 ], Ref: 1 } + - { dLoc: [ 1, 21, 25, 12 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 5, 24, 12 ], Ref: 3 } + - { dLoc: [ 0, 5, 0, 18 ], Branch: [ { Ref: 3 }, { Add: 2 } ] } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 3 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Ref: 4 }, { Sub: 7 } ] } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 4 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 4 } + - { dLoc: [ 2, 5, 2, 12 ], Add: 45 } + - { dLoc: [ 0, 5, 0, 18 ], Branch: [ { Ref: 5 }, { Add: 9 } ] } + - { dLoc: [ 1, 11, 0, 12 ], Add: 45 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Ref: 6 }, { Sub: 15 } ] } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 6 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 6 } + - { dLoc: [ 2, 5, 2, 12 ], Ref: 7 } + - { dLoc: [ 0, 5, 0, 32 ], Branch: [ { Ref: 7 }, { Add: 17 } ] } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 7 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Ref: 8 }, { Sub: 22 } ] } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 8 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 8 } + - { dLoc: [ 4, 5, 2, 12 ], Ref: 9 } + - { dLoc: [ 0, 5, 0, 19 ], Branch: [ { Ref: 9 }, { Add: 23 } ] } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 9 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Ref: 10 }, { Sub: 28 } ] } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 10 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 10 } + - { dLoc: [ 2, 5, 2, 12 ], Ref: 11 } + - { dLoc: [ 0, 5, 0, 33 ], Branch: [ { Ref: 11 }, { Add: 29 } ] } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 11 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Ref: 12 }, { Sub: 34 } ] } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 12 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 12 } + - { dLoc: [ 4, 5, 2, 12 ], Ref: 13 } + - { dLoc: [ 0, 5, 0, 39 ], Branch: [ { Ref: 13 }, { Add: 35 } ] } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 13 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Ref: 14 }, { Sub: 40 } ] } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 14 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 14 } + - { dLoc: [ 2, 5, 2, 12 ], Ref: 15 } + - { dLoc: [ 0, 5, 0, 12 ], Branch: [ { Ref: 15 }, { Add: 41 } ] } + - { dLoc: [ 1, 11, 0, 12 ], Ref: 15 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Ref: 16 }, { Sub: 46 } ] } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Ref: 16 } + - { dLoc: [ 0, 14, 0, 16 ], Ref: 16 } + - Name: '__llvm_covfun (6)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: boolean_operators + FuncHash: 0x46CF38F3CE391 + FilenamesRef: 0x1A6D4D6FD974D39F + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Ref: 2 }, { Ref: 3 } ] + - [ { Ref: 1 }, { Ref: 4 } ] + - [ { Ref: 4 }, { Ref: 5 } ] + - [ { Ref: 1 }, { Ref: 8 } ] + - [ { Ref: 8 }, { Ref: 9 } ] + - [ { Ref: 6 }, { Ref: 7 } ] + - [ { Ref: 1 }, { Ref: 12 } ] + - [ { Ref: 12 }, { Ref: 13 } ] + - [ { Ref: 10 }, { Ref: 11 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-c-general.c' + Regions: + - { dLoc: [ 180, 26, 12, 2 ], Ref: 0 } + - { dLoc: [ 2, 19, 0, 26 ], Add: 0 } + - { dLoc: [ 0, 19, 0, 26 ], Branch: [ { Ref: 1 }, { Ref: 0 } ] } + - { dLoc: [ 0, 28, 0, 31 ], Ref: 1 } + - { dLoc: [ 0, 32, 0, 33 ], isGap: true, Ref: 1 } + - { dLoc: [ 0, 33, 8, 4 ], Ref: 1 } + - { dLoc: [ 1, 9, 0, 14 ], Ref: 1 } + - { dLoc: [ 0, 9, 0, 14 ], Branch: [ { Sub: 1 }, { Ref: 2 } ] } + - { dLoc: [ 0, 18, 0, 19 ], Ref: 2 } + - { dLoc: [ 0, 18, 0, 19 ], Branch: [ { Sub: 2 }, { Ref: 3 } ] } + - { dLoc: [ 2, 9, 0, 14 ], Ref: 1 } + - { dLoc: [ 0, 9, 0, 14 ], Branch: [ { Ref: 4 }, { Sub: 3 } ] } + - { dLoc: [ 0, 18, 0, 19 ], Ref: 4 } + - { dLoc: [ 0, 18, 0, 19 ], Branch: [ { Ref: 5 }, { Sub: 4 } ] } + - { dLoc: [ 2, 9, 0, 14 ], Ref: 1 } + - { dLoc: [ 0, 9, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 9, 0, 14 ], Branch: [ { Sub: 5 }, { Ref: 8 } ] } + - { dLoc: [ 0, 18, 0, 23 ], Ref: 8 } + - { dLoc: [ 0, 18, 0, 23 ], Branch: [ { Sub: 6 }, { Ref: 9 } ] } + - { dLoc: [ 0, 27, 0, 28 ], Ref: 6 } + - { dLoc: [ 0, 27, 0, 28 ], Branch: [ { Sub: 7 }, { Ref: 7 } ] } + - { dLoc: [ 2, 9, 0, 14 ], Ref: 1 } + - { dLoc: [ 0, 9, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 9, 0, 14 ], Branch: [ { Ref: 12 }, { Sub: 8 } ] } + - { dLoc: [ 0, 18, 0, 23 ], Ref: 12 } + - { dLoc: [ 0, 18, 0, 23 ], Branch: [ { Ref: 13 }, { Sub: 9 } ] } + - { dLoc: [ 0, 27, 0, 28 ], Ref: 10 } + - { dLoc: [ 0, 27, 0, 28 ], Branch: [ { Ref: 11 }, { Sub: 10 } ] } + - Name: '__llvm_covfun (7)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: boolop_loops + FuncHash: 0xAC1EE72F5632D15F + FilenamesRef: 0x1A6D4D6FD974D39F + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + - [ { Add: 0 }, { Ref: 2 } ] + - [ { Ref: 2 }, { Ref: 3 } ] + - [ { Ref: 0 }, { Ref: 4 } ] + - [ { Ref: 0 }, { Ref: 4 } ] + - [ { Add: 6 }, { Ref: 5 } ] + - [ { Ref: 0 }, { Ref: 4 } ] + - [ { Ref: 5 }, { Ref: 6 } ] + - [ { Ref: 0 }, { Ref: 7 } ] + - [ { Ref: 0 }, { Ref: 7 } ] + - [ { Add: 11 }, { Ref: 8 } ] + - [ { Ref: 0 }, { Ref: 7 } ] + - [ { Ref: 8 }, { Ref: 9 } ] + - [ { Ref: 0 }, { Ref: 10 } ] + - [ { Ref: 0 }, { Ref: 10 } ] + - [ { Add: 16 }, { Ref: 11 } ] + - [ { Ref: 0 }, { Ref: 10 } ] + - [ { Ref: 11 }, { Ref: 12 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-c-general.c' + Regions: + - { dLoc: [ 194, 21, 13, 2 ], Ref: 0 } + - { dLoc: [ 3, 10, 0, 11 ], Add: 0 } + - { dLoc: [ 0, 10, 0, 21 ], Add: 0 } + - { dLoc: [ 0, 10, 0, 11 ], Branch: [ { Ref: 2 }, { Sub: 1 } ] } + - { dLoc: [ 0, 15, 0, 21 ], Ref: 2 } + - { dLoc: [ 0, 15, 0, 21 ], Branch: [ { Ref: 3 }, { Sub: 2 } ] } + - { dLoc: [ 0, 22, 1, 5 ], isGap: true, Ref: 1 } + - { dLoc: [ 1, 5, 0, 8 ], Ref: 1 } + - { dLoc: [ 2, 10, 0, 17 ], Add: 6 } + - { dLoc: [ 0, 10, 0, 28 ], Add: 6 } + - { dLoc: [ 0, 10, 0, 17 ], Branch: [ { Sub: 5 }, { Ref: 5 } ] } + - { dLoc: [ 0, 21, 0, 28 ], Ref: 5 } + - { dLoc: [ 0, 21, 0, 28 ], Branch: [ { Sub: 7 }, { Ref: 6 } ] } + - { dLoc: [ 0, 29, 1, 5 ], isGap: true, Ref: 4 } + - { dLoc: [ 1, 5, 0, 8 ], Ref: 4 } + - { dLoc: [ 2, 17, 0, 18 ], Add: 11 } + - { dLoc: [ 0, 17, 0, 28 ], Add: 11 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Ref: 8 }, { Sub: 10 } ] } + - { dLoc: [ 0, 22, 0, 28 ], Ref: 8 } + - { dLoc: [ 0, 22, 0, 28 ], Branch: [ { Ref: 9 }, { Sub: 12 } ] } + - { dLoc: [ 0, 30, 0, 33 ], Ref: 7 } + - { dLoc: [ 0, 34, 0, 35 ], Ref: 7 } + - { dLoc: [ 2, 10, 0, 17 ], Add: 16 } + - { dLoc: [ 0, 10, 0, 28 ], Add: 16 } + - { dLoc: [ 0, 10, 0, 17 ], Branch: [ { Sub: 15 }, { Ref: 11 } ] } + - { dLoc: [ 0, 21, 0, 28 ], Ref: 11 } + - { dLoc: [ 0, 21, 0, 28 ], Branch: [ { Sub: 17 }, { Ref: 12 } ] } + - { dLoc: [ 0, 30, 0, 33 ], Ref: 10 } + - { dLoc: [ 0, 34, 0, 35 ], Ref: 10 } + - Name: '__llvm_covfun (8)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: conditional_operator + FuncHash: 0xD6D0 + FilenamesRef: 0x1A6D4D6FD974D39F + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + - [ { Ref: 0 }, { Ref: 2 } ] + - [ { Ref: 0 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-c-general.c' + Regions: + - { dLoc: [ 209, 29, 7, 2 ], Ref: 0 } + - { dLoc: [ 3, 11, 0, 17 ], Branch: [ { Ref: 1 }, { Sub: 0 } ] } + - { dLoc: [ 0, 18, 0, 20 ], isGap: true, Ref: 1 } + - { dLoc: [ 0, 20, 0, 21 ], Ref: 1 } + - { dLoc: [ 0, 24, 0, 25 ], Sub: 0 } + - { dLoc: [ 2, 11, 0, 12 ], Branch: [ { Ref: 2 }, { Sub: 2 } ] } + - { dLoc: [ 0, 16, 0, 17 ], Sub: 2 } + - Name: '__llvm_covfun (9)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: do_fallthrough + FuncHash: 0x78F0876298F0EA92 + FilenamesRef: 0x1A6D4D6FD974D39F + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Add: 10 }, { Ref: 3 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Add: 10 }, { Ref: 3 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Add: 10 }, { Ref: 3 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Add: 10 }, { Ref: 3 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Ref: 1 }, { Ref: 3 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-c-general.c' + Regions: + - { dLoc: [ 218, 23, 11, 2 ], Ref: 0 } + - { dLoc: [ 1, 19, 0, 25 ], Add: 0 } + - { dLoc: [ 0, 19, 0, 25 ], Branch: [ { Ref: 1 }, { Ref: 0 } ] } + - { dLoc: [ 0, 27, 0, 30 ], Ref: 1 } + - { dLoc: [ 0, 31, 0, 32 ], isGap: true, Ref: 1 } + - { dLoc: [ 0, 32, 9, 4 ], Ref: 1 } + - { dLoc: [ 2, 8, 6, 6 ], Add: 10 } + - { dLoc: [ 4, 11, 0, 16 ], Add: 10 } + - { dLoc: [ 0, 11, 0, 16 ], Branch: [ { Ref: 3 }, { Sub: 9 } ] } + - { dLoc: [ 0, 17, 0, 18 ], isGap: true, Ref: 3 } + - { dLoc: [ 0, 18, 0, 23 ], Ref: 3 } + - { dLoc: [ 0, 23, 1, 7 ], isGap: true, Sub: 9 } + - { dLoc: [ 1, 7, 1, 6 ], Sub: 9 } + - { dLoc: [ 1, 14, 0, 19 ], Sub: 9 } + - { dLoc: [ 0, 14, 0, 19 ], Branch: [ { Ref: 2 }, { Sub: 11 } ] } + - Name: '__llvm_covfun (10)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: main + FuncHash: 0x18 + FilenamesRef: 0x1A6D4D6FD974D39F + Expressions: [] + Files: + - Index: 0 + Filename: '/tmp/branch-c-general.c' + Regions: + - { dLoc: [ 245, 40, 15, 2 ], Ref: 0 } + - Name: '__llvm_covfun (11)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: 'branch-c-general.c:static_func' + FuncHash: 0x46D1 + FilenamesRef: 0x1A6D4D6FD974D39F + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-c-general.c' + Regions: + - { dLoc: [ 231, 27, 3, 2 ], Ref: 0 } + - { dLoc: [ 1, 19, 0, 25 ], Add: 0 } + - { dLoc: [ 0, 19, 0, 25 ], Branch: [ { Ref: 1 }, { Ref: 0 } ] } + - { dLoc: [ 0, 27, 0, 30 ], Ref: 1 } + - { dLoc: [ 0, 31, 0, 32 ], isGap: true, Ref: 1 } + - { dLoc: [ 0, 32, 1, 4 ], Ref: 1 } + - Name: __llvm_covmap + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovMap: + - FilenamesRef: 0x1A6D4D6FD974D39F + Version: 3 + - Name: __llvm_prf_names + Type: SHT_PROGBITS + AddressAlign: 0x1 + PrfNames: + - - simple_loops + - conditionals + - early_exits + - jumps + - switches + - big_switch + - boolean_operators + - boolop_loops + - conditional_operator + - do_fallthrough + - main + - 'branch-c-general.c:static_func' + - Type: SectionHeaderTable + Sections: + - Name: .strtab + - Name: __llvm_covfun + - Name: '__llvm_covfun (1)' + - Name: '__llvm_covfun (2)' + - Name: '__llvm_covfun (3)' + - Name: '__llvm_covfun (4)' + - Name: '__llvm_covfun (5)' + - Name: '__llvm_covfun (6)' + - Name: '__llvm_covfun (7)' + - Name: '__llvm_covfun (8)' + - Name: '__llvm_covfun (9)' + - Name: '__llvm_covfun (10)' + - Name: '__llvm_covfun (11)' + - Name: __llvm_covmap + - Name: __llvm_prf_names +... diff --git a/llvm/test/tools/llvm-cov/Inputs/branch-logical-mixed-single.yaml b/llvm/test/tools/llvm-cov/Inputs/branch-logical-mixed-single.yaml index 56f3d4955f4d9..9ea346722b915 100644 --- a/llvm/test/tools/llvm-cov/Inputs/branch-logical-mixed-single.yaml +++ b/llvm/test/tools/llvm-cov/Inputs/branch-logical-mixed-single.yaml @@ -11,22 +11,139 @@ Sections: Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: F0A0ED2C305C0BB32D02000089B21C19C99E86758F2950E06FBD46E8010100600108194302100701000101010C000E01000C010E01000C020E01000C030E01000C040E25010C000E1D010C000E15010C000E0D010C000E05010C000E100101000101010C000E01000C010E01000C020E01000C030E01000C040E4D010C000E45010C000E3D010C000E35010C000E2D010C000E100101000101010C011001000C031001000C051001000C071001000C091001000D000F69010D000F65010C011065000D000F71010D000F61010C011061000D000F79010D000F5D010C01105D000D000F8101010D000F59010C011059000D000F8901010D000F55010C011055000D000F9101010D000F100101000101010C011001000C031001000C051001000C071001000C091001000D000FAD01010D000FA901010C0110A901000D000FB501010D000FA501010C0110A501000D000FBD01010D000FA101010C0110A101000D000FC501010D000F9D01010C01109D01000D000FCD01010D000F9901010C01109901000D000FD501010D000F10010100010101070008DD010009018580808008DD0101050016E1010017028580808008E101020500161001010001E50101030E02E50100070008E9010009018580808008E90101050016ED010017028580808008ED01020500161001010001F10101030902F10100070008F5010009018580808008F50101050016F9010017028580808008F901020500161001010001FD0101030402FD01000700088102000901858080800881020105001685020017028580808008850202050016 + CovFun: + - FuncName: _Z4funcii + FuncHash: 0x75869EC9191CB289 + FilenamesRef: 0xE846BD6FE050298F + Expressions: [] + Files: + - Index: 0 + Filename: branch-logical-mixed.cpp + Regions: + - { dLoc: [ 8, 25, 67, 2 ], Ref: 0 } + - { dLoc: [ 7, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 1, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 2, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 3, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 4, 14 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 9 } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 7 } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 5 } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 3 } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 1 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 1, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 2, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 3, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 4, 14 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 19 } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 17 } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 15 } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 13 } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 11 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 3, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 5, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 7, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 9, 16 ], Ref: 0 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 0 } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 26 } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 25 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 25 } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 28 } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 24 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 24 } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 30 } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 23 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 23 } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 32 } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 22 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 22 } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 34 } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 21 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 21 } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 36 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 3, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 5, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 7, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 9, 16 ], Ref: 0 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 0 } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 43 } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 42 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 42 } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 45 } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 41 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 41 } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 47 } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 40 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 40 } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 49 } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 39 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 39 } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 51 } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 38 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 38 } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 53 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 7, 0, 8 ], Ref: 0 } + - { dLoc: [ 0, 9, 1, 5 ], isGap: true, Ref: 55 } + - { dLoc: [ 1, 5, 0, 22 ], Ref: 55 } + - { dLoc: [ 0, 23, 2, 5 ], isGap: true, Ref: 56 } + - { dLoc: [ 2, 5, 0, 22 ], Ref: 56 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 14, 2 ], Ref: 57 } + - { dLoc: [ 0, 7, 0, 8 ], Ref: 57 } + - { dLoc: [ 0, 9, 1, 5 ], isGap: true, Ref: 58 } + - { dLoc: [ 1, 5, 0, 22 ], Ref: 58 } + - { dLoc: [ 0, 23, 2, 5 ], isGap: true, Ref: 59 } + - { dLoc: [ 2, 5, 0, 22 ], Ref: 59 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 9, 2 ], Ref: 60 } + - { dLoc: [ 0, 7, 0, 8 ], Ref: 60 } + - { dLoc: [ 0, 9, 1, 5 ], isGap: true, Ref: 61 } + - { dLoc: [ 1, 5, 0, 22 ], Ref: 61 } + - { dLoc: [ 0, 23, 2, 5 ], isGap: true, Ref: 62 } + - { dLoc: [ 2, 5, 0, 22 ], Ref: 62 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 4, 2 ], Ref: 63 } + - { dLoc: [ 0, 7, 0, 8 ], Ref: 63 } + - { dLoc: [ 0, 9, 1, 5 ], isGap: true, Ref: 64 } + - { dLoc: [ 1, 5, 0, 22 ], Ref: 64 } + - { dLoc: [ 0, 23, 2, 5 ], isGap: true, Ref: 65 } + - { dLoc: [ 2, 5, 0, 22 ], Ref: 65 } - Name: '__llvm_covfun (1)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: FAD58DE7366495DB0900000018000000000000008F2950E06FBD46E801010001014F010402 + CovFun: + - FuncName: main + FuncHash: 0x18 + FilenamesRef: 0xE846BD6FE050298F + Expressions: [] + Files: + - Index: 0 + Filename: branch-logical-mixed.cpp + Regions: + - { dLoc: [ 79, 1, 4, 2 ], Ref: 0 } - Name: __llvm_covmap Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 000000001D0000000000000006000000021A0000186272616E63682D6C6F676963616C2D6D697865642E637070000000 + CovMap: + - FilenamesRef: 0xE846BD6FE050298F + Version: 6 - Name: __llvm_prf_names Type: SHT_PROGBITS Flags: [ SHF_ALLOC, SHF_GNU_RETAIN ] AddressAlign: 0x1 - Content: 0E005F5A3466756E636969016D61696E + PrfNames: + - - _Z4funcii + - main - Type: SectionHeaderTable Sections: - Name: .strtab @@ -34,24 +151,4 @@ Sections: - Name: '__llvm_covfun (1)' - Name: __llvm_covmap - Name: __llvm_prf_names - - Name: .symtab -Symbols: - - Name: __llvm_covmap - Type: STT_SECTION - Section: __llvm_covmap - - Name: __llvm_prf_names - Type: STT_SECTION - Section: __llvm_prf_names - - Name: __covrec_B30B5C302CEDA0F0u - Type: STT_OBJECT - Section: __llvm_covfun - Binding: STB_WEAK - Size: 0x249 - Other: [ STV_HIDDEN ] - - Name: __covrec_DB956436E78DD5FAu - Type: STT_OBJECT - Section: '__llvm_covfun (1)' - Binding: STB_WEAK - Size: 0x25 - Other: [ STV_HIDDEN ] ... diff --git a/llvm/test/tools/llvm-cov/Inputs/branch-logical-mixed.o32l b/llvm/test/tools/llvm-cov/Inputs/branch-logical-mixed.o similarity index 100% rename from llvm/test/tools/llvm-cov/Inputs/branch-logical-mixed.o32l rename to llvm/test/tools/llvm-cov/Inputs/branch-logical-mixed.o diff --git a/llvm/test/tools/llvm-cov/Inputs/branch-logical-mixed.yaml b/llvm/test/tools/llvm-cov/Inputs/branch-logical-mixed.yaml new file mode 100644 index 0000000000000..7018e49841703 --- /dev/null +++ b/llvm/test/tools/llvm-cov/Inputs/branch-logical-mixed.yaml @@ -0,0 +1,227 @@ +--- !ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_ARM + Flags: [ EF_ARM_EABI_VER5 ] + SectionHeaderStringTable: .strtab +Sections: + - Name: __llvm_covfun + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: _Z4funcii + FuncHash: 0x83C88F515FCF34F8 + FilenamesRef: 0x433778095298742 + Expressions: + - [ { Ref: 0 }, { Ref: 9 } ] + - [ { Ref: 9 }, { Ref: 10 } ] + - [ { Ref: 7 }, { Ref: 8 } ] + - [ { Ref: 5 }, { Ref: 6 } ] + - [ { Ref: 3 }, { Ref: 4 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Ref: 0 }, { Ref: 19 } ] + - [ { Ref: 19 }, { Ref: 20 } ] + - [ { Ref: 17 }, { Ref: 18 } ] + - [ { Ref: 15 }, { Ref: 16 } ] + - [ { Ref: 13 }, { Ref: 14 } ] + - [ { Ref: 11 }, { Ref: 12 } ] + - [ { Ref: 0 }, { Ref: 31 } ] + - [ { Ref: 31 }, { Ref: 32 } ] + - [ { Ref: 29 }, { Ref: 33 } ] + - [ { Ref: 33 }, { Ref: 34 } ] + - [ { Ref: 27 }, { Ref: 35 } ] + - [ { Ref: 35 }, { Ref: 36 } ] + - [ { Ref: 25 }, { Ref: 37 } ] + - [ { Ref: 37 }, { Ref: 38 } ] + - [ { Ref: 23 }, { Ref: 39 } ] + - [ { Ref: 39 }, { Ref: 40 } ] + - [ { Ref: 21 }, { Ref: 41 } ] + - [ { Ref: 41 }, { Ref: 42 } ] + - [ { Ref: 0 }, { Ref: 53 } ] + - [ { Ref: 53 }, { Ref: 54 } ] + - [ { Ref: 51 }, { Ref: 55 } ] + - [ { Ref: 55 }, { Ref: 56 } ] + - [ { Ref: 49 }, { Ref: 57 } ] + - [ { Ref: 57 }, { Ref: 58 } ] + - [ { Ref: 47 }, { Ref: 59 } ] + - [ { Ref: 59 }, { Ref: 60 } ] + - [ { Ref: 45 }, { Ref: 61 } ] + - [ { Ref: 61 }, { Ref: 62 } ] + - [ { Ref: 43 }, { Ref: 63 } ] + - [ { Ref: 63 }, { Ref: 64 } ] + - [ { Ref: 0 }, { Ref: 65 } ] + - [ { Ref: 0 }, { Ref: 65 } ] + - [ { Ref: 0 }, { Ref: 65 } ] + - [ { Ref: 0 }, { Ref: 66 } ] + - [ { Ref: 0 }, { Ref: 66 } ] + - [ { Ref: 0 }, { Ref: 66 } ] + - [ { Ref: 0 }, { Ref: 67 } ] + - [ { Ref: 0 }, { Ref: 67 } ] + - [ { Ref: 0 }, { Ref: 67 } ] + - [ { Ref: 0 }, { Ref: 68 } ] + - [ { Ref: 0 }, { Ref: 68 } ] + - [ { Ref: 0 }, { Ref: 68 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-logical-mixed.cpp' + Regions: + - { dLoc: [ 8, 25, 67, 2 ], Ref: 0 } + - { dLoc: [ 8, 12, 0, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 1, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 2, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 3, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 4, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 14 ], Branch: [ { Ref: 9 }, { Sub: 0 } ] } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 9 } + - { dLoc: [ 0, 12, 0, 14 ], Branch: [ { Ref: 10 }, { Sub: 1 } ] } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 7 } + - { dLoc: [ 0, 12, 0, 14 ], Branch: [ { Ref: 8 }, { Sub: 2 } ] } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 5 } + - { dLoc: [ 0, 12, 0, 14 ], Branch: [ { Ref: 6 }, { Sub: 3 } ] } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 3 } + - { dLoc: [ 0, 12, 0, 14 ], Branch: [ { Ref: 4 }, { Sub: 4 } ] } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 1 } + - { dLoc: [ 0, 12, 0, 14 ], Branch: [ { Ref: 2 }, { Sub: 5 } ] } + - { dLoc: [ 2, 12, 0, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 1, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 2, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 3, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 4, 14 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 14 ], Branch: [ { Sub: 6 }, { Ref: 19 } ] } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 19 } + - { dLoc: [ 0, 12, 0, 14 ], Branch: [ { Sub: 7 }, { Ref: 20 } ] } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 17 } + - { dLoc: [ 0, 12, 0, 14 ], Branch: [ { Sub: 8 }, { Ref: 18 } ] } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 15 } + - { dLoc: [ 0, 12, 0, 14 ], Branch: [ { Sub: 9 }, { Ref: 16 } ] } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 13 } + - { dLoc: [ 0, 12, 0, 14 ], Branch: [ { Sub: 10 }, { Ref: 14 } ] } + - { dLoc: [ 1, 12, 0, 14 ], Ref: 11 } + - { dLoc: [ 0, 12, 0, 14 ], Branch: [ { Sub: 11 }, { Ref: 12 } ] } + - { dLoc: [ 2, 12, 1, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 3, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 5, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 7, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 9, 16 ], Ref: 0 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 0 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Ref: 31 }, { Sub: 12 } ] } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 31 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Ref: 32 }, { Sub: 13 } ] } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 29 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 29 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Ref: 33 }, { Sub: 14 } ] } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 33 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Ref: 34 }, { Sub: 15 } ] } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 27 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 27 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Ref: 35 }, { Sub: 16 } ] } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 35 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Ref: 36 }, { Sub: 17 } ] } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 25 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 25 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Ref: 37 }, { Sub: 18 } ] } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 37 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Ref: 38 }, { Sub: 19 } ] } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 23 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 23 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Ref: 39 }, { Sub: 20 } ] } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 39 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Ref: 40 }, { Sub: 21 } ] } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 21 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 21 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Ref: 41 }, { Sub: 22 } ] } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 41 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Ref: 42 }, { Sub: 23 } ] } + - { dLoc: [ 2, 12, 1, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 3, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 5, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 7, 16 ], Ref: 0 } + - { dLoc: [ 0, 12, 9, 16 ], Ref: 0 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 0 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Sub: 24 }, { Ref: 53 } ] } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 53 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Sub: 25 }, { Ref: 54 } ] } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 51 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 51 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Sub: 26 }, { Ref: 55 } ] } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 55 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Sub: 27 }, { Ref: 56 } ] } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 49 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 49 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Sub: 28 }, { Ref: 57 } ] } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 57 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Sub: 29 }, { Ref: 58 } ] } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 47 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 47 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Sub: 30 }, { Ref: 59 } ] } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 59 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Sub: 31 }, { Ref: 60 } ] } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 45 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 45 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Sub: 32 }, { Ref: 61 } ] } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 61 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Sub: 33 }, { Ref: 62 } ] } + - { dLoc: [ 1, 12, 1, 16 ], Ref: 43 } + - { dLoc: [ 0, 13, 0, 15 ], Ref: 43 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Sub: 34 }, { Ref: 63 } ] } + - { dLoc: [ 1, 13, 0, 15 ], Ref: 63 } + - { dLoc: [ 0, 13, 0, 15 ], Branch: [ { Sub: 35 }, { Ref: 64 } ] } + - { dLoc: [ 2, 7, 0, 8 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 8 ], Branch: [ { Ref: 65 }, { Sub: 38 } ] } + - { dLoc: [ 0, 9, 1, 5 ], isGap: true, Ref: 65 } + - { dLoc: [ 1, 5, 0, 22 ], Ref: 65 } + - { dLoc: [ 0, 23, 2, 5 ], isGap: true, Sub: 38 } + - { dLoc: [ 2, 5, 0, 22 ], Sub: 38 } + - { dLoc: [ 2, 7, 0, 8 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 8 ], Branch: [ { Ref: 66 }, { Sub: 41 } ] } + - { dLoc: [ 0, 9, 1, 5 ], isGap: true, Ref: 66 } + - { dLoc: [ 1, 5, 0, 22 ], Ref: 66 } + - { dLoc: [ 0, 23, 2, 5 ], isGap: true, Sub: 41 } + - { dLoc: [ 2, 5, 0, 22 ], Sub: 41 } + - { dLoc: [ 2, 7, 0, 8 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 8 ], Branch: [ { Ref: 67 }, { Sub: 44 } ] } + - { dLoc: [ 0, 9, 1, 5 ], isGap: true, Ref: 67 } + - { dLoc: [ 1, 5, 0, 22 ], Ref: 67 } + - { dLoc: [ 0, 23, 2, 5 ], isGap: true, Sub: 44 } + - { dLoc: [ 2, 5, 0, 22 ], Sub: 44 } + - { dLoc: [ 2, 7, 0, 8 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 8 ], Branch: [ { Ref: 68 }, { Sub: 47 } ] } + - { dLoc: [ 0, 9, 1, 5 ], isGap: true, Ref: 68 } + - { dLoc: [ 1, 5, 0, 22 ], Ref: 68 } + - { dLoc: [ 0, 23, 2, 5 ], isGap: true, Sub: 47 } + - { dLoc: [ 2, 5, 0, 22 ], Sub: 47 } + - Name: '__llvm_covfun (1)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: main + FuncHash: 0x18 + FilenamesRef: 0x433778095298742 + Expressions: [] + Files: + - Index: 0 + Filename: '/tmp/branch-logical-mixed.cpp' + Regions: + - { dLoc: [ 79, 1, 4, 2 ], Ref: 0 } + - Name: __llvm_covmap + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovMap: + - FilenamesRef: 0x433778095298742 + Version: 3 + - Name: __llvm_prf_names + Type: SHT_PROGBITS + AddressAlign: 0x1 + PrfNames: + - - _Z4funcii + - main + - Type: SectionHeaderTable + Sections: + - Name: .strtab + - Name: __llvm_covfun + - Name: '__llvm_covfun (1)' + - Name: __llvm_covmap + - Name: __llvm_prf_names +... diff --git a/llvm/test/tools/llvm-cov/Inputs/branch-macros-single.yaml b/llvm/test/tools/llvm-cov/Inputs/branch-macros-single.yaml index 5c5f62b11863b..00a085c3e660f 100644 --- a/llvm/test/tools/llvm-cov/Inputs/branch-macros-single.yaml +++ b/llvm/test/tools/llvm-cov/Inputs/branch-macros-single.yaml @@ -11,27 +11,233 @@ Sections: Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: F0A0ED2C305C0BB33F010000D238C8100334540693E696313ECE8F5D15010101010101010101010101010101010101010101001501101911020C010C0011140015001A100101005C1C010C0011100101006224010C001210010100682C010C0012100101006E34010C0012100101007401010A000B01000A001001000A001501000A001A45000F00103D00140015350019001A2D001E001F10010104550201050F001701000F00170105060F00170301070F001F3C00100015440019001E014C0910001501540A100016015C0B1000160201050F001701000F0017010D060F00170301070F001F64001000156C0019001E017409100015017C0A1000160201050F001701000F00170115060F00170301070F001F8401001000158C010019001E019401091000150201050F001701000F0017011D060F00170301070F001F9C0100100015A4010019001E0201050F001701000F00170125060F0017 + CovFun: + - FuncName: _Z4funcii + FuncHash: 0x654340310C838D2 + FilenamesRef: 0x5D8FCE3E3196E693 + Expressions: [] + Files: + - Index: 0 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 16, 25, 17, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 17 ], Expansion: 1 } + - { dLoc: [ 0, 21, 0, 26 ], Expansion: 2 } + - { dLoc: [ 1, 1, 0, 92 ], ExtTag: Skip } + - { dLoc: [ 1, 12, 0, 17 ], Expansion: 3 } + - { dLoc: [ 1, 1, 0, 98 ], ExtTag: Skip } + - { dLoc: [ 1, 12, 0, 18 ], Expansion: 4 } + - { dLoc: [ 1, 1, 0, 104 ], ExtTag: Skip } + - { dLoc: [ 1, 12, 0, 18 ], Expansion: 5 } + - { dLoc: [ 1, 1, 0, 110 ], ExtTag: Skip } + - { dLoc: [ 1, 12, 0, 18 ], Expansion: 6 } + - { dLoc: [ 1, 1, 0, 116 ], ExtTag: Skip } + - { dLoc: [ 1, 10, 0, 11 ], Ref: 0 } + - { dLoc: [ 0, 10, 0, 16 ], Ref: 0 } + - { dLoc: [ 0, 10, 0, 21 ], Ref: 0 } + - { dLoc: [ 0, 10, 0, 26 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 16 ], Ref: 17 } + - { dLoc: [ 0, 20, 0, 21 ], Ref: 15 } + - { dLoc: [ 0, 25, 0, 26 ], Ref: 13 } + - { dLoc: [ 0, 30, 0, 31 ], Ref: 11 } + - { dLoc: [ 1, 1, 4, 85 ], ExtTag: Skip } + - Index: 1 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Ref: 0 } + - Index: 2 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 1 } + - Index: 3 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 7, 15, 0, 31 ], Ref: 0 } + - { dLoc: [ 0, 16, 0, 21 ], Expansion: 7 } + - { dLoc: [ 0, 25, 0, 30 ], Expansion: 8 } + - Index: 4 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 9, 16, 0, 21 ], Expansion: 9 } + - Index: 5 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 10, 16, 0, 22 ], Expansion: 10 } + - Index: 6 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 11, 16, 0, 22 ], Expansion: 11 } + - Index: 7 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Ref: 0 } + - Index: 8 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 3 } + - Index: 9 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 7, 15, 0, 31 ], Ref: 0 } + - { dLoc: [ 0, 16, 0, 21 ], Expansion: 12 } + - { dLoc: [ 0, 25, 0, 30 ], Expansion: 13 } + - Index: 10 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 9, 16, 0, 21 ], Expansion: 14 } + - Index: 11 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 10, 16, 0, 22 ], Expansion: 15 } + - Index: 12 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Ref: 0 } + - Index: 13 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 5 } + - Index: 14 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 7, 15, 0, 31 ], Ref: 0 } + - { dLoc: [ 0, 16, 0, 21 ], Expansion: 16 } + - { dLoc: [ 0, 25, 0, 30 ], Expansion: 17 } + - Index: 15 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 9, 16, 0, 21 ], Expansion: 18 } + - Index: 16 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Ref: 0 } + - Index: 17 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 7 } + - Index: 18 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 7, 15, 0, 31 ], Ref: 0 } + - { dLoc: [ 0, 16, 0, 21 ], Expansion: 19 } + - { dLoc: [ 0, 25, 0, 30 ], Expansion: 20 } + - Index: 19 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Ref: 0 } + - Index: 20 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 9 } - Name: '__llvm_covfun (1)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: B01D983FC67363959E000000039B9E2C8DB865C493E696313ECE8F5D0D01010101010101010101010101000401241A07020C010E0014140018001D1001010365011C0B1000160405080F002624001000152C0018001D3400200025013C0A1000160305070F001F44001000154C0019001E0119060F0017011D050F00170154091000150205050F001705000F00170121060F00170401070F001F01000F001F5C00100015640019001E0201050F001701000F0017010D060F0017 + CovFun: + - FuncName: _Z5func2ii + FuncHash: 0xC465B88D2C9E9B03 + FilenamesRef: 0x5D8FCE3E3196E693 + Expressions: [] + Files: + - Index: 0 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 36, 26, 7, 2 ], Ref: 0 } + - { dLoc: [ 1, 14, 0, 20 ], Expansion: 1 } + - { dLoc: [ 0, 24, 0, 29 ], Expansion: 2 } + - { dLoc: [ 1, 1, 3, 108 ], ExtTag: Skip } + - Index: 1 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 11, 16, 0, 22 ], Expansion: 3 } + - Index: 2 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 8, 15, 0, 38 ], Ref: 1 } + - { dLoc: [ 0, 16, 0, 21 ], Expansion: 4 } + - { dLoc: [ 0, 24, 0, 29 ], Expansion: 5 } + - { dLoc: [ 0, 32, 0, 37 ], Expansion: 6 } + - Index: 3 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 10, 16, 0, 22 ], Expansion: 7 } + - Index: 4 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 7, 15, 0, 31 ], Ref: 1 } + - { dLoc: [ 0, 16, 0, 21 ], Expansion: 8 } + - { dLoc: [ 0, 25, 0, 30 ], Expansion: 9 } + - Index: 5 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 6 } + - Index: 6 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Ref: 7 } + - Index: 7 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 9, 16, 0, 21 ], Expansion: 10 } + - Index: 8 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 15, 0, 23 ], Ref: 1 } + - Index: 9 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 8 } + - Index: 10 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 7, 15, 0, 31 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 31 ], Ref: 0 } + - { dLoc: [ 0, 16, 0, 21 ], Expansion: 11 } + - { dLoc: [ 0, 25, 0, 30 ], Expansion: 12 } + - Index: 11 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Ref: 0 } + - Index: 12 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 3 } - Name: '__llvm_covfun (2)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: FAD58DE7366495DB09000000180000000000000093E696313ECE8F5D01010001012F010502 + CovFun: + - FuncName: main + FuncHash: 0x18 + FilenamesRef: 0x5D8FCE3E3196E693 + Expressions: [] + Files: + - Index: 0 + Filename: branch-macros.cpp + Regions: + - { dLoc: [ 47, 1, 5, 2 ], Ref: 0 } - Name: __llvm_covmap Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 0000000016000000000000000600000002130000116272616E63682D6D6163726F732E6370700000 + CovMap: + - FilenamesRef: 0x5D8FCE3E3196E693 + Version: 6 - Name: __llvm_prf_names Type: SHT_PROGBITS Flags: [ SHF_ALLOC, SHF_GNU_RETAIN ] AddressAlign: 0x1 - Content: 19005F5A3466756E636969015F5A3566756E63326969016D61696E + PrfNames: + - - _Z4funcii + - _Z5func2ii + - main - Type: SectionHeaderTable Sections: - Name: .strtab @@ -40,30 +246,4 @@ Sections: - Name: '__llvm_covfun (2)' - Name: __llvm_covmap - Name: __llvm_prf_names - - Name: .symtab -Symbols: - - Name: __llvm_covmap - Type: STT_SECTION - Section: __llvm_covmap - - Name: __llvm_prf_names - Type: STT_SECTION - Section: __llvm_prf_names - - Name: __covrec_B30B5C302CEDA0F0u - Type: STT_OBJECT - Section: __llvm_covfun - Binding: STB_WEAK - Size: 0x15B - Other: [ STV_HIDDEN ] - - Name: __covrec_956373C63F981DB0u - Type: STT_OBJECT - Section: '__llvm_covfun (1)' - Binding: STB_WEAK - Size: 0xBA - Other: [ STV_HIDDEN ] - - Name: __covrec_DB956436E78DD5FAu - Type: STT_OBJECT - Section: '__llvm_covfun (2)' - Binding: STB_WEAK - Size: 0x25 - Other: [ STV_HIDDEN ] ... diff --git a/llvm/test/tools/llvm-cov/Inputs/branch-macros.o32l b/llvm/test/tools/llvm-cov/Inputs/branch-macros.o similarity index 100% rename from llvm/test/tools/llvm-cov/Inputs/branch-macros.o32l rename to llvm/test/tools/llvm-cov/Inputs/branch-macros.o diff --git a/llvm/test/tools/llvm-cov/Inputs/branch-macros.yaml b/llvm/test/tools/llvm-cov/Inputs/branch-macros.yaml new file mode 100644 index 0000000000000..2bcd7c2d2529f --- /dev/null +++ b/llvm/test/tools/llvm-cov/Inputs/branch-macros.yaml @@ -0,0 +1,278 @@ +--- !ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_ARM + Flags: [ EF_ARM_EABI_VER5 ] + SectionHeaderStringTable: .strtab +Sections: + - Name: __llvm_covfun + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: _Z4funcii + FuncHash: 0x1F69C7A6726516A9 + FilenamesRef: 0x6606FE403140CB5C + Expressions: + - [ { Ref: 0 }, { Ref: 17 } ] + - [ { Ref: 17 }, { Ref: 18 } ] + - [ { Ref: 15 }, { Ref: 16 } ] + - [ { Ref: 13 }, { Ref: 14 } ] + - [ { Ref: 11 }, { Ref: 12 } ] + - [ { Ref: 0 }, { Ref: 1 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 3 }, { Ref: 4 } ] + - [ { Ref: 0 }, { Ref: 5 } ] + - [ { Ref: 5 }, { Ref: 6 } ] + - [ { Ref: 0 }, { Ref: 7 } ] + - [ { Ref: 7 }, { Ref: 8 } ] + - [ { Ref: 0 }, { Ref: 9 } ] + - [ { Ref: 9 }, { Ref: 10 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 16, 25, 17, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 17 ], Expansion: 1 } + - { dLoc: [ 0, 21, 0, 26 ], Expansion: 2 } + - { dLoc: [ 2, 12, 0, 17 ], Expansion: 3 } + - { dLoc: [ 2, 12, 0, 18 ], Expansion: 4 } + - { dLoc: [ 2, 12, 0, 18 ], Expansion: 5 } + - { dLoc: [ 2, 12, 0, 18 ], Expansion: 6 } + - { dLoc: [ 2, 10, 0, 11 ], Ref: 0 } + - { dLoc: [ 0, 10, 0, 16 ], Ref: 0 } + - { dLoc: [ 0, 10, 0, 21 ], Ref: 0 } + - { dLoc: [ 0, 10, 0, 26 ], Ref: 0 } + - { dLoc: [ 0, 10, 0, 11 ], Branch: [ { Ref: 17 }, { Sub: 0 } ] } + - { dLoc: [ 0, 15, 0, 16 ], Ref: 17 } + - { dLoc: [ 0, 15, 0, 16 ], Branch: [ { Ref: 18 }, { Sub: 1 } ] } + - { dLoc: [ 0, 20, 0, 21 ], Ref: 15 } + - { dLoc: [ 0, 20, 0, 21 ], Branch: [ { Ref: 16 }, { Sub: 2 } ] } + - { dLoc: [ 0, 25, 0, 26 ], Ref: 13 } + - { dLoc: [ 0, 25, 0, 26 ], Branch: [ { Ref: 14 }, { Sub: 3 } ] } + - { dLoc: [ 0, 30, 0, 31 ], Ref: 11 } + - { dLoc: [ 0, 30, 0, 31 ], Branch: [ { Ref: 12 }, { Sub: 4 } ] } + - Index: 1 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Branch: [ { Ref: 1 }, { Sub: 5 } ] } + - Index: 2 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 15, 0, 23 ], Branch: [ { Ref: 2 }, { Sub: 6 } ] } + - Index: 3 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 7, 15, 0, 31 ], Ref: 0 } + - { dLoc: [ 0, 16, 0, 21 ], Expansion: 7 } + - { dLoc: [ 0, 25, 0, 30 ], Expansion: 8 } + - Index: 4 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 9, 16, 0, 21 ], Expansion: 9 } + - Index: 5 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 10, 16, 0, 22 ], Expansion: 10 } + - Index: 6 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 11, 16, 0, 22 ], Expansion: 11 } + - Index: 7 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Branch: [ { Ref: 3 }, { Sub: 7 } ] } + - Index: 8 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 3 } + - { dLoc: [ 0, 15, 0, 23 ], Branch: [ { Ref: 4 }, { Sub: 8 } ] } + - Index: 9 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 7, 15, 0, 31 ], Ref: 0 } + - { dLoc: [ 0, 16, 0, 21 ], Expansion: 12 } + - { dLoc: [ 0, 25, 0, 30 ], Expansion: 13 } + - Index: 10 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 9, 16, 0, 21 ], Expansion: 14 } + - Index: 11 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 10, 16, 0, 22 ], Expansion: 15 } + - Index: 12 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Branch: [ { Ref: 5 }, { Sub: 9 } ] } + - Index: 13 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 5 } + - { dLoc: [ 0, 15, 0, 23 ], Branch: [ { Ref: 6 }, { Sub: 10 } ] } + - Index: 14 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 7, 15, 0, 31 ], Ref: 0 } + - { dLoc: [ 0, 16, 0, 21 ], Expansion: 16 } + - { dLoc: [ 0, 25, 0, 30 ], Expansion: 17 } + - Index: 15 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 9, 16, 0, 21 ], Expansion: 18 } + - Index: 16 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Branch: [ { Ref: 7 }, { Sub: 11 } ] } + - Index: 17 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 7 } + - { dLoc: [ 0, 15, 0, 23 ], Branch: [ { Ref: 8 }, { Sub: 12 } ] } + - Index: 18 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 7, 15, 0, 31 ], Ref: 0 } + - { dLoc: [ 0, 16, 0, 21 ], Expansion: 19 } + - { dLoc: [ 0, 25, 0, 30 ], Expansion: 20 } + - Index: 19 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Branch: [ { Ref: 9 }, { Sub: 13 } ] } + - Index: 20 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 9 } + - { dLoc: [ 0, 15, 0, 23 ], Branch: [ { Ref: 10 }, { Sub: 14 } ] } + - Name: '__llvm_covfun (1)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5func2ii + FuncHash: 0x4D0E999EA1293740 + FilenamesRef: 0x6606FE403140CB5C + Expressions: + - [ { Ref: 1 }, { Ref: 2 } ] + - [ { Ref: 1 }, { Ref: 5 } ] + - [ { Ref: 1 }, { Ref: 6 } ] + - [ { Ref: 6 }, { Ref: 7 } ] + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 3 }, { Ref: 4 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 36, 26, 7, 2 ], Ref: 0 } + - { dLoc: [ 1, 14, 0, 20 ], Expansion: 1 } + - { dLoc: [ 0, 24, 0, 29 ], Expansion: 2 } + - Index: 1 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 11, 16, 0, 22 ], Expansion: 3 } + - Index: 2 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 8, 15, 0, 38 ], Ref: 1 } + - { dLoc: [ 0, 15, 0, 38 ], Branch: [ { Sub: 0 }, { Ref: 2 } ] } + - { dLoc: [ 0, 16, 0, 21 ], Expansion: 4 } + - { dLoc: [ 0, 24, 0, 29 ], Expansion: 5 } + - { dLoc: [ 0, 32, 0, 37 ], Expansion: 6 } + - Index: 3 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 10, 16, 0, 22 ], Expansion: 7 } + - Index: 4 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 7, 15, 0, 31 ], Ref: 1 } + - { dLoc: [ 0, 16, 0, 21 ], Expansion: 8 } + - { dLoc: [ 0, 25, 0, 30 ], Expansion: 9 } + - Index: 5 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 5 } + - Index: 6 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Sub: 1 } + - Index: 7 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 9, 16, 0, 21 ], Expansion: 10 } + - Index: 8 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 15, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 15, 0, 23 ], Branch: [ { Ref: 6 }, { Sub: 2 } ] } + - Index: 9 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 6 } + - { dLoc: [ 0, 15, 0, 23 ], Branch: [ { Ref: 7 }, { Sub: 3 } ] } + - Index: 10 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 7, 15, 0, 31 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 31 ], Ref: 0 } + - { dLoc: [ 0, 16, 0, 21 ], Expansion: 11 } + - { dLoc: [ 0, 25, 0, 30 ], Expansion: 12 } + - Index: 11 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 5, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 15, 0, 23 ], Branch: [ { Ref: 3 }, { Sub: 4 } ] } + - Index: 12 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 6, 15, 0, 23 ], Ref: 3 } + - { dLoc: [ 0, 15, 0, 23 ], Branch: [ { Ref: 4 }, { Sub: 5 } ] } + - Name: '__llvm_covfun (2)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: main + FuncHash: 0x18 + FilenamesRef: 0x6606FE403140CB5C + Expressions: [] + Files: + - Index: 0 + Filename: '/tmp/branch-macros.cpp' + Regions: + - { dLoc: [ 47, 1, 5, 2 ], Ref: 0 } + - Name: __llvm_covmap + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovMap: + - FilenamesRef: 0x6606FE403140CB5C + Version: 3 + - Name: __llvm_prf_names + Type: SHT_PROGBITS + AddressAlign: 0x1 + PrfNames: + - - _Z4funcii + - _Z5func2ii + - main + - Type: SectionHeaderTable + Sections: + - Name: .strtab + - Name: __llvm_covfun + - Name: '__llvm_covfun (1)' + - Name: '__llvm_covfun (2)' + - Name: __llvm_covmap + - Name: __llvm_prf_names +... diff --git a/llvm/test/tools/llvm-cov/Inputs/branch-showBranchPercentage.o32l b/llvm/test/tools/llvm-cov/Inputs/branch-showBranchPercentage.o similarity index 100% rename from llvm/test/tools/llvm-cov/Inputs/branch-showBranchPercentage.o32l rename to llvm/test/tools/llvm-cov/Inputs/branch-showBranchPercentage.o diff --git a/llvm/test/tools/llvm-cov/Inputs/branch-showBranchPercentage.yaml b/llvm/test/tools/llvm-cov/Inputs/branch-showBranchPercentage.yaml new file mode 100644 index 0000000000000..72b2bc4841b41 --- /dev/null +++ b/llvm/test/tools/llvm-cov/Inputs/branch-showBranchPercentage.yaml @@ -0,0 +1,117 @@ +--- !ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_ARM + Flags: [ EF_ARM_EABI_VER5 ] + SectionHeaderStringTable: .strtab +Sections: + - Name: __llvm_covfun + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: main + FuncHash: 0x35FE202CA2506077 + FilenamesRef: 0x520437DDBB69AFCD + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + - [ { Sub: 0 }, { Ref: 7 } ] + - [ { Ref: 7 }, { Ref: 8 } ] + - [ { Ref: 5 }, { Ref: 6 } ] + - [ { Ref: 3 }, { Ref: 4 } ] + - [ { Sub: 0 }, { Ref: 10 } ] + - [ { Ref: 10 }, { Ref: 11 } ] + - [ { Sub: 0 }, { Ref: 9 } ] + - [ { Sub: 0 }, { Ref: 12 } ] + - [ { Ref: 12 }, { Ref: 13 } ] + - [ { Add: 11 }, { Ref: 1 } ] + - [ { Ref: 0 }, { Ref: 14 } ] + - [ { Add: 13 }, { Ref: 19 } ] + - [ { Ref: 17 }, { Ref: 18 } ] + - [ { Ref: 16 }, { Ref: 17 } ] + - [ { Add: 16 }, { Ref: 19 } ] + - [ { Ref: 16 }, { Ref: 18 } ] + - [ { Add: 25 }, { Ref: 18 } ] + - [ { Ref: 16 }, { Ref: 17 } ] + - [ { Add: 25 }, { Ref: 19 } ] + - [ { Ref: 16 }, { Ref: 17 } ] + - [ { Add: 24 }, { Ref: 19 } ] + - [ { Add: 25 }, { Ref: 18 } ] + - [ { Ref: 16 }, { Ref: 17 } ] + - [ { Add: 25 }, { Ref: 18 } ] + - [ { Ref: 16 }, { Ref: 17 } ] + - [ { Ref: 15 }, { Ref: 20 } ] + - [ { Ref: 15 }, { Ref: 20 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-showBranchPercentage.c' + Regions: + - { dLoc: [ 12, 1, 46, 2 ], Ref: 0 } + - { dLoc: [ 2, 7, 0, 15 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 15 ], Branch: [ { Ref: 1 }, { Sub: 0 } ] } + - { dLoc: [ 0, 16, 1, 3 ], isGap: true, Ref: 1 } + - { dLoc: [ 1, 3, 3, 4 ], Ref: 1 } + - { dLoc: [ 3, 4, 2, 3 ], isGap: true, Sub: 0 } + - { dLoc: [ 2, 3, 38, 2 ], Sub: 0 } + - { dLoc: [ 7, 7, 0, 25 ], Sub: 0 } + - { dLoc: [ 0, 7, 0, 36 ], Sub: 0 } + - { dLoc: [ 0, 7, 0, 46 ], Sub: 0 } + - { dLoc: [ 0, 8, 0, 14 ], Sub: 0 } + - { dLoc: [ 0, 8, 0, 14 ], Branch: [ { Ref: 7 }, { Sub: 1 } ] } + - { dLoc: [ 0, 18, 0, 24 ], Ref: 7 } + - { dLoc: [ 0, 18, 0, 24 ], Branch: [ { Ref: 8 }, { Sub: 2 } ] } + - { dLoc: [ 0, 29, 0, 36 ], Ref: 5 } + - { dLoc: [ 0, 29, 0, 36 ], Branch: [ { Sub: 3 }, { Ref: 6 } ] } + - { dLoc: [ 0, 40, 0, 46 ], Ref: 3 } + - { dLoc: [ 0, 40, 0, 46 ], Branch: [ { Sub: 4 }, { Ref: 4 } ] } + - { dLoc: [ 0, 47, 1, 5 ], isGap: true, Ref: 2 } + - { dLoc: [ 1, 5, 0, 22 ], Ref: 2 } + - { dLoc: [ 2, 8, 0, 14 ], Sub: 0 } + - { dLoc: [ 0, 8, 0, 14 ], Branch: [ { Sub: 5 }, { Ref: 10 } ] } + - { dLoc: [ 0, 18, 0, 24 ], Ref: 10 } + - { dLoc: [ 0, 18, 0, 24 ], Branch: [ { Sub: 6 }, { Ref: 11 } ] } + - { dLoc: [ 0, 26, 0, 28 ], isGap: true, Ref: 9 } + - { dLoc: [ 0, 28, 0, 29 ], Ref: 9 } + - { dLoc: [ 0, 32, 0, 35 ], Sub: 7 } + - { dLoc: [ 2, 8, 0, 14 ], Sub: 0 } + - { dLoc: [ 0, 8, 0, 14 ], Branch: [ { Ref: 12 }, { Sub: 8 } ] } + - { dLoc: [ 0, 18, 0, 24 ], Ref: 12 } + - { dLoc: [ 0, 18, 0, 24 ], Branch: [ { Ref: 13 }, { Sub: 9 } ] } + - { dLoc: [ 2, 15, 0, 20 ], Sub: 10 } + - { dLoc: [ 0, 15, 0, 20 ], Branch: [ { Ref: 14 }, { Sub: 0 } ] } + - { dLoc: [ 0, 22, 0, 25 ], Ref: 14 } + - { dLoc: [ 0, 26, 0, 27 ], isGap: true, Ref: 14 } + - { dLoc: [ 0, 27, 0, 45 ], Ref: 14 } + - { dLoc: [ 6, 3, 7, 19 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 5, 6, 19 ], Ref: 16 } + - { dLoc: [ 0, 5, 0, 11 ], Branch: [ { Ref: 16 }, { Add: 12 } ] } + - { dLoc: [ 2, 5, 4, 19 ], Add: 25 } + - { dLoc: [ 0, 5, 0, 11 ], Branch: [ { Ref: 17 }, { Add: 15 } ] } + - { dLoc: [ 2, 5, 2, 19 ], Add: 24 } + - { dLoc: [ 0, 5, 0, 11 ], Branch: [ { Ref: 18 }, { Add: 19 } ] } + - { dLoc: [ 2, 5, 0, 19 ], Add: 21 } + - { dLoc: [ 0, 5, 0, 12 ], Branch: [ { Ref: 19 }, { Add: 24 } ] } + - { dLoc: [ 0, 19, 3, 3 ], isGap: true, Ref: 15 } + - { dLoc: [ 3, 3, 8, 2 ], Ref: 15 } + - { dLoc: [ 1, 6, 2, 4 ], Add: 27 } + - { dLoc: [ 2, 12, 0, 20 ], Add: 27 } + - { dLoc: [ 0, 12, 0, 20 ], Branch: [ { Ref: 20 }, { Ref: 15 } ] } + - Name: __llvm_covmap + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovMap: + - FilenamesRef: 0x520437DDBB69AFCD + Version: 3 + - Name: __llvm_prf_names + Type: SHT_PROGBITS + AddressAlign: 0x1 + PrfNames: + - - main + - Type: SectionHeaderTable + Sections: + - Name: .strtab + - Name: __llvm_covfun + - Name: __llvm_covmap + - Name: __llvm_prf_names +... diff --git a/llvm/test/tools/llvm-cov/Inputs/branch-templates-single.yaml b/llvm/test/tools/llvm-cov/Inputs/branch-templates-single.yaml index d4ede6db448e6..03e918953cdc9 100644 --- a/llvm/test/tools/llvm-cov/Inputs/branch-templates-single.yaml +++ b/llvm/test/tools/llvm-cov/Inputs/branch-templates-single.yaml @@ -11,32 +11,107 @@ Sections: Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: FAD58DE7366495DB5100000058242991A444920226ED9A40DAABBC6B0101000D011D0C090201010700130500140185808080080501050016090103060209000700170D00180185808080080D01050016110103040211000700171500180185808080081501050016190103010B + CovFun: + - FuncName: main + FuncHash: 0x29244A491292458 + FilenamesRef: 0x6BBCABDA409AED26 + Expressions: [] + Files: + - Index: 0 + Filename: branch-templates.cpp + Regions: + - { dLoc: [ 29, 12, 9, 2 ], Ref: 0 } + - { dLoc: [ 1, 7, 0, 19 ], Ref: 0 } + - { dLoc: [ 0, 20, 1, 5 ], isGap: true, Ref: 1 } + - { dLoc: [ 1, 5, 0, 22 ], Ref: 1 } + - { dLoc: [ 1, 3, 6, 2 ], Ref: 2 } + - { dLoc: [ 0, 7, 0, 23 ], Ref: 2 } + - { dLoc: [ 0, 24, 1, 5 ], isGap: true, Ref: 3 } + - { dLoc: [ 1, 5, 0, 22 ], Ref: 3 } + - { dLoc: [ 1, 3, 4, 2 ], Ref: 4 } + - { dLoc: [ 0, 7, 0, 23 ], Ref: 4 } + - { dLoc: [ 0, 24, 1, 5 ], isGap: true, Ref: 5 } + - { dLoc: [ 1, 5, 0, 22 ], Ref: 5 } + - { dLoc: [ 1, 3, 1, 11 ], Ref: 6 } - Name: '__llvm_covfun (1)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 5427717259E0E43E38000000113661920200000026ED9A40DAABBC6B01010008010D0F06020101060007050008018580808008050105000D09000E028580808008090205000D0D000E0183808080080D01030102 + CovFun: + - FuncName: _Z4funcIiEiT_ + FuncHash: 0x292613611 + FilenamesRef: 0x6BBCABDA409AED26 + Expressions: [] + Files: + - Index: 0 + Filename: branch-templates.cpp + Regions: + - { dLoc: [ 13, 15, 6, 2 ], Ref: 0 } + - { dLoc: [ 1, 6, 0, 7 ], Ref: 0 } + - { dLoc: [ 0, 8, 1, 5 ], isGap: true, Ref: 1 } + - { dLoc: [ 1, 5, 0, 13 ], Ref: 1 } + - { dLoc: [ 0, 14, 2, 5 ], isGap: true, Ref: 2 } + - { dLoc: [ 2, 5, 0, 13 ], Ref: 2 } + - { dLoc: [ 0, 14, 1, 3 ], isGap: true, Ref: 3 } + - { dLoc: [ 1, 3, 1, 2 ], Ref: 3 } - Name: '__llvm_covfun (2)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 4B7E22082F0551AA38000000113661920200000026ED9A40DAABBC6B01010008010D0F06020101060007050008018580808008050105000D09000E028580808008090205000D0D000E0183808080080D01030102 + CovFun: + - FuncName: _Z4funcIbEiT_ + FuncHash: 0x292613611 + FilenamesRef: 0x6BBCABDA409AED26 + Expressions: [] + Files: + - Index: 0 + Filename: branch-templates.cpp + Regions: + - { dLoc: [ 13, 15, 6, 2 ], Ref: 0 } + - { dLoc: [ 1, 6, 0, 7 ], Ref: 0 } + - { dLoc: [ 0, 8, 1, 5 ], isGap: true, Ref: 1 } + - { dLoc: [ 1, 5, 0, 13 ], Ref: 1 } + - { dLoc: [ 0, 14, 2, 5 ], isGap: true, Ref: 2 } + - { dLoc: [ 2, 5, 0, 13 ], Ref: 2 } + - { dLoc: [ 0, 14, 1, 3 ], isGap: true, Ref: 3 } + - { dLoc: [ 1, 3, 1, 2 ], Ref: 3 } - Name: '__llvm_covfun (3)' Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: AC1440BC3DA3E41A38000000113661920200000026ED9A40DAABBC6B01010008010D0F06020101060007050008018580808008050105000D09000E028580808008090205000D0D000E0183808080080D01030102 + CovFun: + - FuncName: _Z4funcIfEiT_ + FuncHash: 0x292613611 + FilenamesRef: 0x6BBCABDA409AED26 + Expressions: [] + Files: + - Index: 0 + Filename: branch-templates.cpp + Regions: + - { dLoc: [ 13, 15, 6, 2 ], Ref: 0 } + - { dLoc: [ 1, 6, 0, 7 ], Ref: 0 } + - { dLoc: [ 0, 8, 1, 5 ], isGap: true, Ref: 1 } + - { dLoc: [ 1, 5, 0, 13 ], Ref: 1 } + - { dLoc: [ 0, 14, 2, 5 ], isGap: true, Ref: 2 } + - { dLoc: [ 2, 5, 0, 13 ], Ref: 2 } + - { dLoc: [ 0, 14, 1, 3 ], isGap: true, Ref: 3 } + - { dLoc: [ 1, 3, 1, 2 ], Ref: 3 } - Name: __llvm_covmap Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 0000000019000000000000000600000002160000146272616E63682D74656D706C617465732E637070000000 + CovMap: + - FilenamesRef: 0x6BBCABDA409AED26 + Version: 6 - Name: __llvm_prf_names Type: SHT_PROGBITS Flags: [ SHF_ALLOC, SHF_GNU_RETAIN ] AddressAlign: 0x1 - Content: 2E006D61696E015F5A3466756E6349694569545F015F5A3466756E6349624569545F015F5A3466756E6349664569545F + PrfNames: + - - main + - _Z4funcIiEiT_ + - _Z4funcIbEiT_ + - _Z4funcIfEiT_ - Type: SectionHeaderTable Sections: - Name: .strtab @@ -46,36 +121,4 @@ Sections: - Name: '__llvm_covfun (3)' - Name: __llvm_covmap - Name: __llvm_prf_names - - Name: .symtab -Symbols: - - Name: __llvm_covmap - Type: STT_SECTION - Section: __llvm_covmap - - Name: __llvm_prf_names - Type: STT_SECTION - Section: __llvm_prf_names - - Name: __covrec_DB956436E78DD5FAu - Type: STT_OBJECT - Section: __llvm_covfun - Binding: STB_WEAK - Size: 0x6D - Other: [ STV_HIDDEN ] - - Name: __covrec_3EE4E05972712754u - Type: STT_OBJECT - Section: '__llvm_covfun (1)' - Binding: STB_WEAK - Size: 0x54 - Other: [ STV_HIDDEN ] - - Name: __covrec_AA51052F08227E4Bu - Type: STT_OBJECT - Section: '__llvm_covfun (2)' - Binding: STB_WEAK - Size: 0x54 - Other: [ STV_HIDDEN ] - - Name: __covrec_1AE4A33DBC4014ACu - Type: STT_OBJECT - Section: '__llvm_covfun (3)' - Binding: STB_WEAK - Size: 0x54 - Other: [ STV_HIDDEN ] ... diff --git a/llvm/test/tools/llvm-cov/Inputs/branch-templates.o32l b/llvm/test/tools/llvm-cov/Inputs/branch-templates.o similarity index 100% rename from llvm/test/tools/llvm-cov/Inputs/branch-templates.o32l rename to llvm/test/tools/llvm-cov/Inputs/branch-templates.o diff --git a/llvm/test/tools/llvm-cov/Inputs/branch-templates.yaml b/llvm/test/tools/llvm-cov/Inputs/branch-templates.yaml new file mode 100644 index 0000000000000..e7aa1a43559cd --- /dev/null +++ b/llvm/test/tools/llvm-cov/Inputs/branch-templates.yaml @@ -0,0 +1,130 @@ +--- !ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_ARM + Flags: [ EF_ARM_EABI_VER5 ] + SectionHeaderStringTable: .strtab +Sections: + - Name: __llvm_covfun + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: main + FuncHash: 0x29244A491292458 + FilenamesRef: 0xB8050C68267FC0DD + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + - [ { Ref: 0 }, { Ref: 2 } ] + - [ { Ref: 0 }, { Ref: 3 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-templates.cpp' + Regions: + - { dLoc: [ 29, 12, 9, 2 ], Ref: 0 } + - { dLoc: [ 1, 7, 0, 19 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 19 ], Branch: [ { Ref: 1 }, { Sub: 0 } ] } + - { dLoc: [ 0, 20, 1, 5 ], isGap: true, Ref: 1 } + - { dLoc: [ 1, 5, 0, 22 ], Ref: 1 } + - { dLoc: [ 1, 7, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 23 ], Branch: [ { Ref: 2 }, { Sub: 1 } ] } + - { dLoc: [ 0, 24, 1, 5 ], isGap: true, Ref: 2 } + - { dLoc: [ 1, 5, 0, 22 ], Ref: 2 } + - { dLoc: [ 1, 7, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 23 ], Branch: [ { Ref: 3 }, { Sub: 2 } ] } + - { dLoc: [ 0, 24, 1, 5 ], isGap: true, Ref: 3 } + - { dLoc: [ 1, 5, 0, 22 ], Ref: 3 } + - Name: '__llvm_covfun (1)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: _Z4funcIiEiT_ + FuncHash: 0x292613611 + FilenamesRef: 0xB8050C68267FC0DD + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-templates.cpp' + Regions: + - { dLoc: [ 13, 15, 6, 2 ], Ref: 0 } + - { dLoc: [ 1, 6, 0, 7 ], Ref: 0 } + - { dLoc: [ 0, 6, 0, 7 ], Branch: [ { Ref: 1 }, { Sub: 0 } ] } + - { dLoc: [ 0, 8, 1, 5 ], isGap: true, Ref: 1 } + - { dLoc: [ 1, 5, 0, 13 ], Ref: 1 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Sub: 0 } + - { dLoc: [ 0, 14, 2, 5 ], isGap: true, Sub: 0 } + - { dLoc: [ 2, 5, 0, 13 ], Sub: 0 } + - { dLoc: [ 0, 13, 1, 3 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 3, 1, 2 ], Tag: Zero } + - Name: '__llvm_covfun (2)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: _Z4funcIbEiT_ + FuncHash: 0x292613611 + FilenamesRef: 0xB8050C68267FC0DD + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-templates.cpp' + Regions: + - { dLoc: [ 13, 15, 6, 2 ], Ref: 0 } + - { dLoc: [ 1, 6, 0, 7 ], Ref: 0 } + - { dLoc: [ 0, 6, 0, 7 ], Branch: [ { Ref: 1 }, { Sub: 0 } ] } + - { dLoc: [ 0, 8, 1, 5 ], isGap: true, Ref: 1 } + - { dLoc: [ 1, 5, 0, 13 ], Ref: 1 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Sub: 0 } + - { dLoc: [ 0, 14, 2, 5 ], isGap: true, Sub: 0 } + - { dLoc: [ 2, 5, 0, 13 ], Sub: 0 } + - { dLoc: [ 0, 13, 1, 3 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 3, 1, 2 ], Tag: Zero } + - Name: '__llvm_covfun (3)' + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovFun: + - FuncName: _Z4funcIfEiT_ + FuncHash: 0x292613611 + FilenamesRef: 0xB8050C68267FC0DD + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + Files: + - Index: 0 + Filename: '/tmp/branch-templates.cpp' + Regions: + - { dLoc: [ 13, 15, 6, 2 ], Ref: 0 } + - { dLoc: [ 1, 6, 0, 7 ], Ref: 0 } + - { dLoc: [ 0, 6, 0, 7 ], Branch: [ { Ref: 1 }, { Sub: 0 } ] } + - { dLoc: [ 0, 8, 1, 5 ], isGap: true, Ref: 1 } + - { dLoc: [ 1, 5, 0, 13 ], Ref: 1 } + - { dLoc: [ 0, 13, 0, 14 ], isGap: true, Sub: 0 } + - { dLoc: [ 0, 14, 2, 5 ], isGap: true, Sub: 0 } + - { dLoc: [ 2, 5, 0, 13 ], Sub: 0 } + - { dLoc: [ 0, 13, 1, 3 ], isGap: true, Tag: Zero } + - { dLoc: [ 1, 3, 1, 2 ], Tag: Zero } + - Name: __llvm_covmap + Type: SHT_PROGBITS + AddressAlign: 0x8 + CovMap: + - FilenamesRef: 0xB8050C68267FC0DD + Version: 3 + - Name: __llvm_prf_names + Type: SHT_PROGBITS + AddressAlign: 0x1 + PrfNames: + - - main + - _Z4funcIiEiT_ + - _Z4funcIbEiT_ + - _Z4funcIfEiT_ + - Type: SectionHeaderTable + Sections: + - Name: .strtab + - Name: __llvm_covfun + - Name: '__llvm_covfun (1)' + - Name: '__llvm_covfun (2)' + - Name: '__llvm_covfun (3)' + - Name: __llvm_covmap + - Name: __llvm_prf_names +... diff --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.o b/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.o deleted file mode 100644 index 7a16162f29c00..0000000000000 Binary files a/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.o and /dev/null differ diff --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.yaml b/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.yaml new file mode 100644 index 0000000000000..47624eb742d0b --- /dev/null +++ b/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.yaml @@ -0,0 +1,638 @@ +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_GNU + Type: ET_REL + Machine: EM_X86_64 + SectionHeaderStringTable: .strtab +Sections: + - Name: __llvm_covfun + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5case0b + FuncHash: 0x60E + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 3, 20, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Decision: { BIdx: 3, NCond: 2 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 1, 2, 0 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 1 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Ref: 2 }, { Sub: 0 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (1)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5case1b + FuncHash: 0x60E + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 6, 20, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Decision: { BIdx: 3, NCond: 2 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Ref: 1 }, { Sub: 0 } ], MCDC: [ 1, 2, 0 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 1 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (2)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5case2b + FuncHash: 0x60E + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 9, 20, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Decision: { BIdx: 3, NCond: 2 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 1, 2, 0 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 1 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Ref: 2 }, { Sub: 0 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (3)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5case3b + FuncHash: 0x60E + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 12, 20, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Decision: { BIdx: 3, NCond: 2 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Ref: 1 }, { Sub: 0 } ], MCDC: [ 1, 2, 0 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 1 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (4)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5case4b + FuncHash: 0x60F + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 15, 20, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Decision: { BIdx: 3, NCond: 2 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 1, 0, 2 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 1 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Sub: 0 }, { Ref: 2 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (5)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5case5b + FuncHash: 0x60F + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 18, 20, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Decision: { BIdx: 3, NCond: 2 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Sub: 0 }, { Ref: 1 } ], MCDC: [ 1, 0, 2 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 1 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (6)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5case6b + FuncHash: 0x60F + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 21, 20, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Decision: { BIdx: 3, NCond: 2 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 1, 0, 2 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 1 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Sub: 0 }, { Ref: 2 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (7)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5case7b + FuncHash: 0x60F + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 24, 20, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Decision: { BIdx: 3, NCond: 2 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Sub: 0 }, { Ref: 1 } ], MCDC: [ 1, 0, 2 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 1 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (8)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5case8bb + FuncHash: 0x1838E + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 3 }, { Ref: 4 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 28, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 1, 3, 0 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Ref: 4 }, { Sub: 0 } ], MCDC: [ 3, 2, 0 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Ref: 2 }, { Sub: 1 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (9)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5case9bb + FuncHash: 0x1838E + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 31, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Ref: 3 }, { Sub: 0 } ], MCDC: [ 1, 3, 0 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 3, 2, 0 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Ref: 2 }, { Sub: 1 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (10)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5caseabb + FuncHash: 0x1838E + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 3 }, { Ref: 4 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 34, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 1, 3, 0 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Ref: 4 }, { Sub: 0 } ], MCDC: [ 3, 2, 0 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Ref: 2 }, { Sub: 1 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (11)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5casebbb + FuncHash: 0x1838E + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 37, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Ref: 3 }, { Sub: 0 } ], MCDC: [ 1, 3, 0 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 3, 2, 0 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Ref: 2 }, { Sub: 1 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (12)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5casecbb + FuncHash: 0x183CF + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 3 }, { Ref: 4 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 40, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 1, 0, 3 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Sub: 0 }, { Ref: 4 } ], MCDC: [ 3, 0, 2 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Sub: 1 }, { Ref: 2 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (13)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5casedbb + FuncHash: 0x183CF + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 43, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Sub: 0 }, { Ref: 3 } ], MCDC: [ 1, 0, 3 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 3, 0, 2 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Sub: 1 }, { Ref: 2 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (14)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5caseebb + FuncHash: 0x183CF + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 3 }, { Ref: 4 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 46, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 1, 0, 3 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Sub: 0 }, { Ref: 4 } ], MCDC: [ 3, 0, 2 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Sub: 1 }, { Ref: 2 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (15)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5casefbb + FuncHash: 0x183CF + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 49, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Sub: 0 }, { Ref: 3 } ], MCDC: [ 1, 0, 3 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 3, 0, 2 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Sub: 1 }, { Ref: 2 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (16)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5casegbb + FuncHash: 0x1838E + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 3 }, { Ref: 4 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 53, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Ref: 3 }, { Sub: 0 } ], MCDC: [ 1, 3, 0 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Ref: 4 }, { Sub: 1 } ], MCDC: [ 3, 2, 0 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (17)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5casehbb + FuncHash: 0x1838E + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 56, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Ref: 3 }, { Sub: 0 } ], MCDC: [ 1, 3, 0 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 3, 2, 0 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Ref: 2 }, { Sub: 1 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (18)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5caseibb + FuncHash: 0x1838E + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 3 }, { Ref: 4 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 59, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Ref: 3 }, { Sub: 0 } ], MCDC: [ 1, 3, 0 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Ref: 4 }, { Sub: 1 } ], MCDC: [ 3, 2, 0 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (19)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5casejbb + FuncHash: 0x1838E + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 62, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Ref: 3 }, { Sub: 0 } ], MCDC: [ 1, 3, 0 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 3, 2, 0 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Ref: 2 }, { Sub: 1 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (20)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5casekbb + FuncHash: 0x183CF + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 3 }, { Ref: 4 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 65, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Sub: 0 }, { Ref: 3 } ], MCDC: [ 1, 0, 3 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Sub: 1 }, { Ref: 4 } ], MCDC: [ 3, 0, 2 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (21)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5caselbb + FuncHash: 0x183CF + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 68, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Sub: 0 }, { Ref: 3 } ], MCDC: [ 1, 0, 3 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 3, 0, 2 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Sub: 1 }, { Ref: 2 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (22)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5casembb + FuncHash: 0x183CF + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 3 }, { Ref: 4 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 71, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Sub: 0 }, { Ref: 3 } ], MCDC: [ 1, 0, 3 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Sub: 1 }, { Ref: 4 } ], MCDC: [ 3, 0, 2 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (23)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z5casenbb + FuncHash: 0x183CF + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 1 }, { Ref: 2 } ] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 74, 28, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 12, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 12, 0, 23 ], Decision: { BIdx: 4, NCond: 3 } } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Sub: 0 }, { Ref: 3 } ], MCDC: [ 1, 0, 3 ] } + - { dLoc: [ 0, 17, 0, 18 ], Ref: 3 } + - { dLoc: [ 0, 17, 0, 18 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 3, 0, 2 ] } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 1 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Sub: 1 }, { Ref: 2 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (24)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: main + FuncHash: 0x18 + FilenamesRef: 0x133C4C46DEBF75B9 + Expressions: [] + Files: + - Index: 0 + Filename: mcdc-const-folding.cpp + Regions: + - { dLoc: [ 79, 1, 33, 2 ], Ref: 0 } + - { dLoc: [ 4, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 9, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 9, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 9, 1, 0, 1 ], ExtTag: Skip } + - Name: __llvm_covmap + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovMap: + - FilenamesRef: 0x133C4C46DEBF75B9 + - Name: __llvm_prf_names + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_GNU_RETAIN ] + AddressAlign: 0x1 + PrfNames: + - - _Z5case0b + - _Z5case1b + - _Z5case2b + - _Z5case3b + - _Z5case4b + - _Z5case5b + - _Z5case6b + - _Z5case7b + - _Z5case8bb + - _Z5case9bb + - _Z5caseabb + - _Z5casebbb + - _Z5casecbb + - _Z5casedbb + - _Z5caseebb + - _Z5casefbb + - _Z5casegbb + - _Z5casehbb + - _Z5caseibb + - _Z5casejbb + - _Z5casekbb + - _Z5caselbb + - _Z5casembb + - _Z5casenbb + - main + - Type: SectionHeaderTable + Sections: + - Name: .strtab + - Name: __llvm_covfun + - Name: '__llvm_covfun (1)' + - Name: '__llvm_covfun (2)' + - Name: '__llvm_covfun (3)' + - Name: '__llvm_covfun (4)' + - Name: '__llvm_covfun (5)' + - Name: '__llvm_covfun (6)' + - Name: '__llvm_covfun (7)' + - Name: '__llvm_covfun (8)' + - Name: '__llvm_covfun (9)' + - Name: '__llvm_covfun (10)' + - Name: '__llvm_covfun (11)' + - Name: '__llvm_covfun (12)' + - Name: '__llvm_covfun (13)' + - Name: '__llvm_covfun (14)' + - Name: '__llvm_covfun (15)' + - Name: '__llvm_covfun (16)' + - Name: '__llvm_covfun (17)' + - Name: '__llvm_covfun (18)' + - Name: '__llvm_covfun (19)' + - Name: '__llvm_covfun (20)' + - Name: '__llvm_covfun (21)' + - Name: '__llvm_covfun (22)' + - Name: '__llvm_covfun (23)' + - Name: '__llvm_covfun (24)' + - Name: __llvm_covmap + - Name: __llvm_prf_names +... diff --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-const.o b/llvm/test/tools/llvm-cov/Inputs/mcdc-const.o deleted file mode 100644 index bc38b71b5de07..0000000000000 Binary files a/llvm/test/tools/llvm-cov/Inputs/mcdc-const.o and /dev/null differ diff --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-const.yaml b/llvm/test/tools/llvm-cov/Inputs/mcdc-const.yaml new file mode 100644 index 0000000000000..6c6d3eda29056 --- /dev/null +++ b/llvm/test/tools/llvm-cov/Inputs/mcdc-const.yaml @@ -0,0 +1,80 @@ +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_GNU + Type: ET_REL + Machine: EM_X86_64 + SectionHeaderStringTable: .strtab +Sections: + - Name: __llvm_covfun + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z4testbbbb + FuncHash: 0xA3CF38E491 + FilenamesRef: 0x6FEA48B53A6E82A8 + Expressions: + - [ { Ref: 0 }, { Ref: 5 } ] + - [ { Ref: 7 }, { Ref: 8 } ] + Files: + - Index: 0 + Filename: mcdc-const.cpp + Regions: + - { dLoc: [ 10, 43, 4, 2 ], Ref: 0 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 7, 0, 15 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 27 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 32 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 32 ], Decision: { BIdx: 11, NCond: 5 } } + - { dLoc: [ 0, 8, 0, 9 ], Ref: 0 } + - { dLoc: [ 0, 8, 0, 9 ], Branch: [ { Ref: 5 }, { Sub: 0 } ], MCDC: [ 1, 4, 3 ] } + - { dLoc: [ 0, 13, 0, 14 ], Ref: 5 } + - { dLoc: [ 0, 13, 0, 14 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 4, 0, 3 ] } + - { dLoc: [ 0, 19, 0, 27 ], Ref: 4 } + - { dLoc: [ 0, 20, 0, 21 ], Ref: 4 } + - { dLoc: [ 0, 20, 0, 21 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 3, 5, 2 ] } + - { dLoc: [ 0, 25, 0, 26 ], Ref: 7 } + - { dLoc: [ 0, 25, 0, 26 ], Branch: [ { Ref: 8 }, { Sub: 1 } ], MCDC: [ 5, 0, 2 ] } + - { dLoc: [ 0, 31, 0, 32 ], Ref: 2 } + - { dLoc: [ 0, 31, 0, 32 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 2, 0, 0 ] } + - { dLoc: [ 0, 33, 1, 5 ], isGap: true, Ref: 1 } + - { dLoc: [ 1, 5, 0, 36 ], Ref: 1 } + - Name: '__llvm_covfun (1)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: main + FuncHash: 0x18 + FilenamesRef: 0x6FEA48B53A6E82A8 + Expressions: [] + Files: + - Index: 0 + Filename: mcdc-const.cpp + Regions: + - { dLoc: [ 17, 1, 9, 2 ], Ref: 0 } + - { dLoc: [ 5, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 2, 1, 0, 1 ], ExtTag: Skip } + - Name: __llvm_covmap + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovMap: + - FilenamesRef: 0x6FEA48B53A6E82A8 + - Name: __llvm_prf_names + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_GNU_RETAIN ] + AddressAlign: 0x1 + PrfNames: + - - _Z4testbbbb + - main + - Type: SectionHeaderTable + Sections: + - Name: .strtab + - Name: __llvm_covfun + - Name: '__llvm_covfun (1)' + - Name: __llvm_covmap + - Name: __llvm_prf_names +... diff --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-general-18.o b/llvm/test/tools/llvm-cov/Inputs/mcdc-general-18.o deleted file mode 100644 index e802f51132c06..0000000000000 Binary files a/llvm/test/tools/llvm-cov/Inputs/mcdc-general-18.o and /dev/null differ diff --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-general-18.yaml b/llvm/test/tools/llvm-cov/Inputs/mcdc-general-18.yaml new file mode 100644 index 0000000000000..ce67433ba617f --- /dev/null +++ b/llvm/test/tools/llvm-cov/Inputs/mcdc-general-18.yaml @@ -0,0 +1,119 @@ +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_GNU + Type: ET_REL + Machine: EM_X86_64 + SectionHeaderStringTable: .strtab +Sections: + - Name: __llvm_covfun + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z4testbbbb + FuncHash: 0x8844F3EA913AC6F7 + FilenamesRef: 0x936D2263272E38EB + Expressions: + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 3 }, { Ref: 4 } ] + - [ { Ref: 2 }, { Ref: 5 } ] + - [ { Ref: 5 }, { Ref: 6 } ] + - [ { Ref: 0 }, { Ref: 8 } ] + - [ { Ref: 8 }, { Ref: 9 } ] + - [ { Ref: 7 }, { Ref: 11 } ] + - [ { Ref: 11 }, { Ref: 12 } ] + - [ { Ref: 0 }, { Ref: 15 } ] + - [ { Ref: 15 }, { Ref: 16 } ] + - [ { Ref: 14 }, { Ref: 17 } ] + - [ { Ref: 17 }, { Ref: 18 } ] + Files: + - Index: 0 + Filename: mcdc-general.cpp + Regions: + - { dLoc: [ 10, 43, 11, 2 ], Ref: 0 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 7, 0, 15 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 27 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 27 ], Decision: { BIdx: 0, NCond: 4 } } + - { dLoc: [ 0, 8, 0, 9 ], Ref: 0 } + - { dLoc: [ 0, 8, 0, 9 ], Branch: [ { Ref: 3 }, { Sub: 0 } ], MCDC: [ 1, 3, 2 ] } + - { dLoc: [ 0, 13, 0, 14 ], Ref: 3 } + - { dLoc: [ 0, 13, 0, 14 ], Branch: [ { Ref: 4 }, { Sub: 1 } ], MCDC: [ 3, 0, 2 ] } + - { dLoc: [ 0, 19, 0, 27 ], Ref: 2 } + - { dLoc: [ 0, 20, 0, 21 ], Ref: 2 } + - { dLoc: [ 0, 20, 0, 21 ], Branch: [ { Ref: 5 }, { Sub: 2 } ], MCDC: [ 2, 4, 0 ] } + - { dLoc: [ 0, 25, 0, 26 ], Ref: 5 } + - { dLoc: [ 0, 25, 0, 26 ], Branch: [ { Ref: 6 }, { Sub: 3 } ], MCDC: [ 4, 0, 0 ] } + - { dLoc: [ 0, 28, 1, 5 ], isGap: true, Ref: 1 } + - { dLoc: [ 1, 5, 0, 36 ], Ref: 1 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 7, 0, 8 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 13 ], Decision: { BIdx: 2, NCond: 2 } } + - { dLoc: [ 0, 7, 0, 8 ], Branch: [ { Ref: 8 }, { Sub: 4 } ], MCDC: [ 1, 2, 0 ] } + - { dLoc: [ 0, 12, 0, 13 ], Ref: 8 } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Ref: 9 }, { Sub: 5 } ], MCDC: [ 2, 0, 0 ] } + - { dLoc: [ 0, 14, 0, 15 ], isGap: true, Ref: 7 } + - { dLoc: [ 0, 15, 1, 36 ], Ref: 7 } + - { dLoc: [ 0, 19, 0, 20 ], Ref: 7 } + - { dLoc: [ 0, 19, 0, 25 ], Ref: 7 } + - { dLoc: [ 0, 19, 0, 25 ], Decision: { BIdx: 3, NCond: 2 } } + - { dLoc: [ 0, 19, 0, 20 ], Branch: [ { Ref: 11 }, { Sub: 6 } ], MCDC: [ 1, 2, 0 ] } + - { dLoc: [ 0, 24, 0, 25 ], Ref: 11 } + - { dLoc: [ 0, 24, 0, 25 ], Branch: [ { Ref: 12 }, { Sub: 7 } ], MCDC: [ 2, 0, 0 ] } + - { dLoc: [ 0, 26, 1, 5 ], isGap: true, Ref: 10 } + - { dLoc: [ 1, 5, 0, 36 ], Ref: 10 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 7, 0, 15 ], Ref: 0 } + - { dLoc: [ 0, 7, 1, 15 ], Ref: 0 } + - { dLoc: [ 0, 7, 1, 15 ], Decision: { BIdx: 4, NCond: 4 } } + - { dLoc: [ 0, 8, 0, 9 ], Ref: 0 } + - { dLoc: [ 0, 8, 0, 9 ], Branch: [ { Ref: 15 }, { Sub: 8 } ], MCDC: [ 1, 3, 0 ] } + - { dLoc: [ 0, 13, 0, 14 ], Ref: 15 } + - { dLoc: [ 0, 13, 0, 14 ], Branch: [ { Ref: 16 }, { Sub: 9 } ], MCDC: [ 3, 2, 0 ] } + - { dLoc: [ 1, 7, 0, 15 ], Ref: 14 } + - { dLoc: [ 0, 8, 0, 9 ], Ref: 14 } + - { dLoc: [ 0, 8, 0, 9 ], Branch: [ { Ref: 17 }, { Sub: 10 } ], MCDC: [ 2, 4, 0 ] } + - { dLoc: [ 0, 13, 0, 14 ], Ref: 17 } + - { dLoc: [ 0, 13, 0, 14 ], Branch: [ { Ref: 18 }, { Sub: 11 } ], MCDC: [ 4, 0, 0 ] } + - { dLoc: [ 0, 16, 1, 5 ], isGap: true, Ref: 13 } + - { dLoc: [ 1, 5, 0, 36 ], Ref: 13 } + - Name: '__llvm_covfun (1)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: main + FuncHash: 0x18 + FilenamesRef: 0x936D2263272E38EB + Expressions: [] + Files: + - Index: 0 + Filename: mcdc-general.cpp + Regions: + - { dLoc: [ 24, 1, 12, 2 ], Ref: 0 } + - { dLoc: [ 5, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 4, 1, 0, 1 ], ExtTag: Skip } + - Name: __llvm_covmap + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovMap: + - FilenamesRef: 0x936D2263272E38EB + - Name: __llvm_prf_names + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_GNU_RETAIN ] + AddressAlign: 0x1 + PrfNames: + - - _Z4testbbbb + - main + - Type: SectionHeaderTable + Sections: + - Name: .strtab + - Name: __llvm_covfun + - Name: '__llvm_covfun (1)' + - Name: __llvm_covmap + - Name: __llvm_prf_names +... diff --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-general.o b/llvm/test/tools/llvm-cov/Inputs/mcdc-general.o deleted file mode 100644 index 8bed601221a14..0000000000000 Binary files a/llvm/test/tools/llvm-cov/Inputs/mcdc-general.o and /dev/null differ diff --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-general.yaml b/llvm/test/tools/llvm-cov/Inputs/mcdc-general.yaml new file mode 100644 index 0000000000000..60c1358df5845 --- /dev/null +++ b/llvm/test/tools/llvm-cov/Inputs/mcdc-general.yaml @@ -0,0 +1,119 @@ +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_GNU + Type: ET_REL + Machine: EM_X86_64 + SectionHeaderStringTable: .strtab +Sections: + - Name: __llvm_covfun + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: _Z4testbbbb + FuncHash: 0x8844F3EA913AC6F7 + FilenamesRef: 0x936D2263272E38EB + Expressions: + - [ { Ref: 0 }, { Ref: 3 } ] + - [ { Ref: 3 }, { Ref: 4 } ] + - [ { Ref: 2 }, { Ref: 5 } ] + - [ { Ref: 5 }, { Ref: 6 } ] + - [ { Ref: 0 }, { Ref: 8 } ] + - [ { Ref: 8 }, { Ref: 9 } ] + - [ { Ref: 7 }, { Ref: 11 } ] + - [ { Ref: 11 }, { Ref: 12 } ] + - [ { Ref: 0 }, { Ref: 15 } ] + - [ { Ref: 15 }, { Ref: 16 } ] + - [ { Ref: 14 }, { Ref: 17 } ] + - [ { Ref: 17 }, { Ref: 18 } ] + Files: + - Index: 0 + Filename: mcdc-general.cpp + Regions: + - { dLoc: [ 10, 43, 11, 2 ], Ref: 0 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 7, 0, 15 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 27 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 27 ], Decision: { BIdx: 7, NCond: 4 } } + - { dLoc: [ 0, 8, 0, 9 ], Ref: 0 } + - { dLoc: [ 0, 8, 0, 9 ], Branch: [ { Ref: 3 }, { Sub: 0 } ], MCDC: [ 1, 3, 2 ] } + - { dLoc: [ 0, 13, 0, 14 ], Ref: 3 } + - { dLoc: [ 0, 13, 0, 14 ], Branch: [ { Ref: 4 }, { Sub: 1 } ], MCDC: [ 3, 0, 2 ] } + - { dLoc: [ 0, 19, 0, 27 ], Ref: 2 } + - { dLoc: [ 0, 20, 0, 21 ], Ref: 2 } + - { dLoc: [ 0, 20, 0, 21 ], Branch: [ { Ref: 5 }, { Sub: 2 } ], MCDC: [ 2, 4, 0 ] } + - { dLoc: [ 0, 25, 0, 26 ], Ref: 5 } + - { dLoc: [ 0, 25, 0, 26 ], Branch: [ { Ref: 6 }, { Sub: 3 } ], MCDC: [ 4, 0, 0 ] } + - { dLoc: [ 0, 28, 1, 5 ], isGap: true, Ref: 1 } + - { dLoc: [ 1, 5, 0, 36 ], Ref: 1 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 7, 0, 8 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 13 ], Decision: { BIdx: 10, NCond: 2 } } + - { dLoc: [ 0, 7, 0, 8 ], Branch: [ { Ref: 8 }, { Sub: 4 } ], MCDC: [ 1, 2, 0 ] } + - { dLoc: [ 0, 12, 0, 13 ], Ref: 8 } + - { dLoc: [ 0, 12, 0, 13 ], Branch: [ { Ref: 9 }, { Sub: 5 } ], MCDC: [ 2, 0, 0 ] } + - { dLoc: [ 0, 14, 0, 15 ], isGap: true, Ref: 7 } + - { dLoc: [ 0, 15, 1, 36 ], Ref: 7 } + - { dLoc: [ 0, 19, 0, 20 ], Ref: 7 } + - { dLoc: [ 0, 19, 0, 25 ], Ref: 7 } + - { dLoc: [ 0, 19, 0, 25 ], Decision: { BIdx: 13, NCond: 2 } } + - { dLoc: [ 0, 19, 0, 20 ], Branch: [ { Ref: 11 }, { Sub: 6 } ], MCDC: [ 1, 2, 0 ] } + - { dLoc: [ 0, 24, 0, 25 ], Ref: 11 } + - { dLoc: [ 0, 24, 0, 25 ], Branch: [ { Ref: 12 }, { Sub: 7 } ], MCDC: [ 2, 0, 0 ] } + - { dLoc: [ 0, 26, 1, 5 ], isGap: true, Ref: 10 } + - { dLoc: [ 1, 5, 0, 36 ], Ref: 10 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 7, 0, 15 ], Ref: 0 } + - { dLoc: [ 0, 7, 1, 15 ], Ref: 0 } + - { dLoc: [ 0, 7, 1, 15 ], Decision: { BIdx: 18, NCond: 4 } } + - { dLoc: [ 0, 8, 0, 9 ], Ref: 0 } + - { dLoc: [ 0, 8, 0, 9 ], Branch: [ { Ref: 15 }, { Sub: 8 } ], MCDC: [ 1, 3, 0 ] } + - { dLoc: [ 0, 13, 0, 14 ], Ref: 15 } + - { dLoc: [ 0, 13, 0, 14 ], Branch: [ { Ref: 16 }, { Sub: 9 } ], MCDC: [ 3, 2, 0 ] } + - { dLoc: [ 1, 7, 0, 15 ], Ref: 14 } + - { dLoc: [ 0, 8, 0, 9 ], Ref: 14 } + - { dLoc: [ 0, 8, 0, 9 ], Branch: [ { Ref: 17 }, { Sub: 10 } ], MCDC: [ 2, 4, 0 ] } + - { dLoc: [ 0, 13, 0, 14 ], Ref: 17 } + - { dLoc: [ 0, 13, 0, 14 ], Branch: [ { Ref: 18 }, { Sub: 11 } ], MCDC: [ 4, 0, 0 ] } + - { dLoc: [ 0, 16, 1, 5 ], isGap: true, Ref: 13 } + - { dLoc: [ 1, 5, 0, 36 ], Ref: 13 } + - Name: '__llvm_covfun (1)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: main + FuncHash: 0x18 + FilenamesRef: 0x936D2263272E38EB + Expressions: [] + Files: + - Index: 0 + Filename: mcdc-general.cpp + Regions: + - { dLoc: [ 24, 1, 12, 2 ], Ref: 0 } + - { dLoc: [ 5, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 4, 1, 0, 1 ], ExtTag: Skip } + - Name: __llvm_covmap + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovMap: + - FilenamesRef: 0x936D2263272E38EB + - Name: __llvm_prf_names + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_GNU_RETAIN ] + AddressAlign: 0x1 + PrfNames: + - - _Z4testbbbb + - main + - Type: SectionHeaderTable + Sections: + - Name: .strtab + - Name: __llvm_covfun + - Name: '__llvm_covfun (1)' + - Name: __llvm_covmap + - Name: __llvm_prf_names +... diff --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-macro.o b/llvm/test/tools/llvm-cov/Inputs/mcdc-macro.o deleted file mode 100644 index 5b3934816bd22..0000000000000 Binary files a/llvm/test/tools/llvm-cov/Inputs/mcdc-macro.o and /dev/null differ diff --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-macro.yaml b/llvm/test/tools/llvm-cov/Inputs/mcdc-macro.yaml new file mode 100644 index 0000000000000..443072983d7ea --- /dev/null +++ b/llvm/test/tools/llvm-cov/Inputs/mcdc-macro.yaml @@ -0,0 +1,182 @@ +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_GNU + Type: ET_REL + Machine: EM_X86_64 + SectionHeaderStringTable: .strtab +Sections: + - Name: __llvm_covfun + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: func1 + FuncHash: 0x18 + FilenamesRef: 0xEEA5CE3580A93B01 + Expressions: [] + Files: + - Index: 0 + Filename: mcdc-macro.c + Regions: + - { dLoc: [ 6, 44, 0, 55 ], Ref: 0 } + - Name: '__llvm_covfun (1)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: func + FuncHash: 0x57C0939C4913CB1 + FilenamesRef: 0xEEA5CE3580A93B01 + Expressions: + - [ { Ref: 0 }, { Ref: 8 } ] + - [ { Ref: 2 }, { Ref: 3 } ] + - [ { Ref: 0 }, { Ref: 11 } ] + - [ { Ref: 0 }, { Ref: 15 } ] + - [ { Ref: 15 }, { Ref: 16 } ] + - [ { Ref: 6 }, { Ref: 7 } ] + - [ { Ref: 4 }, { Ref: 5 } ] + - [ { Ref: 16 }, { Ref: 17 } ] + - [ { Ref: 20 }, { Ref: 21 } ] + - [ { Ref: 18 }, { Ref: 19 } ] + Files: + - Index: 0 + Filename: mcdc-macro.c + Regions: + - { dLoc: [ 8, 58, 7, 2 ], Ref: 0 } + - { dLoc: [ 1, 7, 0, 8 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 18 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 23 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 23 ], Decision: { BIdx: 9, NCond: 5 } } + - { dLoc: [ 0, 7, 0, 8 ], Branch: [ { Ref: 8 }, { Sub: 0 } ], MCDC: [ 1, 5, 2 ] } + - { dLoc: [ 0, 12, 0, 13 ], Expansion: 1 } + - { dLoc: [ 0, 17, 0, 18 ], Expansion: 2 } + - { dLoc: [ 0, 22, 0, 23 ], Ref: 2 } + - { dLoc: [ 0, 22, 0, 23 ], Branch: [ { Sub: 1 }, { Ref: 3 } ], MCDC: [ 2, 0, 0 ] } + - { dLoc: [ 0, 24, 1, 5 ], isGap: true, Ref: 1 } + - { dLoc: [ 1, 5, 0, 12 ], Ref: 1 } + - { dLoc: [ 1, 7, 0, 8 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 13 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 13 ], Decision: { BIdx: 12, NCond: 2 } } + - { dLoc: [ 0, 7, 0, 8 ], Branch: [ { Ref: 11 }, { Sub: 2 } ], MCDC: [ 1, 2, 0 ] } + - { dLoc: [ 0, 12, 0, 13 ], Expansion: 3 } + - { dLoc: [ 0, 14, 1, 5 ], isGap: true, Ref: 10 } + - { dLoc: [ 1, 5, 0, 12 ], Ref: 10 } + - { dLoc: [ 1, 7, 0, 8 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 20 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 32 ], Ref: 0 } + - { dLoc: [ 0, 7, 0, 32 ], Decision: { BIdx: 25, NCond: 6 } } + - { dLoc: [ 0, 7, 0, 8 ], Branch: [ { Ref: 15 }, { Sub: 3 } ], MCDC: [ 1, 3, 2 ] } + - { dLoc: [ 0, 12, 0, 20 ], Ref: 15 } + - { dLoc: [ 0, 13, 0, 14 ], Ref: 15 } + - { dLoc: [ 0, 13, 0, 14 ], Branch: [ { Ref: 16 }, { Sub: 4 } ], MCDC: [ 3, 4, 2 ] } + - { dLoc: [ 0, 18, 0, 19 ], Expansion: 4 } + - { dLoc: [ 0, 24, 0, 32 ], Ref: 14 } + - { dLoc: [ 0, 25, 0, 26 ], Expansion: 5 } + - { dLoc: [ 0, 26, 0, 31 ], Ref: 14 } + - { dLoc: [ 0, 30, 0, 31 ], Expansion: 6 } + - { dLoc: [ 0, 33, 1, 5 ], isGap: true, Ref: 13 } + - { dLoc: [ 1, 5, 0, 12 ], Ref: 13 } + - Index: 1 + Filename: mcdc-macro.c + Regions: + - { dLoc: [ 2, 11, 0, 12 ], Ref: 8 } + - { dLoc: [ 0, 11, 0, 12 ], Ref: 0 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 5, 4, 2 ] } + - Index: 2 + Filename: mcdc-macro.c + Regions: + - { dLoc: [ 3, 11, 0, 19 ], Ref: 6 } + - { dLoc: [ 0, 11, 0, 30 ], Ref: 0 } + - { dLoc: [ 0, 11, 0, 30 ], Ref: 0 } + - { dLoc: [ 0, 11, 0, 19 ], Branch: [ { Ref: 7 }, { Sub: 5 } ], MCDC: [ 4, 3, 2 ] } + - { dLoc: [ 0, 12, 0, 13 ], Expansion: 7 } + - { dLoc: [ 0, 23, 0, 30 ], Ref: 4 } + - { dLoc: [ 0, 23, 0, 30 ], Branch: [ { Ref: 5 }, { Sub: 6 } ], MCDC: [ 3, 0, 2 ] } + - { dLoc: [ 0, 24, 0, 25 ], Expansion: 8 } + - Index: 3 + Filename: mcdc-macro.c + Regions: + - { dLoc: [ 2, 11, 0, 12 ], Ref: 11 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 2, 0, 0 ] } + - Index: 4 + Filename: mcdc-macro.c + Regions: + - { dLoc: [ 1, 11, 0, 12 ], Ref: 16 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Ref: 17 }, { Sub: 7 } ], MCDC: [ 4, 0, 2 ] } + - Index: 5 + Filename: mcdc-macro.c + Regions: + - { dLoc: [ 2, 11, 0, 12 ], Ref: 14 } + - { dLoc: [ 0, 11, 0, 12 ], Ref: 14 } + - { dLoc: [ 0, 11, 0, 12 ], Branch: [ { Tag: Zero }, { Tag: Zero } ], MCDC: [ 2, 6, 0 ] } + - Index: 6 + Filename: mcdc-macro.c + Regions: + - { dLoc: [ 4, 11, 0, 12 ], Expansion: 9 } + - Index: 7 + Filename: mcdc-macro.c + Regions: + - { dLoc: [ 1, 11, 0, 12 ], Ref: 6 } + - Index: 8 + Filename: mcdc-macro.c + Regions: + - { dLoc: [ 1, 11, 0, 12 ], Ref: 4 } + - Index: 9 + Filename: mcdc-macro.c + Regions: + - { dLoc: [ 3, 11, 0, 19 ], Ref: 20 } + - { dLoc: [ 0, 11, 0, 30 ], Ref: 14 } + - { dLoc: [ 0, 11, 0, 19 ], Branch: [ { Ref: 21 }, { Sub: 8 } ], MCDC: [ 6, 5, 0 ] } + - { dLoc: [ 0, 12, 0, 13 ], Expansion: 10 } + - { dLoc: [ 0, 23, 0, 30 ], Ref: 18 } + - { dLoc: [ 0, 23, 0, 30 ], Branch: [ { Ref: 19 }, { Sub: 9 } ], MCDC: [ 5, 0, 0 ] } + - { dLoc: [ 0, 24, 0, 25 ], Expansion: 11 } + - Index: 10 + Filename: mcdc-macro.c + Regions: + - { dLoc: [ 1, 11, 0, 12 ], Ref: 20 } + - Index: 11 + Filename: mcdc-macro.c + Regions: + - { dLoc: [ 1, 11, 0, 12 ], Ref: 18 } + - Name: '__llvm_covfun (2)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: main + FuncHash: 0x18 + FilenamesRef: 0xEEA5CE3580A93B01 + Expressions: [] + Files: + - Index: 0 + Filename: mcdc-macro.c + Regions: + - { dLoc: [ 17, 12, 3, 2 ], Ref: 0 } + - Name: __llvm_covmap + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovMap: + - FilenamesRef: 0xEEA5CE3580A93B01 + - Name: __llvm_prf_names + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_GNU_RETAIN ] + AddressAlign: 0x1 + PrfNames: + - - func1 + - func + - main + - Type: SectionHeaderTable + Sections: + - Name: .strtab + - Name: __llvm_covfun + - Name: '__llvm_covfun (1)' + - Name: '__llvm_covfun (2)' + - Name: __llvm_covmap + - Name: __llvm_prf_names +... diff --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-maxbs.o b/llvm/test/tools/llvm-cov/Inputs/mcdc-maxbs.o deleted file mode 100644 index 21f9d3a17dad0..0000000000000 Binary files a/llvm/test/tools/llvm-cov/Inputs/mcdc-maxbs.o and /dev/null differ diff --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-maxbs.yaml b/llvm/test/tools/llvm-cov/Inputs/mcdc-maxbs.yaml new file mode 100644 index 0000000000000..cfcebed2353ea --- /dev/null +++ b/llvm/test/tools/llvm-cov/Inputs/mcdc-maxbs.yaml @@ -0,0 +1,96 @@ +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_GNU + Type: ET_REL + Machine: EM_X86_64 + SectionHeaderStringTable: .strtab +Sections: + - Name: __llvm_covfun + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: sub + FuncHash: 0x48352A6636FC7EC6 + FilenamesRef: 0xF513BD425F33BADE + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + - [ { Sub: 0 }, { Ref: 5 } ] + - [ { Ref: 5 }, { Ref: 6 } ] + - [ { Ref: 4 }, { Ref: 7 } ] + - [ { Ref: 7 }, { Ref: 8 } ] + - [ { Ref: 0 }, { Ref: 2 } ] + - [ { Ref: 2 }, { Ref: 3 } ] + Files: + - Index: 0 + Filename: mcdc-maxbs.c + Regions: + - { dLoc: [ 3, 16, 3, 2 ], Ref: 0 } + - { dLoc: [ 1, 7, 0, 12 ], Expansion: 1 } + - { dLoc: [ 0, 26, 0, 27 ], isGap: true, Ref: 1 } + - { dLoc: [ 0, 27, 0, 35 ], Ref: 1 } + - { dLoc: [ 0, 36, 1, 3 ], isGap: true, Sub: 0 } + - { dLoc: [ 1, 3, 0, 60 ], Sub: 0 } + - { dLoc: [ 0, 11, 0, 33 ], Sub: 0 } + - { dLoc: [ 0, 11, 0, 59 ], Decision: { BIdx: 10, NCond: 4 } } + - { dLoc: [ 0, 12, 0, 20 ], Sub: 0 } + - { dLoc: [ 0, 12, 0, 20 ], Branch: [ { Ref: 5 }, { Sub: 1 } ], MCDC: [ 1, 3, 2 ] } + - { dLoc: [ 0, 24, 0, 32 ], Ref: 5 } + - { dLoc: [ 0, 24, 0, 32 ], Branch: [ { Ref: 6 }, { Sub: 2 } ], MCDC: [ 3, 0, 2 ] } + - { dLoc: [ 0, 37, 0, 59 ], Ref: 4 } + - { dLoc: [ 0, 38, 0, 46 ], Ref: 4 } + - { dLoc: [ 0, 38, 0, 46 ], Branch: [ { Ref: 7 }, { Sub: 3 } ], MCDC: [ 2, 4, 0 ] } + - { dLoc: [ 0, 50, 0, 58 ], Ref: 7 } + - { dLoc: [ 0, 50, 0, 58 ], Branch: [ { Ref: 8 }, { Sub: 4 } ], MCDC: [ 4, 0, 0 ] } + - Index: 1 + Filename: mcdc-maxbs.c + Regions: + - { dLoc: [ 1, 22, 0, 48 ], Ref: 0 } + - { dLoc: [ 0, 23, 0, 33 ], Ref: 0 } + - { dLoc: [ 0, 23, 0, 47 ], Decision: { BIdx: 3, NCond: 2 } } + - { dLoc: [ 0, 23, 0, 33 ], Branch: [ { Ref: 2 }, { Sub: 5 } ], MCDC: [ 1, 2, 0 ] } + - { dLoc: [ 0, 37, 0, 47 ], Ref: 2 } + - { dLoc: [ 0, 37, 0, 47 ], Branch: [ { Ref: 3 }, { Sub: 6 } ], MCDC: [ 2, 0, 0 ] } + - Name: '__llvm_covfun (1)' + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovFun: + - FuncName: main + FuncHash: 0x1835C + FilenamesRef: 0xF513BD425F33BADE + Expressions: + - [ { Ref: 0 }, { Ref: 1 } ] + Files: + - Index: 0 + Filename: mcdc-maxbs.c + Regions: + - { dLoc: [ 11, 1, 2, 2 ], Ref: 0 } + - { dLoc: [ 1, 11, 0, 16 ], Ref: 0 } + - { dLoc: [ 0, 11, 0, 16 ], Branch: [ { Ref: 1 }, { Sub: 0 } ] } + - { dLoc: [ 0, 18, 0, 19 ], isGap: true, Ref: 1 } + - { dLoc: [ 0, 19, 0, 25 ], Ref: 1 } + - { dLoc: [ 0, 28, 0, 29 ], Sub: 0 } + - Name: __llvm_covmap + Type: SHT_PROGBITS + Flags: [ SHF_GNU_RETAIN ] + AddressAlign: 0x8 + CovMap: + - FilenamesRef: 0xF513BD425F33BADE + - Name: __llvm_prf_names + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_GNU_RETAIN ] + AddressAlign: 0x1 + PrfNames: + - - sub + - main + - Type: SectionHeaderTable + Sections: + - Name: .strtab + - Name: __llvm_covfun + - Name: '__llvm_covfun (1)' + - Name: __llvm_covmap + - Name: __llvm_prf_names +... diff --git a/llvm/test/tools/llvm-cov/Inputs/showLineExecutionCounts-single.yaml b/llvm/test/tools/llvm-cov/Inputs/showLineExecutionCounts-single.yaml index 84b184023f082..cd82f4437ae55 100644 --- a/llvm/test/tools/llvm-cov/Inputs/showLineExecutionCounts-single.yaml +++ b/llvm/test/tools/llvm-cov/Inputs/showLineExecutionCounts-single.yaml @@ -11,35 +11,58 @@ Sections: Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: FAD58DE7366495DB9A0000006733DBEA42F87ED3C60E0B951FF3509D0101001A01060C130210020100010101070008050009008A8080800805000A0204090204008A8080800809000A020410030100010D01030A02110013001A15001C001F19002000A180808008190021020410030100011D010306021D0007000D25000F0090808080082500100015290018001D2101030502210007000D31000F018980808008310109000E350109000E10010100012D0103000B + CovFun: + - FuncName: main + FuncHash: 0xD37EF842EADB3367 + FilenamesRef: 0x9D50F31F950B0EC6 + Expressions: [] + Files: + - Index: 0 + Filename: showLineExecutionCounts.cpp + Regions: + - { dLoc: [ 6, 12, 19, 2 ], Ref: 0 } + - { dLoc: [ 2, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 7, 0, 8 ], Ref: 0 } + - { dLoc: [ 0, 9, 0, 10 ], isGap: true, Ref: 1 } + - { dLoc: [ 0, 10, 2, 4 ], Ref: 1 } + - { dLoc: [ 2, 4, 0, 10 ], isGap: true, Ref: 2 } + - { dLoc: [ 0, 10, 2, 4 ], Ref: 2 } + - { dLoc: [ 3, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 10, 2 ], Ref: 3 } + - { dLoc: [ 0, 19, 0, 26 ], Ref: 4 } + - { dLoc: [ 0, 28, 0, 31 ], Ref: 5 } + - { dLoc: [ 0, 32, 0, 33 ], isGap: true, Ref: 6 } + - { dLoc: [ 0, 33, 2, 4 ], Ref: 6 } + - { dLoc: [ 3, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 6, 2 ], Ref: 7 } + - { dLoc: [ 0, 7, 0, 13 ], Ref: 7 } + - { dLoc: [ 0, 15, 0, 16 ], isGap: true, Ref: 9 } + - { dLoc: [ 0, 16, 0, 21 ], Ref: 9 } + - { dLoc: [ 0, 24, 0, 29 ], Ref: 10 } + - { dLoc: [ 1, 3, 5, 2 ], Ref: 8 } + - { dLoc: [ 0, 7, 0, 13 ], Ref: 8 } + - { dLoc: [ 0, 15, 1, 9 ], isGap: true, Ref: 12 } + - { dLoc: [ 1, 9, 0, 14 ], Ref: 12 } + - { dLoc: [ 1, 9, 0, 14 ], Ref: 13 } + - { dLoc: [ 1, 1, 0, 1 ], ExtTag: Skip } + - { dLoc: [ 1, 3, 0, 11 ], Ref: 11 } - Name: __llvm_covmap Type: SHT_PROGBITS Flags: [ SHF_GNU_RETAIN ] AddressAlign: 0x8 - Content: 00000000200000000000000006000000021D00001B73686F774C696E65457865637574696F6E436F756E74732E637070 + CovMap: + - FilenamesRef: 0x9D50F31F950B0EC6 + Version: 6 - Name: __llvm_prf_names Type: SHT_PROGBITS Flags: [ SHF_ALLOC, SHF_GNU_RETAIN ] AddressAlign: 0x1 - Content: 04006D61696E + PrfNames: + - - main - Type: SectionHeaderTable Sections: - Name: .strtab - Name: __llvm_covfun - Name: __llvm_covmap - Name: __llvm_prf_names - - Name: .symtab -Symbols: - - Name: __llvm_covmap - Type: STT_SECTION - Section: __llvm_covmap - - Name: __llvm_prf_names - Type: STT_SECTION - Section: __llvm_prf_names - - Name: __covrec_DB956436E78DD5FAu - Type: STT_OBJECT - Section: __llvm_covfun - Binding: STB_WEAK - Size: 0xB6 - Other: [ STV_HIDDEN ] ... diff --git a/llvm/test/tools/llvm-cov/Inputs/yaml.makefile b/llvm/test/tools/llvm-cov/Inputs/yaml.makefile index 2a256f0cffc0b..449542cee5477 100644 --- a/llvm/test/tools/llvm-cov/Inputs/yaml.makefile +++ b/llvm/test/tools/llvm-cov/Inputs/yaml.makefile @@ -2,7 +2,7 @@ # # Usage: # cd /path/to/llvm-project/llvm/test/tools/llvm-cov/Inputs -# PATH=/path/to/build/bin:$PATH make -f yaml.makefile +# PATH=/path/to/build/bin:$PATH make -f yaml.makefile *.yaml CFLAGS_COVMAP = -fcoverage-compilation-dir=. \ -mllvm -runtime-counter-relocation=true \ @@ -34,11 +34,11 @@ CFLAGS_MCDC = -fcoverage-mcdc --only-section=__llvm_covfun \ --only-section=__llvm_covmap \ --only-section=__llvm_prf_names \ - --strip-unneeded \ + --strip-all \ $< $@ %.yaml: %.covmap.o - obj2yaml $< > $@ + obj2yaml --covmap --covmap-dloc $< > $@ %.exe: %.o clang++ -fprofile-instr-generate $^ -o $@