comparison clang/test/PCH/pragma-floatcontrol.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 0572611fdcc8
children
comparison
equal deleted inserted replaced
173:0572611fdcc8 207:2e18cbf3894f
1 // Test this without pch. 1 // Test this without pch.
2 // RUN: %clang_cc1 %s -include %s -verify -fsyntax-only -DSET 2 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -include %s -verify -fsyntax-only -DSET
3 // RUN: %clang_cc1 %s -include %s -verify -fsyntax-only -DPUSH 3 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -include %s -verify -fsyntax-only -DPUSH
4 // RUN: %clang_cc1 %s -include %s -verify -fsyntax-only -DPUSH_POP 4 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -include %s -verify -fsyntax-only -DPUSH_POP
5 5
6 // Test with pch. 6 // Test with pch.
7 // RUN: %clang_cc1 %s -DSET -emit-pch -o %t 7 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -DSET -emit-pch -o %t
8 // RUN: %clang_cc1 %s -DSET -include-pch %t -emit-llvm -o - | FileCheck --check-prefix=CHECK-EBSTRICT %s 8 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -DSET -include-pch %t -emit-llvm -o - | FileCheck --check-prefix=CHECK-EBSTRICT %s
9 // RUN: %clang_cc1 %s -DPUSH -emit-pch -o %t 9 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -ffp-contract=on -DSET -emit-pch -o %t
10 // RUN: %clang_cc1 %s -DPUSH -verify -include-pch %t 10 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -DSET -include-pch %t -emit-llvm -o - | FileCheck --check-prefix=CHECK-EBSTRICT %s
11 // RUN: %clang_cc1 %s -DPUSH_POP -emit-pch -o %t 11 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -menable-no-nans -DSET -emit-pch -o %t
12 // RUN: %clang_cc1 %s -DPUSH_POP -verify -include-pch %t 12 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -DSET -include-pch %t -emit-llvm -o - | FileCheck --check-prefix=CHECK-EBSTRICT %s
13 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -frounding-math -DSET -emit-pch -o %t
14 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -DSET -include-pch %t -emit-llvm -o - | FileCheck --check-prefix=CHECK-EBSTRICT %s
15 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -ffp-exception-behavior=maytrap -DSET -emit-pch -o %t
16 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -DSET -include-pch %t -emit-llvm -o - | FileCheck --check-prefix=CHECK-EBSTRICT %s
17 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -ffp-contract=fast -DSET -emit-pch -o %t
18 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -DSET -include-pch %t -emit-llvm -o - | FileCheck --check-prefix=CHECK-EBSTRICT %s
19 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -DSET -emit-pch -o %t
20 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -ffp-contract=on -DSET -include-pch %t -emit-llvm -o - | FileCheck --check-prefix=CHECK-CONTRACT %s
21 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -DPUSH -emit-pch -o %t
22 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -DPUSH -verify -include-pch %t
23 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -DPUSH_POP -emit-pch -o %t
24 // RUN: %clang_cc1 -fexperimental-strict-floating-point %s -DPUSH_POP -verify -include-pch %t
13 25
14 #ifndef HEADER 26 #ifndef HEADER
15 #define HEADER 27 #define HEADER
16 28
17 #ifdef SET 29 #ifdef SET
34 #ifdef SET 46 #ifdef SET
35 float fun(float a, float b) { 47 float fun(float a, float b) {
36 // CHECK-LABEL: define float @fun{{.*}} 48 // CHECK-LABEL: define float @fun{{.*}}
37 //CHECK-EBSTRICT: llvm.experimental.constrained.fmul{{.*}}tonearest{{.*}}strict 49 //CHECK-EBSTRICT: llvm.experimental.constrained.fmul{{.*}}tonearest{{.*}}strict
38 //CHECK-EBSTRICT: llvm.experimental.constrained.fadd{{.*}}tonearest{{.*}}strict 50 //CHECK-EBSTRICT: llvm.experimental.constrained.fadd{{.*}}tonearest{{.*}}strict
51 //CHECK-CONTRACT: llvm.experimental.constrained.fmuladd{{.*}}tonearest{{.*}}strict
39 return a * b + 2; 52 return a * b + 2;
40 } 53 }
41 #pragma float_control(pop) // expected-warning {{#pragma float_control(pop, ...) failed: stack empty}} 54 #pragma float_control(pop) // expected-warning {{#pragma float_control(pop, ...) failed: stack empty}}
42 #pragma float_control(pop) // expected-warning {{#pragma float_control(pop, ...) failed: stack empty}} 55 #pragma float_control(pop) // expected-warning {{#pragma float_control(pop, ...) failed: stack empty}}
43 #endif 56 #endif