testsuite: Add testcase for already fixed PR [PR90311]
authorJakub Jelinek <jakub@redhat.com>
Thu, 5 Mar 2020 15:59:58 +0000 (16:59 +0100)
committerJakub Jelinek <jakub@redhat.com>
Thu, 5 Mar 2020 15:59:58 +0000 (16:59 +0100)
2020-03-05  Jakub Jelinek  <jakub@redhat.com>

PR target/90311
* gcc.c-torture/execute/pr90311.c: New test.

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr90311.c [new file with mode: 0644]

index bac662302fbd2a7ce1d3ced3cadfcd74f8fb4455..8c693ea08d68ed69f2b81ffee87d89ebc0e8264d 100644 (file)
@@ -1,3 +1,8 @@
+2020-03-05  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/90311
+       * gcc.c-torture/execute/pr90311.c: New test.
+
 2020-03-05  Jeff Law  <law@redhat.com>
 
        * gcc.target/arm/fuse-caller-save.c: Generalize expected output.
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr90311.c b/gcc/testsuite/gcc.c-torture/execute/pr90311.c
new file mode 100644 (file)
index 0000000..af8cde6
--- /dev/null
@@ -0,0 +1,16 @@
+/* PR rtl-optimization/90311 */
+
+int a, b;
+
+int
+main ()
+{
+  unsigned long long x;
+  unsigned int c;
+  __builtin_add_overflow ((unsigned char) a, b, &c);
+  b -= c < (unsigned char) a;
+  x = b;
+  if (x)
+    __builtin_abort ();
+  return 0;
+}