# HG changeset patch
# User Luis Felipe Tabera Alonso <lftabera@yahoo.es>
# Parent cc9a7f502721833cc3291a91c0224e83066d885c
#11771 sage crashes on some degenerate flint xgcd's

diff -r cc9a7f502721 sage/rings/polynomial/polynomial_rational_flint.pyx
--- a/sage/rings/polynomial/polynomial_rational_flint.pyx	Tue Sep 06 14:51:26 2011 +0200
+++ b/sage/rings/polynomial/polynomial_rational_flint.pyx	Tue Oct 04 16:52:39 2011 +0200
@@ -911,6 +911,19 @@
             sage: g = -3 + 1/7 * t
             sage: f.xgcd(g)
             (1, -12/5095, -84/5095*t - 1701/5095)
+
+        TESTS::
+
+        The following example used to crash. See #11771::
+
+            sage: R.<t> = QQ[]
+            sage: f = 10**383 * (t+1)
+            sage: g = 10**445 * t^2 + 1
+            sage: r = f.xgcd(g)
+            sage: r[0] == f.gcd(g)
+            True
+            sage: r[1]*f + r[2]*g == r[0]
+            True
         """
         cdef Polynomial_rational_flint d = self._new()
         cdef Polynomial_rational_flint s = self._new()
