diff gcc/testsuite/c-c++-common/torture/pr60971.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/c-c++-common/torture/pr60971.c	Fri Oct 27 22:46:09 2017 +0900
@@ -0,0 +1,34 @@
+/* PR tree-optimization/60971 */
+/* { dg-do run } */
+
+#ifndef __cplusplus
+#define bool _Bool
+#endif
+
+volatile unsigned char c;
+
+__attribute__((noinline)) unsigned char
+foo (void)
+{
+  return c;
+}
+
+__attribute__((noinline)) bool
+bar (void)
+{
+  return foo () & 1;
+}
+
+int
+main ()
+{
+  c = 0x41;
+  c = bar ();
+  if (c != 1)
+    __builtin_abort ();
+  c = 0x20;
+  c = bar ();
+  if (c != 0)
+    __builtin_abort ();
+  return 0;
+}