[InstCombine] Preserve NSW flags for `lshr (mul nuw X, C1), C2 -> mul nuw nsw X,...
[llvm-project.git] / clang / test / CodeGenCXX / mangle-ms-vector-types.cpp
blob6699c99deaec0039af24ebd0d9c898b70033c50f
1 // RUN: %clang_cc1 -fms-extensions -fcxx-exceptions -ffreestanding -target-feature +avx -emit-llvm %s -o - -triple=i686-pc-win32 | FileCheck %s
3 #include <xmmintrin.h>
4 #include <emmintrin.h>
5 #include <immintrin.h>
7 void thow(int i) {
8 switch (i) {
9 case 0: throw __m64();
10 // CHECK: ??_R0?AT__m64@@@8
11 // CHECK: _CT??_R0?AT__m64@@@88
12 // CHECK: _CTA1?AT__m64@@
13 // CHECK: _TI1?AT__m64@@
14 case 1: throw __m128();
15 // CHECK: ??_R0?AT__m128@@@8
16 // CHECK: _CT??_R0?AT__m128@@@816
17 // CHECK: _CTA1?AT__m128@@
18 // CHECK: _TI1?AT__m128@@
19 case 2: throw __m128d();
20 // CHECK: ??_R0?AU__m128d@@@8
21 // CHECK: _CT??_R0?AU__m128d@@@816
22 // CHECK: _CTA1?AU__m128d@@
23 // CHECK: _TI1?AU__m128d@@
24 case 3: throw __m128i();
25 // CHECK: ??_R0?AT__m128i@@@8
26 // CHECK: _CT??_R0?AT__m128i@@@816
27 // CHECK: _CTA1?AT__m128i@@
28 // CHECK: _TI1?AT__m128i@@
29 case 4: throw __m256();
30 // CHECK: ??_R0?AT__m256@@@8
31 // CHECK: _CT??_R0?AT__m256@@@832
32 // CHECK: _CTA1?AT__m256@@
33 // CHECK: _TI1?AT__m256@@
34 case 5: throw __m256d();
35 // CHECK: ??_R0?AU__m256d@@@8
36 // CHECK: _CT??_R0?AU__m256d@@@832
37 // CHECK: _CTA1?AU__m256d@@
38 // CHECK: _TI1?AU__m256d@@
39 case 6: throw __m256i();
40 // CHECK: ??_R0?AT__m256@@@8
41 // CHECK: _CT??_R0?AT__m256@@@832
42 // CHECK: _CTA1?AT__m256@@
43 // CHECK: _TI1?AT__m256@@
47 void foo64(__m64) {}
48 // CHECK: define dso_local void @"?foo64@@YAXT__m64@@@Z"
50 __m64 rfoo64() { return __m64(); }
51 // CHECK: define dso_local noundef <1 x i64> @"?rfoo64@@YA?AT__m64@@XZ"
53 void foo128(__m128) {}
54 // CHECK: define dso_local void @"?foo128@@YAXT__m128@@@Z"
56 const __m128 rfoo128() { return __m128(); }
57 // CHECK: define dso_local noundef <4 x float> @"?rfoo128@@YA?BT__m128@@XZ"
59 void foo128d(__m128d) {}
60 // CHECK: define dso_local void @"?foo128d@@YAXU__m128d@@@Z"
62 volatile __m128d rfoo128d() { return __m128d(); }
63 // CHECK: define dso_local noundef <2 x double> @"?rfoo128d@@YA?CU__m128d@@XZ"
65 void foo128i(__m128i) {}
66 // CHECK: define dso_local void @"?foo128i@@YAXT__m128i@@@Z"
68 const volatile __m128i rfoo128i() { return __m128i(); }
69 // CHECK: define dso_local noundef <2 x i64> @"?rfoo128i@@YA?DT__m128i@@XZ"
71 void foo256(__m256) {}
72 // CHECK: define dso_local void @"?foo256@@YAXT__m256@@@Z"
74 __m256 rfoo256() { return __m256(); }
75 // CHECK: define dso_local noundef <8 x float> @"?rfoo256@@YA?AT__m256@@XZ"
77 void foo256d(__m256d) {}
78 // CHECK: define dso_local void @"?foo256d@@YAXU__m256d@@@Z"
80 __m256d rfoo256d() { return __m256d(); }
81 // CHECK: define dso_local noundef <4 x double> @"?rfoo256d@@YA?AU__m256d@@XZ"
83 void foo256i(__m256i) {}
84 // CHECK: define dso_local void @"?foo256i@@YAXT__m256i@@@Z"
86 __m256i rfoo256i() { return __m256i(); }
87 // CHECK: define dso_local noundef <4 x i64> @"?rfoo256i@@YA?AT__m256i@@XZ"
89 // We have a custom mangling for vector types not standardized by Intel.
90 void foov8hi(__v8hi) {}
91 // CHECK: define dso_local void @"?foov8hi@@YAXT?$__vector@F$07@__clang@@@Z"
93 typedef __attribute__((ext_vector_type(4))) int vi4b;
94 void foovi4b(vi4b) {}
95 // CHECK: define dso_local void @"?foovi4b@@YAXT?$__vector@H$03@__clang@@@Z"
97 typedef float __attribute__((__ext_vector_type__(3))) vf3;
98 void foovf3(vf3) {}
99 // CHECK: define dso_local void @"?foovf3@@YAXT?$__vector@M$02@__clang@@@Z"
101 // Clang does not support vectors of complex types, so we can't test the
102 // mangling of them.