825bbd75358c59b064ea888a6f4ead3aa67b9cd4
[oota-llvm.git] / test / FrontendObjC / 2009-08-17-DebugInfo.m
1 // This is a regression test on debug info to make sure that we can set a
2 // breakpoint on a objective message.
3 // RUN: %llvmgcc -S -O0 -g %s -o - | llc -disable-cfi -o %t.s -O0
4 // RUN: %compile_c %t.s -o %t.o
5 // RUN: %link %t.o -o %t.exe -framework Foundation
6 // RUN: echo {break randomFunc\n} > %t.in 
7 // RUN: gdb -q -batch -n -x %t.in %t.exe | tee %t.out | \
8 // RUN:   grep {Breakpoint 1 at 0x.*: file .*2009-08-17-DebugInfo.m, line 21}
9 // XTARGET: darwin
10 @interface MyClass
11 {
12  int my;
13 }
14 + init;
15 - randomFunc;
16 @end
17
18 @implementation MyClass
19 + init {
20 }
21 - randomFunc { my = 42; }
22 @end
23
24 int main() {
25   id o = [MyClass init];
26   [o randomFunc];
27   return 0;
28 }