aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/backend/bitwise-ops.c
diff options
authorPekka Enberg <penberg@kernel.org>2011-08-27 15:39:20 +0300
committerPekka Enberg <penberg@kernel.org>2011-08-27 15:43:31 +0300
commit397ea4ed08f699ac84d8fa1e4470b15a2632b2e1 (patch)
tree8105643b8da5e1fb0563a361aef59cf0f0ca9ffc /validation/backend/bitwise-ops.c
parent638debc6162ecb79061bbe8095d203d47c1a31d0 (diff)
downloadsparse-dev-397ea4ed08f699ac84d8fa1e4470b15a2632b2e1.tar.gz
sparse, llvm: Reorganize code generation tests
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'validation/backend/bitwise-ops.c')
-rw-r--r--validation/backend/bitwise-ops.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/validation/backend/bitwise-ops.c b/validation/backend/bitwise-ops.c
new file mode 100644
index 00000000..aa1029e4
--- /dev/null
+++ b/validation/backend/bitwise-ops.c
@@ -0,0 +1,54 @@
+static int shl(int x, int y)
+{
+ return x << y;
+}
+
+static unsigned int ushl(unsigned int x, unsigned int y)
+{
+ return x << y;
+}
+
+static int shr(int x, int y)
+{
+ return x >> y;
+}
+
+static unsigned int ushr(unsigned int x, unsigned int y)
+{
+ return x >> y;
+}
+
+static int and(int x, int y)
+{
+ return x & y;
+}
+
+static unsigned int uand(unsigned int x, unsigned int y)
+{
+ return x & y;
+}
+
+static int or(int x, int y)
+{
+ return x | y;
+}
+
+static unsigned int uor(unsigned int x, unsigned int y)
+{
+ return x | y;
+}
+
+static int xor(int x, int y)
+{
+ return x ^ y;
+}
+
+static unsigned int uxor(unsigned int x, unsigned int y)
+{
+ return x ^ y;
+}
+
+/*
+ * check-name: Bitwise operator code generation
+ * check-command: ./sparsec -c $file -o tmp.o
+ */