| Owen Anderson | f4f80e1 | 2012-05-07 20:47:23 +0000 | [diff] [blame] | 1 | ; RUN: opt -reassociate -S < %s | FileCheck %s | 
|  | 2 |  | 
| Duncan Sands | 763da45e | 2012-06-06 14:53:10 +0000 | [diff] [blame] | 3 | declare void @use(float) | 
|  | 4 |  | 
| Chad Rosier | 5ea14e0 | 2014-06-11 18:28:45 +0000 | [diff] [blame] | 5 | define void @test1(float %x, float %y) { | 
|  | 6 | ; CHECK-LABEL: test1 | 
| Owen Anderson | f4f80e1 | 2012-05-07 20:47:23 +0000 | [diff] [blame] | 7 | ; CHECK: fmul float %x, %y | 
|  | 8 | ; CHECK: fmul float %x, %y | 
| Chad Rosier | 5ea14e0 | 2014-06-11 18:28:45 +0000 | [diff] [blame] | 9 | ; CHECK: fsub float %1, %2 | 
|  | 10 | ; CHECK: call void @use(float %{{.*}}) | 
|  | 11 | ; CHECK: call void @use(float %{{.*}}) | 
|  | 12 |  | 
|  | 13 | %1 = fmul float %x, %y | 
|  | 14 | %2 = fmul float %y, %x | 
|  | 15 | %3 = fsub float %1, %2 | 
|  | 16 | call void @use(float %1) | 
|  | 17 | call void @use(float %3) | 
| Duncan Sands | 763da45e | 2012-06-06 14:53:10 +0000 | [diff] [blame] | 18 | ret void | 
| Owen Anderson | f4f80e1 | 2012-05-07 20:47:23 +0000 | [diff] [blame] | 19 | } |