1
1
// -O2
2
2
// RUN: %clang_cc1 -Wno-implicit-function-declaration \
3
- // RUN: -fmath-errno -ffp-contract=on -fno-rounding-math -O2 -emit-llvm -o - %s \
3
+ // RUN: -triple x86_64-unknown-unknown -fmath-errno -ffp-contract=on \
4
+ // RUN: -fno-rounding-math -O2 -emit-llvm -o - %s \
4
5
// RUN: | FileCheck %s
5
6
6
7
// -ffast-math
7
8
// RUN: %clang_cc1 -Wno-implicit-function-declaration \
8
- // RUN: -menable-no-infs -menable-no-nans -fapprox-func \
9
- // RUN: -funsafe-math-optimizations -fno-signed-zeros -mreassociate \
9
+ // RUN: -triple x86_64-unknown-unknown - menable-no-infs -menable-no-nans \
10
+ // RUN: -fapprox-func - funsafe-math-optimizations -fno-signed-zeros -mreassociate \
10
11
// RUN: -freciprocal-math -ffp-contract=fast -fno-rounding-math -ffast-math \
11
12
// RUN: -ffinite-math-only -ffast-math -emit-llvm -o - %s \
12
13
// RUN: | FileCheck %s -check-prefix=FAST
13
14
14
15
// -O0
15
16
// RUN: %clang_cc1 -Wno-implicit-function-declaration \
16
- // RUN: -fmath-errno -ffp-contract=on -fno-rounding-math -O0 \
17
+ // RUN: -triple x86_64-unknown-unknown -fmath-errno -ffp-contract=on \
18
+ // RUN: -fno-rounding-math -O0 \
17
19
// RUN: -emit-llvm -o - %s | FileCheck %s -check-prefix=NOOPT
18
20
19
21
#pragma float_control(precise,on)
20
22
float f1 (float x ) {
21
23
return sqrtf (x );
22
24
}
23
25
24
- // CHECK-LABEL: define dso_local float @f1
26
+ // CHECK-LABEL: define {{.*}} float @f1
25
27
// CHECK: tail call float @sqrtf(float noundef {{.*}}) #[[ATTR4_O2:[0-9]+]]
26
28
27
- // FAST-LABEL: define dso_local nofpclass(nan inf) float @f1
29
+ // FAST-LABEL: define {{.*}} nofpclass(nan inf) float @f1
28
30
// FAST: call fast nofpclass(nan inf) float @sqrtf(float noundef nofpclass(nan inf) {{.*}}) #[[ATTR3_FAST:[0-9]+]]
29
31
30
- // NOOPT-LABEL: define dso_local float @f1
32
+ // NOOPT-LABEL: define {{.*}} float @f1
31
33
// NOOPT: call float @sqrtf(float noundef {{.*}}) #[[ATTR4_NOOPT:[0-9]+]]
32
34
33
35
#pragma float_control(precise,off)
34
36
float f2 (float x ) {
35
37
return sqrtf (x );
36
38
}
37
39
38
- // CHECK-LABEL: define dso_local float @f2
40
+ // CHECK-LABEL: define {{.*}} float @f2
39
41
// CHECK: tail call fast float @llvm.sqrt.f32(float {{.*}})
40
42
41
- // FAST-LABEL: define dso_local nofpclass(nan inf) float @f2
43
+ // FAST-LABEL: define {{.*}} nofpclass(nan inf) float @f2
42
44
// FAST: call fast float @llvm.sqrt.f32(float {{.*}})
43
45
44
- // NOOPT-LABEL: define dso_local float @f2
46
+ // NOOPT-LABEL: define {{.*}} float @f2
45
47
// NOOPT: call float @sqrtf(float {{.*}}) #[[ATTR4_NOOPT:[0-9]+]]
46
48
47
49
__attribute__((optnone ))
@@ -50,13 +52,13 @@ float f3(float x) {
50
52
return x ;
51
53
}
52
54
53
- // CHECK-LABEL: define dso_local float @f3
55
+ // CHECK-LABEL: define {{.*}} float @f3
54
56
// CHECK: call float @sqrtf(float noundef {{.*}})
55
57
56
- // FAST-LABEL: define dso_local nofpclass(nan inf) float @f3
58
+ // FAST-LABEL: define {{.*}} nofpclass(nan inf) float @f3
57
59
// FAST: call fast nofpclass(nan inf) float @sqrtf(float noundef nofpclass(nan inf) {{.*}}) #[[ATTR4_FAST:[0-9]+]]
58
60
59
- // NOOPT-LABEL: define dso_local float @f3
61
+ // NOOPT-LABEL: define {{.*}} float @f3
60
62
// NOOPT: call float @sqrtf(float noundef %0) #[[ATTR4_NOOPT:[0-9]+]]
61
63
62
64
// CHECK: [[ATTR4_O2]] = { nounwind }
0 commit comments