From: Timur Iskhodzhanov Date: Wed, 27 Jun 2012 02:11:40 +0000 (+0000) Subject: Add a few (currently failing) tests for the PR13207 (template mangling in the presenc... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7249eb05c8edb3987f2971b2f68ec618712c113a;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159250 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGenCXX/mangle-ms-back-references.cpp b/test/CodeGenCXX/mangle-ms-back-references.cpp index e15f14b754..73e4d5c192 100644 --- a/test/CodeGenCXX/mangle-ms-back-references.cpp +++ b/test/CodeGenCXX/mangle-ms-back-references.cpp @@ -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@Z" @@ -109,6 +115,27 @@ void bar(NA::Y x) {} void spam(NA::Y x) {} // CHECK: "\01?spam@NB@PR13207@@YAXV?$Y@VX@NA@PR13207@@@NA@2@@Z" + +// The following CURRENT line is here to improve the precision of the "scanning +// from here" reports of FileCheck. +// CURRENT: "\01?spam@NB@PR13207@@YAXV?$Y@VX@NA@PR13207@@@NA@2@@Z" + +// The tests below currently fail: +void foobar(NA::Y > a, Y >) {} +// CURRENT: "\01?foobar@NB@PR13207@@YAXV?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@12@@Z" +// CORRECT: "\01?foobar@NB@PR13207@@YAXV?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V312@@Z" + +void foobarspam(Y a, NA::Y > b, Y >) {} +// CURRENT: "\01?foobarspam@NB@PR13207@@YAXV?$Y@VX@NB@PR13207@@@12@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@12@@Z" +// CORRECT: "\01?foobarspam@NB@PR13207@@YAXV?$Y@VX@NB@PR13207@@@12@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V412@@Z" + +void foobarbaz(Y a, NA::Y > b, Y >, Y > c) {} +// CURRENT: "\01?foobarbaz@NB@PR13207@@YAXV?$Y@VX@NB@PR13207@@@12@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@12@2@Z" +// CORRECT: "\01?foobarbaz@NB@PR13207@@YAXV?$Y@VX@NB@PR13207@@@12@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V412@2@Z" + +void foobarbazqux(Y a, NA::Y > b, Y >, Y > c , NA::Y > > d) {} +// CURRENT: "\01?foobarbazqux@NB@PR13207@@YAXV?$Y@VX@NB@PR13207@@@12@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@12@2V?$Y@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NB@PR13207@@@32@@Z" +// CORRECT: "\01?foobarbazqux@NB@PR13207@@YAXV?$Y@VX@NB@PR13207@@@12@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V412@2V?$Y@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NB@PR13207@@@52@@Z" } namespace NC {