1 /* Functional tests for the "target" attribute and pragma. */ 2 3 /* { dg-do compile } */ 4 /* { dg-require-effective-target target_attribute } */ 5 /* { dg-options "-msoft-float" } */ 6 7 #pragma GCC target("hard-float") p1(float f)8float p1(float f) 9 { 10 return 2 * f; 11 } 12 #pragma GCC reset_options 13 14 #pragma GCC target("soft-float") p0(float f)15float p0(float f) 16 { 17 return 2 * f; 18 } p0b(float f)19float p0b(float f) 20 { 21 return 2 * f; 22 } 23 #pragma GCC reset_options 24 25 __attribute__ ((target("hard-float"))) a1(float f)26float a1(float f) 27 { 28 return 2 * f; 29 } 30 31 __attribute__ ((target("hard-float"))) a1b(float f)32float a1b(float f) 33 { 34 return 2 * f; 35 } 36 37 __attribute__ ((target("hard-float"))) a1c(float f)38float a1c(float f) 39 { 40 return 2 * f; 41 } 42 43 __attribute__ ((target("hard-float"))) a1d(float f)44float a1d(float f) 45 { 46 return 2 * f; 47 } 48 49 __attribute__ ((target("soft-float"))) a0(float f)50float a0(float f) 51 { 52 return 2 * f; 53 } 54 55 __attribute__ ((target("soft-float"))) a0b(float f)56float a0b(float f) 57 { 58 return 2 * f; 59 } 60 61 __attribute__ ((target("soft-float"))) a0c(float f)62float a0c(float f) 63 { 64 return 2 * f; 65 } 66 67 __attribute__ ((target("soft-float"))) a0d(float f)68float a0d(float f) 69 { 70 return 2 * f; 71 } 72 73 __attribute__ ((target("soft-float"))) a0e(float f)74float a0e(float f) 75 { 76 return 2 * f; 77 } 78 79 __attribute__ ((target("soft-float"))) a0f(float f)80float a0f(float f) 81 { 82 return 2 * f; 83 } 84 85 __attribute__ ((target("soft-float"))) a0g(float f)86float a0g(float f) 87 { 88 return 2 * f; 89 } 90 91 __attribute__ ((target("soft-float"))) a0h(float f)92float a0h(float f) 93 { 94 return 2 * f; 95 } 96 97 /* { dg-final { scan-assembler-times "\tste\t%f" 5 } } */ 98