2012-06-28 Janis Johnson <janisjo@codesourcery.com>
* g++.dg/cpp0x/nullptr19.c: Remove exta directives on same line.
* g++.dg/template/error46.C: Add missing comment to dg-message.
* g++.dg/template/crash107.C: Likewise.
* g++.dg/template/error47.C: Likewise.
* g++.dg/template/crash108.C: Likewise.
* g++.dg/overload/operator5.C: Likewise.
* gcc.dg/Wstrict-aliasing-converted-assigned.c: Fix syntax
errors in dg-message directives, add comments.
2012-06-26 Janis Johnson <janisjo@codesourcery.com>
* lib/scandump.exp (scan-dump, scan-dump-not, scan-dump-dem,
scan-dump-dem-not): Use printable pattern in test name.
2012-06-25 Janis Johnson <janisjo@codesourcery.com>
* lib/target-supports-dg.exp (testname-for-summary): New.
* lib/profopt.exp (profopt_execute): Define testname_with_flags.
* lib/gcc-dg.exp (cleanup-coverage-files, cleanup-repo-notes,
cleanup-stack-usage, cleanup-dump, cleanup-saved-temps, scan-module,
scan-module-absence, output-exists, output-exists-not: Use
testname-for-summary.
(dg-test): Clean up testname_with_flags.
* lib/scanasm.exp (scan-assembler, scan-assembler-not, scan-hidden,
scan-not-hidden, scan-file, scan-file-not, scan-stack-usage,
scan-stack-usage-not, scan-assembler-times, scan-assembler-dem,
scan-assembler-dem-not, object-size: Use testname-for-summary.
* lib/gcov.exp (run-gcov): Likewise.
* lib/scandump.exp (scan-dump, scan-dump-times, scan-dump-not,
scan-dump-dem, scan-dump-dem-note): Likewise.
* lib/profopt.exp: Make prof_option_list local to profopt-execute.
* g++.dg/tree-prof/tree-prof.exp (PROFOPT_OPTIONS): Define after
including profopt.opt; save and restore existing value.
* g++.dg/bprob/bprob.exp: Likewise.
* gcc.dg/matrix/matrix.exp: Likewise.
* gcc.dg/tree-prof/tree-prof.exp: Likewise.
* gcc.misc-tests/bprob.exp: Likewise; also replace formerly-ignored
PROFOPT_OPTIONS.
2012-06-15 Janis Johnson <janosjo@codesourcery.com>
* lib/gcov.exp (verify-lines, verify-branches, verify-calls): Use
testname that includes flags, passed in as new argument, in
pass/fail messages.
(run_gcov): Get testname from dg-test, use it in pass/fail messages
and pass it to verify-* procedures.
* g++.dg/torture/stackalign/stackalign.exp: Combine stack
alignment torture options with usual torture options.
* g++.dg/cpp0x/auto27.C: Add comments to checks for multiple
messages reported for one line of source code.
* g++.dg/cpp0x/constexpr-decl.C: Likewise.
* g++.dg/cpp0x/decltype2.C: Likewise.
* g++.dg/cpp0x/decltype3.C: Likewise.
* g++.dg/cpp0x/lambda/lambda-syntax1.C: Likewise.
* g++.dg/cpp0x/regress/error-recovery1.C: Likewise.
* g++.dg/cpp0x/static_assert3.C: Likewise.
* g++.dg/cpp0x/udlit-cpp98-neg.C: Likewise.
* g++.dg/cpp0x/udlit-shadow-neg.C: Likewise.
* g++.dg/cpp0x/union1.C: Likewise.
* g++.dg/cpp0x/variadic-ex10.C: Likewise.
* g++.dg/cpp0x/variadic-ex14.C: Likewise.
* g++.dg/cpp0x/variadic2.C: Likewise.
* g++.dg/cpp0x/variadic20.C: Likewise.
* g++.dg/cpp0x/variadic74.C: Likewise.
* g++.dg/diagnostic/bitfld2.C: Likewise.
* g++.dg/ext/attrib44.C: Likewise.
* g++.dg/ext/no-asm-1.C: Likewise.
* g++.dg/other/error34.C: Likewise.
* g++.dg/parse/crash46.C: Likewise.
* g++.dg/parse/error10.C: Likewise.
* g++.dg/parse/error2.C: Likewise.
* g++.dg/parse/error3.C: Likewise.
* g++.dg/parse/error36.C: Likewise.
* g++.dg/parse/error8.C: Likewise.
* g++.dg/parse/error9.C: Likewise.
* g++.dg/parse/parser-pr28152-2.C: Likewise.
* g++.dg/parse/parser-pr28152.C: Likewise.
* g++.dg/parse/template25.C: Likewise.
* g++.dg/parse/typename11.C: Likewise.
* g++.dg/tc1/dr147.C: Likewise.
* g++.dg/template/deduce3.C: Likewise.
* g++.dg/template/koenig9.C: Likewise.
* g++.dg/template/pr23510.C: Likewise.
* g++.dg/warn/pr12242.C: Likewise.
* g++.dg/warn/pr30551-2.C: Likewise.
* g++.dg/warn/pr30551.C: Likewise.
* g++.old-deja/g++.other/typename1.C: Likewise.
* g++.old-deja/g++.pt/niklas01a.C: Likewise.
2012-06-13 Janis Johnson <janisjo@codesourcery.com>
PR testsuite/20771
* lib/dg-pch.exp (dg-flags-pch): Add flags to make compile lines in
test summary unique.
* lib/scanasm.exp (scan-assembler, scan-assembler-not, scan-hidden,
scan-not-hiddent, scan-file, scan-file-not, scan-stack-usage,
scan-stack-usage-not): Don't strip torture options from test name.
* lib/scandump.exp (scan-dump-times): Use printable version of
regexp in test summary line.
* gcc.dg/di-longlong64-sync-1.c: Add comments to checks for multiple
messages reported for one line of source code.
* gcc.dg/format/few-1.c: Likewise.
* gcc.dg/ia64-sync-2.c: Likewise.
* gcc.dg/sync-2.c: Likewise.
* gcc.dg/noncompile/pr44517.c: Likewise.
2012-06-12 Janis Johnson <janisjo@codesourcery.com>
* gcc.dg/torture/stackalign/stackalign.exp: Combine stack
alignment torture options with usual torture options.
* gcc.dg/torture/stackalign/alloca-2.c: Use dg-additional-options
instead of dg-options.
* gcc.dg/torture/stackalign/alloca-3.c: Likewise.
* gcc.dg/torture/stackalign/alloca-4.c: Likewise.
* gcc.dg/torture/stackalign/alloca-5.c: Likewise.
* gcc.dg/torture/stackalign/alloca-6.c: Likewise.
* gcc.dg/torture/stackalign/push-1.c: Likewise.
* gcc.dg/torture/stackalign/vararg-3.c: Likewise.
* gcc.target/arm/di-longlong64-sync-withhelpers.c: Add comments
to checks for multiple messages reported for one line of source code.
* gcc.target/arm/di-longlong64-sync-withldrexd.c: Likewise.
* gcc.c-torture/compile/sync-1.c: Add comments to checks for multiple
messages reported for one line of source code.
* gcc.dg/
20031223-1.c: Add comments to check for multiple
messages reported for one line of source code.
* gcc.dg/Wconversion-integer.c: Likewise.
* gcc.dg/Wfatal-2.c: Likewise.
* gcc.dg/Wfatal.c: Likewise.
* gcc.dg/Wobjsize-1.c: Likewise.
* gcc.dg/c99-vla-jump-1.c: Likewise.
* gcc.dg/c99-vla-jump-2.c: Likewise.
* gcc.dg/c99-vla-jump-3.c: Likewise.
* gcc.dg/c99-vla-jump-4.c: Likewise.
* gcc.dg/c99-vla-jump-5.c: Likewise.
* gcc.dg/decl-9.c: Likewise.
* gcc.dg/declspec-10.c: Likewise.
* gcc.dg/declspec-18.c: Likewise.
* gcc.dg/mtune.c: Likewise.
* gcc.dg/parser-pr28152-2.c: Likewise.
* gcc.dg/parser-pr28152.c: Likewise.
* gcc.dg/pr14475.c: Likewise.
* gcc.dg/pr27953.c: Likewise.
* gcc.dg/pr28322-3.c: Likewise.
* gcc.dg/pr30457.c: Likewise.
* gcc.dg/pr30551-2.c: Likewise.
* gcc.dg/pr30551-3.c: Likewise.
* gcc.dg/pr30551-4.c: Likewise.
* gcc.dg/pr30551-5.c: Likewise.
* gcc.dg/pr30551-6.c: Likewise.
* gcc.dg/pr30551.c: Likewise.
* gcc.dg/pr45461.c: Likewise.
* gcc.dg/pr48552-1.c: Likewise.
* gcc.dg/pr48552-2.c: Likewise.
* gcc.dg/redecl-1.c: Likewise.
* gcc.dg/transparent-union-3.c: Likewise.
* gcc.dg/utf-dflt.c: Likewise.
* gcc.dg/utf-dflt2.c: Likewise.
* gcc.dg/vla-8.c: Likewise.
* gcc.dg/vla-init-1.c: Likewise.
* gcc.dg/wtr-int-type-1.c: Likewise.
* c-c++-common/raw-string-3.c: Add comments to checks for multiple
messages reported for for one line of source code.
* c-c++-common/raw-string-5.c: Likewise.
* c-c++-common/raw-string-4.c: Likewise.
* c-c++-common/raw-string-6.c: Likewise.
* c-c++-common/pr20000.c: Likewise.
* gcc.dg/cpp/include2a.c: Add comments to checks for multiple
messages reported for one line of source code.
* gcc.dg/cpp/pr30786.c: Likewise.
* gcc.dg/cpp/pr28709.c: Likewise.
* gcc.dg/cpp/missing-header-MD.c: Likewise.
* gcc.dg/cpp/macspace2.c: Likewise.
* gcc.dg/cpp/missing-header-1.c: Likewise.
* gcc.dg/cpp/missing-header-MMD.c: Likewise.
* gcc.dg/cpp/missing-sysheader-MD.c: Likewise.
* gcc.dg/cpp/missing-sysheader-MMD.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@189393
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-07-09 Janis Johnson <janisjo@codesourcery.com>
+
+ Backport from mainline.
+ 2012-06-28 Janis Johnson <janisjo@codesourcery.com>
+
+ * g++.dg/cpp0x/nullptr19.c: Remove exta directives on same line.
+
+ * g++.dg/template/error46.C: Add missing comment to dg-message.
+ * g++.dg/template/crash107.C: Likewise.
+ * g++.dg/template/error47.C: Likewise.
+ * g++.dg/template/crash108.C: Likewise.
+ * g++.dg/overload/operator5.C: Likewise.
+
+ * gcc.dg/Wstrict-aliasing-converted-assigned.c: Fix syntax
+ errors in dg-message directives, add comments.
+
+ 2012-06-26 Janis Johnson <janisjo@codesourcery.com>
+
+ * lib/scandump.exp (scan-dump, scan-dump-not, scan-dump-dem,
+ scan-dump-dem-not): Use printable pattern in test name.
+
+ 2012-06-25 Janis Johnson <janisjo@codesourcery.com>
+
+ * lib/target-supports-dg.exp (testname-for-summary): New.
+ * lib/profopt.exp (profopt_execute): Define testname_with_flags.
+ * lib/gcc-dg.exp (cleanup-coverage-files, cleanup-repo-notes,
+ cleanup-stack-usage, cleanup-dump, cleanup-saved-temps, scan-module,
+ scan-module-absence, output-exists, output-exists-not: Use
+ testname-for-summary.
+ (dg-test): Clean up testname_with_flags.
+ * lib/scanasm.exp (scan-assembler, scan-assembler-not, scan-hidden,
+ scan-not-hidden, scan-file, scan-file-not, scan-stack-usage,
+ scan-stack-usage-not, scan-assembler-times, scan-assembler-dem,
+ scan-assembler-dem-not, object-size: Use testname-for-summary.
+ * lib/gcov.exp (run-gcov): Likewise.
+ * lib/scandump.exp (scan-dump, scan-dump-times, scan-dump-not,
+ scan-dump-dem, scan-dump-dem-note): Likewise.
+
+ * lib/profopt.exp: Make prof_option_list local to profopt-execute.
+ * g++.dg/tree-prof/tree-prof.exp (PROFOPT_OPTIONS): Define after
+ including profopt.opt; save and restore existing value.
+ * g++.dg/bprob/bprob.exp: Likewise.
+ * gcc.dg/matrix/matrix.exp: Likewise.
+ * gcc.dg/tree-prof/tree-prof.exp: Likewise.
+ * gcc.misc-tests/bprob.exp: Likewise; also replace formerly-ignored
+ PROFOPT_OPTIONS.
+
+ 2012-06-15 Janis Johnson <janosjo@codesourcery.com>
+
+ * lib/gcov.exp (verify-lines, verify-branches, verify-calls): Use
+ testname that includes flags, passed in as new argument, in
+ pass/fail messages.
+ (run_gcov): Get testname from dg-test, use it in pass/fail messages
+ and pass it to verify-* procedures.
+
+ * g++.dg/torture/stackalign/stackalign.exp: Combine stack
+ alignment torture options with usual torture options.
+
+ * g++.dg/cpp0x/auto27.C: Add comments to checks for multiple
+ messages reported for one line of source code.
+ * g++.dg/cpp0x/constexpr-decl.C: Likewise.
+ * g++.dg/cpp0x/decltype2.C: Likewise.
+ * g++.dg/cpp0x/decltype3.C: Likewise.
+ * g++.dg/cpp0x/lambda/lambda-syntax1.C: Likewise.
+ * g++.dg/cpp0x/regress/error-recovery1.C: Likewise.
+ * g++.dg/cpp0x/static_assert3.C: Likewise.
+ * g++.dg/cpp0x/udlit-cpp98-neg.C: Likewise.
+ * g++.dg/cpp0x/udlit-shadow-neg.C: Likewise.
+ * g++.dg/cpp0x/union1.C: Likewise.
+ * g++.dg/cpp0x/variadic-ex10.C: Likewise.
+ * g++.dg/cpp0x/variadic-ex14.C: Likewise.
+ * g++.dg/cpp0x/variadic2.C: Likewise.
+ * g++.dg/cpp0x/variadic20.C: Likewise.
+ * g++.dg/cpp0x/variadic74.C: Likewise.
+ * g++.dg/diagnostic/bitfld2.C: Likewise.
+ * g++.dg/ext/attrib44.C: Likewise.
+ * g++.dg/ext/no-asm-1.C: Likewise.
+ * g++.dg/other/error34.C: Likewise.
+ * g++.dg/parse/crash46.C: Likewise.
+ * g++.dg/parse/error10.C: Likewise.
+ * g++.dg/parse/error2.C: Likewise.
+ * g++.dg/parse/error3.C: Likewise.
+ * g++.dg/parse/error36.C: Likewise.
+ * g++.dg/parse/error8.C: Likewise.
+ * g++.dg/parse/error9.C: Likewise.
+ * g++.dg/parse/parser-pr28152-2.C: Likewise.
+ * g++.dg/parse/parser-pr28152.C: Likewise.
+ * g++.dg/parse/template25.C: Likewise.
+ * g++.dg/parse/typename11.C: Likewise.
+ * g++.dg/tc1/dr147.C: Likewise.
+ * g++.dg/template/deduce3.C: Likewise.
+ * g++.dg/template/koenig9.C: Likewise.
+ * g++.dg/template/pr23510.C: Likewise.
+ * g++.dg/warn/pr12242.C: Likewise.
+ * g++.dg/warn/pr30551-2.C: Likewise.
+ * g++.dg/warn/pr30551.C: Likewise.
+ * g++.old-deja/g++.other/typename1.C: Likewise.
+ * g++.old-deja/g++.pt/niklas01a.C: Likewise.
+
+ 2012-06-13 Janis Johnson <janisjo@codesourcery.com>
+
+ PR testsuite/20771
+ * lib/dg-pch.exp (dg-flags-pch): Add flags to make compile lines in
+ test summary unique.
+
+ * lib/scanasm.exp (scan-assembler, scan-assembler-not, scan-hidden,
+ scan-not-hiddent, scan-file, scan-file-not, scan-stack-usage,
+ scan-stack-usage-not): Don't strip torture options from test name.
+
+ * lib/scandump.exp (scan-dump-times): Use printable version of
+ regexp in test summary line.
+
+ * gcc.dg/di-longlong64-sync-1.c: Add comments to checks for multiple
+ messages reported for one line of source code.
+ * gcc.dg/format/few-1.c: Likewise.
+ * gcc.dg/ia64-sync-2.c: Likewise.
+ * gcc.dg/sync-2.c: Likewise.
+ * gcc.dg/noncompile/pr44517.c: Likewise.
+
+ 2012-06-12 Janis Johnson <janisjo@codesourcery.com>
+
+ * gcc.dg/torture/stackalign/stackalign.exp: Combine stack
+ alignment torture options with usual torture options.
+ * gcc.dg/torture/stackalign/alloca-2.c: Use dg-additional-options
+ instead of dg-options.
+ * gcc.dg/torture/stackalign/alloca-3.c: Likewise.
+ * gcc.dg/torture/stackalign/alloca-4.c: Likewise.
+ * gcc.dg/torture/stackalign/alloca-5.c: Likewise.
+ * gcc.dg/torture/stackalign/alloca-6.c: Likewise.
+ * gcc.dg/torture/stackalign/push-1.c: Likewise.
+ * gcc.dg/torture/stackalign/vararg-3.c: Likewise.
+
+ * gcc.target/arm/di-longlong64-sync-withhelpers.c: Add comments
+ to checks for multiple messages reported for one line of source code.
+ * gcc.target/arm/di-longlong64-sync-withldrexd.c: Likewise.
+
+ * gcc.c-torture/compile/sync-1.c: Add comments to checks for multiple
+ messages reported for one line of source code.
+
+ * gcc.dg/20031223-1.c: Add comments to check for multiple
+ messages reported for one line of source code.
+ * gcc.dg/Wconversion-integer.c: Likewise.
+ * gcc.dg/Wfatal-2.c: Likewise.
+ * gcc.dg/Wfatal.c: Likewise.
+ * gcc.dg/Wobjsize-1.c: Likewise.
+ * gcc.dg/c99-vla-jump-1.c: Likewise.
+ * gcc.dg/c99-vla-jump-2.c: Likewise.
+ * gcc.dg/c99-vla-jump-3.c: Likewise.
+ * gcc.dg/c99-vla-jump-4.c: Likewise.
+ * gcc.dg/c99-vla-jump-5.c: Likewise.
+ * gcc.dg/decl-9.c: Likewise.
+ * gcc.dg/declspec-10.c: Likewise.
+ * gcc.dg/declspec-18.c: Likewise.
+ * gcc.dg/mtune.c: Likewise.
+ * gcc.dg/parser-pr28152-2.c: Likewise.
+ * gcc.dg/parser-pr28152.c: Likewise.
+ * gcc.dg/pr14475.c: Likewise.
+ * gcc.dg/pr27953.c: Likewise.
+ * gcc.dg/pr28322-3.c: Likewise.
+ * gcc.dg/pr30457.c: Likewise.
+ * gcc.dg/pr30551-2.c: Likewise.
+ * gcc.dg/pr30551-3.c: Likewise.
+ * gcc.dg/pr30551-4.c: Likewise.
+ * gcc.dg/pr30551-5.c: Likewise.
+ * gcc.dg/pr30551-6.c: Likewise.
+ * gcc.dg/pr30551.c: Likewise.
+ * gcc.dg/pr45461.c: Likewise.
+ * gcc.dg/pr48552-1.c: Likewise.
+ * gcc.dg/pr48552-2.c: Likewise.
+ * gcc.dg/redecl-1.c: Likewise.
+ * gcc.dg/transparent-union-3.c: Likewise.
+ * gcc.dg/utf-dflt.c: Likewise.
+ * gcc.dg/utf-dflt2.c: Likewise.
+ * gcc.dg/vla-8.c: Likewise.
+ * gcc.dg/vla-init-1.c: Likewise.
+ * gcc.dg/wtr-int-type-1.c: Likewise.
+
+ * c-c++-common/raw-string-3.c: Add comments to checks for multiple
+ messages reported for for one line of source code.
+ * c-c++-common/raw-string-5.c: Likewise.
+ * c-c++-common/raw-string-4.c: Likewise.
+ * c-c++-common/raw-string-6.c: Likewise.
+ * c-c++-common/pr20000.c: Likewise.
+
+ * gcc.dg/cpp/include2a.c: Add comments to checks for multiple
+ messages reported for one line of source code.
+ * gcc.dg/cpp/pr30786.c: Likewise.
+ * gcc.dg/cpp/pr28709.c: Likewise.
+ * gcc.dg/cpp/missing-header-MD.c: Likewise.
+ * gcc.dg/cpp/macspace2.c: Likewise.
+ * gcc.dg/cpp/missing-header-1.c: Likewise.
+ * gcc.dg/cpp/missing-header-MMD.c: Likewise.
+ * gcc.dg/cpp/missing-sysheader-MD.c: Likewise.
+ * gcc.dg/cpp/missing-sysheader-MMD.c: Likewise.
+
2012-07-09 Jason Merrill <jason@redhat.com>
PR c++/53882
int g(void) {
- return 1; /* { dg-warning "function declared 'noreturn' has a 'return' statement" } */
-} /* { dg-warning "'noreturn' function does return" "" { target *-*-* } 12 } */
+ return 1; /* { dg-warning "function declared 'noreturn' has a 'return' statement" "has return" } */
+} /* { dg-warning "'noreturn' function does return" "does return" { target *-*-* } 12 } */
int g2(void) {
h();
int vg2(void); /* { dg-bogus ".noreturn. function returns non-void value" } */
int vg(void) {
- return 1; /* { dg-warning "function declared 'noreturn' has a 'return' statement" "" { target c } 27 } */
-} /* { dg-warning "'noreturn' function does return" "" { target c } 27 } */
+ return 1; /* { dg-warning "function declared 'noreturn' has a 'return' statement" "has return" { target c } 27 } */
+} /* { dg-warning "'noreturn' function does return" "does return" { target c } 27 } */
int vg2(void) {
h();
// { dg-options "" { target c } }
// { dg-options "-std=c++98" { target c++ } }
-const void *s0 = R"(a)"; // { dg-error "was not declared|undeclared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 7 }
-const void *s1 = uR"(a)"; // { dg-error "was not declared|undeclared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 9 }
-const void *s2 = UR"(a)"; // { dg-error "was not declared|undeclared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 11 }
-const void *s3 = u8R"(a)"; // { dg-error "was not declared|undeclared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 13 }
-const void *s4 = LR"(a)"; // { dg-error "was not declared|undeclared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 15 }
-
-const int i0 = R'a'; // { dg-error "expected ',' or ';'" }
- // { dg-error "was not declared" "" { target c++ } 18 }
-const int i1 = uR'a'; // { dg-error "expected ',' or ';'" }
- // { dg-error "was not declared" "" { target c++ } 20 }
-const int i2 = UR'a'; // { dg-error "expected ',' or ';'" }
- // { dg-error "was not declared" "" { target c++ } 22 }
-const int i3 = u8R'a'; // { dg-error "expected ',' or ';'" }
- // { dg-error "was not declared" "" { target c++ } 24 }
-const int i4 = LR'a'; // { dg-error "expected ',' or ';'" }
- // { dg-error "was not declared" "" { target c++ } 26 }
+const void *s0 = R"(a)"; // { dg-error "was not declared|undeclared" "undeclared" }
+ // { dg-error "expected ',' or ';'" "expected" { target *-*-* } 7 }
+const void *s1 = uR"(a)"; // { dg-error "was not declared|undeclared" "undeclared" }
+ // { dg-error "expected ',' or ';'" "expected" { target *-*-* } 9 }
+const void *s2 = UR"(a)"; // { dg-error "was not declared|undeclared" "undeclared" }
+ // { dg-error "expected ',' or ';'" "expected" { target *-*-* } 11 }
+const void *s3 = u8R"(a)"; // { dg-error "was not declared|undeclared" "undeclared" }
+ // { dg-error "expected ',' or ';'" "expected" { target *-*-* } 13 }
+const void *s4 = LR"(a)"; // { dg-error "was not declared|undeclared" "undeclared" }
+ // { dg-error "expected ',' or ';'" "expected" { target *-*-* } 15 }
+
+const int i0 = R'a'; // { dg-error "expected ',' or ';'" "expected" }
+ // { dg-error "was not declared" "undeclared" { target c++ } 18 }
+const int i1 = uR'a'; // { dg-error "expected ',' or ';'" "expected" }
+ // { dg-error "was not declared" "undeclared" { target c++ } 20 }
+const int i2 = UR'a'; // { dg-error "expected ',' or ';'" "expected" }
+ // { dg-error "was not declared" "undeclared" { target c++ } 22 }
+const int i3 = u8R'a'; // { dg-error "expected ',' or ';'" "expected" }
+ // { dg-error "was not declared" "undeclared" { target c++ } 24 }
+const int i4 = LR'a'; // { dg-error "expected ',' or ';'" "expected" }
+ // { dg-error "was not declared" "undeclared" { target c++ } 26 }
#define R "a"
#define uR "b"
// { dg-options "-std=gnu99" { target c } }
// { dg-options "-std=c++0x" { target c++ } }
-const int i0 = R'a'; // { dg-error "was not declared|undeclared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 6 }
-const int i1 = uR'a'; // { dg-error "was not declared|undeclared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 8 }
-const int i2 = UR'a'; // { dg-error "was not declared|undeclared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 10 }
-const int i3 = u8R'a'; // { dg-error "was not declared|undeclared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 12 }
-const int i4 = LR'a'; // { dg-error "was not declared|undeclared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 14 }
+const int i0 = R'a'; // { dg-error "was not declared|undeclared" "undeclared" }
+ // { dg-error "expected ',' or ';'" "expected" { target *-*-* } 6 }
+const int i1 = uR'a'; // { dg-error "was not declared|undeclared" "undeclared" }
+ // { dg-error "expected ',' or ';'" "expected" { target *-*-* } 8 }
+const int i2 = UR'a'; // { dg-error "was not declared|undeclared" "undeclared" }
+ // { dg-error "expected ',' or ';'" "expected" { target *-*-* } 10 }
+const int i3 = u8R'a'; // { dg-error "was not declared|undeclared" "undeclared" }
+ // { dg-error "expected ',' or ';'" "expected" { target *-*-* } 12 }
+const int i4 = LR'a'; // { dg-error "was not declared|undeclared" "undeclared" }
+ // { dg-error "expected ',' or ';'" "expected" { target *-*-* } 14 }
#define R 1 +
#define uR 2 +
// { dg-options "-std=c++0x" { target c++ } }
const void *s0 = R"0123456789abcdefg()0123456789abcdefg";
- // { dg-error "raw string delimiter longer" "" { target *-*-* } 5 }
- // { dg-error "stray" "" { target *-*-* } 5 }
+ // { dg-error "raw string delimiter longer" "longer" { target *-*-* } 5 }
+ // { dg-error "stray" "stray" { target *-*-* } 5 }
const void *s1 = R" () ";
- // { dg-error "invalid character" "" { target *-*-* } 8 }
- // { dg-error "stray" "" { target *-*-* } 8 }
+ // { dg-error "invalid character" "invalid" { target *-*-* } 8 }
+ // { dg-error "stray" "stray" { target *-*-* } 8 }
const void *s2 = R" () ";
- // { dg-error "invalid character" "" { target *-*-* } 11 }
- // { dg-error "stray" "" { target *-*-* } 11 }
+ // { dg-error "invalid character" invalid"" { target *-*-* } 11 }
+ // { dg-error "stray" "stray" { target *-*-* } 11 }
const void *s3 = R")())";
- // { dg-error "invalid character" "" { target *-*-* } 14 }
- // { dg-error "stray" "" { target *-*-* } 14 }
+ // { dg-error "invalid character" invalid"" { target *-*-* } 14 }
+ // { dg-error "stray" "stray" { target *-*-* } 14 }
const void *s4 = R"@()@";
- // { dg-error "invalid character" "" { target *-*-* } 17 }
- // { dg-error "stray" "" { target *-*-* } 17 }
+ // { dg-error "invalid character" invalid"" { target *-*-* } 17 }
+ // { dg-error "stray" "stray" { target *-*-* } 17 }
const void *s5 = R"$()$";
- // { dg-error "invalid character" "" { target *-*-* } 20 }
- // { dg-error "stray" "" { target *-*-* } 20 }
+ // { dg-error "invalid character" invalid"" { target *-*-* } 20 }
+ // { dg-error "stray" "stray" { target *-*-* } 20 }
const void *s6 = R"\u0040()\u0040";
- // { dg-error "invalid character" "" { target *-*-* } 23 }
- // { dg-error "stray" "" { target *-*-* } 23 }
+ // { dg-error "invalid character" invalid"" { target *-*-* } 23 }
+ // { dg-error "stray" "stray" { target *-*-* } 23 }
int main () {}
// { dg-options "-std=gnu99" { target c } }
// { dg-options "-std=c++0x" { target c++ } }
-const void *s0 = R"ouch()ouCh"; // { dg-error "at end of input" }
- // { dg-error "unterminated raw string" "" { target *-*-* } 5 }
+const void *s0 = R"ouch()ouCh"; // { dg-error "at end of input" "end" }
+ // { dg-error "unterminated raw string" "unterminated" { target *-*-* } 5 }
strace $tracelevel
}
-# Override the list defined in profopt.exp.
+# Load support procs.
+load_lib profopt.exp
+
+# Save and override the default list defined in profopt.exp.
+set bprob_save_profopt_options $PROFOPT_OPTIONS
set PROFOPT_OPTIONS [list \
{ -g } \
{ -O0 } \
strace $tracelevel
}
-# Load support procs.
-load_lib profopt.exp
-
set profile_options "-fprofile-arcs"
set feedback_options "-fbranch-probabilities"
profopt-execute $src
}
}
+
+set PROFOPT_OPTIONS $bprob_save_profopt_options
// PR c++/51186
-auto main()->int // { dg-error "std=" "" { target c++98 } }
- // { dg-error "auto" "" { target c++98 } 3 }
- // { dg-error "no type" "" { target c++98 } 3 }
+auto main()->int // { dg-error "std=" "std" { target c++98 } }
+ // { dg-error "auto" "auto" { target c++98 } 3 }
+ // { dg-error "no type" "no type" { target c++98 } 3 }
{ }
// { dg-options -std=c++0x }
struct S {
- static constexpr int size; // { dg-error "must have an initializer" }
- // { dg-error "previous declaration" "" { target *-*-* } 5 }
+ static constexpr int size; // { dg-error "must have an initializer" "must have" }
+ // { dg-error "previous declaration" "previous" { target *-*-* } 5 }
};
const int limit = 2 * S::size;
int bar(int);
CHECK_DECLTYPE(decltype(foo), int(char));
-decltype(bar) z; // { dg-error "overload" }
-// { dg-error "invalid type" "" { target *-*-* } 48 }
+decltype(bar) z; // { dg-error "overload" "overload" }
+// { dg-error "invalid type" "invalid" { target *-*-* } 48 }
CHECK_DECLTYPE(decltype(&foo), int(*)(char));
CHECK_DECLTYPE(decltype(*&foo), int(&)(char));
};
CHECK_DECLTYPE(decltype(aa.*&A::a), int&);
-decltype(aa.*&A::b) zz; // { dg-error "cannot create pointer to reference member" }
-// { dg-error "invalid type" "" { target *-*-* } 58 }
+decltype(aa.*&A::b) zz; // { dg-error "cannot create pointer to reference member" "cannot" }
+// { dg-error "invalid type" "invalid type" { target *-*-* } 58 }
CHECK_DECLTYPE(decltype(caa.*&A::a), const int&);
class X {
// PR c++/46124
// { dg-options -std=c++0x }
-void foo() { [] () -> void (); } // { dg-error "returning a function" }
-// { dg-error "expected .\{" "" { target *-*-* } 4 }
+void foo() { [] () -> void (); } // { dg-error "returning a function" "returning" }
+// { dg-error "expected .\{" "expected" { target *-*-* } 4 }
typedef decltype(nullptr) nullptr_t;
-char* k( char* ); /* { dg-message "note" } { dg-message "note" } */
-nullptr_t k( nullptr_t ); /* { dg-message "note" } { dg-message "note" } */
+char* k( char* ); /* { dg-message "note" } */
+nullptr_t k( nullptr_t ); /* { dg-message "note" } */
void test_k()
{
foo ()
{
const bool b =; // { dg-error "" }
- foo < b > (); // { dg-error "constant expression" }
+ foo < b > (); // { dg-error "constant expression" "const expr" }
};
-// { dg-error "no match" "" { target *-*-* } 8 }
+// { dg-error "no match" "no match" { target *-*-* } 8 }
// { dg-options "-std=c++0x" }
-static_assert(7 / 0, "X"); // { dg-error "non-constant condition" }
-// { dg-warning "division by zero" "" { target *-*-* } 2 }
-// { dg-error "7 / 0.. is not a constant expression" "" { target *-*-* } 2 }
+static_assert(7 / 0, "X"); // { dg-error "non-constant condition" "non-constant" }
+// { dg-warning "division by zero" "zero" { target *-*-* } 2 }
+// { dg-error "7 / 0.. is not a constant expression" "not a constant" { target *-*-* } 2 }
operator"" _Q(const char *, std::size_t) // { dg-warning "user-defined literals only available with" }
{ return 42; }
-int x = "Hello"_Q; // { dg-error "invalid conversion from" }
+int x = "Hello"_Q; // { dg-error "invalid conversion from" "invalid" }
-// { dg-error "expected" "" { target *-*-* } 15 }
+// { dg-error "expected" "expected" { target *-*-* } 15 }
}
-// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 5 }
-// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 9 }
-// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 13 }
-// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 17 }
-// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 25 }
-// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 29 }
-// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 33 }
-// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 37 }
+// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 5 }
+// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 9 }
+// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 13 }
+// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 17 }
+// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 25 }
+// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 29 }
+// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 33 }
+// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 37 }
A a; // { dg-error "union member" }
};
-B b; // { dg-error "B::B\\(\\)" }
-B b2(b); // { dg-error "B::B\\(const B&\\)" }
+B b; // { dg-error "B::B\\(\\)" "B::B" }
+B b2(b); // { dg-error "B::B\\(const B&\\)" "B::B" }
struct C
{
};
};
-C c; // { dg-error "C::C\\(\\)" }
-C c2(c); // { dg-error "C::C\\(const C&\\)" }
+C c; // { dg-error "C::C\\(\\)" "C::C" }
+C c2(c); // { dg-error "C::C\\(const C&\\)" "C::C" }
-// { dg-error "B::~B" "" { target *-*-* } 17 }
-// { dg-error "B::~B" "" { target *-*-* } 18 }
-// { dg-error "C::~C" "" { target *-*-* } 28 }
-// { dg-error "C::~C" "" { target *-*-* } 29 }
+// { dg-error "B::~B" "B::~B" { target *-*-* } 17 }
+// { dg-error "B::~B" "B::~B" { target *-*-* } 18 }
+// { dg-error "C::~C" "C::~C" { target *-*-* } 28 }
+// { dg-error "C::~C" "C::~C" { target *-*-* } 29 }
Tuple<> t0; // Types contains no arguments
Tuple<int> t1; // Types contains one argument: int
Tuple<int, float> t2; // Types contains two arguments: int and float
-Tuple<0> error; // { dg-error "mismatch" }
-// { dg-error "expected a type" "" { target *-*-* } 7 }
-// { dg-error "in declaration" "" { target *-*-* } 7 }
+Tuple<0> error; // { dg-error "mismatch" "mismatch" }
+// { dg-error "expected a type" "expected a type" { target *-*-* } 7 }
+// { dg-error "in declaration" "in declaration" { target *-*-* } 7 }
template<template<class...> class Q> class Y { /* ... */ };
X<A> xA; // okay
-X<B> xB; // { dg-error "mismatch" }
-// { dg-error "expected a template" "" { target *-*-* } 11 }
-// { dg-error "invalid type" "" { target *-*-* } 11 }
-X<C> xC; // { dg-error "mismatch" }
-// { dg-error "expected a template" "" { target *-*-* } 14 }
-// { dg-error "invalid type" "" { target *-*-* } 14 }
+X<B> xB; // { dg-error "mismatch" "mismatch" }
+// { dg-error "expected a template" "expected" { target *-*-* } 11 }
+// { dg-error "invalid type" "invalid" { target *-*-* } 11 }
+X<C> xC; // { dg-error "mismatch" "mismatch" }
+// { dg-error "expected a template" "expected" { target *-*-* } 14 }
+// { dg-error "invalid type" "invalid" { target *-*-* } 14 }
Y<A> yA;
Y<B> yB;
Y<C> yC; // okay
template<typename T1, typename T2, typename... Rest>
struct two_or_more {}; // { dg-error "provided for" }
-typedef two_or_more<int> bad; // { dg-error "2 or more" }
-// { dg-error "invalid type" "" { target *-*-* } 11 }
+typedef two_or_more<int> bad; // { dg-error "2 or more" "2 or more" }
+// { dg-error "invalid type" "invalid type" { target *-*-* } 11 }
void f()
{
int a0[metatuple<>::value == 0? 1 : -1];
int a1[metatuple<add_pointer>::value == 1? 1 : -1];
-int a2a[metatuple<add_pointer, add_pointer>::value == 2? 1 : -1]; // { dg-error "ambiguous|array bound" }
+int a2a[metatuple<add_pointer, add_pointer>::value == 2? 1 : -1]; // { dg-error "ambiguous|array bound" "bound" }
int a2b[metatuple<add_reference, add_reference>::value == 2? 1 : -1];
-int a3[metatuple<add_pointer, add_reference>::value == 3? 1 : -1]; // { dg-error "ambiguous|array bound" }
+int a3[metatuple<add_pointer, add_reference>::value == 3? 1 : -1]; // { dg-error "ambiguous|array bound" "bound" }
int a4[metatuple<add_reference>::value == 4? 1 : -1];
int a5[metatuple<add_reference, add_pointer>::value == 5? 1 : -1];
-// { dg-error "incomplete" "" { target *-*-* } 40 }
-// { dg-error "incomplete" "" { target *-*-* } 42 }
+// { dg-error "incomplete" "incomplete" { target *-*-* } 40 }
+// { dg-error "incomplete" "incomplete" { target *-*-* } 42 }
A<int*, float*>::X<&i, &f> apple1;
B<int, float>::X<&i, &f> banana1;
-A<int*, float*>::X<&i> apple2; // { dg-error "wrong number of template arguments" }
-// { dg-error "invalid type" "" { target *-*-* } 22 }
-A<int*, float*>::X<&i, &f, &f> apple3; // { dg-error "wrong number of template arguments" }
-// { dg-error "invalid type" "" { target *-*-* } 24 }
+A<int*, float*>::X<&i> apple2; // { dg-error "wrong number of template arguments" "wrong number" }
+// { dg-error "invalid type" "invalid" { target *-*-* } 22 }
+A<int*, float*>::X<&i, &f, &f> apple3; // { dg-error "wrong number of template arguments" "wrong number" }
+// { dg-error "invalid type" "invalid" { target *-*-* } 24 }
A<int, float> apple4;
template<int> struct A
{
- struct {} : 2; // { dg-error "expected ';' after struct" }
+ struct {} : 2; // { dg-error "expected ';' after struct" "expected" }
};
-// { dg-error "ISO C.. forbids declaration" "" { target *-*-* } 6 }
-// { dg-error "ISO C.. prohibits anonymous" "" { target *-*-* } 6 }
+// { dg-error "ISO C.. forbids declaration" "declaration" { target *-*-* } 6 }
+// { dg-error "ISO C.. prohibits anonymous" "anonymous" { target *-*-* } 6 }
// PR c++/52671
// { dg-do compile }
-__attribute__ ((deprecated)) enum E { E0 }; // { dg-warning "attribute ignored in declaration of" }
-// { dg-message "must follow the" "" { target *-*-* } 3 }
+__attribute__ ((deprecated)) enum E { E0 }; // { dg-warning "attribute ignored in declaration of" "ignored" }
+// { dg-message "must follow the" "must follow" { target *-*-* } 3 }
// keywords.
int asm; // { dg-error "before .asm." }
-int typeof; // { dg-error "expected" }
-// { dg-error "multiple types" "" { target *-*-* } 8 }
-// { dg-error "declaration" "" { target *-*-* } 8 }
+int typeof; // { dg-error "expected" "expected" }
+// { dg-error "multiple types" "multiple" { target *-*-* } 8 }
+// { dg-error "declaration" "declaration" { target *-*-* } 8 }
// { dg-do compile }
// { dg-options "" }
-S () : str(__PRETTY_FUNCTION__) {} // { dg-error "forbids declaration" }
-// { dg-error "only constructors" "" { target *-*-* } 5 }
+S () : str(__PRETTY_FUNCTION__) {} // { dg-error "forbids declaration" "decl" }
+// { dg-error "only constructors" "constructor" { target *-*-* } 5 }
const String& b,
bool ignoreCase) {
return ignoreCase ? equalIgnoringCase(a, b) : (a == b); } // { dg-error "ambiguous" }
-// { dg-message "note" { target *-*-* } 15 }
+// { dg-message "note" "note" { target *-*-* } 15 }
// { dg-do compile }
void
-foo (_Decimal32) // { dg-error "declared void" }
+foo (_Decimal32) // { dg-error "declared void" "declared" }
{
}
- // { dg-error "was not declared" "" { target *-*-* } 5 }
+ // { dg-error "was not declared" "not" { target *-*-* } 5 }
void
-bar (_Bool) // { dg-error "declared void" }
+bar (_Bool) // { dg-error "declared void" "declared" }
{
}
- // { dg-error "was not declared" "" { target *-*-* } 10 }
+ // { dg-error "was not declared" "not" { target *-*-* } 10 }
void
-baz (_Fract) // { dg-error "declared void" }
+baz (_Fract) // { dg-error "declared void" "declared" }
{
}
- // { dg-error "was not declared" "" { target *-*-* } 15 }
+ // { dg-error "was not declared" "not" { target *-*-* } 15 }
}
// Here, columns nums are not very accurate either. Still acceptable though
-// { dg-error "30:invalid type in declaration before ';' token" "" { target *-*-* } 14 }
-// { dg-error "30:two or more data types in declaration of 'e4'" "" { target *-*-* } 14 }
+// { dg-error "30:invalid type in declaration before ';' token" "invalid" { target *-*-* } 14 }
+// { dg-error "30:two or more data types in declaration of 'e4'" "2 or more" { target *-*-* } 14 }
template <int>
struct Foo {};
-Foo<func(g)> f; // { dg-error "5:'int func.double.' cannot appear in a constant-expression" "" { target *-*-* } 11 }
-// { dg-error "10:'g' cannot appear in a constant-expression" "" { target *-*-* } 11 }
-// { dg-error "11:a function call cannot appear in a constant-expression" "" { target *-*-* } 11 }
-// { dg-error "12:template argument 1 is invalid" "" { target *-*-* } 11 }
-// { dg-error "15:invalid type in declaration before ';' token" "" { target *-*-* } 11 }
+Foo<func(g)> f; // { dg-error "5:'int func.double.' cannot appear in a constant-expression" "func double" { target *-*-* } 11 }
+// { dg-error "10:'g' cannot appear in a constant-expression" "g" { target *-*-* } 11 }
+// { dg-error "11:a function call cannot appear in a constant-expression" "call" { target *-*-* } 11 }
+// { dg-error "12:template argument 1 is invalid" "invalid template argument" { target *-*-* } 11 }
+// { dg-error "15:invalid type in declaration before ';' token" "invalid type" { target *-*-* } 11 }
void(*AddFunction)(const TYPE&,bool&,
char*, char*,
unsigned*));
-// { dg-error "64: ISO C\\+\\+ forbids declaration of 'parameter' with no type" "" { target *-*-* } { 5 } }
-// { dg-error "60: 'TYPE' does not name a type" "" { target *-*-* } { 5 } }
+// { dg-error "64: ISO C\\+\\+ forbids declaration of 'parameter' with no type" "forbids" { target *-*-* } { 5 } }
+// { dg-error "60: 'TYPE' does not name a type" "does not" { target *-*-* } { 5 } }
void f(T t)
{
typedef A<T>::foo type; // { dg-error "typename" }
- A<T>::bar b; // { dg-error "typename" }
-} // { dg-error "expected ';'" "" { target *-*-* } 14 }
+ A<T>::bar b; // { dg-error "typename" "typename" }
+} // { dg-error "expected ';'" "expected" { target *-*-* } 14 }
// PR c++/36353
template <class T> struct B
{
void f()
{
- A<T>::baz z; // { dg-error "typename" }
- } // { dg-error "expected ';'" "" { target *-*-* } 22 }
+ A<T>::baz z; // { dg-error "typename" "typename" }
+ } // { dg-error "expected ';'" "expected" { target *-*-* } 22 }
};
// PR c++/40738
template <class T>
-void g(const A<T>::type &t); // { dg-error "typename" }
-// { dg-error "no type" "" { target *-*-* } 28 }
+void g(const A<T>::type &t); // { dg-error "typename" "typename" }
+// { dg-error "no type" "no type" { target *-*-* } 28 }
// PR c++/18451
template <class T> A<T>::B A<T>::b; // { dg-error "typename" }
struct A { friend typename struct B; };
-// { dg-error "28:expected nested-name-specifier before 'struct'" "" { target *-*-* } 4 }
-// { dg-error "35:multiple types in one declaration" "" { target *-*-* } 4 }
-// { dg-error "12:friend declaration does not name a class or function" "" { target *-*-* } 4 }
+// { dg-error "28:expected nested-name-specifier before 'struct'" "expected" { target *-*-* } 4 }
+// { dg-error "35:multiple types in one declaration" "multiple" { target *-*-* } 4 }
+// { dg-error "12:friend declaration does not name a class or function" "friend decl" { target *-*-* } 4 }
int a[] = { FOO: 1, BAR: 2 };
// the following 2 column locations are still not accurate enough
-// { dg-error "28:name 'FOO' used in a GNU-style designated initializer for an array" "" { target *-*-* } 5 }
-// { dg-error "28:name 'BAR' used in a GNU-style designated initializer for an array" "" { target *-*-* } 5 }
+// { dg-error "28:name 'FOO' used in a GNU-style designated initializer for an array" "FOO" { target *-*-* } 5 }
+// { dg-error "28:name 'BAR' used in a GNU-style designated initializer for an array" "BAR" { target *-*-* } 5 }
{
__complex__ float z;
- z = __complex__ (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '__complex__'" }
- // { dg-error "expected .;. before .__complex__." "" { target *-*-* } 9 }
- z = __complex__ (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '__complex__'" }
- // { dg-error "expected .;. before '__complex__'" "" { target *-*-* } 11 }
- // { dg-error "at end of input" "" { target *-*-* } 11 }
+ z = __complex__ (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '__complex__'" "primary-expression" }
+ // { dg-error "expected .;. before .__complex__." "semicolon" { target *-*-* } 9 }
+ z = __complex__ (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '__complex__'" "primaty-expression" }
+ // { dg-error "expected .;. before '__complex__'" "semicolon" { target *-*-* } 11 }
+ // { dg-error "at end of input" "end" { target *-*-* } 11 }
{
_Complex float z;
- z = _Complex (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '_Complex'" }
- // { dg-error "expected .;. before ._Complex." "" { target *-*-* } 9 }
- z = _Complex (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '_Complex'" }
- // { dg-error "expected .;. before '_Complex'" "" { target *-*-* } 11 }
- // { dg-error "at end of input" "" { target *-*-* } 11 }
+ z = _Complex (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '_Complex'" "primary-expression" }
+ // { dg-error "expected .;. before ._Complex." "semicolon" { target *-*-* } 9 }
+ z = _Complex (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '_Complex'" "primary-expression" }
+ // { dg-error "expected .;. before '_Complex'" "semicolon" { target *-*-* } 11 }
+ // { dg-error "at end of input" "end" { target *-*-* } 11 }
void g(void)
{
- template f<int>(); /* { dg-error "expected primary-expression" } */
- /* { dg-error "expected ';'" "" { target *-*-* } 12 } */
+ template f<int>(); /* { dg-error "expected primary-expression" "primary-expression" } */
+ /* { dg-error "expected ';'" "semicolon" { target *-*-* } 12 } */
}
// note: I is nested type in X, not Y!
template <int dim>
-Y<dim>::I::I () {} // { dg-error "dependent typedef" }
-// { dg-error "no type|dependent type" "" { target *-*-* } 13 }
+Y<dim>::I::I () {} // { dg-error "dependent typedef" "typedef" }
+// { dg-error "no type|dependent type" "no type" { target *-*-* } 13 }
template struct Y<1>;
void f()
{
- A::A a; // { dg-error "constructor" }
-} // { dg-error "" "" { target *-*-* } 23 } error cascade
+ A::A a; // { dg-error "constructor" "constructor" }
+} // { dg-error "" "error cascade" { target *-*-* } 23 } error cascade
}
namespace N2 {
}
};
Vec<double> v(3,4,12); // { dg-error "no matching" }
-// { dg-message "note" { target *-*-* } 16 }
+// { dg-message "note" "note" { target *-*-* } 16 }
Vec<double> V(12,4,3); // { dg-error "no matching" }
-// { dg-message "note" { target *-*-* } 18 }
+// { dg-message "note" "note" { target *-*-* } 18 }
Vec<double> c = v^V; // { dg-message "required" }
template<class T> struct A {A(int b=k(0));}; // { dg-error "arguments" }
void f(int k){A<int> a;} // // { dg-error "parameter|declared" }
-// { dg-message "note" { target *-*-* } 3 }
+// { dg-message "note" "note" { target *-*-* } 3 }
template <typename T>
-void f(int, T (*)() = 0); // { dg-message "note" }
+void f(int, T (*)() = 0); // { dg-message "note" "note" }
void g() {
typedef int A[2];
f<A>(0); // { dg-error "" }
- // { dg-error "returning an array" "candidate explanation" { target *-*-* } 2 }
+ // { dg-error "returning an array" "returning an array" { target *-*-* } 2 }
typedef void F();
f<F>(0); // { dg-error "" }
- // { dg-error "returning a function" "candidate explanation" { target *-*-* } 2 }
+ // { dg-error "returning a function" "returning a function" { target *-*-* } 2 }
}
{
foo(A<0>(), A<1>()); // { dg-error "no matching" }
}
-// { dg-message "candidate|parameter 'N' ('0' and '1')" { target *-*-* } 9 }
+// { dg-message "candidate|parameter 'N' ('0' and '1')" "" { target *-*-* } 9 }
{
foo(0, p); // { dg-error "no matching" }
}
-// { dg-message "candidate|parameter 'T' ('int' and 'void*')" { target *-*-* } 7 }
+// { dg-message "candidate|parameter 'T' ('int' and 'void*')" "" { target *-*-* } 7 }
template <class T> struct B: A<T>
{
- void f() { h(T()); } // { dg-error "argument-dependent" }
- static void g() { h(T()); } // { dg-error "argument-dependent" }
+ void f() { h(T()); } // { dg-error "argument-dependent" "arg-dep" }
+ static void g() { h(T()); } // { dg-error "argument-dependent" "arg-dep" }
};
int main()
b.g();
}
-// { dg-message "dependent base .A.int" "" { target *-*-* } 19 }
-// { dg-message "this->h" "" { target *-*-* } 19 }
-// { dg-message "dependent base .A.int" "" { target *-*-* } 20 }
-// { dg-message "B::h" "" { target *-*-* } 20 }
+// { dg-message "dependent base .A.int" "base" { target *-*-* } 19 }
+// { dg-message "this->h" "this->h" { target *-*-* } 19 }
+// { dg-message "dependent base .A.int" "base" { target *-*-* } 20 }
+// { dg-message "B::h" "B::h" { target *-*-* } 20 }
template<unsigned int nFactor>
struct Factorial
{
- enum { nValue = nFactor * Factorial<nFactor - 1>::nValue }; // { dg-error "depth exceeds maximum" }
- // { dg-message "recursively required" "" { target *-*-* } 6 }
- // { dg-error "incomplete type" "" { target *-*-* } 6 }
+ enum { nValue = nFactor * Factorial<nFactor - 1>::nValue }; // { dg-error "depth exceeds maximum" "exceeds" }
+ // { dg-message "recursively required" "recurse" { target *-*-* } 6 }
+ // { dg-error "incomplete type" "incomplete" { target *-*-* } 6 }
} // { dg-error "expected ';' after" }
template<>
-# Copyright (C) 2008, 2010
+# Copyright (C) 2008, 2010, 2012
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# This harness is for tests that should be run at all optimisation levels.
load_lib g++-dg.exp
+load_lib torture-options.exp
+
+global DG_TORTURE_OPTIONS LTO_TORTURE_OPTIONS
+
dg-init
-set additional_flags ""
+torture-init
+
+# default_flags are replaced by a dg-options test directive, or appended
+# to by using dg-additional-options. Use default_flags for options that
+# are used in all of the torture sets to limit the amount of noise in
+# test summaries.
+set default_flags ""
+
+# torture_flags are combined with other torture options and do not
+# affect options specified within a test.
+set torture_flags ""
+
+set stackalign_options [list]
# If automatic stack alignment is supported, force it on.
if { [check_effective_target_automatic_stack_alignment] } then {
- lappend additional_flags "-mstackrealign"
- lappend additional_flags "-mpreferred-stack-boundary=5"
+ append default_flags " -mstackrealign"
+ append default_flags " -mpreferred-stack-boundary=5"
}
+lappend stackalign_options [join $torture_flags]
-gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] $additional_flags
if { [check_effective_target_fpic] } then {
- lappend additional_flags "-fpic"
- gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] $additional_flags
+ lappend torture_flags "-fpic"
+ lappend stackalign_options [join $torture_flags]
}
+
+# Combine stackalign options with the usual torture optimization flags.
+set-torture-options [concat $DG_TORTURE_OPTIONS $LTO_TORTURE_OPTIONS] $stackalign_options
+
+gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] "$default_flags"
+
+torture-finish
dg-finish
set tool g++
set prof_ext "gcda"
-# Override the list defined in profopt.exp.
-set PROFOPT_OPTIONS [list {}]
-
if $tracelevel then {
strace $tracelevel
}
# Load support procs.
load_lib profopt.exp
+# Save and override the default list defined in profopt.exp.
+set treeprof_save_profopt_options $PROFOPT_OPTIONS
+set PROFOPT_OPTIONS [list {}]
+
# These are globals used by profopt-execute. The first is options
# needed to generate profile data, the second is options to use the
# profile data.
}
profopt-execute $src
}
+
+set PROFOPT_OPTIONS $treeprof_save_profopt_options
X x;
Y y;
- x = 10; // { dg-warning "invalid conversion from .int. to .X." }
- // { dg-warning "unspecified" "" { target *-*-* } 13 }
+ x = 10; // { dg-warning "invalid conversion from .int. to .X." "invalid" }
+ // { dg-warning "unspecified" "unspecified" { target *-*-* } 13 }
x = 1; // { dg-warning "invalid conversion from .int. to .X." }
x = C; // { dg-error "cannot convert .Y. to .X. in assignment" }
x = D; // { dg-error "cannot convert .Y. to .X. in assignment" }
// { dg-do compile }
// { dg-options "-pedantic-errors" }
// { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } }
-int main(char a) {} /* { dg-error "first argument of .*main.* should be .int." } */
-/* { dg-error "main.* takes only zero or two arguments" "" { target *-*-* } 5 } */
+int main(char a) {} /* { dg-error "first argument of .*main.* should be .int." "int" } */
+/* { dg-error "main.* takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
// { dg-do compile }
// { dg-options "" }
// { dg-skip-if "-Wmain not enabled on SPU" { spu-*-* } }
-int main(char a) {} /* { dg-warning "first argument of .*main.* should be .int." } */
-/* { dg-warning "main.* takes only zero or two arguments" "" { target *-*-* } 5 } */
+int main(char a) {} /* { dg-warning "first argument of .*main.* should be .int." "int" } */
+/* { dg-warning "main.* takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
template<class T>
void f()
{
- Vector<T>::iterator i = 0; // { dg-error "typename" } missing typename
-} // { dg-error "expected" "" { target *-*-* } 16 }
+ Vector<T>::iterator i = 0; // { dg-error "typename" "typename" } missing typename
+} // { dg-error "expected" "expected" { target *-*-* } 16 }
// { dg-options "-fshow-column" }
struct A { // { dg-error "" } forward declaration
- friend struct B : A { // { dg-error "invalid use of incomplete type 'struct A" }
+ friend struct B : A { // { dg-error "invalid use of incomplete type 'struct A" "invalid" }
int x;
- }; // { dg-error "class definition may not be declared a friend" "" { target *-*-* } { 5 } }
+ }; // { dg-error "class definition may not be declared a friend" "may not" { target *-*-* } { 5 } }
int y;
};
-/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
-/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */
/* { dg-options "-ffat-lto-objects" } */
/* Validate that each of the __sync builtins compiles. This won't
void f ()
{
- l: int; /* { dg-error "a label can only be part of a statement and a declaration is not a statement" } */
- /* { dg-warning "useless type name in empty declaration" "" { target *-*-* } 10 } */
- /* { dg-error "label at end of compound statement" "" { target *-*-* } 10 } */
+ l: int; /* { dg-error "a label can only be part of a statement and a declaration is not a statement" "not stmt" } */
+ /* { dg-warning "useless type name in empty declaration" "type name" { target *-*-* } 10 } */
+ /* { dg-error "label at end of compound statement" "label" { target *-*-* } 10 } */
}
fuc ('A');
uc = 'A';
- uc = x ? 1U : -1; /* { dg-warning " conversion" } */
- /* { dg-warning "negative integer implicitly converted to unsigned type" "" { target *-*-* } 43 } */
- uc = x ? SCHAR_MIN : 1U; /* { dg-warning " conversion" } */
- /* { dg-warning "negative integer implicitly converted to unsigned type" "" { target *-*-* } 45 } */
+ uc = x ? 1U : -1; /* { dg-warning " conversion" "conversion" } */
+ /* { dg-warning "negative integer implicitly converted to unsigned type" "implicit" { target *-*-* } 43 } */
+ uc = x ? SCHAR_MIN : 1U; /* { dg-warning " conversion" "conversion" } */
+ /* { dg-warning "negative integer implicitly converted to unsigned type" "implicit" { target *-*-* } 45 } */
uc = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
uc = x ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
int i = INT_MAX + 1; /* { dg-error "integer overflow in expression" } */
int k = 1 / 0;
int j = INT_MIN - 1;
-/* { dg-message "being treated as errors" "" { target *-*-* } 0 } */
-/* { dg-message "terminated due to -Wfatal-errors" "" { target *-*-* } 0 } */
+/* { dg-message "being treated as errors" "treated as errors" { target *-*-* } 0 } */
+/* { dg-message "terminated due to -Wfatal-errors" "terminated" { target *-*-* } 0 } */
int i = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */
int k = 1 / 0; /* { dg-error "division by zero" } */
int j = INT_MIN - 1;
-/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
-/* { dg-message "terminated due to -Wfatal-errors" "" { target *-*-* } 0 } */
+/* { dg-message "some warnings being treated as errors" "treated as errors" {target "*-*-*"} 0 } */
+/* { dg-message "terminated due to -Wfatal-errors" "terminated" { target *-*-* } 0 } */
}
/* { dg-warning "will always overflow destination buffer" "" { target *-*-* } 6 } */
-/* { dg-message "file included" "" { target *-*-* } 0 } */
-/* { dg-message "inlined from" "" { target *-*-* } 0 } */
+/* { dg-message "file included" "included" { target *-*-* } 0 } */
+/* { dg-message "inlined from" "inlined" { target *-*-* } 0 } */
int foo()
{
int i;
- *(long*)&i = 0; /* { dg-warning "type-punn" } */
+ *(long*)&i = 0; /* { dg-warning "type-punn" "type-punn" } */
return i;
}
-/* { dg-message "does break strict-aliasing" "" { target { *-*-* && lp64 } xfail *-*-* } 8 } */
-/* { dg-message "initialized" "" { target { *-*-* && lp64 } xfail *-*-* } 8 } */
+/* These messages are only expected for lp64, but fail there. When they
+ pass for lp64, replace "xfail *-*-*" with "target lp64". */
+
+/* { dg-message "does break strict-aliasing" "break" { xfail *-*-* } 8 } */
+/* { dg-message "initialized" "init" { xfail *-*-* } 8 } */
void fa288 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0;a: goto a; }
/* Match extra informative notes. */
-/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */
-/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */
+/* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */
+/* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */
void fb288 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;a: goto a; P03B:goto P03B; }
/* Match extra informative notes. */
-/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */
-/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */
+/* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */
+/* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */
void fc288 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0;a: goto a; }
/* Match extra informative notes. */
-/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */
-/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */
+/* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */
+/* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */
void fd288 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;a: goto a; P03B:goto P03B; }
/* Match extra informative notes. */
-/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */
-/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */
+/* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */
+/* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */
}
/* Match extra informative notes. */
-/* { dg-message "note: switch starts here" "note: expected" { target *-*-* } 0 } */
-/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */
+/* { dg-message "note: switch starts here" "note: starts" { target *-*-* } 0 } */
+/* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */
/* These error is No such file or directory, just once. However, this
message is locale-dependent, so don't test for it. */
-/* { dg-error "silly" "" { target *-*-* } 0 } */
-/* { dg-error "missing" "" { target *-*-* } 0 } */
-/* { dg-message "terminated" "" { target *-*-* } 0 } */
+/* { dg-error "silly" "silly" { target *-*-* } 0 } */
+/* { dg-error "missing" "missing" { target *-*-* } 0 } */
+/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */
#define ag"abc" /* { dg-error "requires whitespace" } */
int dummy;
-/* { dg-error "missing terminating" "" { target *-*-* } 6 } */
-/* { dg-error "missing terminating" "" { target *-*-* } 10 } */
+/* { dg-error "missing terminating" "missing-terminating" { target *-*-* } 6 } */
+/* { dg-error "missing terminating" "missing-terminating" { target *-*-* } 10 } */
/* { dg-options "" } */
#include "nonexistent.h"
-/* { dg-message "nonexistent.h" "" { target *-*-* } 0 } */
-/* { dg-message "terminated" "" { target *-*-* } 0 } */
+/* { dg-message "nonexistent.h" "nonexistent.h" { target *-*-* } 0 } */
+/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */
/* This declaration should not receive any diagnostic. */
foo bar;
/* { dg-options "-MD" } */
#include "nonexistent.h"
-/* { dg-message "nonexistent.h" "" { target *-*-* } 0 } */
-/* { dg-message "terminated" "" { target *-*-* } 0 } */
+/* { dg-message "nonexistent.h" "nonexistent.h" { target *-*-* } 0 } */
+/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */
/* This declaration should not receive any diagnostic. */
foo bar;
/* { dg-options "-MMD" } */
#include "nonexistent.h"
-/* { dg-message "nonexistent.h" "" { target *-*-* } 0 } */
-/* { dg-message "terminated" "" { target *-*-* } 0 } */
+/* { dg-message "nonexistent.h" "nonexistent.h" { target *-*-* } 0 } */
+/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */
/* This declaration should not receive any diagnostic. */
foo bar;
/* { dg-options "-MD" } */
#include <nonexistent.h>
-/* { dg-message "nonexistent.h" "" { target *-*-* } 0 } */
-/* { dg-message "terminated" "" { target *-*-* } 0 } */
+/* { dg-message "nonexistent.h" "nonexistent.h" { target *-*-* } 0 } */
+/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */
/* This declaration should not receive any diagnostic. */
foo bar;
/* { dg-options "-MMD" } */
#include <nonexistent.h>
-/* { dg-message "nonexistent.h" "" { target *-*-* } 0 } */
-/* { dg-message "terminated" "" { target *-*-* } 0 } */
+/* { dg-message "nonexistent.h" "nonexistent.h" { target *-*-* } 0 } */
+/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */
/* This declaration should not receive any diagnostic. */
foo bar;
/* { dg-do compile } */
#define foo - ## >>
foo;
-/* { dg-error "expected identifier.*'-'" "" { target *-*-* } 6 } */
-/* { dg-error pasting "" { target *-*-* } 6 } */
+/* { dg-error "expected identifier.*'-'" "expected" { target *-*-* } 6 } */
+/* { dg-error pasting "pasting" { target *-*-* } 6 } */
/* PR preprocessor/30786 - _Pragma at end of file should not ICE */
/* { dg-do compile } */
-/* { dg-error "parenthesized" "" { target *-*-* } 9 } */
-/* { dg-error "expected" "" { target *-*-* } 9 } */
+/* { dg-error "parenthesized" "parenthesized" { target *-*-* } 9 } */
+/* { dg-error "expected" "expected" { target *-*-* } 9 } */
int x;
{
b: a: ; /* { dg-bogus "a label can only be part of a statement" } */
c: d e; /* { dg-error "a label can only be part of a statement" } */
-/* { dg-error "unknown type name 'd'" "" { target *-*-* } 23 } */
+/* { dg-error "unknown type name 'd'" "unknown type name" { target *-*-* } 23 } */
;
}
inline int main (void) { return 0; } /* { dg-warning "cannot inline function 'main'" } */
-/* { dg-message "error: register name not specified for 'y'" "" { target *-*-* } 19 } */
+/* { dg-message "error: register name not specified for 'y'" "not specified" { target *-*-* } 19 } */
int z; /* { dg-message "previous declaration of 'z'" } */
typedef t2 *z; /* { dg-error "unknown type name 't2'" } */
-/* { dg-error "'z' redeclared " "" { target *-*-* } 7 } */
+/* { dg-error "'z' redeclared " "redeclared" { target *-*-* } 7 } */
extern t3 p1(void); /* { dg-error "unknown type name 't3'" } */
int p2(const t4 x); /* { dg-error "unknown type name 't4'" } */
};
typeof (z) c1;
-typeof (x1) c2; /* { dg-error "undeclared" } */
+typeof (x1) c2; /* { dg-error "undeclared" "undeclared" } */
typeof (const t11) c3; /* { dg-error "unknown type name 't11'" } */
-typeof (t12 *) c3; /* { dg-error "unknown type name 't12'" "" { xfail *-*-* } } */
-/* { dg-bogus "unknown type name 'x1'" "" { target *-*-* } 26 } */
-/* { dg-bogus "undeclared" "" { xfail *-*-* } 28 } */
-/* { dg-bogus "expected expression before" "" { xfail *-*-* } 28 } */
+typeof (t12 *) c3; /* { dg-error "unknown type name 't12'" "t12" { xfail *-*-* } } */
+/* { dg-bogus "unknown type name 'x1'" unknown"" { target *-*-* } 26 } */
+/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 28 } */
+/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 28 } */
int recover1;
int s0 = sizeof (z);
-int s1 = sizeof (x2); /* { dg-error "undeclared" } */
+int s1 = sizeof (x2); /* { dg-error "undeclared" "undeclared" } */
int s2 = sizeof (const t13); /* { dg-error "unknown type name 't13'" } */
-int s3 = sizeof (t14 *); /* { dg-error "unknown type name 't14'" "" { xfail *-*-* } } */
+int s3 = sizeof (t14 *); /* { dg-error "unknown type name 't14'" "t14" { xfail *-*-* } } */
int recover2;
-/* { dg-bogus "unknown type name 'x2'" "" { target *-*-* } 36 } */
-/* { dg-bogus "undeclared" "" { xfail *-*-* } 38 } */
-/* { dg-bogus "expected expression before" "" { xfail *-*-* } 38 } */
+/* { dg-bogus "unknown type name 'x2'" "unknown" { target *-*-* } 36 } */
+/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 38 } */
+/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 38 } */
int a0 = __alignof__ (z);
int a1 = __alignof__ (x3); /* { dg-error "undeclared" } */
int a2 = __alignof__ (const t15); /* { dg-error "unknown type name 't15'" } */
-int a3 = __alignof__ (t16 *); /* { dg-error "unknown type name 't16'" "" { xfail *-*-* } } */
+int a3 = __alignof__ (t16 *); /* { dg-error "unknown type name 't16'" "t16" { xfail *-*-* } } */
int recover3;
/* { dg-bogus "unknown type name 'x3'" "" { target *-*-* } 47 } */
-/* { dg-bogus "undeclared" "" { xfail *-*-* } 49 } */
-/* { dg-bogus "expected expression before" "" { xfail *-*-* } 49 } */
+/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 49 } */
+/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 49 } */
/* Cannot detect (undefd_type *) or (undefd_type (*) because it would
const char *f1()
{
- return (const t17) "abc"; /* { dg-error "unknown type name 't17'" } */
-/* { dg-bogus "expected" "" { target *-*-* } 63 } */
+ return (const t17) "abc"; /* { dg-error "unknown type name 't17'" "t17" } */
+/* { dg-bogus "expected" "expected" { target *-*-* } 63 } */
}
const char *f2()
{
- return (const t18 *) "abc"; /* { dg-error "unknown type name 't18'" } */
-/* { dg-bogus "expected" "" { target *-*-* } 69 } */
+ return (const t18 *) "abc"; /* { dg-error "unknown type name 't18'" "t18" } */
+/* { dg-bogus "expected" "expected" { target *-*-* } 69 } */
}
void *f3(int x)
{
- return (void *) ((void *(*)(t19)) f3); /* { dg-error "unknown type name 't19'" } */
-/* { dg-bogus "expected" "" { xfail *-*-* } 79 } */
+ return (void *) ((void *(*)(t19)) f3); /* { dg-error "unknown type name 't19'" "t19" } */
+/* { dg-bogus "expected" "expected" { xfail *-*-* } 79 } */
}
const void *f4()
{
return &((const t20){1}); /* { dg-error "unknown type name 't20'" } */
-/* { dg-bogus "return discards 'const'" "" { target *-*-* } 85 } */
-/* { dg-bogus "expected" "" { target *-*-* } 85 } */
+/* { dg-bogus "return discards 'const'" "discards" { target *-*-* } 85 } */
+/* { dg-bogus "expected" "expected" { target *-*-* } 85 } */
}
int f5(__builtin_va_list ap)
int f6(void)
{
- return __builtin_offsetof (t23, field); /* { dg-error "unknown type name 't23'" } */
-/* { dg-bogus "request for member" "" { target *-*-* } 98 } */
+ return __builtin_offsetof (t23, field); /* { dg-error "unknown type name 't23'" "t23" } */
+/* { dg-bogus "request for member" "request" { target *-*-* } 98 } */
}
/* { dg-options "-std=gnu99" } */
/* { dg-additional-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
-/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
-/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */
/* Test basic functionality of the intrinsics. The operations should
int f(int *ip, char *cp)
{
__builtin_printf ("%*.*s");
-/* { dg-warning "field width specifier '\\*' expects a matching 'int' argument" "" { target *-*-* } 6 } */
-/* { dg-warning "field precision specifier '\\.\\*' expects a matching 'int' argument" "" { target *-*-* } 6 } */
-/* { dg-warning "format '%s' expects a matching 'char \\*' argument" "" { target *-*-* } 6 } */
+/* { dg-warning "field width specifier '\\*' expects a matching 'int' argument" "width" { target *-*-* } 6 } */
+/* { dg-warning "field precision specifier '\\.\\*' expects a matching 'int' argument" "precision" { target *-*-* } 6 } */
+/* { dg-warning "format '%s' expects a matching 'char \\*' argument" "format" { target *-*-* } 6 } */
__builtin_printf ("%*.*s", ip, *cp);
-/* { dg-warning "field width specifier '\\*' expects argument of type 'int'" "" { target *-*-* } 10 } */
-/* { dg-warning "format '%s' expects a matching 'char \\*' argument" "" { target *-*-* } 10 } */
+/* { dg-warning "field width specifier '\\*' expects argument of type 'int'" "width" { target *-*-* } 10 } */
+/* { dg-warning "format '%s' expects a matching 'char \\*' argument" "format" { target *-*-* } 10 } */
__builtin_printf ("%s %i", ip, ip);
-/* { dg-warning "format '%s' expects argument of type 'char \\*'" "" { target *-*-* } 13 } */
-/* { dg-warning "format '%i' expects argument of type 'int'" "" { target *-*-* } 13 } */
+/* { dg-warning "format '%s' expects argument of type 'char \\*'" "char" { target *-*-* } 13 } */
+/* { dg-warning "format '%i' expects argument of type 'int'" "int" { target *-*-* } 13 } */
__builtin_printf ("%s %i", cp);
/* { dg-warning "format '%i' expects a matching 'int' argument" "" { target *-*-* } 16 } */
__builtin_printf ("%lc");
/* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
-/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
-/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */
/* Test basic functionality of the intrinsics. */
set tool gcc
set prof_ext "gcda"
-# Override the list defined in profopt.exp.
-set PROFOPT_OPTIONS [list {}]
-
if $tracelevel then {
strace $tracelevel
}
# Load support procs.
load_lib profopt.exp
+# Save and override the default list defined in profopt.exp.
+set matrix_save_profopt_options $PROFOPT_OPTIONS
+set PROFOPT_OPTIONS [list {}]
+
# These are globals used by profopt-execute. The first is options
# needed to generate profile data, the second is options to use the
# profile data.
profopt-execute $src
}
+set PROFOPT_OPTIONS $matrix_save_profopt_options
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-mtune=*" } { "" } } */
/* { dg-options "-mtune=foo" } */
-/* { dg-error "mtune" "" { target *-*-* } 0 } */
-/* { dg-bogus "march" "" { target *-*-* } 0 } */
-/* { dg-bogus "mcpu" "" { target *-*-* } 0 } */
+/* { dg-error "mtune" "mtune" { target *-*-* } 0 } */
+/* { dg-bogus "march" "march" { target *-*-* } 0 } */
+/* { dg-bogus "mcpu" "mcpu" { target *-*-* } 0 } */
/* { dg-prune-output "note: valid arguments.*" } */
int i;
/* PR c/44517: Improve diagnostic for misspelled typename in function declaration. */
int f1(int x, pid_t y, long z, in t) {
-/* { dg-error "unknown type name 'pid_t'" "" { target *-*-* } 2 } */
-/* { dg-error "unknown type name 'in'" "" { target *-*-* } 2 } */
+/* { dg-error "unknown type name 'pid_t'" "pid_t" { target *-*-* } 2 } */
+/* { dg-error "unknown type name 'in'" "in" { target *-*-* } 2 } */
return x + y + z + t;
}
-/* { dg-error "undeclared here" "" { target *-*-* } 3 } */
-/* { dg-error "expected" "" { target *-*-* } 3 } */
+/* { dg-error "undeclared here" "undeclared" { target *-*-* } 3 } */
+/* { dg-error "expected" "expected" { target *-*-* } 3 } */
int f()[j]
__complex__ float z;
z = __complex__ (1.90000007326203904e+19, 0.0); /* { dg-error "__complex__" } */
- z = __complex__ (1.0e+0, 0.0) / z; /* { dg-error "__complex__" } */
- /* { dg-error "at end of input" "" { target *-*-* } 10 } */
+ z = __complex__ (1.0e+0, 0.0) / z; /* { dg-error "__complex__" "Complex" } */
+ /* { dg-error "at end of input" "end of input" { target *-*-* } 10 } */
_Complex float z;
z = _Complex (1.90000007326203904e+19, 0.0); /* { dg-error "_Complex" } */
- z = _Complex (1.0e+0, 0.0) / z; /* { dg-error "_Complex" } */
- /* { dg-error "at end of input" "" { target *-*-* } 10 } */
+ z = _Complex (1.0e+0, 0.0) / z; /* { dg-error "_Complex" "_Complex" } */
+ /* { dg-error "at end of input" "end of input" { target *-*-* } 10 } */
struct tree_common
{
- enum tree_code code : 8; /* { dg-error "ISO C forbids forward references to" "" } */
- /* { dg-error "type of bit-field .code. is a GCC extension" "" { target *-*-* } 6 } */
- /* { dg-warning "narrower than values of its type" "" { target *-*-* } 6 } */
- /* { dg-error "incomplete type" "" { target *-*-* } 6 } */
+ enum tree_code code : 8; /* { dg-error "ISO C forbids forward references to" "forward ref" } */
+ /* { dg-error "type of bit-field .code. is a GCC extension" "extension" { target *-*-* } 6 } */
+ /* { dg-warning "narrower than values of its type" "narrower" { target *-*-* } 6 } */
+ /* { dg-error "incomplete type" "incomplete" { target *-*-* } 6 } */
};
/* PR c/27953 */
-void foo(struct A a) {} /* { dg-warning "declared inside parameter list" } */
-/* { dg-warning "its scope is only" "" { target *-*-* } 3 } */
-/* { dg-error "incomplete type" "" { target *-*-* } 3 } */
+void foo(struct A a) {} /* { dg-warning "declared inside parameter list" "inside" } */
+/* { dg-warning "its scope is only" "scope" { target *-*-* } 3 } */
+/* { dg-error "incomplete type" "incomplete" { target *-*-* } 3 } */
-void foo() {} /* { dg-error "redefinition" } */
-/* { dg-message "note: previous definition" "" { target *-*-* } 3 } */
+void foo() {} /* { dg-error "redefinition" "redef" } */
+/* { dg-message "note: previous definition" "previous" { target *-*-* } 3 } */
{
int i = 1;
}
-/* { dg-message "unrecognized command line option .-fno-foobar." "" { target *-*-* } 0 } */
-/* { dg-message "unrecognized command line option .-mno-foobar." "" { target *-*-* } 0 } */
+/* { dg-message "unrecognized command line option .-fno-foobar." "f" { target *-*-* } 0 } */
+/* { dg-message "unrecognized command line option .-mno-foobar." "m" { target *-*-* } 0 } */
va_start(ap, paramN); /* { dg-warning "undefined behaviour when second parameter of 'va_start' is declared with 'register' storage" } */
/* Undefined by C99 7.15.1.1p2: */
- (void) va_arg(ap, char); /* { dg-warning "'char' is promoted to 'int' when passed through '...'" } */
- /* { dg-message "note: .so you should pass .int. not .char. to .va_arg.." "" { target *-*-* } 20 } */
- /* { dg-message "note: if this code is reached, the program will abort" "" { target *-*-* } 20 } */
+ (void) va_arg(ap, char); /* { dg-warning "'char' is promoted to 'int' when passed through '...'" "promoted" } */
+ /* { dg-message "note: .so you should pass .int. not .char. to .va_arg.." "int not char" { target *-*-* } 20 } */
+ /* { dg-message "note: if this code is reached, the program will abort" "will abort" { target *-*-* } 20 } */
va_end(ap);
}
/* { dg-do compile } */
/* { dg-options "" } */
-void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." } */
-/* { dg-bogus ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */
-/* { dg-bogus "return type of .main. is not .int." "" { target *-*-* } 5 } */
+void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." "int" } */
+/* { dg-bogus ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
+/* { dg-bogus "return type of .main. is not .int." "return type" { target *-*-* } 5 } */
/* { dg-do compile } */
/* { dg-options "-pedantic-errors" } */
/* { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } } */
-void main(char a) {} /* { dg-error "first argument of .main. should be .int." } */
-/* { dg-error ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */
-/* { dg-error "return type of .main. is not .int." "" { target *-*-* } 5 } */
+void main(char a) {} /* { dg-error "first argument of .main. should be .int." "int" } */
+/* { dg-error ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
+/* { dg-error "return type of .main. is not .int." "return type" { target *-*-* } 5 } */
/* { dg-do compile } */
/* { dg-options "-pedantic-errors -Wno-main" } */
-void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." } */
-/* { dg-bogus ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */
-/* { dg-bogus "return type of .main. is not .int." "" { target *-*-* } 5 } */
+void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." "int" } */
+/* { dg-bogus ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
+/* { dg-bogus "return type of .main. is not .int." "return type" { target *-*-* } 5 } */
/* { dg-do compile } */
/* { dg-options "-pedantic -Wno-main" } */
-void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." } */
-/* { dg-bogus ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */
-/* { dg-bogus "return type of .main. is not .int." "" { target *-*-* } 5 } */
+void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." "int" } */
+/* { dg-bogus ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
+/* { dg-bogus "return type of .main. is not .int." "return type" { target *-*-* } 5 } */
/* { dg-do compile } */
/* { dg-options "-pedantic" } */
/* { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } } */
-void main(char a) {} /* { dg-warning "first argument of .main. should be .int." } */
-/* { dg-warning ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */
-/* { dg-warning "return type of .main. is not .int." "" { target *-*-* } 5 } */
+void main(char a) {} /* { dg-warning "first argument of .main. should be .int." "int" } */
+/* { dg-warning ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
+/* { dg-warning "return type of .main. is not .int." "return type" { target *-*-* } 5 } */
/* { dg-do compile } */
/* { dg-options "-Wall" } */
/* { dg-skip-if "-Wmain not enabled with -Wall on SPU" { spu-*-* } } */
-void main(char a) {} /* { dg-warning "first argument of .main. should be .int." } */
-/* { dg-warning ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */
-/* { dg-warning "return type of .main. is not .int." "" { target *-*-* } 5 } */
+void main(char a) {} /* { dg-warning "first argument of .main. should be .int." "int" } */
+/* { dg-warning ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
+/* { dg-warning "return type of .main. is not .int." "return type" { target *-*-* } 5 } */
short e;
va_list ap;
va_start (ap, i);
- e = va_arg (ap, short); /* { dg-warning "is promoted" } */
+ e = va_arg (ap, short); /* { dg-warning "is promoted" "promoted" } */
va_end (ap);
return e;
}
-/* { dg-message "note: \\(so you should pass" "" {target *-*-* } 12 } */
-/* { dg-message "note: if this code" "" {target *-*-* } 12 } */
+/* { dg-message "note: \\(so you should pass" "should pass" {target *-*-* } 12 } */
+/* { dg-message "note: if this code" "if this code" {target *-*-* } 12 } */
void
f1 (void *x)
{
- __asm volatile ("" : : "r" (*x)); /* { dg-warning "dereferencing" } */
-} /* { dg-error "invalid use of void expression" "" { target *-*-* } 10 } */
+ __asm volatile ("" : : "r" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 10 } */
void
f2 (void *x)
{
- __asm volatile ("" : "=r" (*x)); /* { dg-warning "dereferencing" } */
-} /* { dg-error "invalid use of void expression" "" { target *-*-* } 16 } */
- /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 16 } */
+ __asm volatile ("" : "=r" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 16 } */
+ /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 16 } */
void
f3 (void *x)
{
void
f5 (void *x)
{
- __asm volatile ("" : : "g" (*x)); /* { dg-warning "dereferencing" } */
-} /* { dg-error "invalid use of void expression" "" { target *-*-* } 34 } */
+ __asm volatile ("" : : "g" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 34 } */
void
f6 (void *x)
{
- __asm volatile ("" : "=g" (*x)); /* { dg-warning "dereferencing" } */
-} /* { dg-error "invalid use of void expression" "" { target *-*-* } 40 } */
- /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 40 } */
+ __asm volatile ("" : "=g" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 40 } */
+ /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 40 } */
void
f7 (struct S *x)
{
void
f8 (struct S *x)
{
- __asm volatile ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" } */
-} /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 52 } */
+ __asm volatile ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" "incomplete" } */
+} /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 52 } */
void
f1 (void *x)
{
- __asm ("" : : "r" (*x)); /* { dg-warning "dereferencing" } */
-} /* { dg-error "invalid use of void expression" "" { target *-*-* } 10 } */
+ __asm ("" : : "r" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 10 } */
void
f2 (void *x)
{
- __asm ("" : "=r" (*x)); /* { dg-warning "dereferencing" } */
-} /* { dg-error "invalid use of void expression" "" { target *-*-* } 16 } */
- /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 16 } */
+ __asm ("" : "=r" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 16 } */
+ /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 16 } */
void
f3 (void *x)
{
void
f5 (void *x)
{
- __asm ("" : : "g" (*x)); /* { dg-warning "dereferencing" } */
-} /* { dg-error "invalid use of void expression" "" { target *-*-* } 34 } */
+ __asm ("" : : "g" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 34 } */
void
f6 (void *x)
{
- __asm ("" : "=g" (*x)); /* { dg-warning "dereferencing" } */
-} /* { dg-error "invalid use of void expression" "" { target *-*-* } 40 } */
- /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 40 } */
+ __asm ("" : "=g" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 40 } */
+ /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 40 } */
void
f7 (struct S *x)
{
void
f8 (struct S *x)
{
- __asm ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" } */
-} /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 52 } */
+ __asm ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" "incomplete" } */
+} /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 52 } */
void prime4(void)
{
- bar4(); /* { dg-warning "implicit declaration of function" } */
+ bar4(); /* { dg-warning "implicit declaration of function" "implicit" } */
}
void test4(void)
{
extern double bar4(double); /* { dg-error "conflict" } */
-/* { dg-message "note: previous implicit declaration" "" { target *-*-* } 55 } */
+/* { dg-message "note: previous implicit declaration" "previous" { target *-*-* } 55 } */
}
/* Implicit decl, clashing with extern at previous function scope. */
void prime5(void)
{
- extern double bar5(double); /* { dg-message "note: previous declaration" "" } */
-} /* { dg-message "note: previous implicit declaration" "" { target *-*-* } 68 } */
+ extern double bar5(double); /* { dg-message "note: previous declaration" "previous 1" } */
+} /* { dg-message "note: previous implicit declaration" "previous 2" { target *-*-* } 68 } */
void test5(void)
{
/* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
-/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
-/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */
/* Test functionality of the intrinsics for 'short' and 'char'. */
/* PR middle-end/37009 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
-/* { dg-options "-msse2" } */
+/* { dg-additional-options "-mmmx -msse2" } */
/* { dg-require-effective-target sse2_runtime } */
#include <emmintrin.h>
/* PR middle-end/37009 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
-/* { dg-options "-msse2" } */
+/* { dg-additional-options "-mmmx -msse2" } */
/* { dg-require-effective-target sse2_runtime } */
#include <emmintrin.h>
/* PR middle-end/37009 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
-/* { dg-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */
+/* { dg-additional-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */
#include "check.h"
/* PR middle-end/45234 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
-/* { dg-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */
+/* { dg-additional-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */
#include "check.h"
/* PR middle-end/45234 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
-/* { dg-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */
+/* { dg-additional-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */
#include "check.h"
/* PR middle-end/37010 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
-/* { dg-options "-msse2 -mpreferred-stack-boundary=2" } */
+/* { dg-additional-options "-mmmx -msse2 -mpreferred-stack-boundary=2" } */
/* { dg-require-effective-target sse2_runtime } */
#include <emmintrin.h>
-# Copyright (C) 2008, 2010
+# Copyright (C) 2008, 2010, 2012
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# This harness is for tests that should be run at all optimisation levels.
load_lib gcc-dg.exp
+load_lib torture-options.exp
-set additional_flags ""
+global DG_TORTURE_OPTIONS LTO_TORTURE_OPTIONS
+
+dg-init
+torture-init
+
+# default_flags are replaced by a dg-options test directive, or appended
+# to by using dg-additional-options. Use default_flags for options that
+# are used in all of the torture sets to limit the amount of noise in
+# test summaries.
+set default_flags ""
+
+# torture_flags are combined with other torture options and do not
+# affect options specified within a test.
+set torture_flags ""
+
+set stackalign_options [list]
if { [check_effective_target_automatic_stack_alignment] } then {
- lappend additional_flags "-mstackrealign"
- lappend additional_flags "-mpreferred-stack-boundary=5"
+ append default_flags " -mstackrealign"
+ append default_flags " -mpreferred-stack-boundary=5"
}
if { [istarget i?86*-*-*] || [istarget x86_64-*-*] } then {
- lappend additional_flags "-mno-mmx"
+ append default_flags " -mno-mmx"
}
+lappend stackalign_options [join $torture_flags]
-dg-init
-
-gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $additional_flags
if { [check_effective_target_fpic] } then {
- set pic_additional_flags $additional_flags
- lappend pic_additional_flags "-fpic"
- gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $pic_additional_flags
+ set pic_torture_flags $torture_flags
+ append pic_torture_flags " -fpic"
+ lappend stackalign_options [join $pic_torture_flags]
}
if { [check_effective_target_automatic_stack_alignment] } then {
- lappend additional_flags "-mforce-drap"
- gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $additional_flags
+ append torture_flags " -mforce-drap"
+ lappend stackalign_options [join $torture_flags]
if { [check_effective_target_fpic] } then {
- set pic_additional_flags $additional_flags
- lappend pic_additional_flags "-fpic"
- gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $pic_additional_flags
+ set pic_torture_flags $torture_flags
+ append pic_torture_flags " -fpic"
+ lappend stackalign_options [join $pic_torture_flags]
}
}
+# Combine stackalign options with the usual torture optimization flags.
+set-torture-options [concat $DG_TORTURE_OPTIONS $LTO_TORTURE_OPTIONS] $stackalign_options
+
+gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] "$default_flags"
+
+torture-finish
dg-finish
/* PR middle-end/37009 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
-/* { dg-options "-msse2" } */
+/* { dg-additional-options "-mmmx -msse2" } */
/* { dg-require-effective-target sse2_runtime } */
#include <stdarg.h>
enum e { A };
-union __attribute__((__transparent_union__)) ue1 { enum e; }; /* { dg-warning "declaration does not declare anything" } */
-/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 9 } */
-union ue2 { enum e; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" } */
-/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 11 } */
+union __attribute__((__transparent_union__)) ue1 { enum e; }; /* { dg-warning "declaration does not declare anything" "not anything" } */
+/* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 9 } */
+union ue2 { enum e; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" "not anything" } */
+/* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 11 } */
-union __attribute__((__transparent_union__)) ui1 { int; }; /* { dg-warning "declaration does not declare anything" } */
-/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 14 } */
-union ui2 { int; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" } */
-/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 16 } */
+union __attribute__((__transparent_union__)) ui1 { int; }; /* { dg-warning "declaration does not declare anything" "not anything" } */
+/* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 14 } */
+union ui2 { int; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" "no anything" } */
+/* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 16 } */
union __attribute__((__transparent_union__)) u1 { };
/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 19 } */
set tool gcc
set prof_ext "gcda"
-# Override the list defined in profopt.exp.
-set PROFOPT_OPTIONS [list {}]
-
if $tracelevel then {
strace $tracelevel
}
# Load support procs.
load_lib profopt.exp
+# Save and override the default list defined in profopt.exp.
+set treeprof_save_profopt_options $PROFOPT_OPTIONS
+set PROFOPT_OPTIONS [list {}]
+
# These are globals used by profopt-execute. The first is options
# needed to generate profile data, the second is options to use the
# profile data.
}
profopt-execute $src
}
+
+set PROFOPT_OPTIONS $treeprof_save_profopt_options
/* { dg-do compile } */
/* { dg-options "" } */
-const unsigned short c0 = u'a'; /* { dg-error "undeclared" } */
- /* { dg-error "expected ',' or ';'" "" { target *-*-* } 6 } */
-const unsigned long c1 = U'a'; /* { dg-error "undeclared" } */
- /* { dg-error "expected ',' or ';'" "" { target *-*-* } 8 } */
+const unsigned short c0 = u'a'; /* { dg-error "undeclared" "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "expected" { target *-*-* } 6 } */
+const unsigned long c1 = U'a'; /* { dg-error "undeclared" "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "expected" { target *-*-* } 8 } */
#define u 1 +
#define U 2 +
/* { dg-do compile } */
/* { dg-options "" } */
-const void *s0 = u8"a"; /* { dg-error "undeclared" } */
- /* { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } */
+const void *s0 = u8"a"; /* { dg-error "undeclared" "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "expected" { target *-*-* } 5 } */
#define u8 "a"
}
/* Match extra informative notes. */
-/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */
-/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */
+/* { dg-message "note: label '\[^\n'\]*' defined here" "defined" { target *-*-* } 0 } */
+/* { dg-message "note: '\[^\n'\]*' declared here" "declared" { target *-*-* } 0 } */
foo (void)
{
int x[a] = { 1 }; /* { dg-error "variable-sized object may not be initialized" "VLA init" } */
- /* { dg-warning "excess elements in array initializer" "" { target *-*-* } 12 } */
- /* { dg-warning "near initialization" "" { target *-*-* } 12 } */
+ /* { dg-warning "excess elements in array initializer" "excess" { target *-*-* } 12 } */
+ /* { dg-warning "near initialization" "near" { target *-*-* } 12 } */
}
/* But this one should, since it doesn't fit in long (long), but
does fit in unsigned long (long). */
- i = 18446744073709551615; /* { dg-warning "integer constant is so large that it is unsigned" "decimal constant" } */
- /* { dg-warning "this decimal constant would be unsigned in ISO C90" "decimal constant" { target *-*-* } 28 } */
+ i = 18446744073709551615; /* { dg-warning "integer constant is so large that it is unsigned" "so large" } */
+ /* { dg-warning "this decimal constant would be unsigned in ISO C90" "ISO C90" { target *-*-* } 28 } */
# 29 "sys-header.h" 3
}
set prof_ext "gcda"
set perf_ext tim
-# Override the list defined in profopt.exp.
-set PROFOPT_OPTIONS [list \
- { -g } \
- { -O0 } \
- { -O1 } \
- { -O2 -DPERFTIME } \
- { -O3 -DPERFTIME } \
- { -O3 -g -DPERFTIME } \
- { -Os } ]
-
if $tracelevel then {
strace $tracelevel
}
# Load support procs.
load_lib profopt.exp
+# Save and override the default list defined in profopt.exp.
+set bprob_save_profopt_options $PROFOPT_OPTIONS
+set PROFOPT_OPTIONS [list { -O2 } { -O3 }]
+
set profile_options "-fprofile-arcs"
set feedback_options "-fbranch-probabilities"
profopt-execute $src
}
}
+
+set PROFOPT_OPTIONS $bprob_save_profopt_options
/* { dg-require-effective-target arm_arch_v5_ok } */
/* { dg-options "-std=gnu99" } */
/* { dg-add-options arm_arch_v5 } */
-/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
-/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */
/* { dg-message "file included" "In file included" { target *-*-* } 0 } */
#include "../../gcc.dg/di-longlong64-sync-1.c"
/* { dg-options "-marm -std=gnu99" } */
/* { dg-require-effective-target arm_arch_v6k_ok } */
/* { dg-add-options arm_arch_v6k } */
-/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
-/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */
/* { dg-message "file included" "In file included" { target *-*-* } 0 } */
#include "../../gcc.dg/di-longlong64-sync-1.c"
# Ensure that the PCH file is used, not the original header.
file_on_host delete "$bname$suffix"
- dg-test -keep-output $test "$otherflags $flags -I." ""
+ # The flags "-Dwith_PCH" and "-Dwithout_PCH" are to distinguish the
+ # two compiles in test summary lines.
+ dg-test -keep-output $test "$otherflags $flags -I. -Dwith_PCH" ""
file_on_host delete "$bname$suffix.gch"
if { !$have_errs } {
if { [ file_on_host exists "$bname.s" ] } {
remote_upload host "$bname.s" "$bname.s-gch"
remote_download host "$bname.s-gch"
gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix"
- dg-test -keep-output $test "$otherflags $flags -I." ""
+ dg-test -keep-output $test "$otherflags $flags -I. -Dwithout_PCH" ""
remote_upload host "$bname.s"
set tmp [ diff "$bname.s" "$bname.s-gch" ]
if { $tmp == 0 } {
proc dg-pch { subdir test options suffix } {
return [dg-flags-pch $subdir $test "" $options $suffix]
-}
\ No newline at end of file
+}
# Remove compiler-generated coverage files for the current test.
proc cleanup-coverage-files { } {
- # This assumes that we are two frames down from dg-test or some other proc
- # that stores the filename of the testcase in a local variable "name".
- # A cleaner solution would require a new DejaGnu release.
- upvar 2 name testcase
+ set testcase [testname-for-summary]
# The name might include a list of options; extract the file name.
set testcase [lindex $testcase 0]
remove-build-file "[file rootname [file tail $testcase]].gc??"
# Remove compiler-generated files from -repo for the current test.
proc cleanup-repo-files { } {
- # This assumes that we are two frames down from dg-test or some other proc
- # that stores the filename of the testcase in a local variable "name".
- # A cleaner solution would require a new DejaGnu release.
- upvar 2 name testcase
+ set testcase [testname-for-summary]
# The name might include a list of options; extract the file name.
set testcase [lindex $testcase 0]
remove-build-file "[file rootname [file tail $testcase]].o"
# Remove a stack usage file for the current test.
proc cleanup-stack-usage { } {
- # This assumes that we are two frames down from dg-test or some other proc
- # that stores the filename of the testcase in a local variable "name".
- # A cleaner solution would require a new DejaGnu release.
- upvar 2 name testcase
+ set testcase [testname-for-summary]
# The name might include a list of options; extract the file name.
set testcase [lindex $testcase 0]
remove-build-file "[file rootname [file tail $testcase]].su"
# Remove all dump files with the provided suffix.
proc cleanup-dump { suffix } {
- # This assumes that we are three frames down from dg-test or some other
- # proc that stores the filename of the testcase in a local variable
- # "name". A cleaner solution would require a new DejaGnu release.
- upvar 3 name testcase
+ set testcase [testname-for-summary]
# The name might include a list of options; extract the file name.
set src [file tail [lindex $testcase 0]]
remove-build-file "[file tail $src].$suffix"
}
}
- # This assumes that we are two frames down from dg-test or some other proc
- # that stores the filename of the testcase in a local variable "name".
- # A cleaner solution would require a new DejaGnu release.
- upvar 2 name testcase
+ set testcase [testname-for-summary]
# The name might include a list of options; extract the file name.
set testcase [lindex $testcase 0]
foreach suffix $suffixes {
set text [read $fd]
close $fd
- upvar 2 name testcase
+ set testcase [testname-for-summary]
if [regexp -- [lindex $args 1] $text] {
pass "$testcase scan-module [lindex $args 1]"
} else {
set text [read $fd]
close $fd
- upvar 2 name testcase
+ set testcase [testname-for-summary]
if [regexp -- [lindex $args 1] $text] {
fail "$testcase scan-module [lindex $args 1]"
} else {
}
}
- # Access variables from gcc-dg-test-1.
- upvar 2 name testcase
+ set testcase [testname-for-summary]
+ # Access variable from gcc-dg-test-1.
upvar 2 output_file output_file
if [file exists $output_file] {
}
}
- # Access variables from gcc-dg-test-1.
- upvar 2 name testcase
+ set testcase [testname-for-summary]
+ # Access variable from gcc-dg-test-1.
upvar 2 output_file output_file
if [file exists $output_file] {
global errorInfo
global compiler_conditional_xfail_data
global shouldfail
+ global testname_with_flags
if { [ catch { eval saved-dg-test $args } errmsg ] } {
set saved_info $errorInfo
if [info exists compiler_conditional_xfail_data] {
unset compiler_conditional_xfail_data
}
+ if [info exists testname_with_flags] {
+ unset testname_with_flags
+ }
unset_timeout_vars
error $errmsg $saved_info
}
if [info exists compiler_conditional_xfail_data] {
unset compiler_conditional_xfail_data
}
+ if [info exists testname_with_flags] {
+ unset testname_with_flags
+ }
}
}
#
# verify-lines -- check that line counts are as expected
#
-# TESTCASE is the name of the test.
+# TESTNAME is the name of the test, including unique flags.
+# TESTCASE is the name of the test file.
# FILE is the name of the gcov output file.
#
-proc verify-lines { testcase file } {
+proc verify-lines { testname testcase file } {
#send_user "verify-lines\n"
global subdir
+
set failed 0
set fd [open $file r]
while { [gets $fd line] >= 0 } {
}
}
if { $is == "" } {
- fail "$subdir/$testcase:$n:no data available for this line"
+ fail "$testname line $n: no data available"
incr failed
} elseif { $is != $shouldbe } {
- fail "$subdir/$testcase:$n:is $is:should be $shouldbe"
+ fail "$testname line $n: is $is:should be $shouldbe"
incr failed
} else {
- pass "$subdir/$testcase:$n line count"
+ pass "$testname count for line $n"
}
}
}
#
# verify-branches -- check that branch percentages are as expected
#
-# TESTCASE is the name of the test.
+# TESTNAME is the name of the test, including unique flags.
+# TESTCASE is the name of the test file.
# FILE is the name of the gcov output file.
#
# Checks are based on comments in the source file. This means to look for
# branch instructions. Don't check for branches that might be
# optimized away or replaced with predicated instructions.
#
-proc verify-branches { testcase file } {
+proc verify-branches { testname testcase file } {
#send_user "verify-branches\n"
+
set failed 0
set shouldbe ""
set fd [open $file r]
if [regexp "branch\\((\[0-9 \]+)\\)" "$line" all new_shouldbe] {
# All percentages in the current list should have been seen.
if {[llength $shouldbe] != 0} {
- fail "$n: expected branch percentages not found: $shouldbe"
+ fail "$testname line $n: expected branch percentages not found: $shouldbe"
incr failed
set shouldbe ""
}
} elseif [regexp "branch +\[0-9\]+ taken (-\[0-9\]+)%" "$line" \
all taken] {
# Percentages should never be negative.
- fail "$n: negative percentage: $taken"
+ fail "$testname line $n: negative percentage: $taken"
incr failed
} elseif [regexp "branch +\[0-9\]+ taken (\[0-9\]+)%" "$line" \
all taken] {
#send_user "$n: taken = $taken\n"
# Percentages should never be greater than 100.
if {$taken > 100} {
- fail "$n: percentage greater than 100: $taken"
+ fail "$testname line $n: branch percentage greater than 100: $taken"
incr failed
}
if {$taken > 50} {
} elseif [regexp "branch\\(end\\)" "$line"] {
# All percentages in the list should have been seen by now.
if {[llength $shouldbe] != 0} {
- fail "$n: expected branch percentages not found: $shouldbe"
+ fail "$testname line n: expected branch percentages not found: $shouldbe"
incr failed
}
set shouldbe ""
}
# All percentages in the list should have been seen.
if {[llength $shouldbe] != 0} {
- fail "$n: expected branch percentages not found: $shouldbe"
+ fail "$testname line $n: expected branch percentages not found: $shouldbe"
incr failed
}
close $fd
#
# verify-calls -- check that call return percentages are as expected
#
-# TESTCASE is the name of the test.
+# TESTNAME is the name of the test, including unique flags.
+# TESTCASE is the name of the test file.
# FILE is the name of the gcov output file.
#
# Checks are based on comments in the source file. This means to look for
# call instructions. Don't check for calls that are inserted by the
# compiler or that might be inlined.
#
-proc verify-calls { testcase file } {
+proc verify-calls { testname testcase file } {
#send_user "verify-calls\n"
+
set failed 0
set shouldbe ""
set fd [open $file r]
if [regexp "returns\\((\[0-9 \]+)\\)" "$line" all new_shouldbe] {
# All percentages in the current list should have been seen.
if {[llength $shouldbe] != 0} {
- fail "$n: expected return percentages not found: $shouldbe"
+ fail "$testname line $n: expected return percentages not found: $shouldbe"
incr failed
set shouldbe ""
}
} elseif [regexp "call +\[0-9\]+ returned (-\[0-9\]+)%" "$line" \
all returns] {
# Percentages should never be negative.
- fail "$n: negative percentage: $returns"
+ fail "$testname line $n: negative percentage: $returns"
incr failed
} elseif [regexp "call +\[0-9\]+ returned (\[0-9\]+)%" "$line" \
all returns] {
} elseif [regexp "returns\\(end\\)" "$line"] {
# All percentages in the list should have been seen by now.
if {[llength $shouldbe] != 0} {
- fail "$n: expected return percentages not found: $shouldbe"
+ fail "$testname line $n: expected return percentages not found: $shouldbe"
incr failed
}
set shouldbe ""
}
# All percentages in the list should have been seen.
if {[llength $shouldbe] != 0} {
- fail "$n: expected return percentages not found: $shouldbe"
+ fail "$testname line $n: expected return percentages not found: $shouldbe"
incr failed
}
close $fd
}
}
- # Extract the test name from the arguments.
+ set testname [testname-for-summary]
+
+ # Extract the test file name from the arguments.
set testcase [lindex $gcov_args end]
verbose "Running $GCOV $testcase" 2
if { $xfailed } {
setup_xfail "*-*-*"
}
- fail "$subdir/$testcase gcov failed: [lindex $result 1]"
+ fail "$testname gcov failed: [lindex $result 1]"
clean-gcov $testcase
return
}
if { $xfailed } {
setup_xfail "*-*-*"
}
- fail "$subdir/$testcase gcov failed: $testcase.gcov does not exist"
+ fail "$testname gcov failed: $testcase.gov does not exist"
clean-gcov $testcase
return
}
remote_upload host $testcase.gcov $testcase.gcov
# Check that line execution counts are as expected.
- set lfailed [verify-lines $testcase $testcase.gcov]
+ set lfailed [verify-lines $testname $testcase $testcase.gcov]
# If requested via the .x file, check that branch and call information
# is correct.
if { $gcov_verify_branches } {
- set bfailed [verify-branches $testcase $testcase.gcov]
+ set bfailed [verify-branches $testname $testcase $testcase.gcov]
} else {
set bfailed 0
}
if { $gcov_verify_calls } {
- set cfailed [verify-calls $testcase $testcase.gcov]
+ set cfailed [verify-calls $testname $testcase $testcase.gcov]
} else {
set cfailed 0
}
setup_xfail "*-*-*"
}
if { $tfailed > 0 } {
- fail "$subdir/$testcase gcov: $lfailed failures in line counts, $bfailed in branch percentages, $cfailed in return percentages"
+ fail "$testname gcov: $lfailed failures in line counts, $bfailed in branch percentages, $cfailed in return percentages"
} else {
- pass "$subdir/$testcase gcov"
+ pass "$testname gcov"
clean-gcov $testcase
}
}
{ -Os } ]
}
-set prof_option_list $PROFOPT_OPTIONS
-
#
# profopt-cleanup -- remove profiling or performance results files.
#
#
proc profopt-execute { src } {
global srcdir tmpdir
- global prof_option_list
+ global PROFOPT_OPTIONS
global tool profile_option feedback_option prof_ext perf_ext perf_delta
global generate_final_code use_final_code
global verbose
+ global testname_with_flags
if ![info exists profile_option] {
error "No profile option specified for first compile."
error "No feedback option specified for second compile."
}
+ # Use the default option list or one defined for a set of tests.
+ if ![info exists PROFOPT_OPTIONS] {
+ error "PROFOPT_OPTIONS is not defined"
+ }
+ set prof_option_list $PROFOPT_OPTIONS
+
regsub "(?q)$srcdir/" $src "" testcase
# If we couldn't rip $srcdir out of `src' then just do the best we can.
# The point is to reduce the unnecessary noise in the logs. Don't strip
set testcase "[file tail [file dirname $src]]/[file tail $src]"
}
+ # Several procedures access the name of the test with torture flags,
+ # normally defined in dg-test. Profile optimization tests don't
+ # use dg-test, so define it here to make it accessible via
+ # testname-for-summary.
+ set testname_with_flags $testcase
+
set executable $tmpdir/[file tail [file rootname $src].x]
set basename [file tail $testcase]
set base [file rootname $basename]
set extra_flags [profopt-get-options $src]
if { [lindex ${dg-do-what} 1 ] == "N" } {
unsupported "$src"
+ unset testname_with_flags
verbose "$src not supported on this target, skipping it" 3
return
}
remote_file build delete $execname3
}
}
+ unset testname_with_flags
}
# dg-scan for details.
proc scan-assembler { args } {
- upvar 2 name testcase
- set testcase [lindex $testcase 0]
+ set testcase [testname-for-summary]
set output_file "[file rootname [file tail $testcase]].s"
-
dg-scan "scan-assembler" 1 $testcase $output_file $args
}
# compiler. See dg-scan for details.
proc scan-assembler-not { args } {
- upvar 2 name testcase
- set testcase [lindex $testcase 0]
+ set testcase [testname-for-summary]
set output_file "[file rootname [file tail $testcase]].s"
dg-scan "scan-assembler-not" 0 $testcase $output_file $args
# produced by the compiler.
proc scan-hidden { args } {
- upvar 2 name testcase
- set testcase [lindex $testcase 0]
+ set testcase [testname-for-summary]
set output_file "[file rootname [file tail $testcase]].s"
set symbol [lindex $args 0]
# produced by the compiler.
proc scan-not-hidden { args } {
- upvar 2 name testcase
- set testcase [lindex $testcase 0]
+ set testcase [testname-for-summary]
set output_file "[file rootname [file tail $testcase]].s"
set symbol [lindex $args 0]
# Look for a pattern in OUTPUT_FILE. See dg-scan for details.
proc scan-file { output_file args } {
- upvar 2 name testcase
- set testcase [lindex $testcase 0]
+ set testcase [testname-for-summary]
dg-scan "scan-file" 1 $testcase $output_file $args
}
# for details.
proc scan-file-not { output_file args } {
- upvar 2 name testcase
- set testcase [lindex $testcase 0]
+ set testcase [testname-for-summary]
dg-scan "scan-file-not" 0 $testcase $output_file $args
}
# dg-scan for details.
proc scan-stack-usage { args } {
- upvar 2 name testcase
- set testcase [lindex $testcase 0]
+ set testcase [testname-for-summary]
set output_file "[file rootname [file tail $testcase]].su"
dg-scan "scan-file" 1 $testcase $output_file $args
# compiler. See dg-scan for details.
proc scan-stack-usage-not { args } {
- upvar 2 name testcase
- set testcase [lindex $testcase 0]
+ set testcase [testname-for-summary]
set output_file "[file rootname [file tail $testcase]].su"
dg-scan "scan-file-not" 0 $testcase $output_file $args
}
}
- # This assumes that we are two frames down from dg-test, and that
- # it still stores the filename of the testcase in a local variable "name".
- # A cleaner solution would require a new dejagnu release.
- upvar 2 name testcase
- set testcase [lindex $testcase 0]
-
+ set testcase [testname-for-summary]
set pattern [lindex $args 0]
set pp_pattern [make_pattern_printable $pattern]
verbose -log "c++filt is $cxxfilt"
}
- upvar 2 name testcase
- set testcase [lindex $testcase 0]
+ set testcase [testname-for-summary]
set pattern [lindex $args 0]
set pp_pattern [make_pattern_printable $pattern]
set output_file "[file rootname [file tail $testcase]].s"
verbose -log "c++filt is $cxxfilt"
}
- upvar 2 name testcase
- set testcase [lindex $testcase 0]
+ set testcase [testname-for-summary]
set pattern [lindex $args 0]
set pp_pattern [make_pattern_printable $pattern]
set output_file "[file rootname [file tail $testcase]].s"
verbose -log "size is $size"
}
- upvar 2 name testcase
- set testcase [lindex $testcase 0]
-
+ set testcase [testname-for-summary]
set what [lindex $args 0]
set where [lsearch { text data bss total } $what]
if { $where == -1 } {
}
}
- # This assumes that we are three frames down from dg-test, and that
- # it still stores the filename of the testcase in a local variable "name".
- # A cleaner solution would require a new DejaGnu release.
- upvar 3 name testcase
+ set testcase [testname-for-summary]
+ set printable_pattern [make_pattern_printable [lindex $args 1]]
set suf [dump-suffix [lindex $args 2]]
- set testname "$testcase scan-[lindex $args 0]-dump $suf \"[lindex $args 1]\""
+ set testname "$testcase scan-[lindex $args 0]-dump $suf \"$printable_pattern\""
set src [file tail [lindex $testcase 0]]
set output_file "[glob -nocomplain $src.[lindex $args 2]]"
if { $output_file == "" } {
}
}
- # This assumes that we are three frames down from dg-test, and that
- # it still stores the filename of the testcase in a local variable "name".
- # A cleaner solution would require a new DejaGnu release.
- upvar 3 name testcase
-
+ set testcase [testname-for-summary]
set suf [dump-suffix [lindex $args 3]]
- set testname "$testcase scan-[lindex $args 0]-dump-times $suf \"[lindex $args 1]\" [lindex $args 2]"
+ set printable_pattern [make_pattern_printable [lindex $args 1]]
+ set testname "$testcase scan-[lindex $args 0]-dump-times $suf \"$printable_pattern\" [lindex $args 2]"
set src [file tail [lindex $testcase 0]]
set output_file "[glob -nocomplain $src.[lindex $args 3]]"
if { $output_file == "" } {
}
}
- # This assumes that we are three frames down from dg-test, and that
- # it still stores the filename of the testcase in a local variable "name".
- # A cleaner solution would require a new DejaGnu release.
- upvar 3 name testcase
-
+ set testcase [testname-for-summary]
+ set printable_pattern [make_pattern_printable [lindex $args 1]]
set suf [dump-suffix [lindex $args 2]]
- set testname "$testcase scan-[lindex $args 0]-dump-not $suf \"[lindex $args 1]\""
+ set testname "$testcase scan-[lindex $args 0]-dump-not $suf \"$printable_pattern\""
set src [file tail [lindex $testcase 0]]
set output_file "[glob -nocomplain $src.[lindex $args 2]]"
if { $output_file == "" } {
verbose -log "c++filt is $cxxfilt"
}
- upvar 3 name testcase
+ set testcase [testname-for-summary]
+ set printable_pattern [make_pattern_printable [lindex $args 1]]
set suf [dump-suffix [lindex $args 2]]
- set testname "$testcase scan-[lindex $args 0]-dump-dem $suf \"[lindex $args 1]\""
+ set testname "$testcase scan-[lindex $args 0]-dump-dem $suf \"$printable_pattern\""
set src [file tail [lindex $testcase 0]]
set output_file "[glob -nocomplain $src.[lindex $args 2]]"
if { $output_file == "" } {
verbose -log "c++filt is $cxxfilt"
}
- upvar 3 name testcase
-
+ set testcase [testname-for-summary]
+ set printable_pattern [make_pattern_printable [lindex $args 1]
set suf [dump-suffix [lindex $args 2]]
- set testname "$testcase scan-[lindex $args 0]-dump-dem-not $suf \"[lindex $args 1]\""
+ set testname "$testcase scan-[lindex $args 0]-dump-dem-not $suf \"$printable_pattern\""
set src [file tail [lindex $testcase 0]]
set output_file "[glob -nocomplain $src.[lindex $args 2]]"
if { $output_file == "" } {
return "$flags1 $flags2"
}
+# DejaGnu's dg-test defines a test name that includes torture options
+# which is used in most pass/fail messages. Grab a copy of it.
+
+proc testname-for-summary { } {
+ global testname_with_flags
+
+ # A variable called "name" is too generic, so identify dg-test by
+ # the existence of dg-extra-tool-flags.
+ if ![info exists testname_with_flags] {
+ set frames 2
+ while { ![info exists flags] } {
+ set frames [expr $frames + 1]
+ upvar $frames dg-extra-tool-flags flags
+ }
+
+ # We've got the stack level for dg-test; get the variable we want.
+ upvar $frames name name
+ set testname_with_flags $name
+
+ # If there are flags, add an extra space to improve readability of
+ # the test summary.
+ if { [llength $testname_with_flags] > 1 } {
+ set testname_with_flags "$testname_with_flags "
+ }
+ }
+ return "$testname_with_flags"
+}
+
# If this target does not support weak symbols, skip this test.
proc dg-require-weak { args } {