blob: a3b36c9838ffcbaa8e059198150569b51f9c1347 [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
29// CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)
30// DEBUGGER: c
31// DEBUGGER: p s
32// CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)
33// DEBUGGER: c
34// DEBUGGER: p s
35// CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)