diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
commit | 676fbe8105eeb6ff4bb2ed261cb212fcfdbe7b63 (patch) | |
tree | 02a1ac369cb734d0abfa5000dd86e5b7797e6a74 /test/Analysis/std-c-library-functions-inlined.c | |
parent | c7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (diff) |
Diffstat (limited to 'test/Analysis/std-c-library-functions-inlined.c')
-rw-r--r-- | test/Analysis/std-c-library-functions-inlined.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Analysis/std-c-library-functions-inlined.c b/test/Analysis/std-c-library-functions-inlined.c new file mode 100644 index 0000000000000..e22df14085723 --- /dev/null +++ b/test/Analysis/std-c-library-functions-inlined.c @@ -0,0 +1,17 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=apiModeling.StdCLibraryFunctions -verify %s +// RUN: %clang_analyze_cc1 -triple i686-unknown-linux -analyzer-checker=apiModeling.StdCLibraryFunctions -verify %s +// RUN: %clang_analyze_cc1 -triple x86_64-unknown-linux -analyzer-checker=apiModeling.StdCLibraryFunctions -verify %s +// RUN: %clang_analyze_cc1 -triple armv7-a15-linux -analyzer-checker=apiModeling.StdCLibraryFunctions -verify %s +// RUN: %clang_analyze_cc1 -triple thumbv7-a15-linux -analyzer-checker=apiModeling.StdCLibraryFunctions -verify %s + +// This test tests crashes that occur when standard functions are available +// for inlining. + +// expected-no-diagnostics + +int isdigit(int _) { return !0; } +void test_redefined_isdigit(int x) { + int (*func)(int) = isdigit; + for (; func(x);) // no-crash + ; +} |