100 lines · plain
1; Test functionality of -D# option: numeric variables are defined to the right2; value and CHECK directives using them match as expected given the value set.3 4; Tests with default format specifier.5RUN: FileCheck -D#NUMVAL1=8 -D#NUMVAL2='NUMVAL1 + 4' --check-prefixes CHECKNUM1,CHECKNUM2 --input-file %s %s6 7RUN: %ProtectFileCheckOutput \8RUN: not FileCheck -D#NUMVAL1=7 -D#NUMVAL2=12 --check-prefix CHECKNUM1 --input-file %s %s 2>&1 \9RUN: | FileCheck %s --strict-whitespace --check-prefix NUMERRMSG110 11RUN: %ProtectFileCheckOutput \12RUN: not FileCheck -D#NUMVAL1=8 -D#NUMVAL2=8 --check-prefix CHECKNUM2 --input-file %s %s 2>&1 \13RUN: | FileCheck %s --strict-whitespace --check-prefix NUMERRMSG214 15RUN: %ProtectFileCheckOutput \16RUN: not FileCheck -D#NUMVAL1=8 -D#NUMVAL2=8 --check-prefix NUMNOT1 --input-file %s %s 2>&1 \17RUN: | FileCheck %s --strict-whitespace --check-prefix NOT-NUMERRMSG118 19RUN: %ProtectFileCheckOutput \20RUN: not FileCheck -D#NUMVAL1=7 -D#NUMVAL2=12 --check-prefix NUMNOT1 --input-file %s %s 2>&1 \21RUN: | FileCheck %s --strict-whitespace --check-prefix NOT-NUMERRMSG222 23RUN: FileCheck -D#NUMVAL1=7 -D#NUMVAL2=8 --check-prefix NUMNOT1 --input-file %s %s24 25Numeric value #1 = 826Numeric value #2 = 1227CHECKNUM1: Numeric value #1 = [[#NUMVAL1]]28CHECKNUM2: Numeric value #2 = [[#NUMVAL2]]29NUMNOT1-NOT: Numeric value #1 = [[#NUMVAL1]]30NUMNOT1-NOT: Numeric value #2 = [[#NUMVAL2]]31 32NUMERRMSG1: defines.txt:[[#@LINE-5]]:12: error: CHECKNUM1: expected string not found in input33NUMERRMSG1: defines.txt:1:1: note: scanning from here34NUMERRMSG1: defines.txt:1:1: note: with "NUMVAL1" equal to "7"35NUMERRMSG1: defines.txt:[[#@LINE-10]]:1: note: possible intended match here36 37NUMERRMSG2: defines.txt:[[#@LINE-9]]:12: error: CHECKNUM2: expected string not found in input38NUMERRMSG2: defines.txt:1:1: note: scanning from here39NUMERRMSG2: defines.txt:1:1: note: with "NUMVAL2" equal to "8"40NUMERRMSG2: defines.txt:[[#@LINE-14]]:1: note: possible intended match here41 42NOT-NUMERRMSG1: defines.txt:[[#@LINE-13]]:14: error: {{NUMNOT1}}-NOT: excluded string found in input43NOT-NUMERRMSG1: defines.txt:[[#@LINE-18]]:1: note: found here44NOT-NUMERRMSG1: defines.txt:[[#@LINE-19]]:1: note: with "NUMVAL1" equal to "8"45 46NOT-NUMERRMSG2: defines.txt:[[#@LINE-16]]:14: error: {{NUMNOT1}}-NOT: excluded string found in input47NOT-NUMERRMSG2: defines.txt:[[#@LINE-21]]:1: note: found here48NOT-NUMERRMSG2: defines.txt:[[#@LINE-22]]:1: note: with "NUMVAL2" equal to "12"49 50; Tests with explicit format specifiers.51RUN: FileCheck -D#%X,NUMVAL3=8 -D#%X,NUMVAL4='NUMVAL3 + 4' --check-prefixes CHECKNUM3,CHECKNUM4 --input-file %s %s52 53RUN: %ProtectFileCheckOutput \54RUN: not FileCheck -D#%X,NUMVAL3=7 -D#%X,NUMVAL4=12 --check-prefix CHECKNUM3 --input-file %s %s 2>&1 \55RUN: | FileCheck %s --strict-whitespace --check-prefix NUMERRMSG356 57RUN: %ProtectFileCheckOutput \58RUN: not FileCheck -D#%X,NUMVAL3=8 -D#%X,NUMVAL4=8 --check-prefix CHECKNUM4 --input-file %s %s 2>&1 \59RUN: | FileCheck %s --strict-whitespace --check-prefix NUMERRMSG460 61RUN: %ProtectFileCheckOutput \62RUN: not FileCheck -D#%X,NUMVAL3=8 -D#%X,NUMVAL4=8 --check-prefix NUMNOT2 --input-file %s %s 2>&1 \63RUN: | FileCheck %s --strict-whitespace --check-prefix NOT-NUMERRMSG364 65RUN: %ProtectFileCheckOutput \66RUN: not FileCheck -D#%X,NUMVAL3=7 -D#%X,NUMVAL4=12 --check-prefix NUMNOT2 --input-file %s %s 2>&1 \67RUN: | FileCheck %s --strict-whitespace --check-prefix NOT-NUMERRMSG468 69RUN: FileCheck -D#%X,NUMVAL3=7 -D#%X,NUMVAL4=8 --check-prefix NUMNOT2 --input-file %s %s70 71; Test with explicit and default format specifiers.72RUN: FileCheck -D#NUMVAL3=8 -D#%X,NUMVAL4='NUMVAL3 + 4' --check-prefixes CHECKNUM3,CHECKNUM4 --input-file %s %s73; Test with explicit and implicit format specifiers.74RUN: FileCheck -D#%X,NUMVAL3=8 -D#NUMVAL4='NUMVAL3 + 4' --check-prefixes CHECKNUM3,CHECKNUM4 --input-file %s %s75 76Numeric value #3 = 877Numeric value #4 = C78CHECKNUM3: Numeric value #3 = [[#NUMVAL3]]79CHECKNUM4: Numeric value #4 = [[#NUMVAL4]]80NUMNOT2-NOT: Numeric value #3 = [[#NUMVAL3]]81NUMNOT2-NOT: Numeric value #4 = [[#NUMVAL4]]82 83NUMERRMSG3: defines.txt:[[#@LINE-5]]:12: error: CHECKNUM3: expected string not found in input84NUMERRMSG3: defines.txt:1:1: note: scanning from here85NUMERRMSG3: defines.txt:1:1: note: with "NUMVAL3" equal to "7"86NUMERRMSG3: defines.txt:[[#@LINE-10]]:1: note: possible intended match here87 88NUMERRMSG4: defines.txt:[[#@LINE-9]]:12: error: CHECKNUM4: expected string not found in input89NUMERRMSG4: defines.txt:1:1: note: scanning from here90NUMERRMSG4: defines.txt:1:1: note: with "NUMVAL4" equal to "8"91NUMERRMSG4: defines.txt:[[#@LINE-14]]:1: note: possible intended match here92 93NOT-NUMERRMSG3: defines.txt:[[#@LINE-13]]:14: error: {{NUMNOT2}}-NOT: excluded string found in input94NOT-NUMERRMSG3: defines.txt:[[#@LINE-18]]:1: note: found here95NOT-NUMERRMSG3: defines.txt:[[#@LINE-19]]:1: note: with "NUMVAL3" equal to "8"96 97NOT-NUMERRMSG4: defines.txt:[[#@LINE-16]]:14: error: {{NUMNOT2}}-NOT: excluded string found in input98NOT-NUMERRMSG4: defines.txt:[[#@LINE-21]]:1: note: found here99NOT-NUMERRMSG4: defines.txt:[[#@LINE-22]]:1: note: with "NUMVAL4" equal to "C"100