summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/Inputs
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/Inputs')
-rw-r--r--clang/test/Analysis/Inputs/ctu-chain.cpp20
-rw-r--r--clang/test/Analysis/Inputs/ctu-other.cpp67
-rw-r--r--clang/test/Analysis/Inputs/externalFnMap.txt13
3 files changed, 100 insertions, 0 deletions
diff --git a/clang/test/Analysis/Inputs/ctu-chain.cpp b/clang/test/Analysis/Inputs/ctu-chain.cpp
new file mode 100644
index 00000000000..2314dde1df0
--- /dev/null
+++ b/clang/test/Analysis/Inputs/ctu-chain.cpp
@@ -0,0 +1,20 @@
+int h_chain(int x) {
+ return x * 2;
+}
+
+namespace chns {
+int chf3(int x);
+
+int chf2(int x) {
+ return chf3(x);
+}
+
+class chcls {
+public:
+ int chf4(int x);
+};
+
+int chcls::chf4(int x) {
+ return x * 3;
+}
+}
diff --git a/clang/test/Analysis/Inputs/ctu-other.cpp b/clang/test/Analysis/Inputs/ctu-other.cpp
new file mode 100644
index 00000000000..d35b7b2d12d
--- /dev/null
+++ b/clang/test/Analysis/Inputs/ctu-other.cpp
@@ -0,0 +1,67 @@
+int callback_to_main(int x);
+int f(int x) {
+ return x - 1;
+}
+
+int g(int x) {
+ return callback_to_main(x) + 1;
+}
+
+int h_chain(int);
+
+int h(int x) {
+ return 2 * h_chain(x);
+}
+
+namespace myns {
+int fns(int x) {
+ return x + 7;
+}
+
+namespace embed_ns {
+int fens(int x) {
+ return x - 3;
+}
+}
+
+class embed_cls {
+public:
+ int fecl(int x) {
+ return x - 7;
+ }
+};
+}
+
+class mycls {
+public:
+ int fcl(int x) {
+ return x + 5;
+ }
+ static int fscl(int x) {
+ return x + 6;
+ }
+
+ class embed_cls2 {
+ public:
+ int fecl2(int x) {
+ return x - 11;
+ }
+ };
+};
+
+namespace chns {
+int chf2(int x);
+
+class chcls {
+public:
+ int chf4(int x);
+};
+
+int chf3(int x) {
+ return chcls().chf4(x);
+}
+
+int chf1(int x) {
+ return chf2(x);
+}
+}
diff --git a/clang/test/Analysis/Inputs/externalFnMap.txt b/clang/test/Analysis/Inputs/externalFnMap.txt
new file mode 100644
index 00000000000..2c93d3e869b
--- /dev/null
+++ b/clang/test/Analysis/Inputs/externalFnMap.txt
@@ -0,0 +1,13 @@
+c:@N@chns@F@chf1#I# ctu-other.cpp.ast
+c:@N@myns@N@embed_ns@F@fens#I# ctu-other.cpp.ast
+c:@F@g#I# ctu-other.cpp.ast
+c:@S@mycls@F@fscl#I#S ctu-other.cpp.ast
+c:@S@mycls@F@fcl#I# ctu-other.cpp.ast
+c:@N@myns@S@embed_cls@F@fecl#I# ctu-other.cpp.ast
+c:@S@mycls@S@embed_cls2@F@fecl2#I# ctu-other.cpp.ast
+c:@F@f#I# ctu-other.cpp.ast
+c:@N@myns@F@fns#I# ctu-other.cpp.ast
+c:@F@h#I# ctu-other.cpp.ast
+c:@F@h_chain#I# ctu-chain.cpp.ast
+c:@N@chns@S@chcls@F@chf4#I# ctu-chain.cpp.ast
+c:@N@chns@F@chf2#I# ctu-chain.cpp.ast
OpenPOWER on IntegriCloud