mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-24 22:08:57 -04:00

The 1st and 2nd tries to land this (r238055, r238851) were reverted due to bot failures caused by the LLVM part of the patch. That was hopefully fixed after r239001. This is the front-end counterpart to D8982. The -mrecip option interface is based on maintaining compatibility with gcc: https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/i386-and-x86-64-Options.html#index-mrecip_003dopt-1627 https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/RS_002f6000-and-PowerPC-Options.html#index-mrecip-2289 ...while adding more functionality (allowing users to specify the number of refinement steps for each estimate type). Differential Revision: http://reviews.llvm.org/D8989 llvm-svn: 239536
71 lines
2.5 KiB
C
71 lines
2.5 KiB
C
////
|
|
//// Verify that valid options for the -mrecip flag are passed through and invalid options cause an error.
|
|
////
|
|
|
|
//// If there are no options, convert to 'all'.
|
|
|
|
// RUN: %clang -### -S %s -mrecip 2>&1 | FileCheck --check-prefix=RECIP0 %s
|
|
// RECIP0: "-mrecip=all"
|
|
|
|
//// Check options that cover all types.
|
|
|
|
// RUN: %clang -### -S %s -mrecip=all 2>&1 | FileCheck --check-prefix=RECIP1 %s
|
|
// RECIP1: "-mrecip=all"
|
|
|
|
// RUN: %clang -### -S %s -mrecip=default 2>&1 | FileCheck --check-prefix=RECIP2 %s
|
|
// RECIP2: "-mrecip=default"
|
|
|
|
// RUN: %clang -### -S %s -mrecip=none 2>&1 | FileCheck --check-prefix=RECIP3 %s
|
|
// RECIP3: "-mrecip=none"
|
|
|
|
//// Check options that do not specify float or double.
|
|
|
|
// RUN: %clang -### -S %s -mrecip=vec-sqrt 2>&1 | FileCheck --check-prefix=RECIP4 %s
|
|
// RECIP4: "-mrecip=vec-sqrt"
|
|
|
|
// RUN: %clang -### -S %s -mrecip=!div,vec-div 2>&1 | FileCheck --check-prefix=RECIP5 %s
|
|
// RECIP5: "-mrecip=!div,vec-div"
|
|
|
|
//// Check individual option types.
|
|
|
|
// RUN: %clang -### -S %s -mrecip=vec-sqrtd 2>&1 | FileCheck --check-prefix=RECIP6 %s
|
|
// RECIP6: "-mrecip=vec-sqrtd"
|
|
|
|
// RUN: %clang -### -S %s -mrecip=!divf 2>&1 | FileCheck --check-prefix=RECIP7 %s
|
|
// RECIP7: "-mrecip=!divf"
|
|
|
|
// RUN: %clang -### -S %s -mrecip=divf,sqrtd,vec-divd,vec-sqrtf 2>&1 | FileCheck --check-prefix=RECIP8 %s
|
|
// RECIP8: "-mrecip=divf,sqrtd,vec-divd,vec-sqrtf"
|
|
|
|
//// Check optional refinement step specifiers.
|
|
|
|
// RUN: %clang -### -S %s -mrecip=all:1 2>&1 | FileCheck --check-prefix=RECIP9 %s
|
|
// RECIP9: "-mrecip=all:1"
|
|
|
|
// RUN: %clang -### -S %s -mrecip=sqrtf:3 2>&1 | FileCheck --check-prefix=RECIP10 %s
|
|
// RECIP10: "-mrecip=sqrtf:3"
|
|
|
|
// RUN: %clang -### -S %s -mrecip=div:5 2>&1 | FileCheck --check-prefix=RECIP11 %s
|
|
// RECIP11: "-mrecip=div:5"
|
|
|
|
// RUN: %clang -### -S %s -mrecip=divd:1,!sqrtf:2,vec-divf:9,vec-sqrtd:0 2>&1 | FileCheck --check-prefix=RECIP12 %s
|
|
// RECIP12: "-mrecip=divd:1,!sqrtf:2,vec-divf:9,vec-sqrtd:0"
|
|
|
|
//// Check invalid parameters.
|
|
|
|
// RUN: %clang -### -S %s -mrecip=bogus 2>&1 | FileCheck --check-prefix=RECIP13 %s
|
|
// RECIP13: error: unknown argument
|
|
|
|
// RUN: %clang -### -S %s -mrecip=divd:1,divd 2>&1 | FileCheck --check-prefix=RECIP14 %s
|
|
// RECIP14: error: invalid value
|
|
|
|
// RUN: %clang -### -S %s -mrecip=sqrt,sqrtf 2>&1 | FileCheck --check-prefix=RECIP15 %s
|
|
// RECIP15: error: invalid value
|
|
|
|
// RUN: %clang -### -S %s -mrecip=+default:10 2>&1 | FileCheck --check-prefix=RECIP16 %s
|
|
// RECIP16: error: invalid value
|
|
|
|
// RUN: %clang -### -S %s -mrecip=!vec-divd: 2>&1 | FileCheck --check-prefix=RECIP17 %s
|
|
// RECIP17: error: invalid value
|
|
|