[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / builtins-systemz-zvector.cpp
blobf6ce7114ed2fe2a20caa41765d2d04801346dfe8
1 // REQUIRES: systemz-registered-target
2 // RUN: %clang_cc1 -target-cpu z13 -triple s390x-linux-gnu \
3 // RUN: -fzvector -flax-vector-conversions=none -std=c++11 \
4 // RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s
6 bool gb;
8 // There was an issue where we weren't properly converting constexprs to
9 // vectors with elements of the appropriate width. (e.g.
10 // (vector signed short)0 would be lowered as [4 x i32] in some cases)
12 // CHECK-LABEL: @_Z8testIntsDv4_i
13 void testInts(vector int VI) {
14 constexpr vector int CI1 = (vector int)0LL;
15 // CHECK: icmp
16 gb = (VI == CI1)[0];
18 // Likewise for float inits.
19 constexpr vector int CI2 = (vector int)char(0);
20 // CHECK: icmp
21 gb = (VI == CI2)[0];
23 constexpr vector int CF1 = (vector int)0.0;
24 // CHECK: icmp
25 gb = (VI == CF1)[0];
27 constexpr vector int CF2 = (vector int)0.0f;
28 // CHECK: icmp
29 gb = (VI == CF2)[0];
32 // CHECK-LABEL: @_Z10testFloatsDv2_d
33 void testFloats(vector double VD) {
34 constexpr vector double CI1 = (vector double)0LL;
35 // CHECK: fcmp
36 gb = (VD == CI1)[0];
38 // Likewise for float inits.
39 constexpr vector double CI2 = (vector double)char(0);
40 // CHECK: fcmp
41 gb = (VD == CI2)[0];
43 constexpr vector double CF1 = (vector double)0.0;
44 // CHECK: fcmp
45 gb = (VD == CF1)[0];
47 constexpr vector double CF2 = (vector double)0.0f;
48 // CHECK: fcmp
49 gb = (VD == CF2)[0];