about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorJamie Cunliffe <Jamie.Cunliffe@arm.com>2021-12-01 15:56:59 +0000
committerJamie Cunliffe <Jamie.Cunliffe@arm.com>2021-12-01 15:56:59 +0000
commit984ca4689dbceea29bbfcf54c4743b45fccf7ad1 (patch)
tree50e979ae7eed117e44f6bce9a82003fe0270f51c /src/test
parent837cc1687f7c0d35a4e90a2f6bee377b5a2ecfd5 (diff)
downloadrust-984ca4689dbceea29bbfcf54c4743b45fccf7ad1.tar.gz
rust-984ca4689dbceea29bbfcf54c4743b45fccf7ad1.zip
Review comments
- Changed the separator from '+' to ','.
- Moved the branch protection options from -C to -Z.
- Additional test for incorrect branch-protection option.
- Remove LLVM < 12 code.
- Style fixes.

Co-authored-by: James McGregor <james.mcgregor2@arm.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/assembly/aarch64-pointer-auth.rs2
-rw-r--r--src/test/codegen/branch-protection.rs8
-rw-r--r--src/test/run-make-fulldeps/pointer-auth-link-with-c/Makefile6
-rw-r--r--src/test/ui/invalid-compile-flags/branch-protection-missing-pac-ret.rs1
-rw-r--r--src/test/ui/invalid-compile-flags/branch-protection-missing-pac-ret.stderr2
5 files changed, 11 insertions, 8 deletions
diff --git a/src/test/assembly/aarch64-pointer-auth.rs b/src/test/assembly/aarch64-pointer-auth.rs
index e778e67e1b3..27e289086b9 100644
--- a/src/test/assembly/aarch64-pointer-auth.rs
+++ b/src/test/assembly/aarch64-pointer-auth.rs
@@ -3,7 +3,7 @@
 // min-llvm-version: 10.0.1
 // assembly-output: emit-asm
 // compile-flags: --target aarch64-unknown-linux-gnu
-// compile-flags: -C branch-protection=pac-ret+leaf
+// compile-flags: -Z branch-protection=pac-ret,leaf
 // needs-llvm-components: aarch64
 
 #![feature(no_core, lang_items)]
diff --git a/src/test/codegen/branch-protection.rs b/src/test/codegen/branch-protection.rs
index 79706cdf070..106c9b148ee 100644
--- a/src/test/codegen/branch-protection.rs
+++ b/src/test/codegen/branch-protection.rs
@@ -3,10 +3,10 @@
 // revisions: bti pac-ret leaf b-key
 // min-llvm-version: 12.0.0
 // needs-llvm-components: aarch64
-// [bti] compile-flags: -C branch-protection=bti
-// [pac-ret] compile-flags: -C branch-protection=pac-ret
-// [leaf] compile-flags: -C branch-protection=pac-ret+leaf
-// [b-key] compile-flags: -C branch-protection=pac-ret+b-key
+// [bti] compile-flags: -Z branch-protection=bti
+// [pac-ret] compile-flags: -Z branch-protection=pac-ret
+// [leaf] compile-flags: -Z branch-protection=pac-ret,leaf
+// [b-key] compile-flags: -Z branch-protection=pac-ret,b-key
 // compile-flags: --target aarch64-unknown-linux-gnu
 
 #![crate_type = "lib"]
diff --git a/src/test/run-make-fulldeps/pointer-auth-link-with-c/Makefile b/src/test/run-make-fulldeps/pointer-auth-link-with-c/Makefile
index 36d0f0e5a19..d0e22cfef4c 100644
--- a/src/test/run-make-fulldeps/pointer-auth-link-with-c/Makefile
+++ b/src/test/run-make-fulldeps/pointer-auth-link-with-c/Makefile
@@ -5,10 +5,10 @@
 all:
 	$(COMPILE_OBJ) $(TMPDIR)/test.o test.c
 	$(AR) rcs $(TMPDIR)/libtest.a $(TMPDIR)/test.o
-	$(RUSTC) -C branch-protection=bti+pac-ret+leaf test.rs
+	$(RUSTC) -Z branch-protection=bti,pac-ret,leaf test.rs
 	$(call RUN,test)
 
 	$(COMPILE_OBJ) $(TMPDIR)/test.o test.c -mbranch-protection=bti+pac-ret+leaf
 	$(AR) rcs $(TMPDIR)/libtest.a $(TMPDIR)/test.o
-	$(RUSTC) -C branch-protection=bti+pac-ret+leaf test.rs
-	$(call RUN,test)
\ No newline at end of file
+	$(RUSTC) -Z branch-protection=bti,pac-ret,leaf test.rs
+	$(call RUN,test)
diff --git a/src/test/ui/invalid-compile-flags/branch-protection-missing-pac-ret.rs b/src/test/ui/invalid-compile-flags/branch-protection-missing-pac-ret.rs
new file mode 100644
index 00000000000..4f39d223a2e
--- /dev/null
+++ b/src/test/ui/invalid-compile-flags/branch-protection-missing-pac-ret.rs
@@ -0,0 +1 @@
+// compile-flags: -Z branch-protection=leaf
diff --git a/src/test/ui/invalid-compile-flags/branch-protection-missing-pac-ret.stderr b/src/test/ui/invalid-compile-flags/branch-protection-missing-pac-ret.stderr
new file mode 100644
index 00000000000..5528d2a0729
--- /dev/null
+++ b/src/test/ui/invalid-compile-flags/branch-protection-missing-pac-ret.stderr
@@ -0,0 +1,2 @@
+error: incorrect value `leaf` for debugging option `branch-protection` - a `,` separated combination of `bti`, `b-key`, `pac-ret`, or `leaf` was expected
+