Devang Patel | 22fb4b2 | 2010-02-17 02:20:34 +0000 | [diff] [blame] | 1 | // RUN: %llvmgcc -S -O0 -g %s -o - | \ |
| 2 | // RUN: llc --disable-fp-elim -o %t.s -O0 -relocation-model=pic |
| 3 | // RUN: %compile_c %t.s -o %t.o |
| 4 | // RUN: %link %t.o -o %t.exe |
| 5 | // RUN: echo {break 24\nrun\np loc\n} > %t.in |
| 6 | // RN: gdb -q -batch -n -x %t.in %t.exe | tee %t.out | \ |
| 7 | // RN: grep {$1 = 1} |
| 8 | |
| 9 | int g1 = 1; |
| 10 | int g2 = 2; |
| 11 | |
| 12 | int __attribute__((always_inline)) bar() { |
| 13 | return g2 - g1; |
| 14 | } |
| 15 | void foobar() {} |
| 16 | |
| 17 | void foo(int s) { |
| 18 | unsigned loc = 0; |
| 19 | if (s) { |
| 20 | loc = 1; |
| 21 | foobar(); |
| 22 | } else { |
| 23 | loc = bar(); |
| 24 | foobar(); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | int main() { |
| 29 | foo(0); |
| 30 | } |