blob: 01c5f7ede9253805cac7d53ea1781767db6f8c8f [file] [log] [blame]
Adrian Prantl7b2bf892017-04-17 17:57:03 +00001// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=safe-stack
2// RUN: %test_debuginfo %s %t.out
3// REQUIRES: not_asan
4// Zorg configures the ASAN stage2 bots to not build the
5// safestack compiler-rt. Only run this test on
6// non-asanified configurations.
Adrian Prantl7b2bf892017-04-17 17:57:03 +00007
8struct S {
9 int a[8];
10};
11
Adrian Prantl18c18de2017-04-17 17:57:05 +000012int f(struct S s, unsigned i);
Adrian Prantl7b2bf892017-04-17 17:57:03 +000013
14int main(int argc, const char **argv) {
15 struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};
Adrian Prantl18c18de2017-04-17 17:57:05 +000016 // DEBUGGER: break 17
17 f(s, 4);
18 // DEBUGGER: break 19
19 return 0;
Adrian Prantl7b2bf892017-04-17 17:57:03 +000020}
Adrian Prantl18c18de2017-04-17 17:57:05 +000021
22int f(struct S s, unsigned i) {
23 // DEBUGGER: break 24
24 return s.a[i];
25}
26
27// DEBUGGER: r
28// DEBUGGER: p s
Reid Klecknera6fc06b2017-08-31 18:16:55 +000029// CHECK: a =
30// DEBUGGER: p s.a[0]
31// CHECK: = 0
32// DEBUGGER: p s.a[1]
33// CHECK: = 1
34// DEBUGGER: p s.a[7]
35// CHECK: = 7
Adrian Prantl18c18de2017-04-17 17:57:05 +000036// DEBUGGER: c
37// DEBUGGER: p s
Reid Klecknera6fc06b2017-08-31 18:16:55 +000038// CHECK: a =
39// DEBUGGER: p s.a[0]
40// CHECK: = 0
41// DEBUGGER: p s.a[1]
42// CHECK: = 1
43// DEBUGGER: p s.a[7]
Adrian Prantl18c18de2017-04-17 17:57:05 +000044// DEBUGGER: c
45// DEBUGGER: p s
Reid Klecknera6fc06b2017-08-31 18:16:55 +000046// CHECK: a =
47// DEBUGGER: p s.a[0]
48// CHECK: = 0
49// DEBUGGER: p s.a[1]
50// CHECK: = 1
51// DEBUGGER: p s.a[7]