1 ; RUN: opt < %s -asan -asan-module -S | FileCheck %s
2 ; RUN: opt < %s -asan -asan-module -asan-mapping-scale=5 -S | FileCheck %s
3 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"
4 target triple = "x86_64-unknown-linux-gnu"
6 ; Here we check that the global redzone sizes grow with the object size.
8 @G10 = global [10 x i8] zeroinitializer, align 1
9 ; CHECK: @G10 = global { [10 x i8], [54 x i8] }
11 @G31 = global [31 x i8] zeroinitializer, align 1
12 @G32 = global [32 x i8] zeroinitializer, align 1
13 @G33 = global [33 x i8] zeroinitializer, align 1
14 ; CHECK: @G31 = global { [31 x i8], [33 x i8] }
15 ; CHECK: @G32 = global { [32 x i8], [32 x i8] }
16 ; CHECK: @G33 = global { [33 x i8], [63 x i8] }
18 @G63 = global [63 x i8] zeroinitializer, align 1
19 @G64 = global [64 x i8] zeroinitializer, align 1
20 @G65 = global [65 x i8] zeroinitializer, align 1
21 ; CHECK: @G63 = global { [63 x i8], [33 x i8] }
22 ; CHECK: @G64 = global { [64 x i8], [32 x i8] }
23 ; CHECK: @G65 = global { [65 x i8], [63 x i8] }
25 @G127 = global [127 x i8] zeroinitializer, align 1
26 @G128 = global [128 x i8] zeroinitializer, align 1
27 @G129 = global [129 x i8] zeroinitializer, align 1
28 ; CHECK: @G127 = global { [127 x i8], [33 x i8] }
29 ; CHECK: @G128 = global { [128 x i8], [32 x i8] }
30 ; CHECK: @G129 = global { [129 x i8], [63 x i8] }
32 @G255 = global [255 x i8] zeroinitializer, align 1
33 @G256 = global [256 x i8] zeroinitializer, align 1
34 @G257 = global [257 x i8] zeroinitializer, align 1
35 ; CHECK: @G255 = global { [255 x i8], [33 x i8] }
36 ; CHECK: @G256 = global { [256 x i8], [64 x i8] }
37 ; CHECK: @G257 = global { [257 x i8], [95 x i8] }
39 @G511 = global [511 x i8] zeroinitializer, align 1
40 @G512 = global [512 x i8] zeroinitializer, align 1
41 @G513 = global [513 x i8] zeroinitializer, align 1
42 ; CHECK: @G511 = global { [511 x i8], [97 x i8] }
43 ; CHECK: @G512 = global { [512 x i8], [128 x i8] }
44 ; CHECK: @G513 = global { [513 x i8], [159 x i8] }
46 @G1023 = global [1023 x i8] zeroinitializer, align 1
47 @G1024 = global [1024 x i8] zeroinitializer, align 1
48 @G1025 = global [1025 x i8] zeroinitializer, align 1
49 ; CHECK: @G1023 = global { [1023 x i8], [225 x i8] }
50 ; CHECK: @G1024 = global { [1024 x i8], [256 x i8] }
51 ; CHECK: @G1025 = global { [1025 x i8], [287 x i8] }
53 @G1000000 = global [1000000 x i8] zeroinitializer, align 1
54 @G10000000 = global [10000000 x i8] zeroinitializer, align 1
55 @G100000000 = global [100000000 x i8] zeroinitializer, align 1
56 ; CHECK: @G1000000 = global { [1000000 x i8], [249984 x i8] }
57 ; CHECK: @G10000000 = global { [10000000 x i8], [262144 x i8] }
58 ; CHECK: @G100000000 = global { [100000000 x i8], [262144 x i8] }