diff options
Diffstat (limited to 'unittests/SymbolFile/PDB/Inputs')
-rw-r--r-- | unittests/SymbolFile/PDB/Inputs/test-dwarf.cpp | 14 | ||||
-rw-r--r-- | unittests/SymbolFile/PDB/Inputs/test-dwarf.exe | bin | 0 -> 6144 bytes | |||
-rw-r--r-- | unittests/SymbolFile/PDB/Inputs/test-pdb-alt.cpp | 9 | ||||
-rw-r--r-- | unittests/SymbolFile/PDB/Inputs/test-pdb-nested.h | 9 | ||||
-rw-r--r-- | unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp | 86 | ||||
-rw-r--r-- | unittests/SymbolFile/PDB/Inputs/test-pdb-types.exe | bin | 0 -> 7168 bytes | |||
-rw-r--r-- | unittests/SymbolFile/PDB/Inputs/test-pdb-types.pdb | bin | 0 -> 143360 bytes | |||
-rw-r--r-- | unittests/SymbolFile/PDB/Inputs/test-pdb.cpp | 15 | ||||
-rw-r--r-- | unittests/SymbolFile/PDB/Inputs/test-pdb.exe | bin | 0 -> 7168 bytes | |||
-rw-r--r-- | unittests/SymbolFile/PDB/Inputs/test-pdb.h | 13 | ||||
-rw-r--r-- | unittests/SymbolFile/PDB/Inputs/test-pdb.pdb | bin | 0 -> 110592 bytes |
11 files changed, 146 insertions, 0 deletions
diff --git a/unittests/SymbolFile/PDB/Inputs/test-dwarf.cpp b/unittests/SymbolFile/PDB/Inputs/test-dwarf.cpp new file mode 100644 index 000000000000..f86ff3d875b4 --- /dev/null +++ b/unittests/SymbolFile/PDB/Inputs/test-dwarf.cpp @@ -0,0 +1,14 @@ +// Compile with "cl /c /Zi /GR- test.cpp" +// Link with "link test.obj /debug /nodefaultlib /entry:main /out:test.exe" + +int __cdecl _purecall(void) +{ + return 0; +} + +int +main(int argc, char **argv) +{ + + return 0; +} diff --git a/unittests/SymbolFile/PDB/Inputs/test-dwarf.exe b/unittests/SymbolFile/PDB/Inputs/test-dwarf.exe Binary files differnew file mode 100644 index 000000000000..15e1910b4b8b --- /dev/null +++ b/unittests/SymbolFile/PDB/Inputs/test-dwarf.exe diff --git a/unittests/SymbolFile/PDB/Inputs/test-pdb-alt.cpp b/unittests/SymbolFile/PDB/Inputs/test-pdb-alt.cpp new file mode 100644 index 000000000000..d36f15e53fb7 --- /dev/null +++ b/unittests/SymbolFile/PDB/Inputs/test-pdb-alt.cpp @@ -0,0 +1,9 @@ +// Compile with "cl /c /Zi /GR- test-pdb-alt.cpp" +// Link with "link test-pdb.obj test-pdb-alt.obj /debug /nodefaultlib /entry:main /out:test-pdb.exe" + +#include "test-pdb.h" + +int bar(int n) +{ + return n-1; +} diff --git a/unittests/SymbolFile/PDB/Inputs/test-pdb-nested.h b/unittests/SymbolFile/PDB/Inputs/test-pdb-nested.h new file mode 100644 index 000000000000..fc63b50d13c9 --- /dev/null +++ b/unittests/SymbolFile/PDB/Inputs/test-pdb-nested.h @@ -0,0 +1,9 @@ +#ifndef TEST_PDB_NESTED_H +#define TEST_PDB_NESTED_H + +inline int baz(int n) +{ + return n+1; +} + +#endif
\ No newline at end of file diff --git a/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp b/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp new file mode 100644 index 000000000000..5e2fb77bc202 --- /dev/null +++ b/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp @@ -0,0 +1,86 @@ +// Compile with "cl /c /Zi /GR- /EHsc test-pdb-types.cpp" +// Link with "link test-pdb-types.obj /debug /nodefaultlib /entry:main /out:test-pdb-types.exe" + +using namespace std; + +// Sizes of builtin types +static const int sizeof_char = sizeof(char); +static const int sizeof_uchar = sizeof(unsigned char); +static const int sizeof_short = sizeof(short); +static const int sizeof_ushort = sizeof(unsigned short); +static const int sizeof_int = sizeof(int); +static const int sizeof_uint = sizeof(unsigned int); +static const int sizeof_long = sizeof(long); +static const int sizeof_ulong = sizeof(unsigned long); +static const int sizeof_longlong = sizeof(long long); +static const int sizeof_ulonglong = sizeof(unsigned long long); +static const int sizeof_int64 = sizeof(__int64); +static const int sizeof_uint64 = sizeof(unsigned __int64); +static const int sizeof_float = sizeof(float); +static const int sizeof_double = sizeof(double); +static const int sizeof_bool = sizeof(bool); +static const int sizeof_wchar = sizeof(wchar_t); + +enum Enum +{ + EValue1 = 1, + EValue2 = 2, +}; + +enum ShortEnum : short +{ + ESValue1 = 1, + ESValue2 = 2 +}; + +namespace NS +{ +class NSClass +{ + float f; + double d; +}; +} + +class Class +{ +public: + class NestedClass + { + Enum e; + }; + ShortEnum se; +}; + +int +test_func(int a, int b) +{ + return a + b; +} + +typedef Class ClassTypedef; +typedef NS::NSClass NSClassTypedef; +int GlobalArray[10]; + +static const int sizeof_NSClass = sizeof(NS::NSClass); +static const int sizeof_Class = sizeof(Class); +static const int sizeof_NestedClass = sizeof(Class::NestedClass); +static const int sizeof_Enum = sizeof(Enum); +static const int sizeof_ShortEnum = sizeof(ShortEnum); +static const int sizeof_ClassTypedef = sizeof(ClassTypedef); +static const int sizeof_NSClassTypedef = sizeof(NSClassTypedef); +static const int sizeof_GlobalArray = sizeof(GlobalArray); + +int +main(int argc, char **argv) +{ + ShortEnum e1; + Enum e2; + Class c1; + Class::NestedClass c2; + NS::NSClass c3; + + ClassTypedef t1; + NSClassTypedef t2; + return test_func(1, 2); +} diff --git a/unittests/SymbolFile/PDB/Inputs/test-pdb-types.exe b/unittests/SymbolFile/PDB/Inputs/test-pdb-types.exe Binary files differnew file mode 100644 index 000000000000..21a4bd2b4ef5 --- /dev/null +++ b/unittests/SymbolFile/PDB/Inputs/test-pdb-types.exe diff --git a/unittests/SymbolFile/PDB/Inputs/test-pdb-types.pdb b/unittests/SymbolFile/PDB/Inputs/test-pdb-types.pdb Binary files differnew file mode 100644 index 000000000000..acf241bcb5d6 --- /dev/null +++ b/unittests/SymbolFile/PDB/Inputs/test-pdb-types.pdb diff --git a/unittests/SymbolFile/PDB/Inputs/test-pdb.cpp b/unittests/SymbolFile/PDB/Inputs/test-pdb.cpp new file mode 100644 index 000000000000..c9bf057cfbfb --- /dev/null +++ b/unittests/SymbolFile/PDB/Inputs/test-pdb.cpp @@ -0,0 +1,15 @@ +// Compile with "cl /c /Zi /GR- test-pdb.cpp" +// Link with "link test-pdb.obj /debug /nodefaultlib /entry:main /out:test-pdb.exe" + +#include "test-pdb.h" + +int __cdecl _purecall(void) +{ + return 0; +} + +int +main(int argc, char **argv) +{ + return foo(argc) + bar(argc); +} diff --git a/unittests/SymbolFile/PDB/Inputs/test-pdb.exe b/unittests/SymbolFile/PDB/Inputs/test-pdb.exe Binary files differnew file mode 100644 index 000000000000..3a2c64504ed9 --- /dev/null +++ b/unittests/SymbolFile/PDB/Inputs/test-pdb.exe diff --git a/unittests/SymbolFile/PDB/Inputs/test-pdb.h b/unittests/SymbolFile/PDB/Inputs/test-pdb.h new file mode 100644 index 000000000000..273343bb03b0 --- /dev/null +++ b/unittests/SymbolFile/PDB/Inputs/test-pdb.h @@ -0,0 +1,13 @@ +#ifndef TEST_PDB_H +#define TEST_PDB_H + +#include "test-pdb-nested.h" + +int bar(int n); + +inline int foo(int n) +{ + return baz(n)+1; +} + +#endif
\ No newline at end of file diff --git a/unittests/SymbolFile/PDB/Inputs/test-pdb.pdb b/unittests/SymbolFile/PDB/Inputs/test-pdb.pdb Binary files differnew file mode 100644 index 000000000000..f43d334d215a --- /dev/null +++ b/unittests/SymbolFile/PDB/Inputs/test-pdb.pdb |