114f5a3b0Smrg /* edtest2.c -- Test for libbacktrace storage allocation stress handling (p2)
2*b1e83836Smrg Copyright (C) 2017-2022 Free Software Foundation, Inc.
314f5a3b0Smrg
414f5a3b0Smrg Redistribution and use in source and binary forms, with or without
514f5a3b0Smrg modification, are permitted provided that the following conditions are
614f5a3b0Smrg met:
714f5a3b0Smrg
814f5a3b0Smrg (1) Redistributions of source code must retain the above copyright
914f5a3b0Smrg notice, this list of conditions and the following disclaimer.
1014f5a3b0Smrg
1114f5a3b0Smrg (2) Redistributions in binary form must reproduce the above copyright
1214f5a3b0Smrg notice, this list of conditions and the following disclaimer in
1314f5a3b0Smrg the documentation and/or other materials provided with the
1414f5a3b0Smrg distribution.
1514f5a3b0Smrg
1614f5a3b0Smrg (3) The name of the author may not be used to
1714f5a3b0Smrg endorse or promote products derived from this software without
1814f5a3b0Smrg specific prior written permission.
1914f5a3b0Smrg
2014f5a3b0Smrg THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2114f5a3b0Smrg IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2214f5a3b0Smrg WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
2314f5a3b0Smrg DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
2414f5a3b0Smrg INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2514f5a3b0Smrg (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2614f5a3b0Smrg SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2714f5a3b0Smrg HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
2814f5a3b0Smrg STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
2914f5a3b0Smrg IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3014f5a3b0Smrg POSSIBILITY OF SUCH DAMAGE. */
3114f5a3b0Smrg
3214f5a3b0Smrg /* This file intentionally written without any #include's
3314f5a3b0Smrg */
3414f5a3b0Smrg
3514f5a3b0Smrg extern int f3(int, int);
3614f5a3b0Smrg extern int f2(int);
3714f5a3b0Smrg
f2(int x)3814f5a3b0Smrg int f2(int x)
3914f5a3b0Smrg {
4014f5a3b0Smrg /* Returning a value here and elsewhere avoids a tailcall which
4114f5a3b0Smrg would mess up the backtrace. */
4214f5a3b0Smrg return f3(x, __LINE__) + 3;
4314f5a3b0Smrg }
44