summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2014-04-26 00:14:00 +0000
committerNick Lewycky <nicholas@mxc.ca>2014-04-26 00:14:00 +0000
commit0c2986f78e8f7b4f3207e1b0b7ff3a9253753185 (patch)
tree49c16504d029f3c432a39557501725884e662a03 /clang/test
parentd71f110fe92c0549499403cbfdd0da786991b7ad (diff)
downloadbcm5719-llvm-0c2986f78e8f7b4f3207e1b0b7ff3a9253753185.tar.gz
bcm5719-llvm-0c2986f78e8f7b4f3207e1b0b7ff3a9253753185.zip
Add mangling for attribute enable_if. The demangling patch for libcxxabi is still in review.
llvm-svn: 207296
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenCXX/enable_if.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/enable_if.cpp b/clang/test/CodeGenCXX/enable_if.cpp
new file mode 100644
index 00000000000..00c55c77490
--- /dev/null
+++ b/clang/test/CodeGenCXX/enable_if.cpp
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-linux-gnu| FileCheck %s
+// Test itanium mangling for attribute enable_if
+
+// CHECK: _Z5test1Ua9enable_ifIXeqfL0p_Li1EEEi
+void test1(int i) __attribute__((enable_if(i == 1, ""))) {}
+
+void ext();
+// CHECK: _Z5test2Ua9enable_ifIXneadL_Z3extvELi0EEEi
+void test2(int i) __attribute__((enable_if(&ext != 0, ""))) {}
+
+// CHECK: _Z5test3Ua9enable_ifIXeqfL0p_Li1EEXeqfL0p0_Li2EEEii
+void test3(int i, int j) __attribute__((enable_if(i == 1, ""), enable_if(j == 2, ""))) {}
+
+// CHECK: _ZN5test4IdE1fEUa9enable_ifIXeqfL0p_Li1EEXeqfL0p0_Li2EEEi
+template <typename T>
+class test4 {
+ virtual void f(int i, int j) __attribute__((enable_if(i == 1, ""))) __attribute__((enable_if(j == 2, "")));
+};
+
+template class test4<double>;
OpenPOWER on IntegriCloud