Files
llvm-project/polly/test/polly.c
Michael Kruse 458f1aae8d [Polly] Forward VFS from PassBuilder for IO sandboxing (#188657)
#184545 default-enables the IO sandbox in assert-builds. This causes
Clang using Polly to crash (#188568).

The issue is that `PassBuilder` uses `vfs::getRealFileSystem()` by
default which is considered a IO sandbox violation in the Clang process.
With this PR store the VFS from the `PassBuilder` from the original
`registerPollyPasses` call for creating other `PassBuilder` instances.

This PR also adds infrastructure for running Polly in `clang` (in
addition in `opt`). `opt` does not enable the sandbox such that we need
separate tests using Clang.

Closes: #188568
2026-03-28 23:55:05 +01:00

10 lines
265 B
C

// Sanity test for Polly in Clang
// RUN: %clang %s -O2 -c -mllvm -polly -mllvm -polly-process-unprofitable -mllvm -print-pipeline-passes -o %t.o | FileCheck %s
// CHECK: ,polly,
void foo(int *A, int *B, int n) {
for (int i = 0; i < n; ++i)
A[i] += B[i];
}