Index: llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp =================================================================== --- llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp +++ llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp @@ -437,6 +437,7 @@ } void visitOperandShadowInst(Instruction &I); + void visitUnaryOperator(UnaryOperator &UO); void visitBinaryOperator(BinaryOperator &BO); void visitCastInst(CastInst &CI); void visitCmpInst(CmpInst &CI); @@ -1398,6 +1399,10 @@ DFSF.storeShadow(SI.getPointerOperand(), Size, Align, Shadow, &SI); } +void DFSanVisitor::visitUnaryOperator(UnaryOperator &UO) { + visitOperandShadowInst(UO); +} + void DFSanVisitor::visitBinaryOperator(BinaryOperator &BO) { visitOperandShadowInst(BO); } Index: llvm/test/Instrumentation/DataFlowSanitizer/arith.ll =================================================================== --- llvm/test/Instrumentation/DataFlowSanitizer/arith.ll +++ llvm/test/Instrumentation/DataFlowSanitizer/arith.ll @@ -62,3 +62,13 @@ %c = udiv i8 %a, %b ret i8 %c } + +define double @fneg(double %a) { + ; CHECK: @"dfs$fneg" + ; CHECK: load{{.*}}__dfsan_arg_tls + ; CHECK: fneg double + ; CHECK: store{{.*}}__dfsan_retval_tls + ; CHECK: ret double + %c = fneg double %a + ret double %c +}