@@ -5,34 +5,26 @@
TBD_CTF_FORMAT_OPEN_ISSUES (1) -
This testcase makes a note of the case of a probable misrepresentation.
- See Note 1 and Note 2 below.
+ See Note 1 below.
In the CTF section, these types are encoded as :
Variables:
- _CTF_NEWSTR -> 7: const char [0] (size 0x0)
- _CTF_SECTION -> 6: const char [5] (size 0x5)
- b1 -> 2: int [0] (size 0x0)
- b2 -> 3: int [0] (size 0x0)
+ b1 -> 3: int [0] (size 0x0)
+ b2 -> 5: int [0] (size 0x0)
Note 1 : There is misrepresentation in that b1 and b2 are specified
differently by the user.
- Note 2 : It is arguable though whether the representation for
- _CTF_NEWSTR is incorrect. */
+
+ In this testcase, two CTF array records each of type int [0] is expected. */
/* { dg-do compile ) */
/* { dg-options "-O0 -gctf -dA" } */
-/* { dg-final { scan-assembler-times "0x12000000\[\t \]+\[^\n\]*ctt_info" 5 } } */
+/* { dg-final { scan-assembler-times "0x12000000\[\t \]+\[^\n\]*ctt_info" 2 } } */
-/* { dg-final { scan-assembler-times "\[\t \]0\[\t \]+\[^\n\]*cta_nelems" 3 } } */
-/* { dg-final { scan-assembler-times "\[\t \]0x5\[\t \]+\[^\n\]*cta_nelems" 1 } } */
+/* { dg-final { scan-assembler-times "\[\t \]0\[\t \]+\[^\n\]*cta_nelems" 2 } } */
static int b1[] = {};
int b2[0];
-
-const char _CTF_SECTION[] = ".ctf";
-
-extern const char _CTF_NEWSTR[];
-const char _CTF_NEWSTR[] = "ctfinfo";
new file mode 100644
@@ -0,0 +1,17 @@
+/* CTF generation for unsized (but initialized) arrays
+
+ In this testcase, one CTF array type record of size 5 is expected.
+
+ Variables:
+ _CTF_SECTION -> 5: const const char [5] (size 0x5) -> 4: const char [5] (size 0x5)
+
+*/
+
+/* { dg-do compile ) */
+/* { dg-options "-O0 -gctf -dA" } */
+
+/* { dg-final { scan-assembler-times "0x12000000\[\t \]+\[^\n\]*ctt_info" 1 } } */
+
+/* { dg-final { scan-assembler-times "\[\t \]0x5\[\t \]+\[^\n\]*cta_nelems" 1 } } */
+
+const char _CTF_SECTION[] = ".ctf";
new file mode 100644
@@ -0,0 +1,22 @@
+/* CTF generation for extern variable with defining and non-defining decl
+ in the same CU.
+
+ This testcase checks the case when a non-defining decl is followed by
+ a defining decl for the same variable. See PR debug/105089.
+
+ In this testcase, although two CTF array types are generated, only a
+ single CTF variable and a single entry in the CTF object info section
+ are expected. */
+
+/* { dg-do compile ) */
+/* { dg-options "-O0 -gctf -dA" } */
+
+/* { dg-final { scan-assembler-times "0x12000000\[\t \]+\[^\n\]*ctt_info" 2 } } */
+
+/* { dg-final { scan-assembler-times "\[\t \]0\[\t \]+\[^\n\]*cta_nelems" 1 } } */
+/* { dg-final { scan-assembler-times "\[\t \]0x8\[\t \]+\[^\n\]*cta_nelems" 1 } } */
+/* { dg-final { scan-assembler-times "ctv_name" 1 } } */
+/* { dg-final { scan-assembler-times "objtinfo_var_type" 1 } } */
+
+extern const char _CTF_NEWSTR[];
+const char _CTF_NEWSTR[] = "ctfinfo";