1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -faltivec -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
2*0a6a1f1dSLionel Sambuc 
3*0a6a1f1dSLionel Sambuc typedef short v2i16 __attribute__((vector_size (4)));
4*0a6a1f1dSLionel Sambuc typedef short v3i16 __attribute__((vector_size (6)));
5*0a6a1f1dSLionel Sambuc typedef short v4i16 __attribute__((vector_size (8)));
6*0a6a1f1dSLionel Sambuc typedef short v6i16 __attribute__((vector_size (12)));
7*0a6a1f1dSLionel Sambuc typedef short v8i16 __attribute__((vector_size (16)));
8*0a6a1f1dSLionel Sambuc typedef short v16i16 __attribute__((vector_size (32)));
9*0a6a1f1dSLionel Sambuc 
10*0a6a1f1dSLionel Sambuc struct v16i16 { v16i16 x; };
11*0a6a1f1dSLionel Sambuc 
12*0a6a1f1dSLionel Sambuc // CHECK: define i32 @test_v2i16(i32 %x.coerce)
test_v2i16(v2i16 x)13*0a6a1f1dSLionel Sambuc v2i16 test_v2i16(v2i16 x)
14*0a6a1f1dSLionel Sambuc {
15*0a6a1f1dSLionel Sambuc   return x;
16*0a6a1f1dSLionel Sambuc }
17*0a6a1f1dSLionel Sambuc 
18*0a6a1f1dSLionel Sambuc // CHECK: define i64 @test_v3i16(i64 %x.coerce)
test_v3i16(v3i16 x)19*0a6a1f1dSLionel Sambuc v3i16 test_v3i16(v3i16 x)
20*0a6a1f1dSLionel Sambuc {
21*0a6a1f1dSLionel Sambuc   return x;
22*0a6a1f1dSLionel Sambuc }
23*0a6a1f1dSLionel Sambuc 
24*0a6a1f1dSLionel Sambuc // CHECK: define i64 @test_v4i16(i64 %x.coerce)
test_v4i16(v4i16 x)25*0a6a1f1dSLionel Sambuc v4i16 test_v4i16(v4i16 x)
26*0a6a1f1dSLionel Sambuc {
27*0a6a1f1dSLionel Sambuc   return x;
28*0a6a1f1dSLionel Sambuc }
29*0a6a1f1dSLionel Sambuc 
30*0a6a1f1dSLionel Sambuc // CHECK: define <6 x i16> @test_v6i16(<6 x i16> %x)
test_v6i16(v6i16 x)31*0a6a1f1dSLionel Sambuc v6i16 test_v6i16(v6i16 x)
32*0a6a1f1dSLionel Sambuc {
33*0a6a1f1dSLionel Sambuc   return x;
34*0a6a1f1dSLionel Sambuc }
35*0a6a1f1dSLionel Sambuc 
36*0a6a1f1dSLionel Sambuc // CHECK: define <8 x i16> @test_v8i16(<8 x i16> %x)
test_v8i16(v8i16 x)37*0a6a1f1dSLionel Sambuc v8i16 test_v8i16(v8i16 x)
38*0a6a1f1dSLionel Sambuc {
39*0a6a1f1dSLionel Sambuc   return x;
40*0a6a1f1dSLionel Sambuc }
41*0a6a1f1dSLionel Sambuc 
42*0a6a1f1dSLionel Sambuc // CHECK: define void @test_v16i16(<16 x i16>* noalias sret %agg.result, <16 x i16>*)
test_v16i16(v16i16 x)43*0a6a1f1dSLionel Sambuc v16i16 test_v16i16(v16i16 x)
44*0a6a1f1dSLionel Sambuc {
45*0a6a1f1dSLionel Sambuc   return x;
46*0a6a1f1dSLionel Sambuc }
47*0a6a1f1dSLionel Sambuc 
48*0a6a1f1dSLionel Sambuc // CHECK: define void @test_struct_v16i16(%struct.v16i16* noalias sret %agg.result, [2 x i128] %x.coerce)
test_struct_v16i16(struct v16i16 x)49*0a6a1f1dSLionel Sambuc struct v16i16 test_struct_v16i16(struct v16i16 x)
50*0a6a1f1dSLionel Sambuc {
51*0a6a1f1dSLionel Sambuc   return x;
52*0a6a1f1dSLionel Sambuc }
53