mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-21 03:53:04 +02:00
4e50d0475a
Just as as llvm IR supports explicitly specifying numeric value ids for instructions, and emits them by default in textual output, now do the same for blocks. This is a slightly incompatible change in the textual IR format. Previously, llvm would parse numeric labels as string names. E.g. define void @f() { br label %"55" 55: ret void } defined a label *named* "55", even without needing to be quoted, while the reference required quoting. Now, if you intend a block label which looks like a value number to be a name, you must quote it in the definition too (e.g. `"55":`). Previously, llvm would print nameless blocks only as a comment, and would omit it if there was no predecessor. This could cause confusion for readers of the IR, just as unnamed instructions did prior to the addition of "%5 = " syntax, back in 2008 (PR2480). Now, it will always print a label for an unnamed block, with the exception of the entry block. (IMO it may be better to print it for the entry-block as well. However, that requires updating many more tests.) Thus, the following is supported, and is the canonical printing: define i32 @f(i32, i32) { %3 = add i32 %0, %1 br label %4 4: ret i32 %3 } New test cases covering this behavior are added, and other tests updated as required. Differential Revision: https://reviews.llvm.org/D58548 llvm-svn: 356789
56 lines
1.5 KiB
LLVM
56 lines
1.5 KiB
LLVM
; RUN: opt < %s -msan-check-access-address=1 -S -passes=msan 2>&1 | FileCheck \
|
|
; RUN: %s
|
|
; RUN: opt < %s -msan -msan-check-access-address=1 -S | FileCheck %s
|
|
|
|
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"
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
|
|
; Test byval argument shadow alignment
|
|
|
|
define <2 x i64> @ByValArgumentShadowLargeAlignment(<2 x i64>* byval %p) sanitize_memory {
|
|
entry:
|
|
%x = load <2 x i64>, <2 x i64>* %p
|
|
ret <2 x i64> %x
|
|
}
|
|
|
|
; CHECK-LABEL: @ByValArgumentShadowLargeAlignment
|
|
; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 {{.*}}, i8* align 8 {{.*}}, i64 16, i1 false)
|
|
; CHECK: ret <2 x i64>
|
|
|
|
|
|
define i16 @ByValArgumentShadowSmallAlignment(i16* byval %p) sanitize_memory {
|
|
entry:
|
|
%x = load i16, i16* %p
|
|
ret i16 %x
|
|
}
|
|
|
|
; CHECK-LABEL: @ByValArgumentShadowSmallAlignment
|
|
; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 2 {{.*}}, i8* align 2 {{.*}}, i64 2, i1 false)
|
|
; CHECK: ret i16
|
|
|
|
|
|
; Check instrumentation of stores. The check must precede the shadow store.
|
|
|
|
define void @Store(i32* nocapture %p, i32 %x) nounwind uwtable sanitize_memory {
|
|
entry:
|
|
store i32 %x, i32* %p, align 4
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL: @Store
|
|
; CHECK: load {{.*}} @__msan_param_tls
|
|
; Shadow calculations must happen after the check.
|
|
; CHECK-NOT: xor
|
|
; CHECK: icmp
|
|
; CHECK: br i1
|
|
; CHECK: {{^[0-9]+}}:
|
|
; CHECK: call void @__msan_warning_noreturn
|
|
; CHECK: {{^[0-9]+}}:
|
|
; CHECK: xor
|
|
; CHECK: store
|
|
; CHECK: store i32 %x
|
|
; CHECK: ret void
|
|
|
|
|