From cd66f6f9b9c68267698720dcf350b140d86f4201 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 29 Sep 2016 15:39:08 +0200
Subject: [PATCH] Use effective target for pr16855
gcc/testsuite/ChangeLog:
2016-09-29 Martin Liska <mliska@suse.cz>
* g++.dg/gcov/pr16855.C: Add init_priority as an effective
target.
---
gcc/testsuite/g++.dg/gcov/pr16855.C | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
@@ -1,13 +1,15 @@
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
/* { dg-do run { target native } } */
+/* { dg-require-effective-target init_priority } */
#include <stdlib.h>
+#include <stdio.h>
int a;
void foo()
{
- a = 123; /* count(1) */
+ fprintf (stderr, "atexit handler foo()\n"); /* count(1) */
}
#include <iostream>
@@ -15,10 +17,10 @@ using namespace std;
class Test {
public:
Test(void){
- cout<< "In Test ctor" << endl; /* count(1) */
+ fprintf (stderr, "In Test ctor\n"); /* count(1) */
}
~Test(void){
- cout<< "In Test dtor" << endl; /* count(1) */
+ fprintf (stderr, "In Test dtor\n"); /* count(1) */
}
}T1;
@@ -27,8 +29,7 @@ void uncalled(void){
}
int main(void){
atexit (&foo);
-// Test T2;
-cout<< "In main" << endl; /* count(1) */
+fprintf (stderr, "In main\n"); /* count(1) */
return 0;
}
@@ -36,12 +37,12 @@ return 0;
__attribute__((constructor))
static void construct_navigationBarImages() {
- fprintf (stderr, "((construct_navigationBarImages))"); /* count(1) */
+ fprintf (stderr, "((construct_navigationBarImages))\n"); /* count(1) */
}
__attribute__((destructor))
static void destroy_navigationBarImages() {
- fprintf (stderr, "((destroy_navigationBarImages))"); /* count(1) */
+ fprintf (stderr, "((destroy_navigationBarImages))\n"); /* count(1) */
}
/* { dg-final { run-gcov branches { -b pr16855.C } } } */
--
2.9.2