xref: /llvm-project/clang/test/CodeGenOpenCL/vector_odd.cl (revision cf4143b55e881519b06295e6954778d00f949c43)
1*cf4143b5SJoey Gouly// RUN: %clang_cc1 %s -O0 -emit-llvm -o - | FileCheck %s
2*cf4143b5SJoey Gouly
3*cf4143b5SJoey Goulytypedef unsigned char __attribute__((ext_vector_type(3))) uchar3;
4*cf4143b5SJoey Gouly
5*cf4143b5SJoey Gouly//CHECK: {{%.*}} = shufflevector <3 x i8> {{%.*}}, <3 x i8> <i8 1, i8 1, i8 undef>, <3 x i32> <i32 0, i32 3, i32 2>
6*cf4143b5SJoey Gouly
7*cf4143b5SJoey Goulykernel void test_odd_vector1 (uchar3 lhs)
8*cf4143b5SJoey Gouly{
9*cf4143b5SJoey Gouly  lhs.odd = 1;
10*cf4143b5SJoey Gouly}
11*cf4143b5SJoey Gouly
12*cf4143b5SJoey Gouly//CHECK: {{%.*}} = shufflevector <3 x i8> {{%.*}}, <3 x i8> <i8 2, i8 2, i8 undef>, <3 x i32> <i32 0, i32 1, i32 3>
13*cf4143b5SJoey Gouly
14*cf4143b5SJoey Goulykernel void test_odd_vector2 (uchar3 lhs)
15*cf4143b5SJoey Gouly{
16*cf4143b5SJoey Gouly  lhs.hi = 2;
17*cf4143b5SJoey Gouly}
18