[Piglit] [PATCH 1/2] Add a CL test for kernel names which match iso646.h definitions.
Aaron Watry
awatry at gmail.com
Tue Nov 27 19:49:25 PST 2012
Tests that the following C++ keywords which are also defined in iso646.h are
usable as valid kernel names:
and
and_eq
bitand
bitor
compl
not
not_eq
or
or_eq
xor
xor_eq
All tests currently pass on MacOS 10.7, but at least some of them fail on
Nvidia Linux.
---
tests/cl/program/execute/reserved-words.cl | 123 ++++++++++++++++++++++++++++
1 files changed, 123 insertions(+), 0 deletions(-)
create mode 100644 tests/cl/program/execute/reserved-words.cl
diff --git a/tests/cl/program/execute/reserved-words.cl b/tests/cl/program/execute/reserved-words.cl
new file mode 100644
index 0000000..a255506
--- /dev/null
+++ b/tests/cl/program/execute/reserved-words.cl
@@ -0,0 +1,123 @@
+/*!
+
+# OpenCL has declared all C99 keywords as reserved words.
+# At least one CL run-time incorrectly treats ISO646 Alternative Operator
+# Spellings defined in iso646.h as reserved (these are also C++ keywords).
+
+[config]
+name: Reserved Words
+
+dimensions: 1
+global_size: 1 0 0
+
+[test]
+name: and
+kernel_name: and
+arg_in: 1 int 1
+arg_out: 0 buffer int[1] 1
+
+[test]
+name: and_eq
+kernel_name: and_eq
+arg_in: 1 int 1
+arg_out: 0 buffer int[1] 2
+
+[test]
+name: bitand
+kernel_name: bitand
+arg_in: 1 int 1
+arg_out: 0 buffer int[1] 3
+
+[test]
+name: bitor
+kernel_name: bitor
+arg_in: 1 int 1
+arg_out: 0 buffer int[1] 4
+
+[test]
+name: compl
+kernel_name: compl
+arg_in: 1 int 1
+arg_out: 0 buffer int[1] 5
+
+[test]
+name: not
+kernel_name: not
+arg_in: 1 int 1
+arg_out: 0 buffer int[1] 6
+
+[test]
+name: not_eq
+kernel_name: not_eq
+arg_in: 1 int 1
+arg_out: 0 buffer int[1] 7
+
+[test]
+name: or
+kernel_name: or
+arg_in: 1 int 1
+arg_out: 0 buffer int[1] 8
+
+[test]
+name: or_eq
+kernel_name: or_eq
+arg_in: 1 int 1
+arg_out: 0 buffer int[1] 9
+
+[test]
+name: xor
+kernel_name: xor
+arg_in: 1 int 1
+arg_out: 0 buffer int[1] 10
+
+[test]
+name: xor_eq
+kernel_name: xor_eq
+arg_in: 1 int 1
+arg_out: 0 buffer int[1] 11
+
+!*/
+
+kernel void and(global int* out, int in){
+ out[0] = in * 1;
+}
+
+kernel void and_eq(global int* out, int in){
+ out[0] = in * 2;
+}
+
+kernel void bitand(global int* out, int in){
+ out[0] = in * 3;
+}
+
+kernel void bitor(global int* out, int in){
+ out[0] = in * 4;
+}
+
+kernel void compl(global int* out, int in){
+ out[0] = in * 5;
+}
+
+kernel void not(global int* out, int in){
+ out[0] = in * 6;
+}
+
+kernel void not_eq(global int* out, int in){
+ out[0] = in * 7;
+}
+
+kernel void or(global int* out, int in){
+ out[0] = in * 8;
+}
+
+kernel void or_eq(global int* out, int in){
+ out[0] = in * 9;
+}
+
+kernel void xor(global int* out, int in){
+ out[0] = in * 10;
+}
+
+kernel void xor_eq(global int* out, int in){
+ out[0] = in * 11;
+}
--
1.7.4.4
More information about the Piglit
mailing list