================
@@ -0,0 +1,60 @@
+// Test that UnsafeBufferReachableAnalysis excludes type-constrained pointers
+
+// RUN: rm -rf %t && mkdir -p %t
+
+// RUN: %clang_cc1 -fsyntax-only %s \
+// RUN:   
--ssaf-extract-summaries=PointerFlow,UnsafeBufferUsage,TypeConstrainedPointers \
+// RUN:   --ssaf-tu-summary-file=%t/tu.summary.json \
+// RUN:   --ssaf-compilation-unit-id="tu-1"
+
+// RUN: clang-ssaf-linker %t/tu.summary.json -o %t/lu.json
+
+// RUN: clang-ssaf-analyzer %t/lu.json -o %t/wpa.json \
+// RUN:   -a UnsafeBufferReachableAnalysisResult
+
+// The CHECK lines below use readable tokens instead of inline FileCheck regex.
+// Expand the tokens into regex, then run FileCheck on the expanded copy:
+//   $NS - skip the "namespace" array, up to its closing ']'.
+//   $WS - whitespace, possibly spanning newlines.
+//   $PTR_L1 - a reachable-set entry closing as "}, 1 ]", i.e. pointer level 1.
+// RUN: sed -e 's|$NS|{{([^]]\|[[:space:]])+\\],}}|g' \
+// RUN:     -e 's|$WS|{{[[:space:]]+}}|g' \
+// RUN:     -e 's|$PTR_L1|{{[[:space:]]+\\},[[:space:]]+1[[:space:]]+\\]}}|g' \
+// RUN:     %s > %t/checks.txt
+// RUN: FileCheck %t/checks.txt --input-file=%t/wpa.json
----------------
ziqingluo-90 wrote:

I changed it to just use std IO.  If we have better ideas, we make follow PRs.

https://github.com/llvm/llvm-project/pull/209354
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to