Files
TheRock/compiler/amd-llvm/llvm/test/FileCheck/var-scope.txt
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

70 lines
2.5 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,CHECK-LOCAL-BOTH,CHECK-GLOBAL --input-file %s %s
RUN: FileCheck --check-prefixes CHECK,CHECK-GLOBAL --enable-var-scope --input-file %s %s
RUN: %ProtectFileCheckOutput not FileCheck --check-prefixes CHECK,CHECK-LOCAL-TEXT --enable-var-scope --input-file %s %s 2>&1 \
RUN: | FileCheck --implicit-check-not "undefined variable:" --check-prefixes ERRUNDEF,ERRUNDEF-LOCAL %s
RUN: %ProtectFileCheckOutput not FileCheck --check-prefixes CHECK,CHECK-LOCAL-NUM --enable-var-scope --input-file %s %s 2>&1 \
RUN: | FileCheck --implicit-check-not "undefined variable:" --check-prefixes ERRUNDEF,ERRUNDEF-LOCNUM %s
RUN: %ProtectFileCheckOutput not FileCheck --check-prefixes CHECK,CHECK-LOCAL-BOTH --enable-var-scope --input-file %s %s 2>&1 \
RUN: | FileCheck --implicit-check-not "undefined variable:" --check-prefixes ERRUNDEF,ERRUNDEF-LOCAL,ERRUNDEF-LOCNUM %s
local1
global1
CHECK: [[LOCAL:loc[^[:digit:]]*]][[#LOCNUM:]]
CHECK: [[$GLOBAL:glo[^[:digit:]]*]][[#$GLOBNUM:]]
local2
global2
CHECK: [[LOCAL]][[#LOCNUM+1]]
CHECK: [[$GLOBAL]][[#$GLOBNUM+1]]
// Barrier to clear local variables
barrier1:
CHECK-LABEL: barrier1
local3
global3
CHECK-LOCAL-TEXT: [[LOCAL]]3
CHECK-LOCAL-NUM: local[[#LOCNUM+2]]
CHECK-LOCAL-BOTH: [[LOCAL]][[#LOCNUM+2]]
CHECK-GLOBAL: [[$GLOBAL]][[#$GLOBNUM+2]]
// Barrier to continue FileCheck execution even after the first fail
barrier2:
CHECK-LABEL: barrier2
// Reassign the variables to check that clearing-after-reassigning works
local4
global4
CHECK: [[LOCAL:loc[^[:digit:]]*]][[#LOCNUM:]]
CHECK: [[$GLOBAL:glo[^[:digit:]]*]][[#$GLOBNUM:]]
// Barrier to clear local variables
barrier3:
CHECK-LABEL: barrier3
local5
global5
CHECK-LOCAL-TEXT: [[LOCAL]]5
CHECK-LOCAL-NUM: local[[#LOCNUM+1]]
CHECK-LOCAL-BOTH: [[LOCAL]][[#LOCNUM+1]]
CHECK-GLOBAL: [[$GLOBAL]][[#$GLOBNUM+1]]
// Check that the tests fail as expected
ERRUNDEF-LOCAL: undefined variable: LOCAL
ERRUNDEF-LOCNUM: undefined variable: LOCNUM
ERRUNDEF-LOCAL: undefined variable: LOCAL
ERRUNDEF-LOCNUM: undefined variable: LOCNUM
// Look for "Input was:" to only match the error messages before the input-context.
//
// The regex /([[:space:]]|.)*/ matches all remaining characters,
// to avoid fails due to --implicit-check-not
ERRUNDEF: {{^Input was:([[:space:]]|.)*}}