File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
lib/Transforms/Instrumentation
test/Instrumentation/MemorySanitizer Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -2110,6 +2110,8 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
2110
2110
SC.Done (&I);
2111
2111
}
2112
2112
2113
+ void visitFNeg (UnaryOperator &I) { handleShadowOr (I); }
2114
+
2113
2115
// Handle multiplication by constant.
2114
2116
//
2115
2117
// Handle a special case of multiplication by constant that may have one or
Original file line number Diff line number Diff line change @@ -438,6 +438,22 @@ entry:
438
438
; CHECK: store i32 %[[SC]], i32* {{.*}}@__msan_retval_tls
439
439
; CHECK: ret float
440
440
441
+ ; Check that fneg simply propagates shadow.
442
+
443
+ define float @FNeg (float %a ) nounwind uwtable readnone sanitize_memory {
444
+ entry:
445
+ %c = fneg float %a
446
+ ret float %c
447
+ }
448
+
449
+ ; CHECK-LABEL: @FNeg
450
+ ; CHECK: %[[SA:.*]] = load i32,{{.*}}@__msan_param_tls
451
+ ; CHECK-ORIGINS: %[[SB:.*]] = load i32,{{.*}}@__msan_param_origin_tls
452
+ ; CHECK: = fneg float
453
+ ; CHECK: store i32 %[[SA]], i32* {{.*}}@__msan_retval_tls
454
+ ; CHECK-ORIGINS: store i32{{.*}}@__msan_retval_origin_tls
455
+ ; CHECK: ret float
456
+
441
457
; Check that we propagate shadow for x<0, x>=0, etc (i.e. sign bit tests)
442
458
443
459
define zeroext i1 @ICmpSLTZero (i32 %x ) nounwind uwtable readnone sanitize_memory {
You can’t perform that action at this time.
0 commit comments