aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/special/weak-2.c
blob: 91a92e6ccc5dfb3393ac6b0c8b7fe55e1afac7d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do run } */
/* { dg-require-weak "" } */
/* { dg-additional-sources "weak-2a.c weak-2b.c" } */

/* NVPTX's implementation of weak is broken when a strong symbol is in
   a later object file than the weak definition.   */
/* { dg-skip-if "" { "nvptx-*-*" } "*" { "" } } */

#include <stdlib.h>

extern int foo(void);

int main(void) {

    if (foo())
        exit(0);
    else
        abort();
}