summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenOpenCL/vector_logops.cl
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2012-01-19 01:16:16 +0000
committerTanya Lattner <tonic@nondot.org>2012-01-19 01:16:16 +0000
commit3dd33b296a6b1d602ad7ffde9774e01077068ffe (patch)
tree5077783b703f57566fad60e45d6af20c19a79cd5 /clang/test/CodeGenOpenCL/vector_logops.cl
parent9e2c7f659e808c2188ad5b80d0f773add73e2965 (diff)
downloadbcm5719-llvm-3dd33b296a6b1d602ad7ffde9774e01077068ffe.tar.gz
bcm5719-llvm-3dd33b296a6b1d602ad7ffde9774e01077068ffe.zip
A few style changes.
Change CheckVectorLogicalOperands to pass params by ref. Add another test case. llvm-svn: 148452
Diffstat (limited to 'clang/test/CodeGenOpenCL/vector_logops.cl')
-rw-r--r--clang/test/CodeGenOpenCL/vector_logops.cl19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/CodeGenOpenCL/vector_logops.cl b/clang/test/CodeGenOpenCL/vector_logops.cl
new file mode 100644
index 00000000000..388f1d7eb74
--- /dev/null
+++ b/clang/test/CodeGenOpenCL/vector_logops.cl
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -O3 %s -emit-llvm -o - | FileCheck %s
+
+typedef int int2 __attribute((ext_vector_type(2)));
+
+int test1()
+{
+ int2 a = (int2)(1,0);
+ int2 b = (int2)(1,1);
+ return (a&&b).x + (a||b).y;
+ // CHECK: ret i32 -2
+}
+
+int test2()
+{
+ int2 a = (int2)(1,0);
+ return (!a).y;
+ // CHECK: ret i32 -1
+}
+
OpenPOWER on IntegriCloud