Clang Project

clang_source_code/test/Analysis/copypaste/expr-types.cpp
1// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s
2
3// expected-no-diagnostics
4
5
6int foo1(int a, int b) {
7  if (a > b)
8    return a;
9  return b;
10}
11
12// Different types, so not a clone
13int foo2(long a, long b) {
14  if (a > b)
15    return a;
16  return b;
17}
18