[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / cross-project-tests / debuginfo-tests / llgdb-tests / asan-blocks.c
blobe836b32a955b3efe9585120623d7bea00f98c1e2
1 // RUN: %clang -fblocks %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=address
2 // RUN: %test_debuginfo %s %t.out
3 // FIXME: Remove system-darwin when we build BlocksRuntime everywhere.
4 // REQUIRES: !asan, compiler-rt, system-darwin
5 // Zorg configures the ASAN stage2 bots to not build the asan
6 // compiler-rt. Only run this test on non-asanified configurations.
7 // XFAIL: !system-darwin && gdb-clang-incompatibility
9 void b();
10 struct S {
11 int a[8];
14 int f(struct S s, unsigned i) {
15 // DEBUGGER: break 19
16 // DEBUGGER: r
17 // DEBUGGER: p s
18 // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)
19 return s.a[i];
22 int main(int argc, const char **argv) {
23 struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};
24 if (f(s, 4) == 4) {
25 // DEBUGGER: break 29
26 // DEBUGGER: c
27 // DEBUGGER: p s
28 // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)
29 b();
31 return 0;
34 void c() {}
36 void b() {
37 // DEBUGGER: break 42
38 // DEBUGGER: c
39 // DEBUGGER: p x
40 // CHECK: 42
41 __block int x = 42;
42 c();