blob: 1d912d0f5e5bca6e1bc06c02cdd1fddc14dd12c8 [file] [log] [blame]
Devang Patel22fb4b22010-02-17 02:20:34 +00001// 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
9int g1 = 1;
10int g2 = 2;
11
12int __attribute__((always_inline)) bar() {
13 return g2 - g1;
14}
15void foobar() {}
16
17void 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
28int main() {
29 foo(0);
30}