From 9f4dbff6669c8037f3b036bcf580d14f1a4f12a5 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 24 Nov 2014 09:15:30 +0000 Subject: Vendor import of clang RELEASE_350/final tag r216957 (effectively, 3.5.0 release): https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_350/final@216957 --- test/CodeGenCXX/mangle-template.cpp | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'test/CodeGenCXX/mangle-template.cpp') diff --git a/test/CodeGenCXX/mangle-template.cpp b/test/CodeGenCXX/mangle-template.cpp index 3b7f3027f6c2..998096a57be4 100644 --- a/test/CodeGenCXX/mangle-template.cpp +++ b/test/CodeGenCXX/mangle-template.cpp @@ -1,4 +1,6 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -verify -Wno-return-type -Wno-main -std=c++11 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s +// expected-no-diagnostics + namespace test1 { int x; template class T { }; @@ -145,7 +147,7 @@ namespace test10 { } } -// Report from Jason Merrill on cxx-abi-dev, 2012.01.04. +// Report from cxx-abi-dev, 2012.01.04. namespace test11 { int cmp(char a, char b); template struct A {}; @@ -156,7 +158,7 @@ namespace test11 { namespace test12 { // Make sure we can mangle non-type template args with internal linkage. - static int f(); + static int f() {} const int n = 10; template void test() {} void use() { @@ -182,3 +184,25 @@ namespace test13 { template short returnShort<-32768>(); // CHECK: @_ZN6test1311returnShortILsn32768EEEsv() } + +namespace test14 { + template inline int inl(bool b) { + if (b) { + static struct { + int field; + } a; + // CHECK: @_ZZN6test143inlIvEEibE1a + + return a.field; + } else { + static struct { + int field; + } a; + // CHECK: @_ZZN6test143inlIvEEibE1a_0 + + return a.field; + } + } + + int call(bool b) { return inl(b); } +} -- cgit v1.3