brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.2 KiB · 379e8af Raw
112 lines · c
1// RUN: %clang_cc1 -target-feature +altivec -target-feature +vsx \2// RUN:   -faltivec-src-compat=mixed -triple powerpc-unknown-unknown \3// RUN:   -emit-llvm %s -o - | FileCheck %s --check-prefix=MIXED4// RUN: %clang_cc1 -target-feature +altivec -target-feature +vsx \5// RUN:   -faltivec-src-compat=mixed -triple powerpc64le-unknown-unknown \6// RUN:   -emit-llvm %s -o - | FileCheck %s --check-prefix=MIXED7// RUN: %clang_cc1 -target-feature +altivec -target-feature +vsx \8// RUN:   -faltivec-src-compat=xl -triple powerpc-unknown-unknown \9// RUN:   -emit-llvm %s -o - | FileCheck %s --check-prefix=XL10// RUN: %clang_cc1 -target-feature +altivec -target-feature +vsx \11// RUN:   -faltivec-src-compat=xl -triple powerpc64le-unknown-unknown \12// RUN:   -emit-llvm %s -o - | FileCheck %s --check-prefix=XL13// RUN: not %clang_cc1 -target-feature +altivec -target-feature +vsx \14// RUN:   -faltivec-src-compat=gcc -triple powerpc-unknown-unknown \15// RUN:   -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=GCC16// RUN: not %clang_cc1 -target-feature +altivec -target-feature +vsx \17// RUN:   -faltivec-src-compat=gcc -triple powerpc64le-unknown-unknown \18// RUN:   -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=GCC19// RUN: %clang -mcpu=pwr8 -faltivec-src-compat=mixed --target=powerpc-unknown-unknown \20// RUN:   -S -emit-llvm %s -o - | FileCheck %s --check-prefix=MIXED21// RUN: %clang -mcpu=pwr9 -faltivec-src-compat=mixed --target=powerpc-unknown-unknown \22// RUN:   -S -emit-llvm %s -o - | FileCheck %s --check-prefix=MIXED23// RUN: %clang -mcpu=pwr8 -faltivec-src-compat=xl --target=powerpc-unknown-unknown \24// RUN:   -S -emit-llvm %s -o - | FileCheck %s --check-prefix=XL25// RUN: %clang -mcpu=pwr9 -faltivec-src-compat=xl --target=powerpc-unknown-unknown \26// RUN:   -S -emit-llvm %s -o - | FileCheck %s --check-prefix=XL27// RUN: not %clang -mcpu=pwr8 -faltivec-src-compat=gcc --target=powerpc-unknown-unknown \28// RUN:   -S -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=GCC29// RUN: not %clang -mcpu=pwr9 -faltivec-src-compat=gcc --target=powerpc-unknown-unknown \30// RUN:   -S -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=GCC31 32// Vector bool type33vector bool char vbi8_1;34vector bool char vbi8_2;35 36vector bool short vbi16_1;37vector bool short vbi16_2;38 39vector bool int vbi32_1;40vector bool int vbi32_2;41 42vector bool long long vbi64_1;43vector bool long long vbi64_2;44 45// Vector pixel type46vector pixel p1;47 48////////////////////////////////////////////////////////////////////////////////49void test_vector_bool_pixel_init(void) {50  // vector bool char initialization51  vbi8_1 = (vector bool char)('a');52  // MIXED: <i8 97, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>53  // XL: splat (i8 97)54  // GCC: error: invalid conversion between vector type '__vector __bool unsigned char' (vector of 16 'unsigned char' values) and integer type 'unsigned char' of different size55  char c = 'c';56  vbi8_2 = (vector bool char)(c);57  // MIXED: [[INS:%.*]] = insertelement <16 x i8>58  // MIXED: store <16 x i8> [[INS:%.*]]59  // XL: [[INS_ELT:%.*]] = insertelement <16 x i8>60  // XL: [[SHUFF:%.*]] = shufflevector <16 x i8> [[INS_ELT]], <16 x i8> poison, <16 x i32> zeroinitializer61  // XL: store <16 x i8> [[SHUFF]]62  // GCC: error: invalid conversion between vector type '__vector __bool unsigned char' (vector of 16 'unsigned char' values) and integer type 'unsigned char' of different size63 64  // vector bool short initialization65  vbi16_1 = (vector bool short)(5);66  // MIXED: <i16 5, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>67  // XL: splat (i16 5)68  // GCC: error: invalid conversion between vector type '__vector __bool unsigned short' (vector of 8 'unsigned short' values) and integer type 'unsigned short' of different size69  short si16 = 55;70  vbi16_2 = (vector bool short)(si16);71  // MIXED: [[INS:%.*]] = insertelement <8 x i16>72  // MIXED: store <8 x i16> [[INS:%.*]]73  // XL: [[INS_ELT:%.*]] = insertelement <8 x i16>74  // XL: [[SHUFF:%.*]] = shufflevector <8 x i16> [[INS_ELT]], <8 x i16> poison, <8 x i32> zeroinitializer75  // XL: store <8 x i16> [[SHUFF]]76  // GCC: error: invalid conversion between vector type '__vector __bool unsigned short' (vector of 8 'unsigned short' values) and integer type 'unsigned short' of different size77 78  // vector bool int initialization79  vbi32_1 = (vector bool int)(9);80  // MIXED: <i32 9, i32 0, i32 0, i32 0>81  // XL: splat (i32 9)82  // GCC: error: invalid conversion between vector type '__vector __bool unsigned int' (vector of 4 'unsigned int' values) and integer type 'unsigned int' of different size83  int si32 = 99;84  vbi32_2 = (vector bool int)(si32);85  // MIXED: [[INS:%.*]] = insertelement <4 x i32>86  // MIXED: store <4 x i32> [[INS:%.*]]87  // XL: [[INS_ELT:%.*]] = insertelement <4 x i32>88  // XL: [[SHUFF:%.*]] = shufflevector <4 x i32> [[INS_ELT]], <4 x i32> poison, <4 x i32> zeroinitializer89  // XL: store <4 x i32> [[SHUFF]]90  // GCC: error: invalid conversion between vector type '__vector __bool unsigned int' (vector of 4 'unsigned int' values) and integer type 'unsigned int' of different size91 92  // vector bool long long initialization93  vbi64_1 = (vector bool long long)(13);94  // MIXED: <i64 13, i64 0>95  // XL: splat (i64 13)96  // GCC: error: invalid conversion between vector type '__vector __bool unsigned long long' (vector of 2 'unsigned long long' values) and integer type 'unsigned long long' of different size97  long long si64 = 1313;98  vbi64_2 = (vector bool long long)(si64);99  // MIXED: [[INS:%.*]] = insertelement <2 x i64>100  // MIXED: store <2 x i64> [[INS:%.*]]101  // XL: [[INS_ELT:%.*]] = insertelement <2 x i64>102  // XL: [[SHUFF:%.*]] = shufflevector <2 x i64> [[INS_ELT]], <2 x i64> poison, <2 x i32> zeroinitializer103  // XL: store <2 x i64> [[SHUFF]]104  // GCC: error: invalid conversion between vector type '__vector __bool unsigned long long' (vector of 2 'unsigned long long' values) and integer type 'unsigned long long' of different size105 106  // vector pixel initialization107  p1 = (vector pixel)(1);108  // MIXED: <i16 1, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>109  // XL: splat (i16 1)110  // GCC: error: invalid conversion between vector type '__vector __pixel ' (vector of 8 'unsigned short' values) and integer type 'unsigned short' of different size111}112