Raul Tambre | e09107a | 2020-09-04 19:10:09 +0300 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm-only %s |
| 2 | |
| 3 | // PR45410 |
| 4 | // Ensure we mark local extern redeclarations with a different type as non-builtin. |
| 5 | void non_builtin() { |
| 6 | extern float exp(); |
| 7 | exp(); // Will crash due to wrong number of arguments if this calls the builtin. |
| 8 | } |
| 9 | |
| 10 | // PR45410 |
| 11 | // We mark exp() builtin as const with -fno-math-errno (default). |
| 12 | // We mustn't do that for extern redeclarations of builtins where the type differs. |
| 13 | float attribute() { |
| 14 | extern float exp(); |
| 15 | return exp(1); |
| 16 | } |