1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/tools/llvm-config/booleans.test
Michal Gorny c7ec34b09f [llvm-config] Canonicalize CMake booleans to 0/1
Following the similar change to lit configuration, ensure that all CMake
booleans are canonicalized to 0/1 when being passed to llvm-config. This
fixes the incorrect interpretation of values when user passes another
value than the ON/OFF, and simplifies the code by removing unnecessary
string matching.

Furthermore, the code for --has-rtti and --has-global-isel has been
modified to print consistent values indepdently of the boolean used by
passed by the user to CMake. Sadly, the code already implicitly used
different values for the two (YES/NO for --has-rtti, ON/OFF for
--has-global-isel).

Include tests for all booleans and multi-value options in llvm-config.

Differential Revision: https://reviews.llvm.org/D28366

llvm-svn: 291593
2017-01-10 19:55:51 +00:00

29 lines
1.2 KiB
Plaintext

# Check whether boolean options are consistently normalized to ON/OFF.
RUN: llvm-config --assertion-mode 2>&1 | FileCheck --check-prefix=CHECK-ONOFF %s
RUN: llvm-config --has-global-isel 2>&1 | FileCheck --check-prefix=CHECK-ONOFF %s
CHECK-ONOFF: {{ON|OFF}}
CHECK-ONOFF-NOT: error:
CHECK-ONOFF-NOT: warning
# ...or to YES/NO.
RUN: llvm-config --has-rtti 2>&1 | FileCheck --check-prefix=CHECK-YESNO %s
CHECK-YESNO: {{YES|NO}}
CHECK-YESNO-NOT: error:
CHECK-YESNO-NOT: warning
# Also check some other multi-choice options.
RUN: llvm-config --build-mode 2>&1 | FileCheck --check-prefix=CHECK-BUILD-MODE %s
CHECK-BUILD-MODE: {{[Dd][Ee][Bb][Uu][Gg]|[Rr][Ee][Ll][Ee][Aa][Ss][Ee]|[Rr][Ee][Ll][Ww][Ii][Tt][Hh][Dd][Ee][Bb][Ii][Nn][Ff][Oo]|[Mm][Ii][Nn][Ss][Ii][Zz][Ee][Rr][Ee][Ll]}}
CHECK-BUILD-MODE-NOT: error:
CHECK-BUILD-MODE-NOT: warning
RUN: llvm-config --build-system 2>&1 | FileCheck --check-prefix=CHECK-BUILD-SYSTEM %s
CHECK-BUILD-SYSTEM: cmake
CHECK-BUILD-SYSTEM-NOT: error:
CHECK-BUILD-SYSTEM-NOT: warning
RUN: llvm-config --shared-mode 2>&1 | FileCheck --check-prefix=CHECK-SHARED-MODE %s
CHECK-SHARED-MODE: {{static|shared}}
CHECK-SHARED-MODE-NOT: error:
CHECK-SHARED-MODE-NOT: warning