1 // Compile with "cl /c /Zi /GR- symbolformat.cpp" 2 // Compile symbolformat-fpo.cpp (see file for instructions) 3 // Link with "link symbolformat.obj symbolformat-fpo.obj /debug /nodefaultlib 4 // /entry:main /out:symbolformat.exe" 5 _purecall(void)6int __cdecl _purecall(void) { return 0; } 7 8 enum TestEnum { 9 Value, 10 Value10 = 10 11 }; 12 13 enum class TestEnumClass { 14 Value, 15 Value10 = 10 16 }; 17 18 struct A { PureFuncA19 virtual void PureFunc() = 0 {} VirtualFuncA20 virtual void VirtualFunc() {} RegularFuncA21 void RegularFunc() {} 22 }; 23 24 struct VirtualBase { 25 }; 26 27 struct B : public A, protected virtual VirtualBase { PureFuncB28 void PureFunc() override {} 29 }; 30 31 struct MemberTest { 32 enum NestedEnum { 33 FirstVal, 34 SecondVal 35 }; 36 37 typedef int NestedTypedef; 38 39 NestedEnum m_nested_enum; 40 NestedTypedef m_typedef; 41 bool m_bool; 42 char m_char; 43 wchar_t m_wchar_t; 44 int m_int; 45 unsigned m_unsigned; 46 long m_long; 47 unsigned long m_unsigned_long; 48 __int64 m_int64; 49 unsigned __int64 m_unsigned_int64; 50 float m_float; 51 double m_double; 52 void (*m_pfn_2_args)(int, double); 53 }; 54 55 typedef int IntType; 56 typedef A ClassAType; 57 58 int g_global_int; 59 void *g_global_pointer = nullptr; 60 main(int argc,char ** argv)61int main(int argc, char **argv) { 62 // Force symbol references so the linker generates debug info 63 B b; 64 MemberTest members; 65 auto PureAddr = &B::PureFunc; 66 auto VirtualAddr = &A::PureFunc; 67 auto RegularAddr = &A::RegularFunc; 68 TestEnum Enum = Value; 69 TestEnumClass EnumClass = TestEnumClass::Value10; 70 IntType Int = 12; 71 ClassAType *ClassA = &b; 72 return 0; 73 } 74