[PM] Widen the interface for invalidate on an analysis result now that
[oota-llvm.git] / test / CodeGen / Generic / isel-optnone.ll
1 ; RUN: llc -debug < %s -o /dev/null 2>&1 | FileCheck %s
2 ; REQUIRES: asserts
3
4 ; Verify that the backend correctly overrides the optimization level
5 ; of optnone functions during instruction selection.
6
7 define float @foo(float %x) #0 {
8 entry:
9   %add = fadd fast float %x, %x
10   %add1 = fadd fast float %add, %x
11   ret float %add1
12 }
13
14 ; CHECK-NOT: Changing optimization level for Function foo
15 ; CHECK-NOT: Restoring optimization level for Function foo
16
17 ; Function Attrs: noinline optnone
18 define float @fooWithOptnone(float %x) #1 {
19 entry:
20   %add = fadd fast float %x, %x
21   %add1 = fadd fast float %add, %x
22   ret float %add1
23 }
24
25 ; CHECK: Changing optimization level for Function fooWithOptnone
26 ; CHECK-NEXT: Before: -O2 ; After: -O0
27
28 ; CHECK: Restoring optimization level for Function fooWithOptnone
29 ; CHECK-NEXT: Before: -O0 ; After: -O2
30
31 attributes #0 = { "unsafe-fp-math"="true" }
32 attributes #1 = { noinline optnone "unsafe-fp-math"="true" }