gcc/testsuite/g++.old-deja/g++.other/builtins6.C
raw| 1 | // { dg-do run } |
| 2 | // { dg-options "-O2" } |
| 3 | // Test that built-in functions are recognized with a prototype. |
| 4 | // Origin: Roger Sayle Mar 20, 2002 |
| 5 | // Copyright (C) 2002 Free Software Foundation. |
| 6 | // |
| 7 | |
| 8 | typedef __SIZE_TYPE__ size_t; |
| 9 | extern "C" size_t strlen (const char*); |
| 10 | extern "C" void link_error (void); |
| 11 | |
| 12 | int |
| 13 | main () |
| 14 | { |
| 15 | if (strlen ("foo") != 3) |
| 16 | link_error (); |
| 17 | return 0; |
| 18 | } |
| 19 |