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
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;
18 // Likewise for float inits.
19 constexpr vector
int CI2
= (vector
int)char(0);
23 constexpr vector
int CF1
= (vector
int)0.0;
27 constexpr vector
int CF2
= (vector
int)0.0f
;
32 // CHECK-LABEL: @_Z10testFloatsDv2_d
33 void testFloats(vector
double VD
) {
34 constexpr vector
double CI1
= (vector
double)0LL;
38 // Likewise for float inits.
39 constexpr vector
double CI2
= (vector
double)char(0);
43 constexpr vector
double CF1
= (vector
double)0.0;
47 constexpr vector
double CF2
= (vector
double)0.0f
;