blob: 582907184ea53411cc50c68f5a0210b02c8abe97 [file] [log] [blame]
Raul Tambree09107a2020-09-04 19:10:09 +03001// RUN: %clang_cc1 -emit-llvm-only %s
2
3// PR45410
4// Ensure we mark local extern redeclarations with a different type as non-builtin.
5void 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.
13float attribute() {
14 extern float exp();
15 return exp(1);
16}