• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test functionality of -D# option: numeric variables are defined to the right
2; 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 %s
6
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 NUMERRMSG1
10
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 NUMERRMSG2
14
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-NUMERRMSG1
18
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-NUMERRMSG2
22
23RUN: FileCheck -D#NUMVAL1=7 -D#NUMVAL2=8 --check-prefix NUMNOT1 --input-file %s %s
24
25Numeric value #1 = 8
26Numeric value #2 = 12
27CHECKNUM1: 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 input
33NUMERRMSG1: defines.txt:1:1: note: scanning from here
34NUMERRMSG1: defines.txt:1:1: note: with "NUMVAL1" equal to "7"
35NUMERRMSG1: defines.txt:[[#@LINE-10]]:1: note: possible intended match here
36
37NUMERRMSG2: defines.txt:[[#@LINE-9]]:12: error: CHECKNUM2: expected string not found in input
38NUMERRMSG2: defines.txt:1:1: note: scanning from here
39NUMERRMSG2: defines.txt:1:1: note: with "NUMVAL2" equal to "8"
40NUMERRMSG2: defines.txt:[[#@LINE-14]]:1: note: possible intended match here
41
42NOT-NUMERRMSG1: defines.txt:[[#@LINE-13]]:14: error: {{NUMNOT1}}-NOT: excluded string found in input
43NOT-NUMERRMSG1: defines.txt:[[#@LINE-18]]:1: note: found here
44NOT-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 input
47NOT-NUMERRMSG2: defines.txt:[[#@LINE-21]]:1: note: found here
48NOT-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 %s
52
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 NUMERRMSG3
56
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 NUMERRMSG4
60
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-NUMERRMSG3
64
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-NUMERRMSG4
68
69RUN: FileCheck -D#%X,NUMVAL3=7 -D#%X,NUMVAL4=8 --check-prefix NUMNOT2 --input-file %s %s
70
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 %s
73; Test with explicit and implicit format specifiers.
74RUN: FileCheck -D#%X,NUMVAL3=8 -D#NUMVAL4='NUMVAL3 + 4' --check-prefixes CHECKNUM3,CHECKNUM4 --input-file %s %s
75
76Numeric value #3 = 8
77Numeric value #4 = C
78CHECKNUM3: 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 input
84NUMERRMSG3: defines.txt:1:1: note: scanning from here
85NUMERRMSG3: defines.txt:1:1: note: with "NUMVAL3" equal to "7"
86NUMERRMSG3: defines.txt:[[#@LINE-10]]:1: note: possible intended match here
87
88NUMERRMSG4: defines.txt:[[#@LINE-9]]:12: error: CHECKNUM4: expected string not found in input
89NUMERRMSG4: defines.txt:1:1: note: scanning from here
90NUMERRMSG4: defines.txt:1:1: note: with "NUMVAL4" equal to "8"
91NUMERRMSG4: defines.txt:[[#@LINE-14]]:1: note: possible intended match here
92
93NOT-NUMERRMSG3: defines.txt:[[#@LINE-13]]:14: error: {{NUMNOT2}}-NOT: excluded string found in input
94NOT-NUMERRMSG3: defines.txt:[[#@LINE-18]]:1: note: found here
95NOT-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 input
98NOT-NUMERRMSG4: defines.txt:[[#@LINE-21]]:1: note: found here
99NOT-NUMERRMSG4: defines.txt:[[#@LINE-22]]:1: note: with "NUMVAL4" equal to "C"
100