1 ; Test that the msan layout customization options work as expected
3 ; RUN: opt < %s -msan-shadow-base 3735928559 -S -passes=msan 2>&1 | FileCheck --check-prefix=CHECK-BASE %s
4 ; RUN: opt < %s -msan-shadow-base 3735928559 -msan-and-mask 4294901760 -S -passes=msan 2>&1 | FileCheck --check-prefix=CHECK-AND %s
5 ; RUN: opt < %s -msan-shadow-base 3735928559 -msan-xor-mask 48879 -S -passes=msan 2>&1 | FileCheck --check-prefix=CHECK-XOR %s
6 ; RUN: opt < %s -msan-shadow-base 3735928559 -msan-xor-mask 48879 -msan-and-mask 4294901760 -S -passes=msan 2>&1 | FileCheck --check-prefix=CHECK-XOR-AND %s
7 ; RUN: opt < %s -msan-track-origins 1 -msan-origin-base 1777777 -S -passes=msan 2>&1 | FileCheck --check-prefix=CHECK-ORIGIN-BASE %s
9 target triple = "x86_64-unknown-linux-gnu"
11 define i32 @read_value(ptr %a) sanitize_memory {
13 %tmp1 = load i32, ptr %a, align 4
16 ; CHECK-BASE-LABEL: @read_value
17 ; CHECK-BASE-NOT: ret i32
18 ; CHECK-BASE: add{{.*}}3735928559
21 ; CHECK-AND-LABEL: @read_value
22 ; CHECK-AND-NOT: ret i32
23 ; CHECK-AND: and{{.*}}-4294901761
24 ; CHECK-AND-NEXT: add{{.*}}3735928559
27 ; CHECK-XOR-LABEL: @read_value
28 ; CHECK-XOR-NOT: ret i32
29 ; CHECK-XOR: xor{{.*}}48879
30 ; CHECK-XOR-NEXT: add{{.*}}3735928559
33 ; CHECK-XOR-AND-LABEL: @read_value
34 ; CHECK-XOR-AND-NOT: ret i32
35 ; CHECK-XOR-AND: and{{.*}}-4294901761
36 ; CHECK-XOR-AND-NEXT: xor{{.*}}48879
37 ; CHECK-XOR-AND-NEXT: add{{.*}}3735928559
38 ; CHECK-XOR-AND: ret i32
40 ; CHECK-ORIGIN-BASE-LABEL: @read_value
41 ; CHECK-ORIGIN-BASE-NOT: ret i32
42 ; CHECK-ORIGIN-BASE: add{{.*}}1777777
43 ; CHECK-ORIGIN-BASE: ret i32