mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
d01f519f6b
Summary: This patch is part of a patch series to add support for FileCheck numeric expressions. This specific patch introduces support for defining numeric variable in a CHECK directive. This commit introduces support for defining numeric variable from a litteral value in the input text. Numeric expressions can then use the variable provided it is on a later line. Copyright: - Linaro (changes up to diff 183612 of revision D55940) - GraphCore (changes in later versions of revision D55940 and in new revision created off D55940) Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield Tags: #llvm Differential Revision: https://reviews.llvm.org/D60386 llvm-svn: 362705
39 lines
1.3 KiB
Plaintext
39 lines
1.3 KiB
Plaintext
; Test that variables not starting with dollar sign get undefined after a
|
|
; CHECK-LABEL directive iff --enable-var-scope is used.
|
|
|
|
; Reference run: variables remain defined at all time when not using
|
|
; --enable-var-scope option.
|
|
RUN: FileCheck --check-prefixes CHECK,LOCAL3,GLOBAL --input-file %s %s
|
|
|
|
RUN: FileCheck --check-prefixes CHECK,GLOBAL --enable-var-scope --input-file %s %s
|
|
RUN: not FileCheck --check-prefixes CHECK,LOCAL1 --enable-var-scope --input-file %s %s 2>&1 \
|
|
RUN: | FileCheck --check-prefixes ERRUNDEF,ERRUNDEFLOCAL %s
|
|
RUN: not FileCheck --check-prefixes CHECK,LOCAL2 --enable-var-scope --input-file %s %s 2>&1 \
|
|
RUN: | FileCheck --check-prefixes ERRUNDEF,ERRUNDEFLOCNUM %s
|
|
RUN: not FileCheck --check-prefixes CHECK,LOCAL3 --enable-var-scope --input-file %s %s 2>&1 \
|
|
RUN: | FileCheck --check-prefixes ERRUNDEF,ERRUNDEFLOCAL,ERRUNDEFLOCNUM %s
|
|
|
|
local1
|
|
global1
|
|
CHECK: [[LOCAL:loc[^[:digit:]]*]][[#LOCNUM:]]
|
|
CHECK: [[$GLOBAL:glo[^[:digit:]]*]][[#$GLOBNUM:]]
|
|
|
|
local2
|
|
global2
|
|
CHECK: [[LOCAL]][[#LOCNUM+1]]
|
|
CHECK: [[$GLOBAL]][[#$GLOBNUM+1]]
|
|
|
|
barrier:
|
|
CHECK-LABEL: barrier
|
|
|
|
local3
|
|
global3
|
|
LOCAL1: [[LOCAL]]3
|
|
LOCAL2: local[[#LOCNUM+2]]
|
|
LOCAL3: [[LOCAL]][[#LOCNUM+2]]
|
|
GLOBAL: [[$GLOBAL]][[#$GLOBNUM+2]]
|
|
|
|
ERRUNDEF: expected string not found in input
|
|
ERRUNDEFLOCAL: uses undefined variable "LOCAL"
|
|
ERRUNDEFLOCNUM: uses undefined variable "LOCNUM"
|