annotate clang/test/CodeGen/fp-options-to-fast-math-flags.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix CHECK-PRECISE %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -menable-no-nans -emit-llvm -o - %s | FileCheck -check-prefix CHECK-NO-NANS %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -menable-no-infs -emit-llvm -o - %s | FileCheck -check-prefix CHECK-NO-INFS %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -ffinite-math-only -emit-llvm -o - %s | FileCheck -check-prefix CHECK-FINITE %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fno-signed-zeros -emit-llvm -o - %s | FileCheck -check-prefix CHECK-NO-SIGNED-ZEROS %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -mreassociate -emit-llvm -o - %s | FileCheck -check-prefix CHECK-REASSOC %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -freciprocal-math -emit-llvm -o - %s | FileCheck -check-prefix CHECK-RECIP %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -menable-unsafe-fp-math -emit-llvm -o - %s | FileCheck -check-prefix CHECK-UNSAFE %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -ffast-math -emit-llvm -o - %s | FileCheck -check-prefix CHECK-FAST %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 float fn(float);
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 float test(float a) {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 return a + fn(a);
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 // CHECK-PRECISE: [[CALL_RES:%.+]] = call float @fn(float {{%.+}})
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 // CHECK-PRECISE: {{%.+}} = fadd float {{%.+}}, [[CALL_RES]]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 // CHECK-NO-NANS: [[CALL_RES:%.+]] = call nnan float @fn(float {{%.+}})
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 // CHECK-NO-NANS: {{%.+}} = fadd nnan float {{%.+}}, [[CALL_RES]]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 // CHECK-NO-INFS: [[CALL_RES:%.+]] = call ninf float @fn(float {{%.+}})
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 // CHECK-NO-INFS: {{%.+}} = fadd ninf float {{%.+}}, [[CALL_RES]]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 // CHECK-FINITE: [[CALL_RES:%.+]] = call nnan ninf float @fn(float {{%.+}})
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 // CHECK-FINITE: {{%.+}} = fadd nnan ninf float {{%.+}}, [[CALL_RES]]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 // CHECK-NO-SIGNED-ZEROS: [[CALL_RES:%.+]] = call nsz float @fn(float {{%.+}})
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 // CHECK-NO-SIGNED-ZEROS: {{%.+}} = fadd nsz float {{%.+}}, [[CALL_RES]]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 // CHECK-REASSOC: [[CALL_RES:%.+]] = call reassoc float @fn(float {{%.+}})
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 // CHECK-REASSOC: {{%.+}} = fadd reassoc float {{%.+}}, [[CALL_RES]]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 // CHECK-RECIP: [[CALL_RES:%.+]] = call arcp float @fn(float {{%.+}})
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 // CHECK-RECIP: {{%.+}} = fadd arcp float {{%.+}}, [[CALL_RES]]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 // CHECK-UNSAFE: [[CALL_RES:%.+]] = call reassoc nsz arcp afn float @fn(float {{%.+}})
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 // CHECK-UNSAFE: {{%.+}} = fadd reassoc nsz arcp afn float {{%.+}}, [[CALL_RES]]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 // CHECK-FAST: [[CALL_RES:%.+]] = call reassoc nnan ninf nsz arcp afn float @fn(float {{%.+}})
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 // CHECK-FAST: {{%.+}} = fadd reassoc nnan ninf nsz arcp afn float {{%.+}}, [[CALL_RES]]