aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/riscv/pragma-target-2.c
blob: 077bcdd280cdae2d589dd9a36178b23269caf831 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* Test for #pragma GCC target with tune parameter */
/* { dg-do compile } */
/* { dg-options "-march=rv64gc -mabi=lp64d -mtune=rocket -O2" } */

void default_tune(void) {
  /* Default tune is rocket */
}

#pragma GCC push_options
#pragma GCC target("tune=sifive-7-series")
void sifive_tune(void) {
  /* Tune should be sifive-7-series */
}
#pragma GCC pop_options

void back_to_rocket(void) {
  /* Tune should be back to rocket */
}

#pragma GCC target("arch=rv64gcv;tune=generic")
void combined_options(void) {
#ifndef __riscv_vector
  __builtin_abort();  /* Should have vector */
#endif
  /* Tune should be generic */
}