[clang] 6dd738e - [StackSafety,NFC] Switch tests to aarch64

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 5 00:25:14 PDT 2020


Author: Vitaly Buka
Date: 2020-06-05T00:24:02-07:00
New Revision: 6dd738e2f0609f7d3313b574a1d471263d2d3ba1

URL: https://github.com/llvm/llvm-project/commit/6dd738e2f0609f7d3313b574a1d471263d2d3ba1
DIFF: https://github.com/llvm/llvm-project/commit/6dd738e2f0609f7d3313b574a1d471263d2d3ba1.diff

LOG: [StackSafety,NFC] Switch tests to aarch64

Added: 
    

Modified: 
    clang/test/Driver/memtag_lto.c
    llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa-alias.ll
    llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa.ll
    llvm/test/Analysis/StackSafetyAnalysis/ipa-alias.ll
    llvm/test/Analysis/StackSafetyAnalysis/ipa.ll

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/memtag_lto.c b/clang/test/Driver/memtag_lto.c
index d9cf327c1bca..81a6f7b842e1 100644
--- a/clang/test/Driver/memtag_lto.c
+++ b/clang/test/Driver/memtag_lto.c
@@ -5,13 +5,13 @@
 // RUN: rm -f %t*
 
 // -O1, no tagging
-// RUN: %clang -fno-experimental-new-pass-manager -O1 -target aarch64-unknown-linux -mllvm -stack-safety-print=1 %s -S -o - 2>&1 | FileCheck %s
-// RUN: %clang    -fexperimental-new-pass-manager -O1 -target aarch64-unknown-linux -mllvm -stack-safety-print=1 %s -S -o - 2>&1 | FileCheck %s
+// RUN: %clang -fno-experimental-new-pass-manager -O1 -target aarch64-unknown-linux -mllvm -stack-safety-print %s -S -o - 2>&1 | FileCheck %s
+// RUN: %clang    -fexperimental-new-pass-manager -O1 -target aarch64-unknown-linux -mllvm -stack-safety-print %s -S -o - 2>&1 | FileCheck %s
 
 // Full LTO
 // RUN: %clang -fno-experimental-new-pass-manager -O1 -target aarch64-unknown-linux -c %s -flto=full -o %t.lto1.bc
 // RUN: %clang -fno-experimental-new-pass-manager -O1 -target aarch64-unknown-linux -c -DBUILD2 %s -flto=full -o %t.lto2.bc
-// RUN: llvm-lto2 run -o %t.lto %t.lto1.bc %t.lto2.bc -save-temps -stack-safety-print=1 -thinlto-threads 1 -O1 \
+// RUN: llvm-lto2 run -o %t.lto %t.lto1.bc %t.lto2.bc -save-temps -stack-safety-print -thinlto-threads 1 -O1 \
 // RUN:  -r %t.lto1.bc,fn,plx \
 // RUN:  -r %t.lto1.bc,use,lx \
 // RUN:  -r %t.lto1.bc,use_local,plx \
@@ -22,7 +22,7 @@
 // Full LTO, new PM
 // RUN: %clang -fexperimental-new-pass-manager -O1 -target aarch64-unknown-linux -c %s -flto=full -o %t.ltonewpm1.bc
 // RUN: %clang -fexperimental-new-pass-manager -O1 -target aarch64-unknown-linux -c -DBUILD2 %s -flto=full -o %t.ltonewpm2.bc
-// RUN: llvm-lto2 run -use-new-pm -o %t.ltonewpm %t.ltonewpm1.bc %t.ltonewpm2.bc -save-temps -stack-safety-print=1 -thinlto-threads 1 -O1 \
+// RUN: llvm-lto2 run -use-new-pm -o %t.ltonewpm %t.ltonewpm1.bc %t.ltonewpm2.bc -save-temps -stack-safety-print -thinlto-threads 1 -O1 \
 // RUN:  -r %t.ltonewpm1.bc,fn,plx \
 // RUN:  -r %t.ltonewpm1.bc,use,lx \
 // RUN:  -r %t.ltonewpm1.bc,use_local,plx \
