Debian Codegraph @

test/compile-strong-alias.c

raw
1 /* Copyright (C) 2018 Björn Esser <[email protected]>
2 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted.
5 *
6 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
7 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
8 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
9 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
10 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
11 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
12 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
13 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
14 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
15 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
16 * SUCH DAMAGE.
17 */
18
19 /* Simple compile test for our macro definition of strong_alias().
20 The sole purpose of this test is the fact some platforms do not
21 support strong aliases, some don't support aliases at all.
22 We test it just in case we may need this macro on those platforms
23 some time in the future. */
24
25 #include "crypt-port.h"
26
27 /* Prototype */
28 int addition (int, int);
29
30 int addition (int a, int b)
31 {
32 return a + b;
33 }
34 strong_alias (addition, add);
35
36 int
37 main (void)
38 {
39 int a = 1;
40 int b = -1;
41
42 return add (a, b);
43 }