brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · e836b32 Raw
44 lines · c
1// RUN: %clang -fblocks %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=address2// RUN: %test_debuginfo %s %t.out3// FIXME: Remove system-darwin when we build BlocksRuntime everywhere.4// REQUIRES: !asan, compiler-rt, system-darwin5//           Zorg configures the ASAN stage2 bots to not build the asan6//           compiler-rt. Only run this test on non-asanified configurations.7// XFAIL: !system-darwin && gdb-clang-incompatibility8 9void b();10struct S {11  int a[8];12};13 14int f(struct S s, unsigned i) {15  // DEBUGGER: break 1916  // DEBUGGER: r17  // DEBUGGER: p s18  // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)19  return s.a[i];20}21 22int 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 2926    // DEBUGGER: c27    // DEBUGGER: p s28    // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)29    b();30  }31  return 0;32}33 34void c() {}35 36void b() {37  // DEBUGGER: break 4238  // DEBUGGER: c39  // DEBUGGER: p x40  // CHECK: 4241  __block int x = 42;42  c();43}44