@@ -33,7 +33,7 @@
 // Thin LTO
 // RUN: %clang -fno-experimental-new-pass-manager -O1 -target aarch64-unknown-linux -c %s -flto=thin -o %t.thinlto1.bc
 // RUN: %clang -fno-experimental-new-pass-manager -O1 -target aarch64-unknown-linux -c -DBUILD2 %s -flto=thin -o %t.thinlto2.bc
-// RUN: llvm-lto2 run -o %t.thinlto %t.thinlto1.bc %t.thinlto2.bc -save-temps -stack-safety-print=1 -thinlto-threads 1 -O1 \
+// RUN: llvm-lto2 run -o %t.thinlto %t.thinlto1.bc %t.thinlto2.bc -save-temps -stack-safety-print -thinlto-threads 1 -O1 \
 // RUN:  -r %t.thinlto1.bc,fn,plx \
 // RUN:  -r %t.thinlto1.bc,use,lx \
 // RUN:  -r %t.thinlto1.bc,use_local,plx \
@@ -44,7 +44,7 @@
 // Thin LTO, new PM
 // RUN: %clang -fexperimental-new-pass-manager -O1 -target aarch64-unknown-linux -c %s -flto=thin -o %t.thinltonewpm1.bc
 // RUN: %clang -fexperimental-new-pass-manager -O1 -target aarch64-unknown-linux -c -DBUILD2 %s -flto=thin -o %t.thinltonewpm2.bc
-// RUN: llvm-lto2 run -use-new-pm -o %t.thinltonewpm %t.thinltonewpm1.bc %t.thinltonewpm2.bc -save-temps -stack-safety-print=1 -thinlto-threads 1 -O1 \
+// RUN: llvm-lto2 run -use-new-pm -o %t.thinltonewpm %t.thinltonewpm1.bc %t.thinltonewpm2.bc -save-temps -stack-safety-print -thinlto-threads 1 -O1 \
 // RUN:  -r %t.thinltonewpm1.bc,fn,plx \
 // RUN:  -r %t.thinltonewpm1.bc,use,lx \
 // RUN:  -r %t.thinltonewpm1.bc,use_local,plx \
@@ -56,17 +56,17 @@
 // RUN: rm -f %t*
 
 // -O0: both are unsafe.
-// RUN: %clang -fno-experimental-new-pass-manager -O0 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -mllvm -stack-safety-print=1 %s -S -o - 2>&1 | FileCheck %s
-// RUN: %clang    -fexperimental-new-pass-manager -O0 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -mllvm -stack-safety-print=1 %s -S -o - 2>&1 | FileCheck %s
+// RUN: %clang -fno-experimental-new-pass-manager -O0 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -mllvm -stack-safety-print %s -S -o - 2>&1 | FileCheck %s
+// RUN: %clang    -fexperimental-new-pass-manager -O0 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -mllvm -stack-safety-print %s -S -o - 2>&1 | FileCheck %s
 
 // No LTO: just one is safe.
-// RUN: %clang -fno-experimental-new-pass-manager -O1 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -mllvm -stack-safety-print=1 %s -S -o /dev/null 2>&1 | FileCheck %s -check-prefixes=SSI,XUNSAFE,YSAFE
-// RUN: %clang    -fexperimental-new-pass-manager -O1 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -mllvm -stack-safety-print=1 %s -S -o /dev/null 2>&1 | FileCheck %s -check-prefixes=SSI,XUNSAFE,YSAFE
+// RUN: %clang -fno-experimental-new-pass-manager -O1 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -mllvm -stack-safety-print %s -S -o /dev/null 2>&1 | FileCheck %s -check-prefixes=SSI,XUNSAFE,YSAFE
+// RUN: %clang    -fexperimental-new-pass-manager -O1 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -mllvm -stack-safety-print %s -S -o /dev/null 2>&1 | FileCheck %s -check-prefixes=SSI,XUNSAFE,YSAFE
 
 // Full LTO: both are safe.
 // RUN: %clang -fno-experimental-new-pass-manager -O1 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -c %s -flto=full -o %t.lto1.bc
 // RUN: %clang -fno-experimental-new-pass-manager -O1 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -c -DBUILD2 %s -flto=full -o %t.lto2.bc
