[PATCH] D96977: [dfsan] Instrument origin variable and function definitions

Matt Morehouse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 15:03:24 PST 2021


morehouse accepted this revision.
morehouse added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/test/Instrumentation/DataFlowSanitizer/basic.ll:1-2
+; RUN: opt < %s -dfsan -S | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK_NO_ORIGIN
+; RUN: opt < %s -dfsan -dfsan-track-origins=1 -dfsan-fast-16-labels=true -S | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK_ORIGIN
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
----------------
gbalats wrote:
> You could use --check-prefixes to merge these.



================
Comment at: llvm/test/Instrumentation/DataFlowSanitizer/basic.ll:11
+; CHECK: @__dfsan_track_origins = weak_odr constant i32 0
+; CHECK_ORIGIN: @__dfsan_track_origins = weak_odr constant i32 1
+; CHECK: @__dfsan_shadow_ptr_mask = external global i64
----------------
stephan.yichao.zhao wrote:
> morehouse wrote:
> > IIRC, even with `--check-prefix`, the `CHECK` lines are still verified.  So don't we get a failure for the line above this one (track_origins = 0)?
> Hm, I found FileCheck ignores CHECK if [[ https://llvm.org/docs/CommandGuide/FileCheck.html#cmdoption-filecheck-check-prefix | --check-prefix ]] is used.
> But the problem is that we may want to rename the last one with prefix CHECK_NO_ORIGIN.
> 
> Updated.
Interesting, I guess I've been doing it wrong then.  Thanks for informing!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96977/new/

https://reviews.llvm.org/D96977



More information about the llvm-commits mailing list