xref: /llvm-project/llvm/test/Other/opt-override-denormal-fp-math.ll (revision 19dc6ec957d4993c0bd89bdb8c31f3cfc52a491b)
1; RUN: opt -S -denormal-fp-math=ieee %s | FileCheck -check-prefixes=IEEE,ALL %s
2; RUN: opt -S -denormal-fp-math=preserve-sign %s | FileCheck -check-prefixes=PRESERVESIGN,ALL %s
3; RUN: opt -S -denormal-fp-math=positive-zero %s | FileCheck -check-prefixes=POSITIVEZERO,ALL %s
4
5; ALL: @no_denormal_fp_math_attr() [[NOATTR:#[0-9]+]] {
6define i32 @no_denormal_fp_math_attr() #0 {
7entry:
8  ret i32 0
9}
10
11; ALL: denormal_fp_math_attr_preserve_sign_ieee() [[ATTR:#[0-9]+]] {
12define i32 @denormal_fp_math_attr_preserve_sign_ieee() #1 {
13entry:
14  ret i32 0
15}
16
17; ALL-DAG: attributes [[ATTR]] = { nounwind "denormal-fp-math"="preserve-sign,ieee" }
18; IEEE-DAG: attributes [[NOATTR]] = { nounwind "denormal-fp-math"="ieee,ieee" }
19; PRESERVESIGN-DAG: attributes [[NOATTR]] = { nounwind "denormal-fp-math"="preserve-sign,preserve-sign" }
20; POSITIVEZERO-DAG: attributes [[NOATTR]] = { nounwind "denormal-fp-math"="positive-zero,positive-zero" }
21
22attributes #0 = { nounwind }
23attributes #1 = { nounwind "denormal-fp-math"="preserve-sign,ieee" }
24