2f576993e90692fe16748fd52915cc29a44224b4
[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 - | llvm-as | llc -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 // XFAIL: *
11 @interface MyClass
12 {
13  int my;
14 }
15 + init;
16 - randomFunc;
17 @end
18
19 @implementation MyClass
20 + init {
21 }
22 - randomFunc { my = 42; }
23 @end
24
25 int main() {
26   id o = [MyClass init];
27   [o randomFunc];
28   return 0;
29 }