diff mbox series

[avr,committed] Add tests for PR83801.

Message ID b6a959ff-b564-41b1-6b61-8b6e17116276@gjlay.de
State New
Headers show
Series [avr,committed] Add tests for PR83801. | expand

Commit Message

Georg-Johann Lay Jan. 15, 2018, 10:06 a.m. UTC
Added the following avr specific test cases for the already fixed PR83801.

Johann


	PR c/83801
	PR c/83729
	* gcc.target/avr/torture/pr83729.c: New test.
	* gcc.target/avr/torture/pr83801.c: New test.
diff mbox series

Patch

Index: gcc.target/avr/torture/pr83729.c
===================================================================
--- gcc.target/avr/torture/pr83729.c	(nonexistent)
+++ gcc.target/avr/torture/pr83729.c	(working copy)
@@ -0,0 +1,17 @@ 
+/* { dg-options { "-std=gnu99" } } */
+/* { dg-do run { target { ! avr_tiny } } } */
+
+__attribute((noinline,noclone))
+char to_ascii (unsigned i)
+{
+    static const char __memx code_tab[] = "0123456789";
+    return code_tab[i];
+}
+
+int main()
+{
+  if (to_ascii (2) != '2')
+    __builtin_abort();
+
+  return 0;
+}
Index: gcc.target/avr/torture/pr83801.c
===================================================================
--- gcc.target/avr/torture/pr83801.c	(nonexistent)
+++ gcc.target/avr/torture/pr83801.c	(working copy)
@@ -0,0 +1,17 @@ 
+/* { dg-options { "-std=gnu99" } } */
+/* { dg-do run { target { ! avr_tiny } } } */
+
+__attribute((noinline,noclone))
+char to_ascii (unsigned i)
+{
+    static const char __flash code_tab[] = "0123456789";
+    return code_tab[i];
+}
+
+int main()
+{
+  if (to_ascii (2) != '2')
+    __builtin_abort();
+
+  return 0;
+}