Skip to content

Commit 86c66f7

Browse files
committed
Add a test
1 parent 37f9b0f commit 86c66f7

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Check that optimized with -O3 values that have a file address can be read
2+
// DWARF info:
3+
// 0x00000023: DW_TAG_variable
4+
// DW_AT_name ("array")
5+
// DW_AT_type (0x00000032 "char[5]")
6+
// DW_AT_location (DW_OP_piece 0x2, DW_OP_addrx 0x0, DW_OP_piece 0x1)
7+
8+
// RUN: %clang_host -O3 -gdwarf %s -o %t
9+
// RUN: %lldb %t \
10+
// RUN: -o "b 22" \
11+
// RUN: -o "r" \
12+
// RUN: -o "p/x array[2]" \
13+
// RUN: -b | FileCheck %s
14+
//
15+
// CHECK: (lldb) p/x array[2]
16+
// CHECK: (char) 0x03
17+
18+
static char array[5] = {0, 1, 2, 3, 4};
19+
20+
int main(void) {
21+
array[2]++;
22+
return 0;
23+
}

0 commit comments

Comments
 (0)