Dan Gohman | f2f6ce6 | 2009-09-11 18:01:28 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -mergefunc -S > %t |
Nick Lewycky | 8728d7a | 2009-06-12 15:56:56 +0000 | [diff] [blame] | 2 | ; RUN: grep {define weak} %t | count 2 |
| 3 | ; RUN: grep {call} %t | count 2 |
Nick Lewycky | b38824f | 2011-01-25 08:56:50 +0000 | [diff] [blame] | 4 | ; XFAIL: * |
| 5 | |
| 6 | ; This test is off for a bit as we change this particular sort of folding to |
| 7 | ; only apply on ELF systems and not Mach-O systems. |
Nick Lewycky | 8728d7a | 2009-06-12 15:56:56 +0000 | [diff] [blame] | 8 | |
| 9 | define weak i32 @sum(i32 %x, i32 %y) { |
| 10 | %sum = add i32 %x, %y |
| 11 | ret i32 %sum |
| 12 | } |
| 13 | |
| 14 | define weak i32 @add(i32 %x, i32 %y) { |
| 15 | %sum = add i32 %x, %y |
| 16 | ret i32 %sum |
| 17 | } |