+# elif defined(OS_WINDOWS)
+
+#include <intrin.h>
+#pragma intrinsic(_ReturnAddress)
+
+struct Foo {
+ static void func(int x);
+};
+
+__declspec(noinline) void Foo::func(int x) {
+ volatile int a = x;
+ ++a;
+}
+
+TEST(Symbolize, SymbolizeWithDemangling) {
+ Foo::func(100);
+ const char* ret = TrySymbolize((void *)(&Foo::func));
+ EXPECT_STREQ("public: static void __cdecl Foo::func(int)", ret);
+}
+
+__declspec(noinline) void TestWithReturnAddress() {
+ void *return_address = _ReturnAddress();
+ const char *symbol = TrySymbolize(return_address);
+ CHECK(symbol != NULL);
+ CHECK_STREQ(symbol, "main");
+ cout << "Test case TestWithReturnAddress passed." << endl;
+}
+# endif // __ELF__
+#endif // HAVE_STACKTRACE
+