diff options
Diffstat (limited to 'clang/test/Analysis/copypaste/dependent-exist.cpp')
| -rw-r--r-- | clang/test/Analysis/copypaste/dependent-exist.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Analysis/copypaste/dependent-exist.cpp b/clang/test/Analysis/copypaste/dependent-exist.cpp new file mode 100644 index 00000000000..5182ba61c9d --- /dev/null +++ b/clang/test/Analysis/copypaste/dependent-exist.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -analyze -fms-extensions -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s + +// expected-no-diagnostics + +bool foo1(int x) { + if (x < 0) { + __if_exists(x) { return false; } + } + return true; +} + +// Same as above, but __if_not_exists +bool foo2(int x) { + if (x < 0) { + __if_not_exists(x) { return false; } + } + return true; +} |

