annotate test/Verifier/fp-intrinsics.ll @ 146:3fc4d5c3e21e

set tail call flag for code segment in CGCAll
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 19:23:36 +0900
parents 803732b1fca8
children c2174574ed3a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; RUN: opt -verify -S < %s 2>&1 | FileCheck --check-prefix=CHECK1 %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 ; RUN: sed -e s/.T2:// %s | not opt -verify -disable-output 2>&1 | FileCheck --check-prefix=CHECK2 %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 ; RUN: sed -e s/.T3:// %s | not opt -verify -disable-output 2>&1 | FileCheck --check-prefix=CHECK3 %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 ; RUN: sed -e s/.T4:// %s | not opt -verify -disable-output 2>&1 | FileCheck --check-prefix=CHECK4 %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 ; RUN: sed -e s/.T5:// %s | not opt -verify -disable-output 2>&1 | FileCheck --check-prefix=CHECK5 %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 ; Common declarations used for all runs.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 declare double @llvm.experimental.constrained.fadd.f64(double, double, metadata, metadata)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 declare double @llvm.experimental.constrained.sqrt.f64(double, metadata, metadata)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 ; Test that the verifier accepts legal code, and that the correct attributes are
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 ; attached to the FP intrinsic.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 ; CHECK1: declare double @llvm.experimental.constrained.fadd.f64(double, double, metadata, metadata) #[[ATTR:[0-9]+]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 ; CHECK1: declare double @llvm.experimental.constrained.sqrt.f64(double, metadata, metadata) #[[ATTR]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 ; CHECK1: attributes #[[ATTR]] = { inaccessiblememonly nounwind }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 ; Note: FP exceptions aren't usually caught through normal unwind mechanisms,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 ; but we may want to revisit this for asynchronous exception handling.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 define double @f1(double %a, double %b) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 %fadd = call double @llvm.experimental.constrained.fadd.f64(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 double %a, double %b,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 metadata !"round.dynamic",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 metadata !"fpexcept.strict")
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 ret double %fadd
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 define double @f1u(double %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 %fsqrt = call double @llvm.experimental.constrained.sqrt.f64(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 double %a,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 metadata !"round.dynamic",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 metadata !"fpexcept.strict")
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 ret double %fsqrt
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 ; Test an illegal value for the rounding mode argument.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 ; CHECK2: invalid rounding mode argument
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 ;T2: define double @f2(double %a, double %b) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 ;T2: entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 ;T2: %fadd = call double @llvm.experimental.constrained.fadd.f64(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 ;T2: double %a, double %b,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 ;T2: metadata !"round.dynomite",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 ;T2: metadata !"fpexcept.strict")
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 ;T2: ret double %fadd
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 ;T2: }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 ; Test an illegal value for the exception behavior argument.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 ; CHECK3: invalid exception behavior argument
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 ;T3: define double @f3(double %a, double %b) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 ;T3: entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 ;T3: %fadd = call double @llvm.experimental.constrained.fadd.f64(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 ;T3: double %a, double %b,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 ;T3: metadata !"round.dynamic",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 ;T3: metadata !"fpexcept.restrict")
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 ;T3: ret double %fadd
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 ;T3: }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 ; Test an illegal value for the rounding mode argument.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 ; CHECK4: invalid rounding mode argument
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 ;T4: define double @f4(double %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 ;T4: entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 ;T4: %fadd = call double @llvm.experimental.constrained.sqrt.f64(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 ;T4: double %a,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 ;T4: metadata !"round.dynomite",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65 ;T4: metadata !"fpexcept.strict")
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 ;T4: ret double %fadd
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 ;T4: }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69 ; Test an illegal value for the exception behavior argument.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70 ; CHECK5: invalid exception behavior argument
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 ;T5: define double @f5(double %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 ;T5: entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73 ;T5: %fadd = call double @llvm.experimental.constrained.sqrt.f64(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 ;T5: double %a,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 ;T5: metadata !"round.dynamic",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76 ;T5: metadata !"fpexcept.restrict")
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77 ;T5: ret double %fadd
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78 ;T5: }