summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2016-04-11 15:20:14 +0200
committerLinaro Code Review <review@review.linaro.org>2016-04-12 10:59:45 +0000
commit55d3bceea8eef018564a026e615af58cca5d6273 (patch)
treecd5fae31de16d725f1b590dfa176a0c5e2b26877 /gcc/testsuite
parent07017c3304ec630a4d2b63fdf6346be9407f9153 (diff)
downloadgcc-55d3bceea8eef018564a026e615af58cca5d6273.tar.gz
gcc/
Backport from trunk r233342. 2016-02-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * config/aarch64/aarch64.c (aarch64_last_printed_arch_string): New variable. (aarch64_last_printed_tune_string): Likewise. (aarch64_declare_function_name): Only output .arch assembler directive if it will be different from the previously output directive. Same for .tune comment but only if -dA is set. (aarch64_start_file): New function. (TARGET_ASM_FILE_START): Define. gcc/testsuite/ Backport from trunk r233342. 2016-02-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * gcc.target/aarch64/target_attr_15.c: Scan assembly for .arch armv8-a\n. Add -dA to dg-options. * gcc.target/aarch64/assembler_arch_1.c: New test. * gcc.target/aarch64/target_attr_7.c: Add -dA to dg-options. gcc/testsuite/ Backport from trunk r233559. 2016-02-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * lib/target-supports.exp: Define aarch64_asm_FUNC_ok checks for fp, simd, crypto, crc, lse. * doc/sourcebuild.texi (AArch64-specific attributes): Document the above. * gcc.target/aarch64/assembler_arch_1.c: Add aarch64_asm_lse_ok effective target check. gcc/ Backport from trunk r234875. 2016-04-11 James Greenhalgh <james.greenhalgh@arm.com> * config/aarch64/aarch64.h (AARCH64_FL_FOR_ARCH8_1): Also add AARCH64_FL_CRC. gcc/ Backport from trunk r234876. 2016-04-11 James Greenhalgh <james.greenhalgh@arm.com> PR target/70133 * config/aarch64/aarch64-common.c (aarch64_option_extension): Keep track of a canonical flag name. (all_extensions): Likewise. (arch_to_arch_name): Also track extension flags enabled by the arch. (all_architectures): Likewise. (aarch64_parse_extension): Move to here. (aarch64_get_extension_string_for_isa_flags): Take a new argument, rework. (aarch64_rewrite_selected_cpu): Update for above change. * config/aarch64/aarch64-option-extensions.def: Rework the way flags are handled, such that the single explicit value enabled by an extension is kept seperate from the implicit values it also enables. * config/aarch64/aarch64-protos.h (aarch64_parse_opt_result): Move to here. (aarch64_parse_extension): New. * config/aarch64/aarch64.c (aarch64_parse_opt_result): Move from here to config/aarch64/aarch64-protos.h. (aarch64_parse_extension): Move from here to common/config/aarch64/aarch64-common.c. (aarch64_option_print): Update. (aarch64_declare_function_name): Likewise. (aarch64_start_file): Likewise. * config/aarch64/driver-aarch64.c (arch_extension): Keep track of the canonical flag for extensions. * config.gcc (aarch64*-*-*): Extend regex for capturing extension flags. gcc/testsuite/ Backport from trunk r234876. 2016-04-11 James Greenhalgh <james.greenhalgh@arm.com> PR target/70133 * gcc.target/aarch64/mgeneral-regs_4.c: Fix expected output. * gcc.target/aarch64/target_attr_15.c: Likewise. gcc/ Backport from trunk r234877. 2016-04-11 James Greenhalgh <james.greenhalgh@arm.com> PR target/70133 * config/aarch64/driver-aarch64.c (aarch64_get_extension_string_for_isa_flags): New. (arch_extension): Rename to... (aarch64_arch_extension): ...This. (ext_to_feat_string): Rename to... (aarch64_extensions): ...This. (aarch64_core_data): Keep track of architecture extension flags. (cpu_data): Rename to... (aarch64_cpu_data): ...This. (aarch64_arch_driver_info): Keep track of architecture extension flags. (get_arch_name_from_id): Rename to... (get_arch_from_id): ...This, change return type. (host_detect_local_cpu): Update and reformat for renames, handle extensions through common infrastructure. Change-Id: I30437869d04438f2efc2946e6bdfc5a621578cce
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/gcc.target/aarch64/assembler_arch_1.c21
-rw-r--r--gcc/testsuite/gcc.target/aarch64/mgeneral-regs_4.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/target_attr_1.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/target_attr_15.c4
-rw-r--r--gcc/testsuite/gcc.target/aarch64/target_attr_7.c2
-rw-r--r--gcc/testsuite/lib/target-supports.exp17
6 files changed, 42 insertions, 6 deletions
diff --git a/gcc/testsuite/gcc.target/aarch64/assembler_arch_1.c b/gcc/testsuite/gcc.target/aarch64/assembler_arch_1.c
new file mode 100644
index 00000000000..5deea5cf0ee
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/assembler_arch_1.c
@@ -0,0 +1,21 @@
+/* { dg-do assemble } */
+/* { dg-require-effective-target aarch64_asm_lse_ok } */
+/* { dg-options "-march=armv8-a" } */
+
+/* Make sure that the function header in assembly doesn't override
+ user asm arch_extension directives. */
+
+__asm__ (".arch_extension lse");
+
+void
+foo (int i, int *v)
+{
+ register int w0 asm ("w0") = i;
+ register int *x1 asm ("x1") = v;
+
+ asm volatile (
+ "\tstset %w[i], %[v]\n"
+ : [i] "+r" (w0), [v] "+Q" (v)
+ : "r" (x1)
+ : "x30");
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_4.c b/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_4.c
index 8eb50aafa2b..49b74d9e265 100644
--- a/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_4.c
+++ b/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_4.c
@@ -6,4 +6,4 @@ test (void)
return 1;
}
-/* { dg-final { scan-assembler "\.arch.*fp.*simd" } } */
+/* { dg-final { scan-assembler-times "\\.arch armv8-a\n" 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/target_attr_1.c b/gcc/testsuite/gcc.target/aarch64/target_attr_1.c
index 852ce1e9f06..0527d0c3d61 100644
--- a/gcc/testsuite/gcc.target/aarch64/target_attr_1.c
+++ b/gcc/testsuite/gcc.target/aarch64/target_attr_1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -mcpu=thunderx -save-temps" } */
+/* { dg-options "-O2 -mcpu=thunderx -dA" } */
/* Test that cpu attribute overrides the command-line -mcpu. */
diff --git a/gcc/testsuite/gcc.target/aarch64/target_attr_15.c b/gcc/testsuite/gcc.target/aarch64/target_attr_15.c
index 02091c6c542..2d8c7b955ce 100644
--- a/gcc/testsuite/gcc.target/aarch64/target_attr_15.c
+++ b/gcc/testsuite/gcc.target/aarch64/target_attr_15.c
@@ -10,6 +10,4 @@ foo (int a)
return a + 1;
}
-/* { dg-final { scan-assembler-not "\\+fp" } } */
-/* { dg-final { scan-assembler-not "\\+crypto" } } */
-/* { dg-final { scan-assembler-not "\\+simd" } } */
+/* { dg-final { scan-assembler-times "\\.arch armv8-a\\+nofp\\+nosimd\n" 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/target_attr_7.c b/gcc/testsuite/gcc.target/aarch64/target_attr_7.c
index 32a840378ab..818d327705f 100644
--- a/gcc/testsuite/gcc.target/aarch64/target_attr_7.c
+++ b/gcc/testsuite/gcc.target/aarch64/target_attr_7.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -mcpu=thunderx -save-temps" } */
+/* { dg-options "-O2 -mcpu=thunderx -dA" } */
/* Make sure that #pragma overrides command line option and
target attribute overrides the pragma. */
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index ef6d1f0dda5..771a0d4d593 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -6304,6 +6304,23 @@ proc check_effective_target_aarch64_tiny { } {
}
}
+# Create functions to check that the AArch64 assembler supports the
+# various architecture extensions via the .arch_extension pseudo-op.
+
+foreach { aarch64_ext } { "fp" "simd" "crypto" "crc" "lse"} {
+ eval [string map [list FUNC $aarch64_ext] {
+ proc check_effective_target_aarch64_asm_FUNC_ok { } {
+ if { [istarget aarch64*-*-*] } {
+ return [check_no_compiler_messages aarch64_FUNC_assembler object {
+ __asm__ (".arch_extension FUNC");
+ } "-march=armv8-a+FUNC"]
+ } else {
+ return 0
+ }
+ }
+ }]
+}
+
proc check_effective_target_aarch64_small { } {
if { [istarget aarch64*-*-*] } {
return [check_no_compiler_messages aarch64_small object {