xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenOpenCL/vector_logops.cl (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -O3 %s -emit-llvm -o - | FileCheck %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuctypedef int int2 __attribute((ext_vector_type(2)));
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambucint test1()
6*f4a2713aSLionel Sambuc{
7*f4a2713aSLionel Sambuc  int2 a = (int2)(1,0);
8*f4a2713aSLionel Sambuc  int2 b = (int2)(1,1);
9*f4a2713aSLionel Sambuc  return (a&&b).x + (a||b).y;
10*f4a2713aSLionel Sambuc  // CHECK: ret i32 -2
11*f4a2713aSLionel Sambuc}
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambucint test2()
14*f4a2713aSLionel Sambuc{
15*f4a2713aSLionel Sambuc  int2 a = (int2)(1,0);
16*f4a2713aSLionel Sambuc  return (!a).y;
17*f4a2713aSLionel Sambuc  // CHECK: ret i32 -1
18*f4a2713aSLionel Sambuc}
19*f4a2713aSLionel Sambuc
20