1; This is identical to injected-sources.test, except that it uses the -native
2; mode of pretty (and hence doesn't require diasdk and runs on all platforms).
3
4; RUN: llvm-pdbutil pretty -native -injected-sources -injected-source-content \
5; RUN:   %p/Inputs/InjectedSource.pdb | FileCheck %s
6; RUN: llvm-pdbutil pretty -native -injected-sources -injected-source-content \
7; RUN:   %p/Inputs/ClassLayoutTest.pdb | FileCheck --check-prefix=NEGATIVE %s
8
9; CHECK:      ---INJECTED SOURCES---
10; CHECK:      c.natvis (140 bytes): obj=<null>, vname=c.natvis, crc=334478030, compression=None
11; CHECK-NEXT: <?xml version="1.0" encoding="utf-8"?>
12; CHECK-NEXT: <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
13; CHECK-NEXT: </AutoVisualizer>
14; CHECK:      a.natvis (140 bytes): obj=<null>, vname=a.natvis, crc=334478030, compression=None
15; CHECK-NEXT: <?xml version="1.0" encoding="utf-8"?>
16; CHECK-NEXT: <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
17; CHECK-NEXT: </AutoVisualizer>
18; CHECK:      b.natvis (294 bytes): obj=<null>, vname=b.natvis, crc=2059731902, compression=None
19; CHECK-NEXT: <?xml version="1.0" encoding="utf-8"?>
20; CHECK-NEXT: <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
21; CHECK-NEXT: <Type Name="Baz">
22; CHECK-NEXT:   <DisplayString>Third test</DisplayString>
23; CHECK-NEXT: </Type>
24; CHECK-NEXT: <Type Name="Buzz">
25; CHECK-NEXT:   <DisplayString>Fourth test</DisplayString>
26; CHECK-NEXT: </Type>
27; CHECK-NEXT: </AutoVisualizer>
28
29; NEGATIVE:      ---INJECTED SOURCES---
30; NEGATIVE-NEXT: There are no injected sources.
31
32; PDB created by running `csc /debug Hello.cs`
33; RUN: llvm-pdbutil pretty -native -injected-sources -injected-source-content \
34; RUN:   %p/Inputs/dotnet_hashonly.pdb | FileCheck --check-prefix=HASH %s
35
36; HASH:      ---INJECTED SOURCES---
37; HASH:      C:\src\llvm-mono\Hello.cs (92 bytes): obj=<null>, vname=c:\src\llvm-mono\hello.cs, crc=269413292, compression=DotNet
38; HASH-NEXT: Compressed data (
39; HASH-NEXT:   0000: F862513F C607D311 905300C0 4FA302A1 C4454B99 E9E6D211 903F00C0 4FA302A1  |.bQ?.....S..O....EK......?..O...|
40; HASH-NEXT:   0020: 0B9D865A 1166D311 BD2A0000 F80849BD EC1618FF 5EAA104D 87F76F49 63833460  |...Z.f...*....I.....^..M..oIc.4`|
41; HASH-NEXT:   0040: 14000000 00000000 17299CBE 74FDDF66 FFCD5E08 CE34A775 D464C611           |.........)..t..f..^..4.u.d..|
42; HASH-NEXT: )
43
44; PDB created by running `csc /debug Hello.cs` with Hello.cs smaller than 200 bytes.
45; RUN: llvm-pdbutil pretty -native -injected-sources -injected-source-content \
46; RUN:   %p/Inputs/dotnet_contents_uncompressed.pdb | FileCheck --check-prefix=UNCOMP %s
47
48; UNCOMP:      ---INJECTED SOURCES---
49; UNCOMP:      C:\src\llvm-mono\Hello.cs (232 bytes): obj=<null>, vname=c:\src\llvm-mono\hello.cs, crc=323787205, compression=DotNet
50; UNCOMP-NEXT: Compressed data (
51; UNCOMP-NEXT:   0000: F862513F C607D311 905300C0 4FA302A1 C4454B99 E9E6D211 903F00C0 4FA302A1  |.bQ?.....S..O....EK......?..O...|
52; UNCOMP-NEXT:   0020: 0B9D865A 1166D311 BD2A0000 F80849BD EC1618FF 5EAA104D 87F76F49 63833460  |...Z.f...*....I.....^..M..oIc.4`|
53; UNCOMP-NEXT:   0040: 14000000 8C000000 17299CBE 74FDDF66 FFCD5E08 CE34A775 D464C611 00000000  |.........)..t..f..^..4.u.d......|
54; UNCOMP-NEXT:   0060: 6E616D65 73706163 65204865 6C6C6F57 6F726C64 207B0D0A 636C6173 73204865  |namespace HelloWorld {..class He|
55; UNCOMP-NEXT:   0080: 6C6C6F20 7B0D0A20 20737461 74696320 766F6964 204D6169 6E282920 7B205379  |llo {..  static void Main() { Sy|
56; UNCOMP-NEXT:   00A0: 7374656D 2E436F6E 736F6C65 2E577269 74654C69 6E652822 48656C6C 6F206173  |stem.Console.WriteLine("Hello as|
57; UNCOMP-NEXT:   00C0: 64666A6B 6C777763 6F697762 72796669 75667566 20576F72 6C642122 293B207D  |dfjklwwcoiwbryfiufuf World!"); }|
58; UNCOMP-NEXT:   00E0: 0D0A7D0D 0A7D0D0A                                                        |..}..}..|
59; UNCOMP-NEXT: )
60
61; PDB created by running `csc /debug Hello.cs` with Hello.cs larger than 200 bytes.
62; RUN: llvm-pdbutil pretty -native -injected-sources -injected-source-content \
63; RUN:   %p/Inputs/dotnet_contents_compressed.pdb | FileCheck --check-prefix=COMP %s
64
65; COMP:      ---INJECTED SOURCES---
66; COMP:      C:\src\llvm-mono\Hello.cs (218 bytes): obj=<null>, vname=c:\src\llvm-mono\hello.cs, crc=616104201, compression=DotNet
67; COMP-NEXT: Compressed data (
68; COMP-NEXT:   0000: F862513F C607D311 905300C0 4FA302A1 C4454B99 E9E6D211 903F00C0 4FA302A1  |.bQ?.....S..O....EK......?..O...|
69; COMP-NEXT:   0020: 0B9D865A 1166D311 BD2A0000 F80849BD EC1618FF 5EAA104D 87F76F49 63833460  |...Z.f...*....I.....^..M..oIc.4`|
70; COMP-NEXT:   0040: 14000000 7E000000 52CD36A0 6A9824CD A3034543 7FA9765E D572DA21 FB000000  |....~...R.6.j.$...EC..v^.r.!....|
71; COMP-NEXT:   0060: CB4BCC4D 2D2E484C 4E55F048 CDC9C90F CF2FCA49 51A8E6E5 4ACE492C 2E868881  |.K.M-.HLNU.H...../.IQ...J.I,....|
72; COMP-NEXT:   0080: B80A0AC5 25892599 C90A65F9 99290ABE 8999791A 9A0AD50A C195C525 A9B97ACE  |....%.%...e..)....y........%..z.|
73; COMP-NEXT:   00A0: F979C5F9 39A97AE1 459925A9 3E9979A9 1A4A109D 89C52969 59D939E5 E5C9F999  |.y..9.z.E.%.>.y..J....)iY.9.....|
74; COMP-NEXT:   00C0: E5494595 6999A569 A5690321 0CF698A2 92A6B542 2D2F1704 0100               |.IE.i..i.i.!.......B-/....|
75; COMP-NEXT: )
76