r206125 - [-fms-extensions] Add tests for __FUNCDNAME__
David Majnemer
david.majnemer at gmail.com
Sat Apr 12 19:29:56 PDT 2014
Author: majnemer
Date: Sat Apr 12 21:29:55 2014
New Revision: 206125
URL: http://llvm.org/viewvc/llvm-project?rev=206125&view=rev
Log:
[-fms-extensions] Add tests for __FUNCDNAME__
__FUNCDNAME__ was introduced way back in r194181 but I forgot to add
these tests.
Added:
cfe/trunk/test/SemaCXX/funcdname.cpp
Added: cfe/trunk/test/SemaCXX/funcdname.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/funcdname.cpp?rev=206125&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/funcdname.cpp (added)
+++ cfe/trunk/test/SemaCXX/funcdname.cpp Sat Apr 12 21:29:55 2014
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -std=c++1y -triple i386-pc-win32 -fms-compatibility -fms-extensions -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+int foo() {
+ static_assert(sizeof(__FUNCDNAME__) == 12, "?foo@@YAHXZ");
+ return 0;
+}
+
+// Within templates.
+template <typename T>
+int baz() {
+ static_assert(sizeof(__FUNCDNAME__) == 16, "??$baz at H@@YAHXZ");
+
+ return 0;
+}
+
+struct A {
+ A() {
+ static_assert(sizeof(__FUNCDNAME__) == 13, "??0A@@QAE at XZ");
+ }
+ ~A() {
+ static_assert(sizeof(__FUNCDNAME__) == 13, "??1A@@QAE at XZ");
+ }
+};
+
+int main() {
+ static_assert(sizeof(__FUNCDNAME__) == 5, "main");
+
+ baz<int>();
+
+ return 0;
+}
More information about the cfe-commits
mailing list