[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / SystemZ / strictfp_builtins.c
blob8c8f1f4cabd7429e78482881bd2a1fc259f3baa4
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // REQUIRES: systemz-registered-target
3 // RUN: %clang_cc1 %s -emit-llvm -ffp-exception-behavior=maytrap -o - -triple s390x-linux-gnu | FileCheck %s
5 #pragma float_control(except, on)
7 // CHECK-LABEL: @test_isnan_float(
8 // CHECK-NEXT: entry:
9 // CHECK-NEXT: [[F_ADDR:%.*]] = alloca float, align 4
10 // CHECK-NEXT: store float [[F:%.*]], ptr [[F_ADDR]], align 4
11 // CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[F_ADDR]], align 4
12 // CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.s390.tdc.f32(float [[TMP0]], i64 15) #[[ATTR2:[0-9]+]]
13 // CHECK-NEXT: ret i32 [[TMP1]]
15 int test_isnan_float(float f) {
16 return __builtin_isnan(f);
19 // CHECK-LABEL: @test_isnan_double(
20 // CHECK-NEXT: entry:
21 // CHECK-NEXT: [[D_ADDR:%.*]] = alloca double, align 8
22 // CHECK-NEXT: store double [[D:%.*]], ptr [[D_ADDR]], align 8
23 // CHECK-NEXT: [[TMP0:%.*]] = load double, ptr [[D_ADDR]], align 8
24 // CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.s390.tdc.f64(double [[TMP0]], i64 15) #[[ATTR2]]
25 // CHECK-NEXT: ret i32 [[TMP1]]
27 int test_isnan_double(double d) {
28 return __builtin_isnan(d);
31 // CHECK-LABEL: @test_isnan_long_double(
32 // CHECK-NEXT: entry:
33 // CHECK-NEXT: [[LD_ADDR:%.*]] = alloca fp128, align 8
34 // CHECK-NEXT: [[LD:%.*]] = load fp128, ptr [[TMP0:%.*]], align 8
35 // CHECK-NEXT: store fp128 [[LD]], ptr [[LD_ADDR]], align 8
36 // CHECK-NEXT: [[TMP1:%.*]] = load fp128, ptr [[LD_ADDR]], align 8
37 // CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.s390.tdc.f128(fp128 [[TMP1]], i64 15) #[[ATTR2]]
38 // CHECK-NEXT: ret i32 [[TMP2]]
40 int test_isnan_long_double(long double ld) {
41 return __builtin_isnan(ld);
44 // CHECK-LABEL: @test_isinf_float(
45 // CHECK-NEXT: entry:
46 // CHECK-NEXT: [[F_ADDR:%.*]] = alloca float, align 4
47 // CHECK-NEXT: store float [[F:%.*]], ptr [[F_ADDR]], align 4
48 // CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[F_ADDR]], align 4
49 // CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.s390.tdc.f32(float [[TMP0]], i64 48) #[[ATTR2]]
50 // CHECK-NEXT: ret i32 [[TMP1]]
52 int test_isinf_float(float f) {
53 return __builtin_isinf(f);
56 // CHECK-LABEL: @test_isinf_double(
57 // CHECK-NEXT: entry:
58 // CHECK-NEXT: [[D_ADDR:%.*]] = alloca double, align 8
59 // CHECK-NEXT: store double [[D:%.*]], ptr [[D_ADDR]], align 8
60 // CHECK-NEXT: [[TMP0:%.*]] = load double, ptr [[D_ADDR]], align 8
61 // CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.s390.tdc.f64(double [[TMP0]], i64 48) #[[ATTR2]]
62 // CHECK-NEXT: ret i32 [[TMP1]]
64 int test_isinf_double(double d) {
65 return __builtin_isinf(d);
68 // CHECK-LABEL: @test_isinf_long_double(
69 // CHECK-NEXT: entry:
70 // CHECK-NEXT: [[LD_ADDR:%.*]] = alloca fp128, align 8
71 // CHECK-NEXT: [[LD:%.*]] = load fp128, ptr [[TMP0:%.*]], align 8
72 // CHECK-NEXT: store fp128 [[LD]], ptr [[LD_ADDR]], align 8
73 // CHECK-NEXT: [[TMP1:%.*]] = load fp128, ptr [[LD_ADDR]], align 8
74 // CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.s390.tdc.f128(fp128 [[TMP1]], i64 48) #[[ATTR2]]
75 // CHECK-NEXT: ret i32 [[TMP2]]
77 int test_isinf_long_double(long double ld) {
78 return __builtin_isinf(ld);
81 // CHECK-LABEL: @test_isfinite_float(
82 // CHECK-NEXT: entry:
83 // CHECK-NEXT: [[F_ADDR:%.*]] = alloca float, align 4
84 // CHECK-NEXT: store float [[F:%.*]], ptr [[F_ADDR]], align 4
85 // CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[F_ADDR]], align 4
86 // CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.s390.tdc.f32(float [[TMP0]], i64 4032) #[[ATTR2]]
87 // CHECK-NEXT: ret i32 [[TMP1]]
89 int test_isfinite_float(float f) {
90 return __builtin_isfinite(f);
93 // CHECK-LABEL: @test_isfinite_double(
94 // CHECK-NEXT: entry:
95 // CHECK-NEXT: [[D_ADDR:%.*]] = alloca double, align 8
96 // CHECK-NEXT: store double [[D:%.*]], ptr [[D_ADDR]], align 8
97 // CHECK-NEXT: [[TMP0:%.*]] = load double, ptr [[D_ADDR]], align 8
98 // CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.s390.tdc.f64(double [[TMP0]], i64 4032) #[[ATTR2]]
99 // CHECK-NEXT: ret i32 [[TMP1]]
101 int test_isfinite_double(double d) {
102 return __builtin_isfinite(d);
105 // CHECK-LABEL: @test_isfinite_long_double(
106 // CHECK-NEXT: entry:
107 // CHECK-NEXT: [[LD_ADDR:%.*]] = alloca fp128, align 8
108 // CHECK-NEXT: [[LD:%.*]] = load fp128, ptr [[TMP0:%.*]], align 8
109 // CHECK-NEXT: store fp128 [[LD]], ptr [[LD_ADDR]], align 8
110 // CHECK-NEXT: [[TMP1:%.*]] = load fp128, ptr [[LD_ADDR]], align 8
111 // CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.s390.tdc.f128(fp128 [[TMP1]], i64 4032) #[[ATTR2]]
112 // CHECK-NEXT: ret i32 [[TMP2]]
114 int test_isfinite_long_double(long double ld) {
115 return __builtin_isfinite(ld);