OLD | NEW |
---|---|
(Empty) | |
1 ; Test of global redzone layout | |
2 | |
3 ; REQUIRES: allow_dump | |
4 | |
5 ; RUN: %lc2i -i %s --args -threads=0 -fsanitize-address \ | |
Karl
2016/06/13 17:55:50
nit: %p2i (rather than %lc2i)is a better choice. l
tlively
2016/06/13 18:17:26
Done.
| |
6 ; RUN: | %iflc FileCheck %s | |
7 ; RUN: %lc2i -i %s --args -verbose=global_init,inst -threads=0 \ | |
Karl
2016/06/13 17:55:49
Same here.
tlively
2016/06/13 18:17:26
Done.
| |
8 ; RUN: -fsanitize-address | %iflc FileCheck --check-prefix=DUMP %s | |
9 | |
10 ; DUMP-LABEL: ========= Instrumented Globals ========= | |
11 | |
12 ; The array of redzones | |
13 ; CHECK-LABEL: .type __$rz0,%object | |
14 ; CHECK-NEXT: .section .rodata | |
15 ; CHECK-NEXT: __$rz0: | |
16 ; CHECK-NEXT: .long __$rz2 | |
17 ; CHECK-NEXT: .long __$rz3 | |
18 ; CHECK-NEXT: .long __$rz4 | |
19 ; CHECK-NEXT: .long __$rz5 | |
20 ; CHECK-NEXT: .long __$rz6 | |
21 ; CHECK-NEXT: .long __$rz7 | |
22 ; CHECK-LABEL: .type __$rz1,%object | |
23 ; CHECK-NEXT: .section .rodata | |
24 ; CHECK-NEXT: __$rz1: | |
25 ; CHECK-NEXT: .byte 6 | |
26 ; CHECK-NEXT: .byte 0 | |
27 ; CHECK-NEXT: .byte 0 | |
28 ; CHECK-NEXT: .byte 0 | |
29 ; DUMP: @__$rz0 = internal constant <{ i32, i32, i32, i32, i32, i32 }> <{ i32 pt rtoint ([32 x i8]* @__$rz2 to i32), i32 ptrtoint ([32 x i8]* @__$rz3 to i32), i3 2 ptrtoint ([32 x i8]* @__$rz4 to i32), i32 ptrtoint ([32 x i8]* @__$rz5 to i32) , i32 ptrtoint ([32 x i8]* @__$rz6 to i32), i32 ptrtoint ([32 x i8]* @__$rz7 to i32) }> | |
30 ; DUMP-NEXT: @__$rz1 = internal constant [4 x i8] c"\06\00\00\00" | |
31 ; A zero-initialized global | |
32 @zeroInitGlobal = internal global [32 x i8] zeroinitializer | |
33 ; CHECK-LABEL: .type __$rz2,%object | |
34 ; CHECK-NEXT: .section .bss | |
35 ; CHECK-NEXT: __$rz2: | |
36 ; CHECK-LABEL: .type zeroInitGlobal,%object | |
37 ; CHECK-NEXT: .section .bss | |
38 ; CHECK-NEXT: zeroInitGlobal: | |
39 ; CHECK-LABEL: .type __$rz3,%object | |
40 ; CHECK-NEXT: .section .bss | |
41 ; CHECK-NEXT: __$rz3: | |
42 ; DUMP-NEXT: @__$rz2 = internal global [32 x i8] zeroinitializer | |
Karl
2016/06/13 17:55:50
Nit: I think that DUMP-NEXT's should appear first.
tlively
2016/06/13 18:17:26
Done.
| |
43 ; DUMP-NEXT: @zeroInitGlobal = internal global [32 x i8] zeroinitializer | |
44 ; DUMP-NEXT: @__$rz3 = internal global [32 x i8] zeroinitializer | |
45 | |
46 ; A constant-initialized global | |
47 @constInitGlobal = internal constant [32 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ01234 5" | |
Karl
2016/06/13 18:22:04
Note: Considering moving this to the next line (in
| |
48 ; CHECK-LABEL: .type __$rz4,%object | |
49 ; CHECK-NEXT: .section .rodata | |
50 ; CHECK-NEXT: __$rz4: | |
51 ; CHECK-LABEL: .type constInitGlobal,%object | |
52 ; CHECK-NEXT: .section .rodata | |
53 ; CHECK-NEXT: constInitGlobal: | |
54 ; CHECK-LABEL: .type __$rz5,%object | |
55 ; CHECK-NEXT: .section .rodata | |
56 ; CHECK-NEXT: __$rz5: | |
57 ; DUMP-NEXT: @__$rz4 = internal constant [32 x i8] c"RRRRRRRRRRRRRRRRRRRRRRRRRRR RRRRR" | |
58 ; DUMP-NEXT: @constInitGlobal = internal constant [32 x i8] c"ABCDEFGHIJKLMNOPQR STUVWXYZ012345" | |
59 ; DUMP-NEXT: @__$rz5 = internal constant [32 x i8] c"RRRRRRRRRRRRRRRRRRRRRRRRRRR RRRRR" | |
60 | |
61 ; A regular global | |
62 @regInitGlobal = internal global [32 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ012345" | |
63 ; CHECK-LABEL: .type __$rz6,%object | |
64 ; CHECK-NEXT: .section .data | |
65 ; CHECK-NEXT: __$rz6: | |
66 ; CHECK-LABEL: .type regInitGlobal,%object | |
67 ; CHECK-NEXT: .section .data | |
68 ; CHECK-NEXT: regInitGlobal: | |
69 ; CHECK-LABEL: .type __$rz7,%object | |
70 ; CHECK-NEXT: .section .data | |
71 ; CHECK-NEXT: __$rz7: | |
72 ; DUMP-NEXT: @__$rz6 = internal global [32 x i8] c"RRRRRRRRRRRRRRRRRRRRRRRRRRRRR RRR" | |
73 ; DUMP-NEXT: @regInitGlobal = internal global [32 x i8] c"ABCDEFGHIJKLMNOPQRSTUV WXYZ012345" | |
74 ; DUMP-NEXT: @__$rz7 = internal global [32 x i8] c"RRRRRRRRRRRRRRRRRRRRRRRRRRRRR RRR" | |
75 | |
76 define internal void @func() { | |
77 ret void | |
78 } | |
79 | |
80 ; CHECK-LABEL: func: | |
81 ; DUMP: define internal void @func() { | |
OLD | NEW |