aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/mangle-template.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/mangle-template.cpp')
-rw-r--r--test/CodeGenCXX/mangle-template.cpp30
1 files changed, 27 insertions, 3 deletions
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 <int& D> 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 <typename T, int (*cmp)(T, T)> 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<typename T, T v> void test() {}
void use() {
@@ -182,3 +184,25 @@ namespace test13 {
template short returnShort<-32768>();
// CHECK: @_ZN6test1311returnShortILsn32768EEEsv()
}
+
+namespace test14 {
+ template <typename> 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<void>(b); }
+}