[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Driver / memtag-stack.c
blob8ee49bec3e364f6544389d0738bf1357750ded0f
1 // RUN: %clang --target=aarch64 -march=armv8+memtag -fsanitize=memtag-stack -mllvm -stack-safety-print=1 %s -S -o - 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SAFETY
2 // RUN: %clang -O1 --target=aarch64 -march=armv8+memtag -fsanitize=memtag-stack -mllvm -stack-safety-print=1 %s -S -o - 2>&1 | FileCheck %s --check-prefix=CHECK-SAFETY
3 // RUN: %clang -O2 --target=aarch64 -march=armv8+memtag -fsanitize=memtag-stack -mllvm -stack-safety-print=1 %s -S -o - 2>&1 | FileCheck %s --check-prefix=CHECK-SAFETY
4 // RUN: %clang -O3 --target=aarch64 -march=armv8+memtag -fsanitize=memtag-stack -mllvm -stack-safety-print=1 %s -S -o - 2>&1 | FileCheck %s --check-prefix=CHECK-SAFETY
6 // REQUIRES: aarch64-registered-target
8 int z;
9 __attribute__((noinline)) void use(int *p) { *p = z; }
10 int foo() {
11 int x;
12 use(&x);
13 return x;
16 // CHECK-NO-SAFETY-NOT: allocas uses
18 // CHECK-SAFETY-LABEL: @foo
19 // CHECK-SAFETY-LABEL: allocas uses:
20 // CHECK-SAFETY-NEXT: [4]: [0,4)