blob: e1ce3dfd82ef2c2b8e461f43a8e64d1f573c1bb9 [file] [log] [blame]
Adrian Prantla0de3a82017-12-07 19:40:31 +00001// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=safe-stack
Adrian Prantl7b2bf892017-04-17 17:57:03 +00002// RUN: %test_debuginfo %s %t.out
Vlad Tsyrklevichcd4056c2018-08-14 21:38:50 +00003// UNSUPPORTED: system-darwin
Adrian Prantl7b2bf892017-04-17 17:57:03 +00004// REQUIRES: not_asan
5// Zorg configures the ASAN stage2 bots to not build the
6// safestack compiler-rt. Only run this test on
7// non-asanified configurations.
Adrian Prantl7b2bf892017-04-17 17:57:03 +00008
9struct S {
10 int a[8];
11};
12
Adrian Prantl18c18de2017-04-17 17:57:05 +000013int f(struct S s, unsigned i);
Adrian Prantl7b2bf892017-04-17 17:57:03 +000014
15int main(int argc, const char **argv) {
16 struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};
Adrian Prantl18c18de2017-04-17 17:57:05 +000017 // DEBUGGER: break 17
18 f(s, 4);
19 // DEBUGGER: break 19
20 return 0;
Adrian Prantl7b2bf892017-04-17 17:57:03 +000021}
Adrian Prantl18c18de2017-04-17 17:57:05 +000022
23int f(struct S s, unsigned i) {
24 // DEBUGGER: break 24
25 return s.a[i];
26}
27
28// DEBUGGER: r
29// DEBUGGER: p s
Reid Klecknera6fc06b2017-08-31 18:16:55 +000030// CHECK: a =
31// DEBUGGER: p s.a[0]
32// CHECK: = 0
33// DEBUGGER: p s.a[1]
34// CHECK: = 1
35// DEBUGGER: p s.a[7]
36// CHECK: = 7
Adrian Prantl18c18de2017-04-17 17:57:05 +000037// DEBUGGER: c
38// DEBUGGER: p s
Reid Klecknera6fc06b2017-08-31 18:16:55 +000039// CHECK: a =
40// DEBUGGER: p s.a[0]
41// CHECK: = 0
42// DEBUGGER: p s.a[1]
43// CHECK: = 1
44// DEBUGGER: p s.a[7]
Adrian Prantl18c18de2017-04-17 17:57:05 +000045// DEBUGGER: c
46// DEBUGGER: p s
Reid Klecknera6fc06b2017-08-31 18:16:55 +000047// CHECK: a =
48// DEBUGGER: p s.a[0]
49// CHECK: = 0
50// DEBUGGER: p s.a[1]
51// CHECK: = 1
52// DEBUGGER: p s.a[7]