[cfe-commits] r159250 - /cfe/trunk/test/CodeGenCXX/mangle-ms-back-references.cpp

Timur Iskhodzhanov timurrrr at google.com
Tue Jun 26 19:11:40 PDT 2012


Author: timurrrr
Date: Tue Jun 26 21:11:40 2012
New Revision: 159250

URL: http://llvm.org/viewvc/llvm-project?rev=159250&view=rev
Log:
Add a few (currently failing) tests for the PR13207 (template mangling in the presence of back references).

I've added an extra FileCheck pass for that with an extra "CURRENT" prefix.
I've carefully chosed the CURRENT/CORRECT prefixes so they
a) are self-descriptive
b) have the same length so the mangling between the current and the correct version is obvious

Feel free to ask me to change the prefixes if you know a better alternative.


Modified:
    cfe/trunk/test/CodeGenCXX/mangle-ms-back-references.cpp

Modified: cfe/trunk/test/CodeGenCXX/mangle-ms-back-references.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-ms-back-references.cpp?rev=159250&r1=159249&r2=159250&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-ms-back-references.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-ms-back-references.cpp Tue Jun 26 21:11:40 2012
@@ -1,5 +1,11 @@
 // RUN: %clang_cc1 -fms-extensions -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
 
+// NOTE on the "CURRENT" prefix: some things are mangled incorrectly as of
+// writing. If you find a CURRENT-test that fails with your patch, please test
+// if your patch has actually fixed a problem in the mangler and replace the
+// corresponding CORRECT line with a CHECK.
+// RUN: %clang_cc1 -fms-extensions -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck -check-prefix CURRENT %s
+
 void f1(const char* a, const char* b) {}
 // CHECK: "\01?f1@@YAXPBD0 at Z"
 
@@ -109,6 +115,27 @@
 
 void spam(NA::Y<NA::X> x) {}
 // CHECK: "\01?spam at NB@PR13207@@YAXV?$Y at VX@NA at PR13207@@@NA at 2@@Z"
+
+// The following CURRENT line is here to improve the precision of the "scanning
+// from here" reports of FileCheck.
+// CURRENT: "\01?spam at NB@PR13207@@YAXV?$Y at VX@NA at PR13207@@@NA at 2@@Z"
+
+// The tests below currently fail:
+void foobar(NA::Y<Y<X> > a, Y<Y<X> >) {}
+// CURRENT: "\01?foobar at NB@PR13207@@YAXV?$Y at V?$Y at VX@NB at PR13207@@@NB at PR13207@@@NA at 2@V?$Y at V?$Y at VX@NB at PR13207@@@NB at PR13207@@@12@@Z"
+// CORRECT: "\01?foobar at NB@PR13207@@YAXV?$Y at V?$Y at VX@NB at PR13207@@@NB at PR13207@@@NA at 2@V312@@Z"
+
+void foobarspam(Y<X> a, NA::Y<Y<X> > b, Y<Y<X> >) {}
+// CURRENT: "\01?foobarspam at NB@PR13207@@YAXV?$Y at VX@NB at PR13207@@@12 at V?$Y at V?$Y at VX@NB at PR13207@@@NB at PR13207@@@NA at 2@V?$Y at V?$Y at VX@NB at PR13207@@@NB at PR13207@@@12@@Z"
+// CORRECT: "\01?foobarspam at NB@PR13207@@YAXV?$Y at VX@NB at PR13207@@@12 at V?$Y at V?$Y at VX@NB at PR13207@@@NB at PR13207@@@NA at 2@V412@@Z"
+
+void foobarbaz(Y<X> a, NA::Y<Y<X> > b, Y<Y<X> >, Y<Y<X> > c) {}
+// CURRENT: "\01?foobarbaz at NB@PR13207@@YAXV?$Y at VX@NB at PR13207@@@12 at V?$Y at V?$Y at VX@NB at PR13207@@@NB at PR13207@@@NA at 2@V?$Y at V?$Y at VX@NB at PR13207@@@NB at PR13207@@@12 at 2@Z"
+// CORRECT: "\01?foobarbaz at NB@PR13207@@YAXV?$Y at VX@NB at PR13207@@@12 at V?$Y at V?$Y at VX@NB at PR13207@@@NB at PR13207@@@NA at 2@V412 at 2@Z"
+
+void foobarbazqux(Y<X> a, NA::Y<Y<X> > b, Y<Y<X> >, Y<Y<X> > c , NA::Y<Y<Y<X> > > d) {}
+// CURRENT: "\01?foobarbazqux at NB@PR13207@@YAXV?$Y at VX@NB at PR13207@@@12 at V?$Y at V?$Y at VX@NB at PR13207@@@NB at PR13207@@@NA at 2@V?$Y at V?$Y at VX@NB at PR13207@@@NB at PR13207@@@12 at 2V?$Y at V?$Y at V?$Y at VX@NB at PR13207@@@NB at PR13207@@@NB at PR13207@@@32@@Z"
+// CORRECT: "\01?foobarbazqux at NB@PR13207@@YAXV?$Y at VX@NB at PR13207@@@12 at V?$Y at V?$Y at VX@NB at PR13207@@@NB at PR13207@@@NA at 2@V412 at 2V?$Y at V?$Y at V?$Y at VX@NB at PR13207@@@NB at PR13207@@@NB at PR13207@@@52@@Z"
 }
 
 namespace NC {





More information about the cfe-commits mailing list