aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2013-03-26 16:56:59 +0000
committerReid Kleckner <reid@kleckner.net>2013-03-26 16:56:59 +0000
commit1232e279b4a0d98885b9672d3bb5905488360e49 (patch)
treefaef8810cae33e1dff44da009fc27eac97a70f5f /test/CodeGenCXX
parent76ed61788e88ab1f6345fd3611e1a618f1c334e3 (diff)
[ms-cxxabi] Mangle vector types
Summary: The only vector types a user can pass from MSVC code to clang code are the ones from *mmintrin.h, so we only have to match the MSVC mangling for these types. MSVC mangles the __m128 family of types as tag types, which we match. For other vector types, we emit a unique tag type mangling that won't match anything produced by MSVC. Reviewers: rjmccall CC: chandlerc, timurrrr, cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D576 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178036 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX')
-rw-r--r--test/CodeGenCXX/mangle-ms-vector-types.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/CodeGenCXX/mangle-ms-vector-types.cpp b/test/CodeGenCXX/mangle-ms-vector-types.cpp
new file mode 100644
index 0000000000..64cb7250a4
--- /dev/null
+++ b/test/CodeGenCXX/mangle-ms-vector-types.cpp
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -fms-extensions -ffreestanding -target-feature +avx -emit-llvm %s -o - -cxx-abi microsoft -triple=i686-pc-win32 | FileCheck %s
+
+#include <xmmintrin.h>
+#include <emmintrin.h>
+#include <immintrin.h>
+
+void foo64(__m64) {}
+// CHECK: define void @"\01?foo64@@YAXT__m64@@@Z"
+
+void foo128(__m128) {}
+// CHECK: define void @"\01?foo128@@YAXT__m128@@@Z"
+
+void foo128d(__m128d) {}
+// CHECK: define void @"\01?foo128d@@YAXU__m128d@@@Z"
+
+void foo128i(__m128i) {}
+// CHECK: define void @"\01?foo128i@@YAXT__m128i@@@Z"
+
+void foo256(__m256) {}
+// CHECK: define void @"\01?foo256@@YAXT__m256@@@Z"
+
+void foo256d(__m256d) {}
+// CHECK: define void @"\01?foo256d@@YAXU__m256d@@@Z"
+
+void foo256i(__m256i) {}
+// CHECK: define void @"\01?foo256i@@YAXT__m256i@@@Z"
+
+// We have a custom mangling for vector types not standardized by Intel.
+void foov8hi(__v8hi) {}
+// CHECK: define void @"\01?foov8hi@@YAXT__clang_vec8_F@@@Z"
+
+// Clang does not support vectors of complex types, so we can't test the
+// mangling of them.