Commit 97f35831 authored by Hans Wennborg's avatar Hans Wennborg
Browse files

Creating release_38 branch off revision 257626

llvm-svn: 257641
llvm-svn: 257640
llvm-svn: 257639
llvm-svn: 257638
llvm-svn: 257637
llvm-svn: 257636
llvm-svn: 257635
llvm-svn: 257634
llvm-svn: 257633
llvm-svn: 257631
llvm-svn: 257630
parent f2341685
Loading
Loading
Loading
Loading

debuginfo-tests/README.txt

deleted100644 → 0
+0 −19
Original line number Diff line number Diff line
                                                                   -*- rst -*-
This is a collection of tests to check debugging information generated by 
compiler. This test suite can be checked out inside clang/test folder. This 
will enable 'make test' for clang to pick up these tests. Typically, test 
cases included here includes debugger commands and intended debugger output 
as comments in source file using DEBUGGER: and CHECK: as prefixes respectively.

For example::

  define i32 @f1(i32 %i) nounwind ssp {
  ; DEBUGGER: break f1
  ; DEBUGGER: r
  ; DEBUGGER: p i 
  ; CHECK: $1 = 42 
  entry:
  }

is a testcase where the debugger is asked to break at function 'f1' and 
print value of argument 'i'. The expected value of 'i' is 42 in this case.
+0 −32
Original line number Diff line number Diff line
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out
// RUN: %test_debuginfo %s %t.out 
// Radar 8945514
// DEBUGGER: break 22
// DEBUGGER: r
// DEBUGGER: p v
// CHECK: ${{[0-9]+}} =
// CHECK:  Data ={{.*}} 0x0{{(0*)}}
// CHECK:  Kind = 2142

class SVal {
public:
  ~SVal() {}
  const void* Data;
  unsigned Kind;
};

void bar(SVal &v) {}
class A {
public:
  void foo(SVal v) { bar(v); }
};

int main() {
  SVal v;
  v.Data = 0;
  v.Kind = 2142;
  A a;
  a.foo(v);
  return 0;
}

debuginfo-tests/block_var.m

deleted100644 → 0
+0 −32
Original line number Diff line number Diff line
// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation
// RUN: %test_debuginfo %s %t.out 

// REQUIRES: system-darwin

// DEBUGGER: break 24
// DEBUGGER: r
// DEBUGGER: p result
// CHECK: ${{[0-9]}} = 42

void doBlock(void (^block)(void))
{
    block();
}

int I(int n)
{
    __block int result;
    int i = 2;
    doBlock(^{
        result = n;
    });
    return result + i; /* Check value of 'result' */
}


int main (int argc, const char * argv[]) {
  return I(42);
}

debuginfo-tests/blocks.m

deleted100644 → 0
+0 −43
Original line number Diff line number Diff line
// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation
// RUN: %test_debuginfo %s %t.out 

// REQUIRES: system-darwin
// Radar 9279956

// DEBUGGER: break 31
// DEBUGGER: r
// DEBUGGER: p m2
// CHECK: ${{[0-9]}} = 1
// DEBUGGER: p dbTransaction
// CHECK: ${{[0-9]}} = 0
// DEBUGGER: p master
// CHECK: ${{[0-9]}} = 0

#include <Cocoa/Cocoa.h>

extern void foo(void(^)(void));

@interface A:NSObject @end
@implementation A
- (void) helper {
 int master = 0;
 __block int m2 = 0;
 __block int dbTransaction = 0;
 int (^x)(void) = ^(void) { (void) self; 
	(void) master; 
	(void) dbTransaction; 
	m2++;
	return m2;
	};
  master = x();
}
@end

void foo(void(^x)(void)) {}

int main() {
	A *a = [A alloc];
	[a helper];
	return 0;
}

debuginfo-tests/ctor.cpp

deleted100644 → 0
+0 −25
Original line number Diff line number Diff line
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out
// RUN: %test_debuginfo %s %t.out 


// DEBUGGER: break 14
// DEBUGGER: r
// DEBUGGER: p *this
// CHECK-NEXT-NOT: Cannot access memory at address 

class A {
public:
	A() : zero(0), data(42)
	{
	}
private:
	int zero;
	int data;
};

int main() {
	A a;
	return 0;
}
Loading