aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/btfout.c2
-rw-r--r--gcc/testsuite/gcc.dg/debug/btf/btf-float-1.c20
-rw-r--r--gcc/testsuite/gcc.dg/debug/btf/btf-function-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/debug/btf/btf-struct-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/debug/btf/btf-variables-2.c2
5 files changed, 25 insertions, 3 deletions
diff --git a/gcc/btfout.c b/gcc/btfout.c
index e58c969..8cdd990 100644
--- a/gcc/btfout.c
+++ b/gcc/btfout.c
@@ -124,6 +124,7 @@ get_btf_kind (uint32_t ctf_kind)
switch (ctf_kind)
{
case CTF_K_INTEGER: return BTF_KIND_INT;
+ case CTF_K_FLOAT: return BTF_KIND_FLOAT;
case CTF_K_POINTER: return BTF_KIND_PTR;
case CTF_K_ARRAY: return BTF_KIND_ARRAY;
case CTF_K_FUNCTION: return BTF_KIND_FUNC_PROTO;
@@ -627,6 +628,7 @@ btf_asm_type (ctf_container_ref ctfc, ctf_dtdef_ref dtd)
switch (btf_kind)
{
case BTF_KIND_INT:
+ case BTF_KIND_FLOAT:
case BTF_KIND_STRUCT:
case BTF_KIND_UNION:
case BTF_KIND_ENUM:
diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-float-1.c b/gcc/testsuite/gcc.dg/debug/btf/btf-float-1.c
new file mode 100644
index 0000000..6876df0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/btf/btf-float-1.c
@@ -0,0 +1,20 @@
+/* Tests for BTF floating point type kinds. We expect a single record for each
+ of the base types: float, double and long double. */
+
+/* { dg-do compile } */
+/* { dg-options "-O0 -gbtf -dA" } */
+
+/* { dg-final { scan-assembler-times "\[\t \]0x10000000\[\t \]+\[^\n\]*btt_info" 3 } } */
+
+/* { dg-final { scan-assembler-times "ascii \"float.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */
+/* { dg-final { scan-assembler-times "ascii \"double.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */
+/* { dg-final { scan-assembler-times "ascii \"long double.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */
+
+float a;
+float b = 1.5f;
+
+double c;
+double d = -99.9;
+
+long double e;
+long double f = 1000.01;
diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-function-3.c b/gcc/testsuite/gcc.dg/debug/btf/btf-function-3.c
index 35f96a2..c83b823 100644
--- a/gcc/testsuite/gcc.dg/debug/btf/btf-function-3.c
+++ b/gcc/testsuite/gcc.dg/debug/btf/btf-function-3.c
@@ -16,7 +16,7 @@
/* Exactly one function parameter should have type_id=0. */
/* { dg-final { scan-assembler-times "\[\t \]0\[\t \]+\[^\n\]*farg_type" 1 } } */
-int foo (int a, float f, long b)
+int foo (int a, float __attribute__((__vector_size__(16))) f, long b)
{
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-struct-2.c b/gcc/testsuite/gcc.dg/debug/btf/btf-struct-2.c
index 24514fc..c3aff09 100644
--- a/gcc/testsuite/gcc.dg/debug/btf/btf-struct-2.c
+++ b/gcc/testsuite/gcc.dg/debug/btf/btf-struct-2.c
@@ -14,6 +14,6 @@
struct with_float
{
int a;
- float f;
+ float __attribute__((__vector_size__(16))) f;
char c;
} instance;
diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-variables-2.c b/gcc/testsuite/gcc.dg/debug/btf/btf-variables-2.c
index 0f9742e..db0bdd7 100644
--- a/gcc/testsuite/gcc.dg/debug/btf/btf-variables-2.c
+++ b/gcc/testsuite/gcc.dg/debug/btf/btf-variables-2.c
@@ -16,7 +16,7 @@
/* { dg-final { scan-assembler-times "ascii \"myst.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */
int foo;
-float bar;
+float __attribute__((__vector_size__(16))) bar;
int baz[10];
struct st