Commit 392e4fbd authored by Bill Wendling's avatar Bill Wendling
Browse files

Creating release_31 branch

llvm-svn: 155059
llvm-svn: 155053
llvm-svn: 155051
parent eb1c2bdc
Loading
Loading
Loading
Loading

debuginfo-tests/README.txt

deleted100644 → 0
+0 −19
Original line number Diff line number Diff line

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 exmaple,

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

is a testcase where the debuger 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 -O0 -g %s -c -o %t.o
// RUN: %clangxx %t.o -o %t.out
// RUN: %test_debuginfo %s %t.out 
// Radar 8945514
// DEBUGGER: break 22
// DEBUGGER: r
// DEBUGGER: p v
// CHECK: $1 = (SVal &)
// CHECK:  Data = 0x0, 
// 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 -O0 -g %s -c -o %t.o
// RUN: %clang %t.o -o %t.out -framework Foundation
// RUN: %test_debuginfo %s %t.out 
// XFAIL: *
// XTARGET: darwin

// DEBUGGER: break 24
// DEBUGGER: r
// DEBUGGER: p result
// CHECK: $1 = 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 -O0 -g %s -c -o %t.o
// RUN: %clang %t.o -o %t.out -framework Foundation
// RUN: %test_debuginfo %s %t.out 
// XFAIL: *
// XTARGET: darwin
// Radar 9279956

// DEBUGGER: break 31
// DEBUGGER: r
// DEBUGGER: p m2
// DEBUGGER: p dbTransaction
// DEBUGGER: p master
// CHECK: $1 = 1
// CHECK: $2 = 0
// CHECK: $3 = 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 -O0 -g %s -c -o %t.o
// RUN: %clangxx %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