-// RUN: llvm-lto2 run -o %t.lto %t.lto1.bc %t.lto2.bc -save-temps -stack-safety-print=1 -thinlto-threads 1 -O1 \
+// RUN: llvm-lto2 run -o %t.lto %t.lto1.bc %t.lto2.bc -save-temps -stack-safety-print -thinlto-threads 1 -O1 \
 // RUN:  -r %t.lto1.bc,fn,plx \
 // RUN:  -r %t.lto1.bc,use,lx \
 // RUN:  -r %t.lto1.bc,use_local,plx \
@@ -77,7 +77,7 @@
 // Full LTO, new PM: both are safe.
 // RUN: %clang -fexperimental-new-pass-manager -O1 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -c %s -flto=full -o %t.ltonewpm1.bc
 // RUN: %clang -fexperimental-new-pass-manager -O1 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -c -DBUILD2 %s -flto=full -o %t.ltonewpm2.bc
-// RUN: llvm-lto2 run -use-new-pm -o %t.ltonewpm %t.ltonewpm1.bc %t.ltonewpm2.bc -save-temps -stack-safety-print=1 -thinlto-threads 1 -O1 \
+// RUN: llvm-lto2 run -use-new-pm -o %t.ltonewpm %t.ltonewpm1.bc %t.ltonewpm2.bc -save-temps -stack-safety-print -thinlto-threads 1 -O1 \
 // RUN:  -r %t.ltonewpm1.bc,fn,plx \
 // RUN:  -r %t.ltonewpm1.bc,use,lx \
 // RUN:  -r %t.ltonewpm1.bc,use_local,plx \
@@ -88,7 +88,7 @@
 // FIXME: Thin LTO: both are safe.
 // RUN: %clang -fno-experimental-new-pass-manager -O1 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -c %s -flto=thin -o %t.thinlto1.bc
 // RUN: %clang -fno-experimental-new-pass-manager -O1 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -c -DBUILD2 %s -flto=thin -o %t.thinlto2.bc
-// RUN: llvm-lto2 run -o %t.thinlto %t.thinlto1.bc %t.thinlto2.bc -save-temps -stack-safety-print=1 -thinlto-threads 1 -O1 \
+// RUN: llvm-lto2 run -o %t.thinlto %t.thinlto1.bc %t.thinlto2.bc -save-temps -stack-safety-print -thinlto-threads 1 -O1 \
 // RUN:  -r %t.thinlto1.bc,fn,plx \
 // RUN:  -r %t.thinlto1.bc,use,lx \
 // RUN:  -r %t.thinlto1.bc,use_local,plx \
@@ -99,7 +99,7 @@
 // FIXME: Thin LTO, new PM: both are safe.
 // RUN: %clang -fexperimental-new-pass-manager -O1 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -c %s -flto=thin -o %t.thinltonewpm1.bc
 // RUN: %clang -fexperimental-new-pass-manager -O1 -target aarch64-unknown-linux -march=armv8+memtag -fsanitize=memtag -c -DBUILD2 %s -flto=thin -o %t.thinltonewpm2.bc
-// RUN: llvm-lto2 run -use-new-pm -o %t.thinltonewpm %t.thinltonewpm1.bc %t.thinltonewpm2.bc -save-temps -stack-safety-print=1 -thinlto-threads 1 -O1 \
+// RUN: llvm-lto2 run -use-new-pm -o %t.thinltonewpm %t.thinltonewpm1.bc %t.thinltonewpm2.bc -save-temps -stack-safety-print -thinlto-threads 1 -O1 \
 // RUN:  -r %t.thinltonewpm1.bc,fn,plx \
 // RUN:  -r %t.thinltonewpm1.bc,use,lx \
 // RUN:  -r %t.thinltonewpm1.bc,use_local,plx \

