xref: /llvm-project/clang/test/Driver/eval-method-with-unsafe-math.c (revision 4d165ad7d9b3395a59c287ef60542b4de3a4d95a)
1 // RUN: not %clang -Xclang -fexperimental-strict-floating-point \
2 // RUN: -Xclang -triple -Xclang x86_64-linux-gnu -fapprox-func \
3 // RUN: -Xclang -verify -ffp-eval-method=source %s 2>&1  \
4 // RUN: | FileCheck %s --check-prefixes=CHECK-FUNC
5 
6 // RUN: not %clang -Xclang -fexperimental-strict-floating-point \
7 // RUN: -Xclang -triple -Xclang x86_64-linux-gnu -Xclang -mreassociate \
8 // RUN: -ffp-eval-method=source -Xclang -verify %s 2>&1 \
9 // RUN: | FileCheck %s --check-prefixes=CHECK-ASSOC
10 
11 // RUN: not %clang -Xclang -fexperimental-strict-floating-point \
12 // RUN: -Xclang -triple -Xclang x86_64-linux-gnu -Xclang -freciprocal-math \
13 // RUN: -ffp-eval-method=source -Xclang -verify %s 2>&1 \
14 // RUN: | FileCheck %s --check-prefixes=CHECK-RECPR
15 
16 // RUN: not %clang -Xclang -fexperimental-strict-floating-point \
17 // RUN: -Xclang -triple -Xclang x86_64-linux-gnu -Xclang -freciprocal-math \
18 // RUN: -Xclang -mreassociate -ffp-eval-method=source -Xclang -verify %s 2>&1 \
19 // RUN: | FileCheck %s --check-prefixes=CHECK-ASSOC,CHECK-RECPR
20 
21 // RUN: not %clang -Xclang -fexperimental-strict-floating-point \
22 // RUN: -Xclang -triple -Xclang x86_64-linux-gnu -Xclang -freciprocal-math \
23 // RUN: -Xclang -mreassociate -fapprox-func -ffp-eval-method=source \
24 // RUN: -Xclang -verify %s 2>&1 \
25 // RUN: | FileCheck %s --check-prefixes=CHECK-ASSOC,CHECK-RECPR,CHECK-FUNC
26 
27 // CHECK-FUNC: (frontend): option 'ffp-eval-method' cannot be used with option 'fapprox-func'
28 // CHECK-ASSOC: (frontend): option 'ffp-eval-method' cannot be used with option 'mreassociate'
29 // CHECK-RECPR: (frontend): option 'ffp-eval-method' cannot be used with option 'freciprocal'
30