summary refs log tree commit diff stats
path: root/tests/tcg/hexagon/test_abs.S
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tcg/hexagon/test_abs.S')
-rw-r--r--tests/tcg/hexagon/test_abs.S17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/tcg/hexagon/test_abs.S b/tests/tcg/hexagon/test_abs.S
new file mode 100644
index 0000000000..d68aea6f64
--- /dev/null
+++ b/tests/tcg/hexagon/test_abs.S
@@ -0,0 +1,17 @@
+/* Purpose: test example, verify the soundness of the abs operation */
+
+    .text
+    .globl _start
+
+_start:
+    {
+        r1 = #-2
+        r2 = #2
+    }
+    {
+        r3 = abs(r1)
+    }
+    {
+        p0 = cmp.eq(r3, r2); if (p0.new) jump:t pass
+        jump fail
+    }