diff  --git a/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa-alias.ll b/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa-alias.ll
index bd290a8321aa..aa2372578918 100644
--- a/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa-alias.ll
+++ b/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa-alias.ll
@@ -1,5 +1,7 @@
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
+target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
+target triple = "aarch64-unknown-linux"
+
+attributes #0 = { sanitize_memtag "target-features"="+mte,+neon" }
 
 @InterposableAliasWrite1 = linkonce dso_local alias void(i8*), void(i8*)* @Write1
 
@@ -11,7 +13,8 @@ target triple = "x86_64-unknown-linux-gnu"
 @BitcastAliasWrite1 = dso_local alias void(i32*), bitcast (void(i8*)* @Write1 to void(i32*)*)
 @AliasToBitcastAliasWrite1 = dso_local alias void(i8*), bitcast (void(i32*)* @BitcastAliasWrite1 to void(i8*)*)
 
-define dso_local void @Write1(i8* %p) {
+
+define dso_local void @Write1(i8* %p) #0 {
 entry:
   store i8 0, i8* %p, align 1
   ret void

diff  --git a/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa.ll b/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa.ll
index fb789345692d..2a04ec769583 100644
--- a/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa.ll
+++ b/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa.ll
@@ -1,20 +1,22 @@
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
+target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
+target triple = "aarch64-unknown-linux"
 
-define dso_local void @Write1(i8* %p) {
+attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" }
+
+define dso_local void @Write1(i8* %p) #0 {
 entry:
   store i8 0, i8* %p, align 1
   ret void
 }
 
-define dso_local void @Write4(i8* %p) {
+define dso_local void @Write4(i8* %p) #0 {
 entry:
   %0 = bitcast i8* %p to i32*
   store i32 0, i32* %0, align 1
   ret void
 }
 
-define dso_local void @Write4_2(i8* %p, i8* %q) {
+define dso_local void @Write4_2(i8* %p, i8* %q) #0 {
 entry:
   %0 = bitcast i8* %p to i32*
   store i32 0, i32* %0, align 1
@@ -23,14 +25,14 @@ entry:
   ret void
 }
 
-define dso_local void @Write8(i8* %p) {
+define dso_local void @Write8(i8* %p) #0 {
 entry:
   %0 = bitcast i8* %p to i64*
   store i64 0, i64* %0, align 1
   ret void
 }
 
-define dso_local i8* @WriteAndReturn8(i8* %p) {
+define dso_local i8* @WriteAndReturn8(i8* %p) #0 {
 entry:
   store i8 0, i8* %p, align 1
   ret i8* %p
@@ -38,26 +40,26 @@ entry:
 
 declare dso_local void @ExternalCall(i8* %p)
 
-define dso_preemptable void @PreemptableWrite1(i8* %p) {
+define dso_preemptable void @PreemptableWrite1(i8* %p) #0 {
 entry:
   store i8 0, i8* %p, align 1
   ret void
 }
 
-define linkonce dso_local void @InterposableWrite1(i8* %p) {
+define linkonce dso_local void @InterposableWrite1(i8* %p) #0 {
 entry:
   store i8 0, i8* %p, align 1
   ret void
 }
 
-define dso_local i8* @ReturnDependent(i8* %p) {
+define dso_local i8* @ReturnDependent(i8* %p) #0 {
 entry:
   %p2 = getelementptr i8, i8* %p, i64 2
   ret i8* %p2
 }
 
 ; access range [2, 6)
-define dso_local void @Rec0(i8* %p) {
+define dso_local void @Rec0(i8* %p) #0 {
 entry:
   %p1 = getelementptr i8, i8* %p, i64 2
   call void @Write4(i8* %p1)
@@ -65,7 +67,7 @@ entry:
 }
 
 ; access range [3, 7)
-define dso_local void @Rec1(i8* %p) {
+define dso_local void @Rec1(i8* %p) #0 {
 entry:
   %p1 = getelementptr i8, i8* %p, i64 1
   call void @Rec0(i8* %p1)
@@ -73,7 +75,7 @@ entry:
 }
 
 ; access range [-2, 2)
-define dso_local void @Rec2(i8* %p) {
+define dso_local void @Rec2(i8* %p) #0 {
 entry:
   %p1 = getelementptr i8, i8* %p, i64 -5
   call void @Rec1(i8* %p1)
@@ -116,3 +118,9 @@ if.end:
 return:
   ret void
 }
+
+define dso_local i64* @ReturnAlloca() {
+entry:
+  %x = alloca i64, align 4
+  ret i64* %x
+}

diff  --git a/llvm/test/Analysis/StackSafetyAnalysis/ipa-alias.ll b/llvm/test/Analysis/StackSafetyAnalysis/ipa-alias.ll
index cfb6528e34e8..091610dc9192 100644
--- a/llvm/test/Analysis/StackSafetyAnalysis/ipa-alias.ll
+++ b/llvm/test/Analysis/StackSafetyAnalysis/ipa-alias.ll
@@ -1,14 +1,20 @@
+; REQUIRES: aarch64-registered-target
+
 ; Test IPA over a single combined file
 ; RUN: llvm-as %s -o %t0.bc
 ; RUN: llvm-as %S/Inputs/ipa-alias.ll -o %t1.bc
 ; RUN: llvm-link %t0.bc %t1.bc -o %t.combined.bc
+
 ; RUN: opt -S -analyze -stack-safety-local %t.combined.bc | FileCheck %s --check-prefixes=CHECK,LOCAL
 ; RUN: opt -S -passes="print<stack-safety-local>" -disable-output %t.combined.bc 2>&1 | FileCheck %s --check-prefixes=CHECK,LOCAL
-; RUN: opt -S -analyze -stack-safety %t.combined.bc | FileCheck %s --check-prefixes=CHECK,GLOBAL
-; RUN: opt -S -passes="print-stack-safety" -disable-output %t.combined.bc 2>&1 | FileCheck %s --check-prefixes=CHECK,GLOBAL
 
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
+; RUN: opt -S -analyze -stack-safety %t.combined.bc | FileCheck %s --check-prefixes=CHECK,GLOBAL,NOLTO
+; RUN: opt -S -passes="print-stack-safety" -disable-output %t.combined.bc 2>&1 | FileCheck %s --check-prefixes=CHECK,GLOBAL,NOLTO
+
+target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
+target triple = "aarch64-unknown-linux"
+
+attributes #0 = { sanitize_memtag "target-features"="+mte,+neon" }
 
 declare void @PreemptableAliasWrite1(i8* %p)
 declare void @AliasToPreemptableAliasWrite1(i8* %p)
@@ -22,7 +28,7 @@ declare void @BitcastAliasWrite1(i32* %p)
 declare void @AliasToBitcastAliasWrite1(i8* %p)
 
 ; Call to dso_preemptable alias to a dso_local aliasee
-define void @PreemptableAliasCall() {
+define void @PreemptableAliasCall() #0 {
 ; CHECK-LABEL: @PreemptableAliasCall dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -42,12 +48,12 @@ entry:
 }
 
 ; Call to an interposable alias to a non-interposable aliasee
-define void @InterposableAliasCall() {
+define void @InterposableAliasCall() #0 {
 ; CHECK-LABEL: @InterposableAliasCall dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
 ; LOCAL-NEXT: x[1]: empty-set, @InterposableAliasWrite1(arg0, [0,1)){{$}}
-; GLOBAL-NEXT: x[1]: full-set, @InterposableAliasWrite1(arg0, [0,1)){{$}}
+; NOLTO-NEXT: x[1]: full-set, @InterposableAliasWrite1(arg0, [0,1)){{$}}
 ; CHECK-NOT: ]:
 entry:
   %x = alloca i8
@@ -57,7 +63,7 @@ entry:
 }
 
 ; Call to a dso_local/non-interposable alias/aliasee
-define void @AliasCall() {
+define void @AliasCall() #0 {
 ; CHECK-LABEL: @AliasCall dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -71,7 +77,7 @@ entry:
 }
 
 ; Call to a bitcasted dso_local/non-interposable alias/aliasee
-define void @BitcastAliasCall() {
+define void @BitcastAliasCall() #0 {
 ; CHECK-LABEL: @BitcastAliasCall dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:

diff  --git a/llvm/test/Analysis/StackSafetyAnalysis/ipa.ll b/llvm/test/Analysis/StackSafetyAnalysis/ipa.ll
index 72922fbbdf1a..11393b1aa503 100644
--- a/llvm/test/Analysis/StackSafetyAnalysis/ipa.ll
+++ b/llvm/test/Analysis/StackSafetyAnalysis/ipa.ll
@@ -1,13 +1,19 @@
+; REQUIRES: aarch64-registered-target
+
 ; RUN: llvm-as %s -o %t0.bc
 ; RUN: llvm-as %S/Inputs/ipa.ll -o %t1.bc
 ; RUN: llvm-link -disable-lazy-loading %t0.bc %t1.bc -o %t.combined.bc
+
 ; RUN: opt -S -analyze -stack-safety-local %t.combined.bc | FileCheck %s --check-prefixes=CHECK,LOCAL
 ; RUN: opt -S -passes="print<stack-safety-local>" -disable-output %t.combined.bc 2>&1 | FileCheck %s --check-prefixes=CHECK,LOCAL
-; RUN: opt -S -analyze -stack-safety %t.combined.bc | FileCheck %s --check-prefixes=CHECK,GLOBAL
-; RUN: opt -S -passes="print-stack-safety" -disable-output %t.combined.bc 2>&1 | FileCheck %s --check-prefixes=CHECK,GLOBAL
 
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
+; RUN: opt -S -analyze -stack-safety %t.combined.bc | FileCheck %s --check-prefixes=CHECK,GLOBAL,NOLTO
+; RUN: opt -S -passes="print-stack-safety" -disable-output %t.combined.bc 2>&1 | FileCheck %s --check-prefixes=CHECK,GLOBAL,NOLTO
+
+target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
+target triple = "aarch64-unknown-linux"
+
+attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" }
 
 declare void @Write1(i8* %p)
 declare void @Write4(i8* %p)
@@ -23,7 +29,7 @@ declare void @RecursiveNoOffset(i32* %p, i32 %size, i32* %acc)
 declare void @RecursiveWithOffset(i32 %size, i32* %acc)
 
 ; Basic out-of-bounds.
-define void @f1() {
+define void @f1() #0 {
 ; CHECK-LABEL: @f1 dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -38,7 +44,7 @@ entry:
 }
 
 ; Basic in-bounds.
-define void @f2() {
+define void @f2() #0 {
 ; CHECK-LABEL: @f2 dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -53,7 +59,7 @@ entry:
 }
 
 ; Another basic in-bounds.
-define void @f3() {
+define void @f3() #0 {
 ; CHECK-LABEL: @f3 dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -68,7 +74,7 @@ entry:
 }
 
 ; In-bounds with offset.
-define void @f4() {
+define void @f4() #0 {
 ; CHECK-LABEL: @f4 dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -84,7 +90,7 @@ entry:
 }
 
 ; Out-of-bounds with offset.
-define void @f5() {
+define void @f5() #0 {
 ; CHECK-LABEL: @f5 dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -100,7 +106,7 @@ entry:
 }
 
 ; External call.
-define void @f6() {
+define void @f6() #0 {
 ; CHECK-LABEL: @f6 dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -115,7 +121,7 @@ entry:
 }
 
 ; Call to dso_preemptable function
-define void @PreemptableCall() {
+define void @PreemptableCall() #0 {
 ; CHECK-LABEL: @PreemptableCall dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -130,12 +136,12 @@ entry:
 }
 
 ; Call to function with interposable linkage
-define void @InterposableCall() {
+define void @InterposableCall() #0 {
 ; CHECK-LABEL: @InterposableCall dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
 ; LOCAL-NEXT: x[4]: empty-set, @InterposableWrite1(arg0, [0,1)){{$}}
-; GLOBAL-NEXT: x[4]: full-set, @InterposableWrite1(arg0, [0,1)){{$}}
+; NOLTO-NEXT: x[4]: full-set, @InterposableWrite1(arg0, [0,1)){{$}}
 ; CHECK-NOT: ]:
 entry:
   %x = alloca i32, align 4
@@ -145,7 +151,7 @@ entry:
 }
 
 ; Call to function with private linkage
-define void @PrivateCall() {
+define void @PrivateCall() #0 {
 ; CHECK-LABEL: @PrivateCall dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -159,7 +165,7 @@ entry:
   ret void
 }
 
-define private void @PrivateWrite1(i8* %p) {
+define private void @PrivateWrite1(i8* %p) #0 {
 ; CHECK-LABEL: @PrivateWrite1{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: p[]: [0,1){{$}}
@@ -172,7 +178,7 @@ entry:
 
 ; Caller returns a dependent value.
 ; FIXME: alloca considered unsafe even if the return value is unused.
-define void @f7() {
+define void @f7() #0 {
 ; CHECK-LABEL: @f7 dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -186,7 +192,7 @@ entry:
   ret void
 }
 
-define void @f8left() {
+define void @f8left() #0 {
 ; CHECK-LABEL: @f8left dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -202,7 +208,7 @@ entry:
   ret void
 }
 
-define void @f8right() {
+define void @f8right() #0 {
 ; CHECK-LABEL: @f8right dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -218,7 +224,7 @@ entry:
   ret void
 }
 
-define void @f8oobleft() {
+define void @f8oobleft() #0 {
 ; CHECK-LABEL: @f8oobleft dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -234,7 +240,7 @@ entry:
   ret void
 }
 
-define void @f8oobright() {
+define void @f8oobright() #0 {
 ; CHECK-LABEL: @f8oobright dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -250,7 +256,7 @@ entry:
   ret void
 }
 
-define void @TwoArguments() {
+define void @TwoArguments() #0 {
 ; CHECK-LABEL: @TwoArguments dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -280,7 +286,7 @@ entry:
   ret void
 }
 
-define void @TwoArgumentsOOBOther() {
+define void @TwoArgumentsOOBOther() #0 {
 ; CHECK-LABEL: @TwoArgumentsOOBOther dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -296,7 +302,7 @@ entry:
   ret void
 }
 
-define void @TwoArgumentsOOBBoth() {
+define void @TwoArgumentsOOBBoth() #0 {
 ; CHECK-LABEL: @TwoArgumentsOOBBoth dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -329,7 +335,7 @@ entry:
   ret i32 %1
 }
 
-define void @TestRecursiveWithOffset(i32 %size) {
+define void @TestRecursiveWithOffset(i32 %size) #0 {
 ; CHECK-LABEL: @TestRecursiveWithOffset dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -343,7 +349,7 @@ entry:
 }
 
 ; FIXME: IPA should detect that access is safe
-define void @TestUpdateArg() {
+define void @TestUpdateArg() #0 {
 ; CHECK-LABEL: @TestUpdateArg dso_preemptable{{$}}
 ; CHECK-NEXT: args uses:
 ; CHECK-NEXT: allocas uses:
@@ -442,3 +448,9 @@ entry:
 ; GLOBAL-NEXT: acc[]: full-set, @RecursiveWithOffset(arg1, [4,5)){{$}}
 ; CHECK-NEXT: allocas uses:
 ; CHECK-NOT: ]:
+
+; CHECK-LABEL: @ReturnAlloca
+; CHECK-NEXT: args uses:
+; CHECK-NEXT: allocas uses:
+; CHECK-NEXT: x[8]: full-set
+; CHECK-NOT: ]:


        


More information about the cfe-commits mailing list