brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · f6ce711 Raw
51 lines · cpp
1// REQUIRES: systemz-registered-target2// 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 %s5 6bool gb;7 8// There was an issue where we weren't properly converting constexprs to9// vectors with elements of the appropriate width. (e.g.10// (vector signed short)0 would be lowered as [4 x i32] in some cases)11 12// CHECK-LABEL: @_Z8testIntsDv4_i13void testInts(vector int VI) {14  constexpr vector int CI1 = (vector int)0LL;15  // CHECK: icmp16  gb = (VI == CI1)[0];17 18  // Likewise for float inits.19  constexpr vector int CI2 = (vector int)char(0);20  // CHECK: icmp21  gb = (VI == CI2)[0];22 23  constexpr vector int CF1 = (vector int)0.0;24  // CHECK: icmp25  gb = (VI == CF1)[0];26 27  constexpr vector int CF2 = (vector int)0.0f;28  // CHECK: icmp29  gb = (VI == CF2)[0];30}31 32// CHECK-LABEL: @_Z10testFloatsDv2_d33void testFloats(vector double VD) {34  constexpr vector double CI1 = (vector double)0LL;35  // CHECK: fcmp36  gb = (VD == CI1)[0];37 38  // Likewise for float inits.39  constexpr vector double CI2 = (vector double)char(0);40  // CHECK: fcmp41  gb = (VD == CI2)[0];42 43  constexpr vector double CF1 = (vector double)0.0;44  // CHECK: fcmp45  gb = (VD == CF1)[0];46 47  constexpr vector double CF2 = (vector double)0.0f;48  // CHECK: fcmp49  gb = (VD == CF2)[0];50}51