aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/csky/ck801-constpool.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/csky/ck801-constpool.c')
-rw-r--r--gcc/testsuite/gcc.target/csky/ck801-constpool.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/csky/ck801-constpool.c b/gcc/testsuite/gcc.target/csky/ck801-constpool.c
new file mode 100644
index 0000000..5c92f39
--- /dev/null
+++ b/gcc/testsuite/gcc.target/csky/ck801-constpool.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck801" { csky-*-* } { "*" } { "-mcpu=ck801" } } */
+/* { dg-csky-options "-O1" } */
+
+/* Make sure that constant pools are emitted by the compiler for ck801.
+ If this is deferred to the assembler, the compiler will compute
+ incorrect branch offsets. */
+
+void f (unsigned int *u, long long int *l, float *f, double *d)
+{
+ *u = 0xdeadbeef;
+ *l = 0xcafef00dc0ffeeULL;
+ *f = 3.14159F;
+ *d = 2.718281828459;
+}
+
+/* { dg-final { scan-assembler-times "\\.long" 6 } } */