llvm-project/clang/test/Driver/fkeep-persistent-storage-variables.c
Zheng Qian bb6ab91b1d Add option -fkeep-persistent-storage-variables to emit all variables that have a persistent storage duration
This patch adds a new option -fkeep-persistent-storage-variables to emit
all variables that have a persistent storage duration, including global,
static and thread-local variables. This could be useful in cases where
the presence of all these variables as symbols in the object file are
required, so that they can be directly addressed.

Reviewed By: hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D150221
2023-07-15 16:13:48 -04:00

6 lines
338 B
C

// RUN: %clang -fkeep-persistent-storage-variables -c %s -### 2>&1 | FileCheck %s
// RUN: %clang -fkeep-persistent-storage-variables -fno-keep-persistent-storage-variables -c %s -### 2>&1 | FileCheck %s -check-prefix=CHECK-NOKEEP
// CHECK: "-fkeep-persistent-storage-variables"
// CHECK-NOKEEP-NOT: "-fkeep-persistent-storage-variables"