aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-22 17:43:43 -0300
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-22 17:43:43 -0300
commita926878ddbd5a98b272c22171ce58663fc04c3e0 (patch)
tree86af256e5d9a9c06263c00adc90e5fe348008c43 /gcc/testsuite
parent542730f087133690b47e036dfd43eb0db8a650ce (diff)
parent07cbaed8ba7d1b6e4ab3a9f44175502a4e1ecdb1 (diff)
Merge branch 'autopar_rebase2' into autopar_develdevel/autopar_devel
Quickly commit changes in the rebase branch.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog6351
-rw-r--r--gcc/testsuite/brig.dg/test/gimple/packed.hsail4
-rw-r--r--gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c48
-rw-r--r--gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c37
-rw-r--r--gcc/testsuite/c-c++-common/Wattributes.c2
-rw-r--r--gcc/testsuite/c-c++-common/Wmisleading-indentation-3.c12
-rw-r--r--gcc/testsuite/c-c++-common/Wmisleading-indentation.c6
-rw-r--r--gcc/testsuite/c-c++-common/Wparentheses-2.c18
-rw-r--r--gcc/testsuite/c-c++-common/Wsizeof-pointer-memaccess1.c2
-rw-r--r--gcc/testsuite/c-c++-common/Wstringop-truncation.c2
-rw-r--r--gcc/testsuite/c-c++-common/asan/inline-kernel.c20
-rw-r--r--gcc/testsuite/c-c++-common/asan/inline.c20
-rw-r--r--gcc/testsuite/c-c++-common/attr-copy.c1
-rw-r--r--gcc/testsuite/c-c++-common/builtin-arith-overflow-1.c73
-rw-r--r--gcc/testsuite/c-c++-common/builtin-has-attribute-4.c3
-rw-r--r--gcc/testsuite/c-c++-common/builtin-has-attribute-7.c3
-rw-r--r--gcc/testsuite/c-c++-common/cpp/counter-2.c (renamed from gcc/testsuite/gcc.dg/cpp/counter-2.c)0
-rw-r--r--gcc/testsuite/c-c++-common/cpp/counter-3.c (renamed from gcc/testsuite/gcc.dg/cpp/counter-3.c)0
-rw-r--r--gcc/testsuite/c-c++-common/cpp/dir-only-1.c (renamed from gcc/testsuite/gcc.dg/cpp/dir-only-1.c)0
-rw-r--r--gcc/testsuite/c-c++-common/cpp/dir-only-1.h (renamed from gcc/testsuite/gcc.dg/cpp/dir-only-1.h)0
-rw-r--r--gcc/testsuite/c-c++-common/cpp/dir-only-2.c (renamed from gcc/testsuite/gcc.dg/cpp/dir-only-2.c)0
-rw-r--r--gcc/testsuite/c-c++-common/cpp/dir-only-3.c (renamed from gcc/testsuite/gcc.dg/cpp/dir-only-3.c)0
-rw-r--r--gcc/testsuite/c-c++-common/cpp/dir-only-3a.h (renamed from gcc/testsuite/gcc.dg/cpp/dir-only-3a.h)0
-rw-r--r--gcc/testsuite/c-c++-common/cpp/dir-only-3b.h (renamed from gcc/testsuite/gcc.dg/cpp/dir-only-3b.h)0
-rw-r--r--gcc/testsuite/c-c++-common/cpp/dir-only-4.c (renamed from gcc/testsuite/gcc.dg/cpp/dir-only-4.c)0
-rw-r--r--gcc/testsuite/c-c++-common/cpp/dir-only-5.c (renamed from gcc/testsuite/gcc.dg/cpp/dir-only-5.c)3
-rw-r--r--gcc/testsuite/c-c++-common/cpp/dir-only-6.c (renamed from gcc/testsuite/gcc.dg/cpp/dir-only-6.c)0
-rw-r--r--gcc/testsuite/c-c++-common/cpp/dir-only-7.c35
-rw-r--r--gcc/testsuite/c-c++-common/cpp/dir-only-8.c38
-rw-r--r--gcc/testsuite/c-c++-common/cpp/eof-1.c7
-rw-r--r--gcc/testsuite/c-c++-common/cpp/eof-2.c8
-rw-r--r--gcc/testsuite/c-c++-common/cpp/eof-2.h4
-rw-r--r--gcc/testsuite/c-c++-common/cpp/eof-3.c8
-rw-r--r--gcc/testsuite/c-c++-common/cpp/has-include-1-traditional.c38
-rw-r--r--gcc/testsuite/c-c++-common/cpp/line-2.c11
-rw-r--r--gcc/testsuite/c-c++-common/cpp/line-2.h5
-rw-r--r--gcc/testsuite/c-c++-common/cpp/line-3.c20
-rw-r--r--gcc/testsuite/c-c++-common/cpp/line-4.c11
-rw-r--r--gcc/testsuite/c-c++-common/cpp/line-4.h3
-rw-r--r--gcc/testsuite/c-c++-common/cpp/pr63831-1.c2
-rw-r--r--gcc/testsuite/c-c++-common/cpp/pr96323.c8
-rw-r--r--gcc/testsuite/c-c++-common/cpp/pragma-eof.c7
-rw-r--r--gcc/testsuite/c-c++-common/dfp/func-vararg-mixed-2.c105
-rw-r--r--gcc/testsuite/c-c++-common/diagnostic-format-json-1.c5
-rw-r--r--gcc/testsuite/c-c++-common/diagnostic-format-json-2.c5
-rw-r--r--gcc/testsuite/c-c++-common/diagnostic-format-json-3.c5
-rw-r--r--gcc/testsuite/c-c++-common/diagnostic-format-json-4.c9
-rw-r--r--gcc/testsuite/c-c++-common/diagnostic-format-json-5.c9
-rw-r--r--gcc/testsuite/c-c++-common/diagnostic-units-1.c28
-rw-r--r--gcc/testsuite/c-c++-common/diagnostic-units-2.c28
-rw-r--r--gcc/testsuite/c-c++-common/diagnostic-units-3.c28
-rw-r--r--gcc/testsuite/c-c++-common/diagnostic-units-4.c28
-rw-r--r--gcc/testsuite/c-c++-common/diagnostic-units-5.c28
-rw-r--r--gcc/testsuite/c-c++-common/diagnostic-units-6.c28
-rw-r--r--gcc/testsuite/c-c++-common/diagnostic-units-7.c28
-rw-r--r--gcc/testsuite/c-c++-common/diagnostic-units-8.c28
-rw-r--r--gcc/testsuite/c-c++-common/goacc/kernels-alias-ipa-pta-2.c3
-rw-r--r--gcc/testsuite/c-c++-common/goacc/kernels-alias-ipa-pta-4.c5
-rw-r--r--gcc/testsuite/c-c++-common/goacc/kernels-alias-ipa-pta.c3
-rw-r--r--gcc/testsuite/c-c++-common/goacc/mdc-1.c14
-rw-r--r--gcc/testsuite/c-c++-common/goacc/pr79428-1.c4
-rw-r--r--gcc/testsuite/c-c++-common/goacc/struct-enter-exit-data-1.c27
-rw-r--r--gcc/testsuite/c-c++-common/goacc/uninit-dim-clause.c12
-rw-r--r--gcc/testsuite/c-c++-common/goacc/uninit-firstprivate-clause.c2
-rw-r--r--gcc/testsuite/c-c++-common/goacc/uninit-if-clause.c16
-rw-r--r--gcc/testsuite/c-c++-common/goacc/uninit-use-device-clause.c2
-rw-r--r--gcc/testsuite/c-c++-common/gomp/declare-variant-14.c28
-rw-r--r--gcc/testsuite/c-c++-common/gomp/default-1.c8
-rw-r--r--gcc/testsuite/c-c++-common/gomp/defaultmap-3.c6
-rw-r--r--gcc/testsuite/c-c++-common/gomp/depend-iterator-2.c2
-rw-r--r--gcc/testsuite/c-c++-common/gomp/gridify-1.c54
-rw-r--r--gcc/testsuite/c-c++-common/gomp/gridify-2.c66
-rw-r--r--gcc/testsuite/c-c++-common/gomp/gridify-3.c68
-rw-r--r--gcc/testsuite/c-c++-common/gomp/loop-6.c113
-rw-r--r--gcc/testsuite/c-c++-common/gomp/loop-7.c24
-rw-r--r--gcc/testsuite/c-c++-common/gomp/order-4.c8
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr70550-1.c16
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr70550-2.c16
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr79428-2.c4
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr94874.c25
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr96424.c23
-rw-r--r--gcc/testsuite/c-c++-common/gomp/schedule-modifiers-2.c14
-rw-r--r--gcc/testsuite/c-c++-common/missing-close-func-paren.c40
-rw-r--r--gcc/testsuite/c-c++-common/missing-close-symbol.c6
-rw-r--r--gcc/testsuite/c-c++-common/patchable_function_entry-decl.c2
-rw-r--r--gcc/testsuite/c-c++-common/patchable_function_entry-default.c2
-rw-r--r--gcc/testsuite/c-c++-common/patchable_function_entry-definition.c2
-rw-r--r--gcc/testsuite/c-c++-common/pr28656.c12
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-13.c2
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-15.c2
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-16.c4
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-26.c6
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-27.c2
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-28.c10
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-29.c3
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-3.c12
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-30.c5
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-31.c2
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-32.c3
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-33.c2
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-35.c4
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-4.c12
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-5.c12
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-6.c12
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-8.c14
-rw-r--r--gcc/testsuite/c-c++-common/pr51628-9.c14
-rw-r--r--gcc/testsuite/c-c++-common/pr56493.c2
-rw-r--r--gcc/testsuite/c-c++-common/pr59223.c2
-rw-r--r--gcc/testsuite/c-c++-common/pr66208.c2
-rw-r--r--gcc/testsuite/c-c++-common/pr81376.c9
-rw-r--r--gcc/testsuite/c-c++-common/pr88664-2.c4
-rw-r--r--gcc/testsuite/c-c++-common/pr95237-1.c16
-rw-r--r--gcc/testsuite/c-c++-common/pr95237-2.c10
-rw-r--r--gcc/testsuite/c-c++-common/pr95237-3.c10
-rw-r--r--gcc/testsuite/c-c++-common/pr95237-4.c10
-rw-r--r--gcc/testsuite/c-c++-common/pr95237-5.c16
-rw-r--r--gcc/testsuite/c-c++-common/pr95237-6.c24
-rw-r--r--gcc/testsuite/c-c++-common/pr95237-7.c19
-rw-r--r--gcc/testsuite/c-c++-common/pr95237-8.c10
-rw-r--r--gcc/testsuite/c-c++-common/pr95237-9.c10
-rw-r--r--gcc/testsuite/c-c++-common/pr95378.c111
-rw-r--r--gcc/testsuite/c-c++-common/pr95903.c19
-rw-r--r--gcc/testsuite/c-c++-common/pr96192-1.c16
-rw-r--r--gcc/testsuite/c-c++-common/pr96369.c12
-rw-r--r--gcc/testsuite/c-c++-common/pr96545.c31
-rw-r--r--gcc/testsuite/c-c++-common/raw-string-14.c39
-rw-r--r--gcc/testsuite/c-c++-common/raw-string-16.c14
-rw-r--r--gcc/testsuite/c-c++-common/raw-string-5.c14
-rw-r--r--gcc/testsuite/c-c++-common/raw-string-6.c5
-rw-r--r--gcc/testsuite/c-c++-common/torture/vector-subscript-3.c3
-rw-r--r--gcc/testsuite/c-c++-common/tsan/func_entry_exit.c29
-rw-r--r--gcc/testsuite/c-c++-common/tsan/func_entry_exit_disabled.c29
-rw-r--r--gcc/testsuite/c-c++-common/tsan/inline.c20
-rw-r--r--gcc/testsuite/c-c++-common/tsan/volatile.c67
-rw-r--r--gcc/testsuite/c-c++-common/ubsan/bounds-13.c1
-rw-r--r--gcc/testsuite/c-c++-common/ubsan/bounds-2.c1
-rw-r--r--gcc/testsuite/c-c++-common/ubsan/div-by-zero-1.c1
-rw-r--r--gcc/testsuite/c-c++-common/ubsan/div-by-zero-6.c1
-rw-r--r--gcc/testsuite/c-c++-common/ubsan/div-by-zero-7.c1
-rw-r--r--gcc/testsuite/c-c++-common/ubsan/inline.c20
-rw-r--r--gcc/testsuite/c-c++-common/ubsan/overflow-add-1.c1
-rw-r--r--gcc/testsuite/c-c++-common/ubsan/overflow-add-2.c1
-rw-r--r--gcc/testsuite/c-c++-common/ubsan/overflow-int128.c1
-rw-r--r--gcc/testsuite/c-c++-common/ubsan/overflow-sub-1.c1
-rw-r--r--gcc/testsuite/c-c++-common/ubsan/overflow-sub-2.c1
-rw-r--r--gcc/testsuite/c-c++-common/uninit-pr51010.c4
-rw-r--r--gcc/testsuite/driver/a.c6
-rw-r--r--gcc/testsuite/driver/b.c6
-rw-r--r--gcc/testsuite/driver/driver.exp80
-rw-r--r--gcc/testsuite/driver/empty.c0
-rw-r--r--gcc/testsuite/driver/foo.c7
-rw-r--r--gcc/testsuite/g++.dg/20090107-1.C2
-rw-r--r--gcc/testsuite/g++.dg/20090121-1.C2
-rw-r--r--gcc/testsuite/g++.dg/DRs/dr188.C7
-rw-r--r--gcc/testsuite/g++.dg/DRs/dr2237.C18
-rw-r--r--gcc/testsuite/g++.dg/Wclass-memaccess.C174
-rw-r--r--gcc/testsuite/g++.dg/abi/pure-virtual1.C23
-rw-r--r--gcc/testsuite/g++.dg/abi/scoped1.C20
-rw-r--r--gcc/testsuite/g++.dg/analyzer/pr93212.C5
-rw-r--r--gcc/testsuite/g++.dg/analyzer/pr93950.C4
-rw-r--r--gcc/testsuite/g++.dg/analyzer/pr94011.C16
-rw-r--r--gcc/testsuite/g++.dg/analyzer/pr94028.C9
-rw-r--r--gcc/testsuite/g++.dg/analyzer/pr94503.C25
-rw-r--r--gcc/testsuite/g++.dg/analyzer/pr95042.C28
-rw-r--r--gcc/testsuite/g++.dg/asan/function-argument-4.C26
-rw-r--r--gcc/testsuite/g++.dg/asan/pr95025.C28
-rw-r--r--gcc/testsuite/g++.dg/concepts/abbrev7.C14
-rw-r--r--gcc/testsuite/g++.dg/concepts/diagnostic1.C3
-rw-r--r--gcc/testsuite/g++.dg/concepts/diagnostic14.C36
-rw-r--r--gcc/testsuite/g++.dg/concepts/fn8.C2
-rw-r--r--gcc/testsuite/g++.dg/concepts/pr95181-2.C8
-rw-r--r--gcc/testsuite/g++.dg/concepts/pr95181.C9
-rw-r--r--gcc/testsuite/g++.dg/concepts/pr95386.C11
-rw-r--r--gcc/testsuite/g++.dg/conversion/ref4.C22
-rw-r--r--gcc/testsuite/g++.dg/conversion/ref5.C14
-rw-r--r--gcc/testsuite/g++.dg/conversion/ref6.C24
-rw-r--r--gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C2
-rw-r--r--gcc/testsuite/g++.dg/coroutines/co-return-syntax-10-movable.C75
-rw-r--r--gcc/testsuite/g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C65
-rw-r--r--gcc/testsuite/g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C59
-rw-r--r--gcc/testsuite/g++.dg/coroutines/coro-bad-grooaf-00-static.C15
-rw-r--r--gcc/testsuite/g++.dg/coroutines/coro-bad-grooaf-01-grooaf-expected.C14
-rw-r--r--gcc/testsuite/g++.dg/coroutines/coro-missing-final-suspend.C19
-rw-r--r--gcc/testsuite/g++.dg/coroutines/coro-missing-initial-suspend.C19
-rw-r--r--gcc/testsuite/g++.dg/coroutines/coro-missing-promise-yield.C6
-rw-r--r--gcc/testsuite/g++.dg/coroutines/coro-missing-promise.C6
-rw-r--r--gcc/testsuite/g++.dg/coroutines/coro-missing-ret-value.C6
-rw-r--r--gcc/testsuite/g++.dg/coroutines/coro-missing-ret-void.C6
-rw-r--r--gcc/testsuite/g++.dg/coroutines/coro-missing-ueh-3.C6
-rw-r--r--gcc/testsuite/g++.dg/coroutines/coro.h10
-rw-r--r--gcc/testsuite/g++.dg/coroutines/coro1-allocators.h5
-rw-r--r--gcc/testsuite/g++.dg/coroutines/coro1-ret-int-yield-int.h6
-rw-r--r--gcc/testsuite/g++.dg/coroutines/coroutines.exp2
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C (renamed from gcc/testsuite/g++.dg/coroutines/pr9xxxx-mismatched-traits-and-promise-prev.C)0
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr94817.C10
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr94829.C49
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr95050.C49
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr95345.C32
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr95346.C26
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr95350.C28
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr95440.C39
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr95477.C37
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr95505.C26
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr95518.C28
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr95591.C26
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr95599.C69
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr95711.C79
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr95736.C84
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr95813.C46
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr95823.C30
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr95824.C37
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C12
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/func-params-08.C11
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/func-params-09-awaitable-parms.C11
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/pr95003.C50
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/pr95519-00-return_void.C63
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/pr95519-01-initial-suspend.C69
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/pr95519-02-final_suspend.C69
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/pr95519-03-return-value.C80
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/pr95519-04-yield-value.C84
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/pr95519-05-gro.C64
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/pr95519-06-grooaf.C49
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/pr95519-07-unhandled-exception.C69
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/Wnarrowing18.C15
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/Wredundant-move1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/Wredundant-move7.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/Wredundant-move9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-70.C23
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-70001-1.C1
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-95307.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr10.C41
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-array25.C21
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-array26.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-array27.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-bitfield3.C1
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-is_literal.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-ptrsub2.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-shift2.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype63.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype76.C7
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype77.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype78.C24
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype79.C19
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/elision_neg.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/enum13.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist-array12.C26
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist7.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist92.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-constexpr2.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice30.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice31.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/move-return2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/move-return3.C23
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/noexcept30.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/noexcept58.C9
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/noexcept59.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/noexcept60.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi16.C11
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nullptr04.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nullptr22.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr62101.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr68726.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr78341.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr80259.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr81246.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/ref-qual20.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/sfinae66.C32
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic-value1.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic74.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/vt-59978.C16
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/auto-fn58.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/auto-fn59.C8
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/auto-fn60.C11
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/auto-fn61.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-82304.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-96182.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-arith-overflow.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-array8.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C1
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-shift1.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/digit-sep-neg.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic21.C26
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/new1.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/new2.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr57644.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr63996.C1
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr65202.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr65340.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr68578.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr77321.C1
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr90996.C19
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/var-templ4.C8
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/var-templ44.C1
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/var-templ66.C7
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/var-templ67.C16
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/aggr-base10.C16
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/attributes-enum-1a.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/class-deduction44.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/constexpr-if-lambda3.C1
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/constexpr-if34.C15
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/decomp52.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/decomp53.C22
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/direct-enum-init1.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/eval-order9.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/fold7a.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/lambda-this7.C11
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/launder9.C11
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/nontype-auto3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/nontype2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/nontype3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/nontype3a.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/pr86648.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/static2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/utf8-2a.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/aggr1.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/array-conv11.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/array-conv12.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/array-conv13.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/array-conv14.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/array-conv15.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/array-conv16.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/array-conv17.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/array-conv2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/array-conv3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/array-conv4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/array-conv5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/array-conv6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/array-conv7.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/array-conv8.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/array-conv9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/attr-likely1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/attr-likely2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/attr-likely3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/attr-likely4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr3.C24
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr4.C29
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr5.C20
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr6.C35
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr7.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/class-deduction-alias1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/class-deduction-alias2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/class-deduction-alias3.C11
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/comma1.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/comma2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/comma4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/comma5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-alias.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-alias3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-alias4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-alias5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-ca107.C33
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-class.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-cmath.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-complete1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-constrained-parm.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-conv2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-decltype.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-dr1430.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-err2.C11
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst5.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-feature-macro.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-fn1.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-fn2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-fn3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-fn4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-fn5.C17
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-friend1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-friend2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-friend4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-friend6.C19
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-friend7.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-friend8.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-iconv1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-lambda1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-lambda10.C7
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-lambda11.C17
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-lambda12.C15
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-lambda2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-lambda3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-lambda4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-lambda5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-lambda7.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-lambda8.C11
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-lambda9.C11
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-locations1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-member-concept.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-memfun-err.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-memfun.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-memtmpl1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-noexcept1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-p2113a.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-p2113b.C25
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec7.C22
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec8.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-placeholder1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-placeholder2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr65552.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr65634.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr65636.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr65848.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr65854.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr66844.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr66962.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67070.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67147.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67148.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67178.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67210.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67217.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67319.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67427.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67654.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67658.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67684.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67692.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67697.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67719.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67774.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67825.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67860.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67862.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr67969.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr68093-1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr68093-2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr68372.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr68434.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr68683.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr68812.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr69235.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr71368.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr71385.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr71965.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr78752-2.C21
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr78752.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr79759.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr80746.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr80773.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr82507.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr82740.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr84140.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr84551.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr84810.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr85808.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr86269.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr87441.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr88395.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr92078.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr95497.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-redecl1.C7
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires10.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires11.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires12.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires13.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires14.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires15.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires16.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires17.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires18.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires19.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires20.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires21.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires7.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires8.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-requires9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-return-req1.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-spec1.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-template-parm1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-template-parm10.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-template-parm2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-template-parm5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-template-parm6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-template-parm8.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-template-parm9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-traits2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-ts1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-ts2.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-ts3.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-ts4.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-ts5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-ts6.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-ttp1.C16
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-using1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-using2.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/cond-triv2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/consteval-virtual1.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/consteval-virtual2.C22
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/consteval-virtual3.C53
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/consteval-virtual4.C48
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/consteval-virtual5.C61
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/consteval-void1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/consteval17.C11
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dtor2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dtor3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dtor4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic10.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic11.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic12.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic13.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic14.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic15.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic16.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic17.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic18.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic7.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic8.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init10.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init11.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init12.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init13.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init14.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init15.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init16.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init17.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init18.C16
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init7.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init8.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-init9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-new1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-new10.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-new11.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-new12.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-new13.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-new2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-new4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-new5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-new6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-new7.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-new8.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-new9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-typeid1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-typeid2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-typeid3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-union1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-virtual14.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-virtual15.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-virtual16.C22
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-virtual17.C28
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constinit1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constinit10.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constinit11.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constinit12.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constinit14.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constinit15.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constinit3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constinit4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constinit5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constinit8.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constinit9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/desig11.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/desig13.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/desig16.C28
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/desig2.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/destroying-delete1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/destroying-delete2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/destroying-delete3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/destroying-delete4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/explicit14.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/explicit15.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/explicit16.C21
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/implicit-move1.C17
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/implicit-move2.C49
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/implicit-move3.C49
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/inline-asm2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/inline-asm3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated10.C30
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-generic-variadic20.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-generic5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-generic7.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-mangle.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-pack-init1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-pack-init2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-pack-init4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-pack-init5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-this3.C16
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-uneval1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-uneval11.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-uneval12.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-uneval2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-uneval3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-uneval4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-uneval5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-uneval6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-uneval7.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-uneval8.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-uneval9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-1.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nested-inline-ns2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/no_unique_address1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/no_unique_address4.C22
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/no_unique_address5.C25
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/no_unique_address6.C25
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/no_unique_address7.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/no_unique_address7a.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nodiscard-constructor.c2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nodiscard-once.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-only-one.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nodiscard-reason.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class-equiv1.C25
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class-union1.C25
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class10.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class11.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class12.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class13.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class14.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class15.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class16.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class17.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class18.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class19.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class20.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class21.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class22.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class23.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class24.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class25.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class26.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class27.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class28.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class29.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class30.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class31.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class32.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class33.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class34.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class35.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class36.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class37.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class38.C30
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class7.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class8.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-subob1.C25
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-subob2.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init10.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init11.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init12.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init13.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init15.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init16.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init18.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init19.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init20.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init21.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init22.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init23.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init24.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init25.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init26.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init27.C24
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init28.C15
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init29.C15
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init30.C23
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init31.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init32.C21
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init7.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init8.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/paren-init9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/pr88534.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/pr88537.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/pr89913.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr3.C7
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-decltype1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-eq1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-eq1a.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-eq2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-eq3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-eq4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-eq5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-eq6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-eq7.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-eq8.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-eq9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-err1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-err2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-err3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-err4.C8
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-friend1.C26
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-ref1.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite3.C8
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-scalar1-neg.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-scalar1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-scalar1a.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-scalar2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-scalar3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-sfinae1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg4.C20
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth1a.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth2.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth2a.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth2b.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth3a.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth7.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth8.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth9.C27
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-union1.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-vec1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-weak1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/srcloc1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/srcloc10.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/srcloc11.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/srcloc12.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/srcloc13.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/srcloc14.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/srcloc2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/srcloc3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/srcloc4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/srcloc5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/srcloc6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/srcloc7.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/srcloc8.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/srcloc9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename10.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename11.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename12.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename13.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename14.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename15.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename16.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename17.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename7.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename8.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/typename9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/ucn2.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad-neg.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad-neg2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-neg.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-neg2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/volatile1.C66
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/volatile2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/volatile4.C2
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C3
-rw-r--r--gcc/testsuite/g++.dg/delayedfold/fwrapv1.C1
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/bad-binary-ops.C8
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/enum2.C10
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/mem-init1.C29
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/pr96328.C4
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/unclosed-extern-c.C3
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/unclosed-function.C3
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/unclosed-namespace.C3
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/unclosed-struct.C4
-rw-r--r--gcc/testsuite/g++.dg/eh/builtin10.C12
-rw-r--r--gcc/testsuite/g++.dg/eh/builtin11.C20
-rw-r--r--gcc/testsuite/g++.dg/eh/builtin5.C8
-rw-r--r--gcc/testsuite/g++.dg/eh/builtin6.C16
-rw-r--r--gcc/testsuite/g++.dg/eh/builtin7.C12
-rw-r--r--gcc/testsuite/g++.dg/eh/builtin9.C20
-rw-r--r--gcc/testsuite/g++.dg/expr/bitfield9.C4
-rw-r--r--gcc/testsuite/g++.dg/expr/composite-ptr-type.C72
-rw-r--r--gcc/testsuite/g++.dg/expr/ptr-comp1.C32
-rw-r--r--gcc/testsuite/g++.dg/expr/ptr-comp2.C14
-rw-r--r--gcc/testsuite/g++.dg/expr/ptr-comp3.C15
-rw-r--r--gcc/testsuite/g++.dg/ext/attr-access.C4
-rw-r--r--gcc/testsuite/g++.dg/ext/attr-nonnull.C8
-rw-r--r--gcc/testsuite/g++.dg/ext/attr-parm-1.C11
-rw-r--r--gcc/testsuite/g++.dg/ext/attrib49.C4
-rw-r--r--gcc/testsuite/g++.dg/ext/attribute-test-1.C12
-rw-r--r--gcc/testsuite/g++.dg/ext/bitfield1.C6
-rw-r--r--gcc/testsuite/g++.dg/ext/builtin-has-attribute.C8
-rw-r--r--gcc/testsuite/g++.dg/ext/fixed1.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/flexary13.C10
-rw-r--r--gcc/testsuite/g++.dg/ext/flexary37.C15
-rw-r--r--gcc/testsuite/g++.dg/ext/pr84598.C3
-rw-r--r--gcc/testsuite/g++.dg/ext/pr85503.C1
-rw-r--r--gcc/testsuite/g++.dg/ext/tmplattr10.C52
-rw-r--r--gcc/testsuite/g++.dg/ext/utf-cvt.C16
-rw-r--r--gcc/testsuite/g++.dg/ext/vector28.C4
-rw-r--r--gcc/testsuite/g++.dg/ext/vla1.C3
-rw-r--r--gcc/testsuite/g++.dg/ext/vla15.C4
-rw-r--r--gcc/testsuite/g++.dg/ext/vla23.C14
-rw-r--r--gcc/testsuite/g++.dg/gcov/loop.C2
-rw-r--r--gcc/testsuite/g++.dg/gomp/critical-3.C31
-rw-r--r--gcc/testsuite/g++.dg/gomp/gomp.exp2
-rw-r--r--gcc/testsuite/g++.dg/gomp/loop-1.C16
-rw-r--r--gcc/testsuite/g++.dg/gomp/loop-2.C16
-rw-r--r--gcc/testsuite/g++.dg/gomp/loop-5.C50
-rw-r--r--gcc/testsuite/g++.dg/gomp/loop-6.C69
-rw-r--r--gcc/testsuite/g++.dg/gomp/parallel-2.C4
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr95063.C24
-rw-r--r--gcc/testsuite/g++.dg/gomp/predetermined-1.C14
-rw-r--r--gcc/testsuite/g++.dg/gomp/sharing-1.C2
-rw-r--r--gcc/testsuite/g++.dg/init/array11.C1
-rw-r--r--gcc/testsuite/g++.dg/init/array15.C1
-rw-r--r--gcc/testsuite/g++.dg/init/array4.C1
-rw-r--r--gcc/testsuite/g++.dg/init/const7.C2
-rw-r--r--gcc/testsuite/g++.dg/init/new18.C3
-rw-r--r--gcc/testsuite/g++.dg/init/new38.C2
-rw-r--r--gcc/testsuite/g++.dg/init/new44.C54
-rw-r--r--gcc/testsuite/g++.dg/init/value9.C4
-rw-r--r--gcc/testsuite/g++.dg/ipa/devirt-19.C3
-rw-r--r--gcc/testsuite/g++.dg/ipa/devirt-52.C3
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr44372.C3
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr58371.C3
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr63587-2.C3
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr77333.C4
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr78211.C3
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr83667.C2
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr94856.C1
-rw-r--r--gcc/testsuite/g++.dg/lookup/koenig15.C45
-rw-r--r--gcc/testsuite/g++.dg/lookup/missing-std-include-10.C43
-rw-r--r--gcc/testsuite/g++.dg/lookup/missing-std-include-10.h1
-rw-r--r--gcc/testsuite/g++.dg/lookup/missing-std-include-11.C43
-rw-r--r--gcc/testsuite/g++.dg/lookup/this1.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20080908-1_0.C21
-rw-r--r--gcc/testsuite/g++.dg/lto/20081219_1.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20091002-1_0.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/pr65475c_0.C3
-rw-r--r--gcc/testsuite/g++.dg/lto/pr84805_0.C2
-rw-r--r--gcc/testsuite/g++.dg/opt/dump1.C5
-rw-r--r--gcc/testsuite/g++.dg/opt/flifetime-dse2.C1
-rw-r--r--gcc/testsuite/g++.dg/opt/flifetime-dse4.C1
-rw-r--r--gcc/testsuite/g++.dg/opt/flifetime-dse7.C16
-rw-r--r--gcc/testsuite/g++.dg/opt/pr44919.C3
-rw-r--r--gcc/testsuite/g++.dg/opt/pr47615.C3
-rw-r--r--gcc/testsuite/g++.dg/opt/pr55717.C4
-rw-r--r--gcc/testsuite/g++.dg/opt/pr60597.C30
-rw-r--r--gcc/testsuite/g++.dg/opt/pr81715.C1
-rw-r--r--gcc/testsuite/g++.dg/opt/pr82159-2.C3
-rw-r--r--gcc/testsuite/g++.dg/opt/pr95080.C41
-rw-r--r--gcc/testsuite/g++.dg/opt/pr95528.C27
-rw-r--r--gcc/testsuite/g++.dg/opt/pr96194.C21
-rw-r--r--gcc/testsuite/g++.dg/opt/pr96354.C24
-rw-r--r--gcc/testsuite/g++.dg/opt/reload3.C4
-rw-r--r--gcc/testsuite/g++.dg/opt/temp2.C1
-rw-r--r--gcc/testsuite/g++.dg/opt/thunk1.C3
-rw-r--r--gcc/testsuite/g++.dg/other/error23.C2
-rw-r--r--gcc/testsuite/g++.dg/other/error35.C2
-rw-r--r--gcc/testsuite/g++.dg/other/i386-2.C4
-rw-r--r--gcc/testsuite/g++.dg/other/i386-3.C4
-rw-r--r--gcc/testsuite/g++.dg/other/operator1.C2
-rw-r--r--gcc/testsuite/g++.dg/other/pr31078.C3
-rw-r--r--gcc/testsuite/g++.dg/other/pr52048.C3
-rw-r--r--gcc/testsuite/g++.dg/other/pr53574.C2
-rw-r--r--gcc/testsuite/g++.dg/other/pr95231.C4
-rw-r--r--gcc/testsuite/g++.dg/other/switch4.C1
-rw-r--r--gcc/testsuite/g++.dg/overload/builtin4.C31
-rw-r--r--gcc/testsuite/g++.dg/overload/builtin5.C21
-rw-r--r--gcc/testsuite/g++.dg/overload/operator2.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/attr4.C3
-rw-r--r--gcc/testsuite/g++.dg/parse/concat1.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/cond4.C1
-rw-r--r--gcc/testsuite/g++.dg/parse/constructor2.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/crash10.C5
-rw-r--r--gcc/testsuite/g++.dg/parse/crash18.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/crash27.C3
-rw-r--r--gcc/testsuite/g++.dg/parse/crash34.C3
-rw-r--r--gcc/testsuite/g++.dg/parse/crash35.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/crash52.C3
-rw-r--r--gcc/testsuite/g++.dg/parse/crash55.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/crash59.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/crash61.C1
-rw-r--r--gcc/testsuite/g++.dg/parse/crash67.C3
-rw-r--r--gcc/testsuite/g++.dg/parse/ctor3.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/defarg5.C7
-rw-r--r--gcc/testsuite/g++.dg/parse/dtor12.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/dtor4.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/enum14.C7
-rw-r--r--gcc/testsuite/g++.dg/parse/error11.C18
-rw-r--r--gcc/testsuite/g++.dg/parse/error14.C5
-rw-r--r--gcc/testsuite/g++.dg/parse/error33.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/error4.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/error5.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/error56.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/invalid1.C3
-rw-r--r--gcc/testsuite/g++.dg/parse/parameter-declaration-1.C3
-rw-r--r--gcc/testsuite/g++.dg/parse/parser-pr28152-2.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/parser-pr28152.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/pr68722.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/pr96257.C18
-rw-r--r--gcc/testsuite/g++.dg/parse/pragma-recovery.C32
-rw-r--r--gcc/testsuite/g++.dg/pr46852.C3
-rw-r--r--gcc/testsuite/g++.dg/pr46868.C1
-rw-r--r--gcc/testsuite/g++.dg/pr48484.C8
-rw-r--r--gcc/testsuite/g++.dg/pr53037-2.C12
-rw-r--r--gcc/testsuite/g++.dg/pr53037-3.C12
-rw-r--r--gcc/testsuite/g++.dg/pr57662.C3
-rw-r--r--gcc/testsuite/g++.dg/pr59510.C3
-rw-r--r--gcc/testsuite/g++.dg/pr66655.C4
-rw-r--r--gcc/testsuite/g++.dg/pr66655.h6
-rw-r--r--gcc/testsuite/g++.dg/pr66655_1.cc8
-rw-r--r--gcc/testsuite/g++.dg/pr67351.C2
-rw-r--r--gcc/testsuite/g++.dg/pr67989.C3
-rw-r--r--gcc/testsuite/g++.dg/pr71973-2.C2
-rw-r--r--gcc/testsuite/g++.dg/pr81194.C3
-rw-r--r--gcc/testsuite/g++.dg/pr96308.C7
-rw-r--r--gcc/testsuite/g++.dg/spellcheck-inttypes.C80
-rw-r--r--gcc/testsuite/g++.dg/spellcheck-stdint.C68
-rw-r--r--gcc/testsuite/g++.dg/template/access30.C10
-rw-r--r--gcc/testsuite/g++.dg/template/access31.C29
-rw-r--r--gcc/testsuite/g++.dg/template/array30.C6
-rw-r--r--gcc/testsuite/g++.dg/template/array9.C4
-rw-r--r--gcc/testsuite/g++.dg/template/canon-type-8.C3
-rw-r--r--gcc/testsuite/g++.dg/template/cast6.C19
-rw-r--r--gcc/testsuite/g++.dg/template/constant1.C6
-rw-r--r--gcc/testsuite/g++.dg/template/constant2.C6
-rw-r--r--gcc/testsuite/g++.dg/template/conv16.C17
-rw-r--r--gcc/testsuite/g++.dg/template/crash106.C8
-rw-r--r--gcc/testsuite/g++.dg/template/crash107.C7
-rw-r--r--gcc/testsuite/g++.dg/template/crash115.C1
-rw-r--r--gcc/testsuite/g++.dg/template/crash119.C2
-rw-r--r--gcc/testsuite/g++.dg/template/crash43.C4
-rw-r--r--gcc/testsuite/g++.dg/template/crash87.C2
-rw-r--r--gcc/testsuite/g++.dg/template/crash90.C4
-rw-r--r--gcc/testsuite/g++.dg/template/dtor4.C2
-rw-r--r--gcc/testsuite/g++.dg/template/error-recovery1.C3
-rw-r--r--gcc/testsuite/g++.dg/template/error30.C2
-rw-r--r--gcc/testsuite/g++.dg/template/error34.C10
-rw-r--r--gcc/testsuite/g++.dg/template/error35.C2
-rw-r--r--gcc/testsuite/g++.dg/template/error41.C2
-rw-r--r--gcc/testsuite/g++.dg/template/error56.C2
-rw-r--r--gcc/testsuite/g++.dg/template/error57.C2
-rw-r--r--gcc/testsuite/g++.dg/template/error59.C11
-rw-r--r--gcc/testsuite/g++.dg/template/friend18.C6
-rw-r--r--gcc/testsuite/g++.dg/template/incomplete12.C9
-rw-r--r--gcc/testsuite/g++.dg/template/lookup12.C26
-rw-r--r--gcc/testsuite/g++.dg/template/lookup13.C28
-rw-r--r--gcc/testsuite/g++.dg/template/lookup14.C11
-rw-r--r--gcc/testsuite/g++.dg/template/lookup15.C24
-rw-r--r--gcc/testsuite/g++.dg/template/nontype12.C20
-rw-r--r--gcc/testsuite/g++.dg/template/nontype13.C2
-rw-r--r--gcc/testsuite/g++.dg/template/nontype18.C2
-rw-r--r--gcc/testsuite/g++.dg/template/nontype25.C6
-rw-r--r--gcc/testsuite/g++.dg/template/nontype8.C4
-rw-r--r--gcc/testsuite/g++.dg/template/partial-order1.C2
-rw-r--r--gcc/testsuite/g++.dg/template/partial-order2.C20
-rw-r--r--gcc/testsuite/g++.dg/template/pr39425.C8
-rw-r--r--gcc/testsuite/g++.dg/template/pr68978.C24
-rw-r--r--gcc/testsuite/g++.dg/template/pr79650.C10
-rw-r--r--gcc/testsuite/g++.dg/template/pr95263.C23
-rw-r--r--gcc/testsuite/g++.dg/template/pr95672.C3
-rw-r--r--gcc/testsuite/g++.dg/template/sfinae30.C21
-rw-r--r--gcc/testsuite/g++.dg/template/sfinae31.C14
-rw-r--r--gcc/testsuite/g++.dg/template/show-template-tree-3.C3
-rw-r--r--gcc/testsuite/g++.dg/template/sizeof-template-argument.C4
-rw-r--r--gcc/testsuite/g++.dg/template/spec41.C17
-rw-r--r--gcc/testsuite/g++.dg/template/template-keyword3.C11
-rw-r--r--gcc/testsuite/g++.dg/template/typename23.C10
-rw-r--r--gcc/testsuite/g++.dg/template/virtual5.C31
-rw-r--r--gcc/testsuite/g++.dg/template/void3.C2
-rw-r--r--gcc/testsuite/g++.dg/template/void7.C2
-rw-r--r--gcc/testsuite/g++.dg/template/void9.C2
-rw-r--r--gcc/testsuite/g++.dg/tm/cgraph_edge.C3
-rw-r--r--gcc/testsuite/g++.dg/torture/20141013.C3
-rw-r--r--gcc/testsuite/g++.dg/torture/pr34641.C3
-rw-r--r--gcc/testsuite/g++.dg/torture/pr34850.C3
-rw-r--r--gcc/testsuite/g++.dg/torture/pr36745.C3
-rw-r--r--gcc/testsuite/g++.dg/torture/pr37421.C1
-rw-r--r--gcc/testsuite/g++.dg/torture/pr40991.C3
-rw-r--r--gcc/testsuite/g++.dg/torture/pr48271.C3
-rw-r--r--gcc/testsuite/g++.dg/torture/pr49394.C2
-rw-r--r--gcc/testsuite/g++.dg/torture/pr53602.C3
-rw-r--r--gcc/testsuite/g++.dg/torture/pr53752.C3
-rw-r--r--gcc/testsuite/g++.dg/torture/pr54838.C3
-rw-r--r--gcc/testsuite/g++.dg/torture/pr58252.C3
-rw-r--r--gcc/testsuite/g++.dg/torture/pr82154.C3
-rw-r--r--gcc/testsuite/g++.dg/torture/pr88861.C4
-rw-r--r--gcc/testsuite/g++.dg/torture/pr95268.C46
-rw-r--r--gcc/testsuite/g++.dg/torture/pr95284.C16
-rw-r--r--gcc/testsuite/g++.dg/torture/pr95308.C21
-rw-r--r--gcc/testsuite/g++.dg/torture/pr95493-1.C95
-rw-r--r--gcc/testsuite/g++.dg/torture/pr95493.C62
-rw-r--r--gcc/testsuite/g++.dg/torture/pr95548.C10
-rw-r--r--gcc/testsuite/g++.dg/torture/pr95717.C12
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/final4.C12
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr19807.C2
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr22444.C3
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr24351-3.C3
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr27283.C3
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr27291.C17
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr27548.C3
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr42337.C3
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr49516.C32
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr95638.C150
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr95649.C13
-rw-r--r--gcc/testsuite/g++.dg/ubsan/pr65583.C3
-rw-r--r--gcc/testsuite/g++.dg/ubsan/pr85029.C2
-rw-r--r--gcc/testsuite/g++.dg/ubsan/ubsan.exp2
-rw-r--r--gcc/testsuite/g++.dg/ubsan/vla-2.C14
-rw-r--r--gcc/testsuite/g++.dg/ubsan/vptr-14.C2
-rw-r--r--gcc/testsuite/g++.dg/ubsan/vptr-16.C14
-rw-r--r--gcc/testsuite/g++.dg/ubsan/vptr-17.C15
-rw-r--r--gcc/testsuite/g++.dg/vect/pr95290.cc25
-rw-r--r--gcc/testsuite/g++.dg/vect/pr95297.cc22
-rw-r--r--gcc/testsuite/g++.dg/vect/pr95487.cc20
-rw-r--r--gcc/testsuite/g++.dg/vect/pr95576.cc23
-rw-r--r--gcc/testsuite/g++.dg/vect/pr96022.cc12
-rw-r--r--gcc/testsuite/g++.dg/vect/pr96163.cc146
-rw-r--r--gcc/testsuite/g++.dg/vect/slp-pr56812.cc2
-rw-r--r--gcc/testsuite/g++.dg/vect/slp-pr87105.cc2
-rw-r--r--gcc/testsuite/g++.dg/vect/vec-cond-expr-eh.C17
-rw-r--r--gcc/testsuite/g++.dg/warn/Wconversion-integer.C13
-rw-r--r--gcc/testsuite/g++.dg/warn/Wconversion-null-2.C8
-rw-r--r--gcc/testsuite/g++.dg/warn/Wconversion-null.C8
-rw-r--r--gcc/testsuite/g++.dg/warn/Wconversion3.C2
-rw-r--r--gcc/testsuite/g++.dg/warn/Wdiv-by-zero-3.C17
-rw-r--r--gcc/testsuite/g++.dg/warn/Wduplicated-branches1.C2
-rw-r--r--gcc/testsuite/g++.dg/warn/Wextra-3.C9
-rw-r--r--gcc/testsuite/g++.dg/warn/Wmismatched-tags-7.C13
-rw-r--r--gcc/testsuite/g++.dg/warn/Wmismatched-tags-8.C22
-rw-r--r--gcc/testsuite/g++.dg/warn/Wnonnull3.C4
-rw-r--r--gcc/testsuite/g++.dg/warn/Wnonnull4.C4
-rw-r--r--gcc/testsuite/g++.dg/warn/Wnonnull5.C108
-rw-r--r--gcc/testsuite/g++.dg/warn/Wnonnull6.C37
-rw-r--r--gcc/testsuite/g++.dg/warn/Wnonnull7.C36
-rw-r--r--gcc/testsuite/g++.dg/warn/Wnonnull8.C20
-rw-r--r--gcc/testsuite/g++.dg/warn/Wplacement-new-size-5.C10
-rw-r--r--gcc/testsuite/g++.dg/warn/Wplacement-new-size.C248
-rw-r--r--gcc/testsuite/g++.dg/warn/Wshadow-local-3.C7
-rw-r--r--gcc/testsuite/g++.dg/warn/Wstrict-aliasing-5.C4
-rw-r--r--gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C8
-rw-r--r--gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-tmpl.C12
-rw-r--r--gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C12
-rw-r--r--gcc/testsuite/g++.dg/warn/Wtype-limits.C12
-rw-r--r--gcc/testsuite/g++.dg/warn/Wtype-limits4.C23
-rw-r--r--gcc/testsuite/g++.dg/warn/deprecated-6.C2
-rw-r--r--gcc/testsuite/g++.dg/warn/deprecated.C2
-rw-r--r--gcc/testsuite/g++.dg/warn/forward-inner.C9
-rw-r--r--gcc/testsuite/g++.dg/warn/pr94038-2.C28
-rw-r--r--gcc/testsuite/g++.dg/warn/pr94038-3.C15
-rw-r--r--gcc/testsuite/g++.dg/warn/template-2.C22
-rw-r--r--gcc/testsuite/g++.dg/wrappers/wrapper-around-type-pack-expansion.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/crash11.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/enum11.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.bugs/900227_01.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/operator.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/missed-error2.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns15.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash31.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/exprstmt1.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline12.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline15.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/new6.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/crash10.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/crash16.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ctor2.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/overload2.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/spec20.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb109.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb27.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb76.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.warn/flow1.C6
-rw-r--r--gcc/testsuite/g++.target/aarch64/pr94052.C2
-rw-r--r--gcc/testsuite/g++.target/aarch64/pr95114.C3
-rw-r--r--gcc/testsuite/g++.target/aarch64/pr95726.C46
-rw-r--r--gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/attributes_1.C122
-rw-r--r--gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C15
-rw-r--r--gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C15
-rw-r--r--gcc/testsuite/g++.target/arm/pr95726.C49
-rw-r--r--gcc/testsuite/g++.target/i386/mv16.C12
-rw-r--r--gcc/testsuite/g++.target/i386/pr95229.C24
-rw-r--r--gcc/testsuite/g++.target/riscv/frflags.C7
-rw-r--r--gcc/testsuite/g++.target/xtensa/pr95571.C43
-rw-r--r--gcc/testsuite/g++.target/xtensa/xtensa.exp43
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/packed-aligned-1.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr96426.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/noinit-attribute.c6
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/packed-aligned.c28
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr23135.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr51447.c6
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr94591.c32
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr96549.c12
-rw-r--r--gcc/testsuite/gcc.dg/20020919-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/20050121-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/Walloca-14.c3
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-32.c4
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-46.c9
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-48.c3
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-50.c3
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-52.c3
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-53.c3
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-54.c6
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-56.c4
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-61.c190
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-62.c130
-rw-r--r--gcc/testsuite/gcc.dg/Wattributes-6.c2
-rw-r--r--gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c6
-rw-r--r--gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-ignore.c11
-rw-r--r--gcc/testsuite/gcc.dg/Wno-frame-address.c2
-rw-r--r--gcc/testsuite/gcc.dg/Wrestrict-9.c2
-rw-r--r--gcc/testsuite/gcc.dg/Wreturn-local-addr-2.c3
-rw-r--r--gcc/testsuite/gcc.dg/Wreturn-local-addr-3.c3
-rw-r--r--gcc/testsuite/gcc.dg/Wreturn-local-addr-4.c3
-rw-r--r--gcc/testsuite/gcc.dg/Wreturn-local-addr-6.c3
-rw-r--r--gcc/testsuite/gcc.dg/Wstack-usage.c3
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-12.c16
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-15.c3
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-23.c3
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-25.c11
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-27.c3
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-28.c2
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-33.c40
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-34.c252
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-35.c76
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-36.c24
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-37.c229
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-38.c94
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-39.c119
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-dedupe-issue-2.c30
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-dedupe-issue.c2
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-minimal.c61
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/abs-1.c22
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/aliasing-1.c25
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/aliasing-2.c32
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/alloca-leak.c2
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/analyzer-decls.h7
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/attribute-nonnull.c12
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/bzero-1.c11
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/casts-1.c49
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/casts-2.c15
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/compound-assignment-1.c9
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/compound-assignment-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/compound-assignment-4.c28
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/compound-assignment-5.c142
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/conditionals-notrans.c33
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/data-model-1.c98
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/data-model-13.c7
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/data-model-14.c9
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/data-model-16.c2
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/data-model-18.c4
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/data-model-20.c25
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/data-model-5.c13
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/data-model-5b.c12
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/data-model-5c.c13
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/data-model-5d.c61
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/data-model-6.c14
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/data-model-8.c3
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/describe-1.c11
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/dot-output.c3
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/explode-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/explode-2.c16
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/feasibility-1.c62
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/first-field-1.c24
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/first-field-2.c33
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/init.c136
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/leak-2.c9
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/loop-0-up-to-n-by-1-with-iter-obj.c73
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/loop-0-up-to-n-by-1.c31
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/loop-2a.c10
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/loop-3.c7
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/loop-4.c13
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/loop-n-down-to-1-by-1.c35
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/loop-start-down-to-end-by-1.c35
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/loop-start-down-to-end-by-step.c30
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/loop-start-to-end-by-step.c36
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/loop-start-up-to-end-by-1.c34
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/loop.c9
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/malloc-1.c28
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/malloc-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/malloc-in-loop.c19
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/malloc-ipa-8-double-free.c82
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/malloc-ipa-8-unchecked.c6
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/malloc-paths-8.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/malloc-paths-9.c59
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/malloc-vs-local-1a.c22
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/malloc-vs-local-2.c16
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/malloc-vs-local-3.c7
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/memset-1.c100
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/paths-3.c4
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/paths-4.c10
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/paths-6.c4
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/paths-7.c3
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-simplified.c22
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr93032-mztools.c331
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr93382.c6
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr93546.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr93938.c13
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr94099.c3
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr94399.c13
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr94447.c2
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr94458.c23
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr94640.c17
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr94688.c6
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr94689.c8
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr94839.c20
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr95026.c17
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr95240.c27
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr96598.c26
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr96611.c14
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/refcounting-1.c31
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/setjmp-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/setjmp-2.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/setjmp-3.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/setjmp-4.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/setjmp-5.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/setjmp-6.c2
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/setjmp-7.c2
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/setjmp-7a.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/setjmp-8.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/setjmp-9.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/setjmp-pr93378.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/signal-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/signal-2.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/signal-3.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/signal-4a.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/signal-4b.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/signal-5.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/signal-6.c1
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/signal-exit.c24
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/single-field.c37
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/stale-frame-1.c15
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/symbolic-1.c43
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/symbolic-2.c32
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/symbolic-3.c12
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/symbolic-4.c20
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/symbolic-5.c29
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/symbolic-6.c24
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/taint-1.c22
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/torture/loop-inc-ptr-1.c15
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/torture/loop-inc-ptr-2.c17
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/torture/loop-inc-ptr-3.c18
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/unknown-fns-2.c238
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/unknown-fns-3.c67
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/unknown-fns-4.c15
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/unknown-fns.c8
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/use-after-free.c12
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/vla-1.c13
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/zlib-4.c10
-rw-r--r--gcc/testsuite/gcc.dg/asan/pr95033.c13
-rw-r--r--gcc/testsuite/gcc.dg/asan/pr95051.c22
-rw-r--r--gcc/testsuite/gcc.dg/attr-access-none.c38
-rw-r--r--gcc/testsuite/gcc.dg/attr-access-read-only.c2
-rw-r--r--gcc/testsuite/gcc.dg/attr-access-read-write.c2
-rw-r--r--gcc/testsuite/gcc.dg/attr-access-write-only.c2
-rw-r--r--gcc/testsuite/gcc.dg/attr-copy-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/attr-copy-6.c1
-rw-r--r--gcc/testsuite/gcc.dg/attr-copy-8.c25
-rw-r--r--gcc/testsuite/gcc.dg/autopar/pr68460.c2
-rw-r--r--gcc/testsuite/gcc.dg/bad-binary-ops.c8
-rw-r--r--gcc/testsuite/gcc.dg/builtin-bswap-10.c8
-rw-r--r--gcc/testsuite/gcc.dg/builtin-bswap-11.c51
-rw-r--r--gcc/testsuite/gcc.dg/builtin-bswap-12.c27
-rw-r--r--gcc/testsuite/gcc.dg/builtin-object-size-20.c315
-rw-r--r--gcc/testsuite/gcc.dg/builtin-object-size-21.c52
-rw-r--r--gcc/testsuite/gcc.dg/builtin-stringop-chk-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/builtin-stringop-chk-5.c24
-rw-r--r--gcc/testsuite/gcc.dg/builtin-stringop-chk-8.c2
-rw-r--r--gcc/testsuite/gcc.dg/c11-align-9.c4
-rw-r--r--gcc/testsuite/gcc.dg/c11-bool-limits-1.c13
-rw-r--r--gcc/testsuite/gcc.dg/c2x-bool-limits-1.c19
-rw-r--r--gcc/testsuite/gcc.dg/c90-fordecl-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/cdce3.c3
-rw-r--r--gcc/testsuite/gcc.dg/concat2.c2
-rw-r--r--gcc/testsuite/gcc.dg/const-uniq-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/trad/funlike-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-dfp.c2
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-float.c2
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr96383-1.c17
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr96383-2.c17
-rw-r--r--gcc/testsuite/gcc.dg/empty-source-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/empty-source-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/fixits-pr84852-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/fixits-pr84852-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/fold-convmaxconv-1.c7
-rw-r--r--gcc/testsuite/gcc.dg/fold-convminconv-1.c7
-rw-r--r--gcc/testsuite/gcc.dg/fold-parity-1.c21
-rw-r--r--gcc/testsuite/gcc.dg/fold-parity-2.c20
-rw-r--r--gcc/testsuite/gcc.dg/fold-parity-3.c20
-rw-r--r--gcc/testsuite/gcc.dg/fold-parity-4.c20
-rw-r--r--gcc/testsuite/gcc.dg/fold-parity-5.c38
-rw-r--r--gcc/testsuite/gcc.dg/fold-popcount-5.c38
-rw-r--r--gcc/testsuite/gcc.dg/format/branch-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/format/pr79210.c2
-rw-r--r--gcc/testsuite/gcc.dg/gimplefe-44.c1
-rw-r--r--gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c2
-rw-r--r--gcc/testsuite/gcc.dg/gomp/gomp.exp2
-rw-r--r--gcc/testsuite/gcc.dg/gomp/loop-1.c16
-rw-r--r--gcc/testsuite/gcc.dg/gomp/loop-2.c13
-rw-r--r--gcc/testsuite/gcc.dg/gomp/parallel-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr44085.c2
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr95108.c18
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr95315-2.c46
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr95315.c5
-rw-r--r--gcc/testsuite/gcc.dg/gomp/sharing-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/gomp/vla-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/graphite/scop-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr95343.c45
-rw-r--r--gcc/testsuite/gcc.dg/ia64-sync-5.c83
-rw-r--r--gcc/testsuite/gcc.dg/independent-cloneids-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/intermod-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-clone-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipcp-agg-13.c45
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipcp-agg-8.c5
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr95113.c33
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr96040.c57
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr96482-2.c33
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr96482.c44
-rw-r--r--gcc/testsuite/gcc.dg/loop-8.c2
-rw-r--r--gcc/testsuite/gcc.dg/loop-versioning-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/loop-versioning-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081210-1_0.c8
-rw-r--r--gcc/testsuite/gcc.dg/lto/pr52634_0.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/pr85870_0.c10
-rw-r--r--gcc/testsuite/gcc.dg/lto/pr85870_1.c10
-rw-r--r--gcc/testsuite/gcc.dg/lto/pr96291.h4
-rw-r--r--gcc/testsuite/gcc.dg/lto/pr96291_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/pr96291_1.c3
-rw-r--r--gcc/testsuite/gcc.dg/lto/pr96291_2.c7
-rw-r--r--gcc/testsuite/gcc.dg/memchr.c94
-rw-r--r--gcc/testsuite/gcc.dg/memcmp-2.c183
-rw-r--r--gcc/testsuite/gcc.dg/memcmp-3.c349
-rw-r--r--gcc/testsuite/gcc.dg/memcmp-4.c81
-rw-r--r--gcc/testsuite/gcc.dg/memcmp-pr95189.c28
-rw-r--r--gcc/testsuite/gcc.dg/missing-header-fixit-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/missing-header-fixit-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/missing-header-fixit-5.c36
-rw-r--r--gcc/testsuite/gcc.dg/no_profile_instrument_function-attr-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/pr30552-3.c3
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/pr35447-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/parallel-early-constant.c22
-rw-r--r--gcc/testsuite/gcc.dg/parallel-static-1.c21
-rw-r--r--gcc/testsuite/gcc.dg/parallel-static-2.c21
-rw-r--r--gcc/testsuite/gcc.dg/parallel-static-clash-1.c23
-rw-r--r--gcc/testsuite/gcc.dg/parallel-static-clash-aux.c14
-rw-r--r--gcc/testsuite/gcc.dg/plugin/diagnostic-test-expressions-1.c16
-rw-r--r--gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr20245-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/pr26570.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr28419.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr30957-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/pr31866.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr32069.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr35445.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr36227.c10
-rw-r--r--gcc/testsuite/gcc.dg/pr40172-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr42611.c3
-rw-r--r--gcc/testsuite/gcc.dg/pr44194-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/pr46647.c4
-rw-r--r--gcc/testsuite/gcc.dg/pr51628-17.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr51628-19.c6
-rw-r--r--gcc/testsuite/gcc.dg/pr51628-20.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr51628-21.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr51628-22.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr51628-24.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr51628-25.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr51628-34.c8
-rw-r--r--gcc/testsuite/gcc.dg/pr53037-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/pr59924.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr59963-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr68317.c10
-rw-r--r--gcc/testsuite/gcc.dg/pr71581.c6
-rw-r--r--gcc/testsuite/gcc.dg/pr78973.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr84131.c3
-rw-r--r--gcc/testsuite/gcc.dg/pr85859.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr86179.c13
-rw-r--r--gcc/testsuite/gcc.dg/pr87347.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr87485.c1
-rw-r--r--gcc/testsuite/gcc.dg/pr88660.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr88928.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr89410-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr89410-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr89689.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr93986.c3
-rw-r--r--gcc/testsuite/gcc.dg/pr94600-1.c36
-rw-r--r--gcc/testsuite/gcc.dg/pr94600-2.c34
-rw-r--r--gcc/testsuite/gcc.dg/pr94600-3.c35
-rw-r--r--gcc/testsuite/gcc.dg/pr94600-4.c34
-rw-r--r--gcc/testsuite/gcc.dg/pr94600-5.c34
-rw-r--r--gcc/testsuite/gcc.dg/pr94600-6.c33
-rw-r--r--gcc/testsuite/gcc.dg/pr94600-7.c33
-rw-r--r--gcc/testsuite/gcc.dg/pr94600-8.c33
-rw-r--r--gcc/testsuite/gcc.dg/pr94873.c27
-rw-r--r--gcc/testsuite/gcc.dg/pr94963.c35
-rw-r--r--gcc/testsuite/gcc.dg/pr94968.c8
-rw-r--r--gcc/testsuite/gcc.dg/pr95052.c12
-rw-r--r--gcc/testsuite/gcc.dg/pr95118.c11
-rw-r--r--gcc/testsuite/gcc.dg/pr95133.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr95141.c8
-rw-r--r--gcc/testsuite/gcc.dg/pr95171.c18
-rw-r--r--gcc/testsuite/gcc.dg/pr95580.c16
-rw-r--r--gcc/testsuite/gcc.dg/pr95694.c23
-rw-r--r--gcc/testsuite/gcc.dg/pr95713.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr95770.c9
-rw-r--r--gcc/testsuite/gcc.dg/pr95854.c20
-rw-r--r--gcc/testsuite/gcc.dg/pr95857.c38
-rw-r--r--gcc/testsuite/gcc.dg/pr96335.c12
-rw-r--r--gcc/testsuite/gcc.dg/pr96370.c8
-rw-r--r--gcc/testsuite/gcc.dg/pr96377-1.c32
-rw-r--r--gcc/testsuite/gcc.dg/pr96377-2.c31
-rw-r--r--gcc/testsuite/gcc.dg/pr96377-3.c33
-rw-r--r--gcc/testsuite/gcc.dg/pr96377-4.c32
-rw-r--r--gcc/testsuite/gcc.dg/pr96377-5.c33
-rw-r--r--gcc/testsuite/gcc.dg/pr96377-6.c32
-rw-r--r--gcc/testsuite/gcc.dg/pr96514.c27
-rw-r--r--gcc/testsuite/gcc.dg/pr96558.c32
-rw-r--r--gcc/testsuite/gcc.dg/redecl-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c2
-rw-r--r--gcc/testsuite/gcc.dg/sibcall-10.c2
-rw-r--r--gcc/testsuite/gcc.dg/sibcall-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/sibcall-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/sibcall-9.c2
-rw-r--r--gcc/testsuite/gcc.dg/sinatan-2.c18
-rw-r--r--gcc/testsuite/gcc.dg/sinhatanh-1.c18
-rw-r--r--gcc/testsuite/gcc.dg/sinhovercosh-1.c18
-rw-r--r--gcc/testsuite/gcc.dg/spellcheck-inttypes.c82
-rw-r--r--gcc/testsuite/gcc.dg/spellcheck-options-22.c3
-rw-r--r--gcc/testsuite/gcc.dg/spellcheck-stdbool.c17
-rw-r--r--gcc/testsuite/gcc.dg/spellcheck-stdint.c62
-rw-r--r--gcc/testsuite/gcc.dg/sso-11.c36
-rw-r--r--gcc/testsuite/gcc.dg/sso/memcpy-1.c59
-rw-r--r--gcc/testsuite/gcc.dg/sso/sso.exp12
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-55.c3
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-74.c2
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-83.c3
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-84.c3
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-91.c3
-rw-r--r--gcc/testsuite/gcc.dg/strncmp-3.c57
-rw-r--r--gcc/testsuite/gcc.dg/tanhbysinh.c40
-rw-r--r--gcc/testsuite/gcc.dg/tls/opt-9.c2
-rw-r--r--gcc/testsuite/gcc.dg/tm/pr95569.c18
-rw-r--r--gcc/testsuite/gcc.dg/torture/20181024-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/20200727-0.c82
-rw-r--r--gcc/testsuite/gcc.dg/torture/builtins-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/cris-asm-mof-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/cris-volatile-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-3.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-4.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr38948.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr39074-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr39074.c4
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr51106-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr51106-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr57359-1.c23
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr57359-2.c30
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr59330.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr71598-2.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr80281.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr86034.c12
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr92088-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr92088-2.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr92252.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr93124.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr94479.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr94947-1.c23
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr94947-2.c7
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr94988.c22
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr95025.c13
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr95045.c29
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr95049.c7
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr95172.c17
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr95248.c28
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr95283.c19
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr95295-1.c15
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr95295-2.c14
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr95295-3.c16
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr95761.c25
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr96130.c26
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr96133.c16
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr96349.c25
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr96491.c29
-rw-r--r--gcc/testsuite/gcc.dg/torture/pta-callused-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-2.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-malloc.c49
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-topn.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/andnot-2.c10
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-22.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c32
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/dse-points-to.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-36.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/loop-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c10
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/phi-opt-21.c15
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/popcount4ll.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/popcount5ll.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr79448-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr79448.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr83403-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr83403-2.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr83403.h30
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr84436-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr84648.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr89430-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr89430-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr89430-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr89430-6.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr89430-7-comp-ref.c17
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr89430-8-mem-ref-size.c15
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr92163.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr93121-1.c56
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr93121-2.c22
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr94703.c12
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr94783.c12
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr94786.c66
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr94880.c29
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr94882-1.c42
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr94882-2.c78
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr94882-3.c79
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr94882.c36
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr94913.c33
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr94921.c18
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr94969.c28
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr95433-2.c15
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr95433.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr95527.c172
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr95649.c21
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr95699.c39
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr95804.c18
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr95906.c13
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr96480.c23
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/reassoc-20.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/reassoc-28.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/scev-8.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/split-path-12.c19
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/split-path-7.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c12
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-30.c20
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-14.c33
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-17.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-13.c25
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-14.c17
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/upcast-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/vector-4.c3
-rw-r--r--gcc/testsuite/gcc.dg/two-types-6.c2
-rw-r--r--gcc/testsuite/gcc.dg/ubsan/c-shift-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/ubsan/pr81981.c4
-rw-r--r--gcc/testsuite/gcc.dg/ubsan/pr89284.c4
-rw-r--r--gcc/testsuite/gcc.dg/ubsan/pr95810.c13
-rw-r--r--gcc/testsuite/gcc.dg/unclosed-init.c2
-rw-r--r--gcc/testsuite/gcc.dg/uninit-15.c2
-rw-r--r--gcc/testsuite/gcc.dg/uninit-32.c313
-rw-r--r--gcc/testsuite/gcc.dg/uninit-33.c145
-rw-r--r--gcc/testsuite/gcc.dg/uninit-34.c58
-rw-r--r--gcc/testsuite/gcc.dg/uninit-36.c238
-rw-r--r--gcc/testsuite/gcc.dg/uninit-B-O0.c2
-rw-r--r--gcc/testsuite/gcc.dg/uninit-I-O0.c2
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr19430-O0.c16
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr19430.c18
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr95136.c63
-rw-r--r--gcc/testsuite/gcc.dg/var-expand3.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-10.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-22.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-34.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-44.c41
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-pr68892.c7
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-pr95271.c22
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-pr95335.c13
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-pr95839-2.c20
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-pr95839.c13
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-pr95866.c17
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-slp-2.c14
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr71264.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr95272.c18
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr95495.c16
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr95539.c29
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr95570.c11
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr95856.c20
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr95897.c13
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr95916.c13
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-45.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-46.c96
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-47.c56
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-48.c56
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-109.c2
-rw-r--r--gcc/testsuite/gcc.dg/weak/typeof-2.c1
-rw-r--r--gcc/testsuite/gcc.misc-tests/arm-isr.c2
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-pr94029.c2
-rw-r--r--gcc/testsuite/gcc.misc-tests/outputs-0.c1
-rw-r--r--gcc/testsuite/gcc.misc-tests/outputs-1.c4
-rw-r--r--gcc/testsuite/gcc.misc-tests/outputs-2.c2
-rw-r--r--gcc/testsuite/gcc.misc-tests/outputs.exp804
-rw-r--r--gcc/testsuite/gcc.target/aarch64/acle/jcvt_2.c33
-rw-r--r--gcc/testsuite/gcc.target/aarch64/asimd-mull-elem.c21
-rw-r--r--gcc/testsuite/gcc.target/aarch64/bti-4.c60
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/aarch64-cpunative.exp35
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_08
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_18
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_108
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_118
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_128
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_138
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_148
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_158
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_28
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_38
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_48
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_58
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_68
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_78
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_88
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_98
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_0.c12
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_1.c12
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_10.c12
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_11.c12
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_12.c12
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_13.c12
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_14.c12
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_15.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_2.c12
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_3.c13
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_4.c12
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_5.c12
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_6.c13
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_7.c13
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_8.c12
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_9.c14
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpymem-q-reg_1.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/csinv-neg.c104
-rw-r--r--gcc/testsuite/gcc.target/aarch64/get_fpcr64_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/get_fpsr64_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/large_struct_copy_2.c7
-rw-r--r--gcc/testsuite/gcc.target/aarch64/ldp_vec_v2sf.c14
-rw-r--r--gcc/testsuite/gcc.target/aarch64/ldp_vec_v2si.c14
-rw-r--r--gcc/testsuite/gcc.target/aarch64/mgeneral-regs_5.c14
-rw-r--r--gcc/testsuite/gcc.target/aarch64/mgeneral-regs_6.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/nospill.c35
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr95254.c19
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr96377-1.c20
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr96402.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/return_address_sign_1.c8
-rw-r--r--gcc/testsuite/gcc.target/aarch64/return_address_sign_b_1.c8
-rw-r--r--gcc/testsuite/gcc.target/aarch64/set_fpcr64_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/set_fpsr64_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/shrink_wrap_1.c19
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr-bti.c40
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr.c33
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr-pacret.c21
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr.c119
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-mitigation.exp73
-rw-r--r--gcc/testsuite/gcc.target/aarch64/stack-protector-1.c89
-rw-r--r--gcc/testsuite/gcc.target/aarch64/stack-protector-2.c6
-rw-r--r--gcc/testsuite/gcc.target/aarch64/stp_vec_v2df.c18
-rw-r--r--gcc/testsuite/gcc.target/aarch64/stp_vec_v2di.c18
-rw-r--r--gcc/testsuite/gcc.target/aarch64/stp_vec_v2sf.c18
-rw-r--r--gcc/testsuite/gcc.target/aarch64/stp_vec_v2si.c18
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_8.c101
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr96146.c20
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/clastb_1.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/clastb_2.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/clastb_3.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/clastb_4.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/clastb_5.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/clastb_6.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/clastb_7.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/cost_model_2.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/load_const_offset_2.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_abs.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_1.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_2.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_3.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_4.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_5.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_6.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_7.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_1.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_2.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_3.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_4.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_1.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_2.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_3.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_4.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_5.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_6.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_7.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_neg.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_not.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_1.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_2.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_3.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_4.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_5.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_6.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_7.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/pr95199.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/pr95361.c11
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/pr95523.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/pr95961.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/pr96195.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/scatter_store_6.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/scatter_store_7.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/strided_load_3.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/strided_store_3.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/unpack_signed_1.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/target_attr_20.c27
-rw-r--r--gcc/testsuite/gcc.target/aarch64/target_attr_21.c27
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vdup_n_3.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vins-1.c23
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vins-2.c23
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vins-3.c23
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vzip_1.c12
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vzip_2.c13
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vzip_3.c13
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vzip_4.c13
-rw-r--r--gcc/testsuite/gcc.target/arm/empty_fiq_handler.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/handler-align.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/interrupt-1.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/interrupt-2.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/ivopts.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/lob.h15
-rw-r--r--gcc/testsuite/gcc.target/arm/lob1.c85
-rw-r--r--gcc/testsuite/gcc.target/arm/lob2.c32
-rw-r--r--gcc/testsuite/gcc.target/arm/lob3.c27
-rw-r--r--gcc/testsuite/gcc.target/arm/lob4.c34
-rw-r--r--gcc/testsuite/gcc.target/arm/lob5.c35
-rw-r--r--gcc/testsuite/gcc.target/arm/lob6.c97
-rw-r--r--gcc/testsuite/gcc.target/arm/multilib.exp2
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve-vldstr16-no-writeback.c17
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts1.c40
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts2.c35
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts3.c28
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts4.c34
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vaddq_m.c48
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vector_float2.c13
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vldr.c61
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vldr_z.c73
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_base.c67
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_base_p.c69
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_offset.c215
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_offset_p.c216
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_shifted_offset.c141
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_shifted_offset_p.c142
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstr.c43
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstr_p.c42
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_f16.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_f32.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_s16.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_s32.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_u16.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_u32.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_s16.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_s32.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_s8.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_u16.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_u32.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_u8.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_f16.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_f32.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_s16.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_s32.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_s8.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_u16.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_u32.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_u8.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_f16.c6
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_f32.c6
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_s16.c6
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_s32.c6
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_s8.c6
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_u16.c6
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_u32.c6
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_u8.c6
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_s8.c3
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_u8.c3
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_z_s8.c4
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_z_u8.c4
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_s64.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_u64.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_s64.c6
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_u64.c6
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_f16.c3
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_s16.c3
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_s32.c3
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_u16.c3
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_u32.c3
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_f16.c4
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_s16.c4
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_s32.c4
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_u16.c4
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_u32.c4
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_f32.c3
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_f32.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_s32.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_u32.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_f32.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_s32.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_u32.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_s32.c3
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_u32.c3
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_z_f32.c4
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_z_s32.c4
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_z_u32.c4
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_float.c6
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_float1.c6
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_int.c8
-rw-r--r--gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_int1.c8
-rw-r--r--gcc/testsuite/gcc.target/arm/pr70830.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/pr94743-1-hard.c29
-rw-r--r--gcc/testsuite/gcc.target/arm/pr94743-1-soft.c27
-rw-r--r--gcc/testsuite/gcc.target/arm/pr94743-1-softfp.c29
-rw-r--r--gcc/testsuite/gcc.target/arm/pr94743-2.c22
-rw-r--r--gcc/testsuite/gcc.target/arm/pr94743-3.c23
-rw-r--r--gcc/testsuite/gcc.target/arm/pr95646.c32
-rw-r--r--gcc/testsuite/gcc.target/arm/simd/vmmla_1.c3
-rw-r--r--gcc/testsuite/gcc.target/arm/stack-protector-1.c63
-rw-r--r--gcc/testsuite/gcc.target/arm/stack-protector-2.c6
-rw-r--r--gcc/testsuite/gcc.target/arm/unsigned-extend-2.c2
-rw-r--r--gcc/testsuite/gcc.target/bpf/diag-funargs-2.c1
-rw-r--r--gcc/testsuite/gcc.target/bpf/diag-funargs-3.c1
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-bind.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-bpf-redirect.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-clone-redirect.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-csum-diff.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-csum-update.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-current-task-under-cgroup.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-fib-lookup.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-cgroup-classid.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-current-cgroup-id.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-current-comm.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-current-pid-tgid.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-current-task.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-current-uid-gid.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-hash-recalc.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-listener-sock.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-local-storage.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-numa-node-id.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-prandom-u32.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-route-realm.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-smp-processor-id.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-socket-cookie.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-socket-uid.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-stack.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-get-stackid.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-getsockopt.c8
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-ktime-get-ns.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-l3-csum-replace.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-l4-csum-replace.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-lwt-push-encap.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-lwt-seg6-action.c8
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-lwt-seg6-adjust-srh.c7
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-lwt-seg6-store-bytes.c7
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-map-delete-elem.c5
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-map-lookup-elem.c5
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-map-peek-elem.c5
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-map-pop-elem.c5
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-map-push-elem.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-map-update-elem.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-msg-apply-bytes.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-msg-cork-bytes.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-msg-pop-data.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-msg-pull-data.c9
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-msg-push-data.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-msg-redirect-hash.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-msg-redirect-map.c7
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-override-return.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-perf-event-output.c3
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-perf-event-read-value.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-perf-event-read.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-perf-prog-read-value.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-probe-read-str.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-probe-read.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-probe-write-user.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-rc-keydown.c7
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-rc-pointer-rel.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-rc-repeat.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-redirect-map.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-set-hash-invalid.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-set-hash.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-setsockopt.c7
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sk-fullsock.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sk-lookup-tcp.c12
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sk-lookup-upd.c12
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sk-redirect-hash.c5
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sk-redirect-map.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sk-release.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sk-select-reuseport.c8
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sk-storage-delete.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sk-storage-get.c7
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-adjust-room.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-cgroup-id.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-change-head.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-change-proto.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-change-tail.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-change-type.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-ecn-set-ce.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-get-tunnel-key.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-get-tunnel-opt.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-get-xfrm-state.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-load-bytes-relative.c8
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-load-bytes.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-pull-data.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-set-tunnel-key.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-set-tunnel-opt.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-store-bytes.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-under-cgroup.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-vlan-pop.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skb-vlan-push.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-skc-lookup-tcp.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sock-hash-update.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sock-map-update.c7
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sock-ops-cb-flags-set.c7
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-spin-lock.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-spin-unlock.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-strtol.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-strtoul.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sysctl-get-current-value.c7
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sysctl-get-name.c7
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sysctl-get-new-value.c7
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-sysctl-set-new-value.c7
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-tail-call.c5
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-tcp-check-syncookie.c10
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-tcp-sock.c4
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-trace-printk.c5
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-xdp-adjust-head.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-xdp-adjust-meta.c6
-rw-r--r--gcc/testsuite/gcc.target/bpf/helper-xdp-adjust-tail.c3
-rw-r--r--gcc/testsuite/gcc.target/bpf/skb-ancestor-cgroup-id.c7
-rw-r--r--gcc/testsuite/gcc.target/bpf/xbpf-callee-saved-regs-1.c17
-rw-r--r--gcc/testsuite/gcc.target/bpf/xbpf-callee-saved-regs-2.c17
-rw-r--r--gcc/testsuite/gcc.target/cris/asm-other.S11
-rw-r--r--gcc/testsuite/gcc.target/cris/asmreg-1.c2
-rw-r--r--gcc/testsuite/gcc.target/cris/cris.exp2
-rw-r--r--gcc/testsuite/gcc.target/cris/inasm-other.c8
-rw-r--r--gcc/testsuite/gcc.target/cris/peep2-movulsr.c19
-rw-r--r--gcc/testsuite/gcc.target/cris/pr93372-36.c37
-rw-r--r--gcc/testsuite/gcc.target/cris/pr93372-37.c26
-rw-r--r--gcc/testsuite/gcc.target/cris/pr93372-38.c30
-rw-r--r--gcc/testsuite/gcc.target/cris/pr93372-39.c19
-rw-r--r--gcc/testsuite/gcc.target/cris/pr93372-44.c13
-rw-r--r--gcc/testsuite/gcc.target/cris/pr93372-45.c13
-rw-r--r--gcc/testsuite/gcc.target/cris/pr93372-46.c16
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-1-v10.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-1-v32.c5
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-2i.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-2s.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-3i.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-3s.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-4i.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-4s.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/cris-torture.exp2
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1.c4
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1a.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1ml.c4
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2.c4
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2a.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2ml.c4
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3.c4
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3a.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3ml.c4
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1.c13
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1a.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1ml.c4
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1.c4
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1a.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1ml.c4
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2.c4
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2a.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2ml.c4
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3.c4
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3a.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3ml.c4
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1.c4
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1a.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1ml.c4
-rw-r--r--gcc/testsuite/gcc.target/gcn/gcn.exp42
-rw-r--r--gcc/testsuite/gcc.target/gcn/vcc-clobber.c33
-rw-r--r--gcc/testsuite/gcc.target/i386/avx2-shiftqihi-constant-1.c31
-rw-r--r--gcc/testsuite/gcc.target/i386/avx2-shiftqihi-constant-2.c62
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512bw-pr95488-1.c21
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512bw-pr95488-2.c47
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512bw-pr96246-1.c30
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512bw-pr96246-2.c47
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512bw-shiftqihi-constant-1.c31
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512bw-shiftqihi-constant-2.c62
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512bw-vmovdqu16-1.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512bw-vmovdqu8-1.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-pr95060.c22
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-vcmppd-3.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-vcmpps-3.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-vcvtps2ph-pr95254.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-vmovapd-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-vmovaps-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-vmovdqa32-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-vmovdqa64-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512vl-pr92686-movcc-1.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512vl-pr95488-1.c36
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512vl-pr95488-2.c50
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512vl-pr96246-1.c36
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512vl-pr96246-2.c51
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512vl-vcvtps2ph-pr95254.c18
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512vl-vmovapd-1.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512vl-vmovaps-1.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa32-1.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa64-1.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/builtin-bswap-5.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/builtin_target.c355
-rw-r--r--gcc/testsuite/gcc.target/i386/endbr_immediate.c198
-rw-r--r--gcc/testsuite/gcc.target/i386/fma_double_1.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/fma_double_2.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/fma_double_3.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/fma_double_4.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/fma_double_5.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/fma_double_6.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/fma_float_1.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/fma_float_2.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/fma_float_3.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/fma_float_4.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/fma_float_5.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/fma_float_6.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-56.inc12
-rw-r--r--gcc/testsuite/gcc.target/i386/l_fma_double_1.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/l_fma_double_2.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/l_fma_double_3.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/l_fma_double_4.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/l_fma_double_5.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/l_fma_double_6.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/l_fma_float_1.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/l_fma_float_2.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/l_fma_float_3.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/l_fma_float_4.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/l_fma_float_5.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/l_fma_float_6.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/memcpy-pr95886.c107
-rw-r--r--gcc/testsuite/gcc.target/i386/minmax-10.c38
-rw-r--r--gcc/testsuite/gcc.target/i386/minmax-11.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/minmax-12.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/minmax-8.c18
-rw-r--r--gcc/testsuite/gcc.target/i386/minmax-9.c23
-rw-r--r--gcc/testsuite/gcc.target/i386/parity-3.c24
-rw-r--r--gcc/testsuite/gcc.target/i386/parity-4.c24
-rw-r--r--gcc/testsuite/gcc.target/i386/parity-5.c9
-rw-r--r--gcc/testsuite/gcc.target/i386/parity-6.c9
-rw-r--r--gcc/testsuite/gcc.target/i386/parity-7.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/parity-8.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/parity-9.c33
-rw-r--r--gcc/testsuite/gcc.target/i386/pr60473.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/pr67609.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70314.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/pr71321.c3
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78904-1a.c47
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78904-1b.c49
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78904-2a.c48
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78904-2b.c50
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78904-3a.c42
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78904-3b.c43
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78904-4a.c21
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78904-4b.c23
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78904-5a.c21
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78904-5b.c23
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78904-6a.c21
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78904-6b.c23
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78967-1a.c20
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78967-1b.c21
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78967-2a.c24
-rw-r--r--gcc/testsuite/gcc.target/i386/pr78967-2b.c26
-rw-r--r--gcc/testsuite/gcc.target/i386/pr88240.c26
-rw-r--r--gcc/testsuite/gcc.target/i386/pr88713-1.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/pr88713-2.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/pr88713-3.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/pr92645-4.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/pr92658-avx2.c192
-rw-r--r--gcc/testsuite/gcc.target/i386/pr92658-avx512bw-trunc.c90
-rw-r--r--gcc/testsuite/gcc.target/i386/pr92658-avx512bw.c280
-rw-r--r--gcc/testsuite/gcc.target/i386/pr92658-avx512f.c106
-rw-r--r--gcc/testsuite/gcc.target/i386/pr92658-avx512vl.c129
-rw-r--r--gcc/testsuite/gcc.target/i386/pr92658-sse4.c148
-rw-r--r--gcc/testsuite/gcc.target/i386/pr92807-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr92865-1.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/pr93492-1.c73
-rw-r--r--gcc/testsuite/gcc.target/i386/pr93492-2.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/pr93492-3.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/pr93492-4.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr93492-5.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr94857.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/pr94913-1.c21
-rw-r--r--gcc/testsuite/gcc.target/i386/pr94913-2.c24
-rw-r--r--gcc/testsuite/gcc.target/i386/pr94956.c28
-rw-r--r--gcc/testsuite/gcc.target/i386/pr94980.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95021-1.c27
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95021-2.c39
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95021-3.c5
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95021-4.c28
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95021-5.c45
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95046-1.c62
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95046-2.c35
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95046-3.c42
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95046-4.c39
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95046-5.c44
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95046-6.c44
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95046-7.c25
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95046-8.c22
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95052.c20
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95125-avx.c27
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95125-avx512f.c37
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95169.c28
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95211.c38
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95255.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95355.c20
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95356.c125
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95443-1.c130
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95443-2.c79
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95464.c64
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95535-1.c54
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95535-2.c54
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95750.c19
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95778-1.c21
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95778-2.c21
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95791.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95866-1.c18
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95973.c25
-rw-r--r--gcc/testsuite/gcc.target/i386/pr96176.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/pr96189-1.c24
-rw-r--r--gcc/testsuite/gcc.target/i386/pr96189.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/pr96203-1.c18
-rw-r--r--gcc/testsuite/gcc.target/i386/pr96203-2.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr96539.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/serialize-1.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-12.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-13.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-14.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-22.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-23.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-mmx-18a.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-mmx-18b.c7
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-mmx-18c.c7
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-mmx-19a.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-mmx-19b.c7
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-mmx-19c.c7
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-mmx-19d.c7
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-mmx-19e.c7
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-shiftqihi-constant-1.c31
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-shiftqihi-constant-2.c62
-rw-r--r--gcc/testsuite/gcc.target/i386/strncmp-1.c47
-rw-r--r--gcc/testsuite/gcc.target/i386/tsxldtrk-1.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/vect-pr67800.c3
-rw-r--r--gcc/testsuite/gcc.target/i386/vperm-v2sf.c41
-rw-r--r--gcc/testsuite/gcc.target/i386/vperm-v2si.c41
-rw-r--r--gcc/testsuite/gcc.target/i386/vperm-v4hi.c47
-rw-r--r--gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c3
-rw-r--r--gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c3
-rw-r--r--gcc/testsuite/gcc.target/msp430/region-attribute-misuse.c1
-rw-r--r--gcc/testsuite/gcc.target/nvptx/cvt.c13
-rw-r--r--gcc/testsuite/gcc.target/nvptx/ia64-sync-1.c2
-rw-r--r--gcc/testsuite/gcc.target/nvptx/ia64-sync-2.c2
-rw-r--r--gcc/testsuite/gcc.target/nvptx/ia64-sync-3.c2
-rw-r--r--gcc/testsuite/gcc.target/nvptx/ia64-sync-4.c3
-rw-r--r--gcc/testsuite/gcc.target/nvptx/ia64-sync-5.c2
-rw-r--r--gcc/testsuite/gcc.target/nvptx/mul-hi.c15
-rw-r--r--gcc/testsuite/gcc.target/nvptx/mul-wide.c16
-rw-r--r--gcc/testsuite/gcc.target/nvptx/popc-1.c9
-rw-r--r--gcc/testsuite/gcc.target/nvptx/popc-2.c11
-rw-r--r--gcc/testsuite/gcc.target/nvptx/popc-3.c11
-rw-r--r--gcc/testsuite/gcc.target/nvptx/recip-1.c18
-rw-r--r--gcc/testsuite/gcc.target/nvptx/shift16.c30
-rw-r--r--gcc/testsuite/gcc.target/nvptx/umul-hi.c15
-rw-r--r--gcc/testsuite/gcc.target/nvptx/umul-wide.c16
-rw-r--r--gcc/testsuite/gcc.target/nvptx/v2si-cvt.c34
-rw-r--r--gcc/testsuite/gcc.target/nvptx/v2si-vec-set-extract.c25
-rw-r--r--gcc/testsuite/gcc.target/nvptx/vadd_add.c15
-rw-r--r--gcc/testsuite/gcc.target/nvptx/vsub_add.c25
-rw-r--r--gcc/testsuite/gcc.target/powerpc/20030218-1.c26
-rw-r--r--gcc/testsuite/gcc.target/powerpc/20030505.c21
-rw-r--r--gcc/testsuite/gcc.target/powerpc/20081204-1.c9
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bcd-1.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bcd-2.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bcd-3.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bswap-brd.c23
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bswap-brh.c11
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bswap-brw.c22
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-1-p9-runnable.c43
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-1.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-2-p9-runnable.c5
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-2.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-3-p9-runnable.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-3-runnable-p8.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-3.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-4-p9-runnable.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-4.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-5-p9-runnable.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-5.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-6-p9-runnable.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-6-runnable.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-7-p9-runnable.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-7-runnable.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-8-p9-runnable.c121
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-8-runnable.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-msum-runnable.c74
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-revb-runnable.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cfuged-0.c50
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cfuged-1.c50
-rw-r--r--gcc/testsuite/gcc.target/powerpc/clone3.c33
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cntlzdm-0.c56
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cntlzdm-1.c56
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cnttzdm-0.c53
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cnttzdm-1.c53
-rw-r--r--gcc/testsuite/gcc.target/powerpc/conv-vectorize-1.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/conv-vectorize-2.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/convert-fp-128.c20
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c5
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cpu-future.c6
-rw-r--r--gcc/testsuite/gcc.target/powerpc/dg-future-0.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/dg-future-1.c19
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-double1.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-double2.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-float1.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-float2.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-float3.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-long1.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-long2.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-vint1.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-vint2.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/doloop-2.c29
-rw-r--r--gcc/testsuite/gcc.target/powerpc/extend-divide-1.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/extend-divide-2.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-fma1.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-hw.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-hw10.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-hw11.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-hw2.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-hw3.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-hw4.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-hw5.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-hw6.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-hw7.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-hw8.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-hw9.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-minmax.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-odd.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-sqrt1.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/fold-vec-perm-char.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/fold-vec-perm-double.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/fold-vec-perm-float.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/fold-vec-perm-int.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/fold-vec-perm-longlong.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/fold-vec-perm-pixel.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/fold-vec-perm-short.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/localentry-1.c6
-rw-r--r--gcc/testsuite/gcc.target/powerpc/localentry-detect-1.c8
-rw-r--r--gcc/testsuite/gcc.target/powerpc/lsbb-runnable.c65
-rw-r--r--gcc/testsuite/gcc.target/powerpc/lsbb.c24
-rw-r--r--gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/mma-builtin-1.c313
-rw-r--r--gcc/testsuite/gcc.target/powerpc/mma-builtin-2.c72
-rw-r--r--gcc/testsuite/gcc.target/powerpc/mma-builtin-3.c31
-rw-r--r--gcc/testsuite/gcc.target/powerpc/mma-builtin-4.c28
-rw-r--r--gcc/testsuite/gcc.target/powerpc/mma-builtin-5.c31
-rw-r--r--gcc/testsuite/gcc.target/powerpc/mma-builtin-6.c18
-rwxr-xr-xgcc/testsuite/gcc.target/powerpc/mma-double-test.c186
-rwxr-xr-xgcc/testsuite/gcc.target/powerpc/mma-single-test.c194
-rw-r--r--gcc/testsuite/gcc.target/powerpc/mma-supported.c25
-rw-r--r--gcc/testsuite/gcc.target/powerpc/notoc-direct-1.c6
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p10-arch31.c25
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p10-identify.c26
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p8vector-int128-1.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p8vector-int128-2.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-1.h18
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-2.h17
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-3.h31
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-4.h24
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-5.h29
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-6.h32
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-7.h20
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-8.h14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-1.c15
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-2.c15
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-3.c18
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-4.c15
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-5.c15
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-6.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-7.c11
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-8.c12
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-1.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-2.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-3.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-4.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-5.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-6.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-7.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-8.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-1.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-2.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-3.c17
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-4.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-5.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-6.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-7.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-8.c12
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-1.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-2.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-3.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-4.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-5.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-6.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-7.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-8.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-1.h34
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-2.h36
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-3.h34
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-4.h62
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-5.h45
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-6.h52
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-7.h16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-8.h27
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length.h14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pack01.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pack02.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pack03.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pcrel-sibcall-1.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pdep-0.c48
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pdep-1.c48
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pextd-0.c50
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pextd-1.c49
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppc-spe.c663
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppc-spe64-1.c7
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr52457.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr60102.c11
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr60158.c89
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr60735.c11
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr71309.c34
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr71763.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr78458.c15
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr80343.c50
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr88845.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr89310.c17
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr90763.c5
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr91275.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr92488.c43
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr92796.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr93122.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr93658.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr93800.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr94740.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr95907.c7
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr96125.c47
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr96446.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr96493.c30
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr96506.c66
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr96530.c20
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-add.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-di-constant.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c161
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-large-dd.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-large-df.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-large-di.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-large-hi.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-large-kf.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-large-qi.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-large-sd.c20
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-large-sf.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-large-si.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-large-udi.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-large-uhi.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-large-uqi.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-large-usi.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-large-v2df.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-large.h40
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-no-update.c51
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-pcrel-dd.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-pcrel-df.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-pcrel-di.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-pcrel-hi.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-pcrel-kf.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-pcrel-qi.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sd.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sf.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-pcrel-si.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-pcrel-udi.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uhi.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uqi.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-pcrel-usi.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-pcrel-v2df.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-pcrel.h41
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-si-constant.c12
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-stack-protect.c21
-rw-r--r--gcc/testsuite/gcc.target/powerpc/quad-atomic.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/recip-6.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/recip-7.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/setbc.h27
-rw-r--r--gcc/testsuite/gcc.target/powerpc/setbceq.c9
-rw-r--r--gcc/testsuite/gcc.target/powerpc/setbcge.c12
-rw-r--r--gcc/testsuite/gcc.target/powerpc/setbcgt.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/setbcle.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/setbclt.c12
-rw-r--r--gcc/testsuite/gcc.target/powerpc/setbcne.c9
-rw-r--r--gcc/testsuite/gcc.target/powerpc/setnbc.h27
-rw-r--r--gcc/testsuite/gcc.target/powerpc/setnbceq.c9
-rw-r--r--gcc/testsuite/gcc.target/powerpc/setnbcge.c12
-rw-r--r--gcc/testsuite/gcc.target/powerpc/setnbcgt.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/setnbcle.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/setnbclt.c12
-rw-r--r--gcc/testsuite/gcc.target/powerpc/setnbcne.c9
-rw-r--r--gcc/testsuite/gcc.target/powerpc/spe-evmerge.c71
-rw-r--r--gcc/testsuite/gcc.target/powerpc/spe-small-data-1.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/spe-small-data-2.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/spe-unwind-1.c116
-rw-r--r--gcc/testsuite/gcc.target/powerpc/spe-vector-memcpy.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/spe-vector-memset.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/spe1.c15
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-blend-runnable.c276
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-cfuged-0.c61
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-cfuged-1.c60
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-clrl-0.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-clrl-1.c37
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-clrl-2.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-clrl-3.c37
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-clrr-0.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-clrr-1.c37
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-clrr-2.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-clrr-3.c37
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-cntlzm-0.c54
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-cntlzm-1.c54
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-cnttzm-0.c54
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-cnttzm-1.c53
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extracth-0.c33
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extracth-1.c32
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extracth-2.c31
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extracth-3.c30
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extracth-4.c31
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extracth-5.c29
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extracth-6.c31
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extracth-7.c30
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extracth-be-0.c33
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extracth-be-1.c31
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extracth-be-2.c31
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extracth-be-3.c31
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extractl-0.c33
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extractl-1.c32
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extractl-2.c31
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extractl-3.c30
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extractl-4.c31
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extractl-5.c29
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extractl-6.c31
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extractl-7.c30
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extractl-be-0.c33
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extractl-be-1.c31
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extractl-be-2.c31
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-extractl-be-3.c31
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-gnb-0.c74
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-gnb-1.c73
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-gnb-2.c73
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-insert-word-runnable.c345
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-mult-char-2.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-pdep-0.c61
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-pdep-1.c53
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-permute-ext-runnable.c294
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-pext-0.c53
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-pext-1.c52
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-replace-word-runnable.c289
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-shift-double-runnable.c384
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c166
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-0.c21
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-1.c52
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-10.c27
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-11.c29
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-12.c27
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-13.c28
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-14.c27
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-15.c28
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-16.c56
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-17.c54
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-18.c56
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-19.c54
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-2.c21
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-20.c46
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-21.c44
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-22.c44
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-23.c42
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-3.c52
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-4.c21
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-5.c45
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-6.c21
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-7.c43
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-8.c27
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril-9.c28
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril_p-0.c24
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril_p-1.c41
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril_p-10.c37
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril_p-11.c37
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril_p-2.c23
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril_p-3.c40
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril_p-4.c23
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril_p-5.c35
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril_p-6.c23
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril_p-7.c36
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril_p-8.c42
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-stril_p-9.c42
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-0.c21
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-1.c52
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-10.c27
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-11.c28
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-12.c28
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-13.c29
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-14.c27
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-15.c28
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-16.c56
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-17.c54
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-18.c56
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-19.c54
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-2.c21
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-20.c48
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-21.c46
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-22.c48
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-23.c46
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-3.c52
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-4.c21
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-5.c44
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-6.c21
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-7.c44
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-8.c27
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir-9.c28
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir_p-0.c23
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir_p-1.c39
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir_p-10.c46
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir_p-11.c38
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir_p-2.c23
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir_p-3.c40
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir_p-4.c23
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir_p-5.c44
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir_p-6.c23
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir_p-7.c36
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir_p-8.c43
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-strir_p-9.c42
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-0.c120
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-1.c119
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-10.c130
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-2.c105
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-3.c106
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-4.c104
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-5.c103
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-6.c104
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-7.c103
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-8.c129
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-9.c130
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vector_float.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-builtin-msum.c26
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vector-1.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vector-2.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vector-3.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vector-4.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vector-5.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p8.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p9.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vector-abss.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-1.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c8
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c8
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-8.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx_mask-count-runnable.c149
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx_mask-expand-runnable.c194
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx_mask-extract-runnable.c162
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx_mask-move-runnable.c225
-rw-r--r--gcc/testsuite/gcc.target/powerpc/xxgenpc-runnable.c231
-rw-r--r--gcc/testsuite/gcc.target/pru/clobber-sp.c24
-rw-r--r--gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-1.c5
-rw-r--r--gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-2.c10
-rw-r--r--gcc/testsuite/gcc.target/riscv/arch-3.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/arch-5.c5
-rw-r--r--gcc/testsuite/gcc.target/riscv/arch-6.c5
-rw-r--r--gcc/testsuite/gcc.target/riscv/attribute-11.c6
-rw-r--r--gcc/testsuite/gcc.target/riscv/attribute-12.c6
-rw-r--r--gcc/testsuite/gcc.target/riscv/attribute-13.c6
-rw-r--r--gcc/testsuite/gcc.target/riscv/attribute-9.c4
-rw-r--r--gcc/testsuite/gcc.target/riscv/pr91441.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/pr95252.c47
-rw-r--r--gcc/testsuite/gcc.target/riscv/pr95683.c10
-rw-r--r--gcc/testsuite/gcc.target/riscv/pr96260.c9
-rw-r--r--gcc/testsuite/gcc.target/riscv/read-thread-pointer.c7
-rw-r--r--gcc/testsuite/gcc.target/riscv/save-restore-9.c23
-rw-r--r--gcc/testsuite/gcc.target/riscv/shorten-memrefs-1.c26
-rw-r--r--gcc/testsuite/gcc.target/riscv/shorten-memrefs-2.c51
-rw-r--r--gcc/testsuite/gcc.target/riscv/shorten-memrefs-3.c39
-rw-r--r--gcc/testsuite/gcc.target/riscv/shorten-memrefs-4.c26
-rw-r--r--gcc/testsuite/gcc.target/riscv/shorten-memrefs-5.c53
-rw-r--r--gcc/testsuite/gcc.target/riscv/shorten-memrefs-6.c39
-rw-r--r--gcc/testsuite/gcc.target/riscv/shorten-memrefs-7.c46
-rw-r--r--gcc/testsuite/gcc.target/riscv/zero-extend-5.c8
-rw-r--r--gcc/testsuite/gcc.target/s390/20200617.c23
-rw-r--r--gcc/testsuite/gcc.target/s390/pr96127.c29
-rw-r--r--gcc/testsuite/gcc.target/s390/pr96456.c13
-rw-r--r--gcc/testsuite/gcc.target/s390/stack-clash-1.c17
-rw-r--r--gcc/testsuite/gcc.target/s390/stack-clash-2.c17
-rw-r--r--gcc/testsuite/gcc.target/s390/stack-clash-3.c17
-rw-r--r--gcc/testsuite/gcc.target/s390/vector/align-1.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/vector/align-2.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/vector/pr96128.c35
-rw-r--r--gcc/testsuite/gcc.target/xtensa/mabi-call0.c13
-rw-r--r--gcc/testsuite/gcc.target/xtensa/mabi-windowed.c13
-rw-r--r--gcc/testsuite/gdc.dg/array1.d14
-rw-r--r--gcc/testsuite/gdc.dg/asm1.d8
-rw-r--r--gcc/testsuite/gdc.dg/compilable.d444
-rw-r--r--gcc/testsuite/gdc.dg/gdc108.d19
-rw-r--r--gcc/testsuite/gdc.dg/gdc115.d16
-rw-r--r--gcc/testsuite/gdc.dg/gdc121.d4
-rw-r--r--gcc/testsuite/gdc.dg/gdc122.d36
-rw-r--r--gcc/testsuite/gdc.dg/gdc127.d6
-rw-r--r--gcc/testsuite/gdc.dg/gdc131.d15
-rw-r--r--gcc/testsuite/gdc.dg/gdc133.d16
-rw-r--r--gcc/testsuite/gdc.dg/gdc141.d14
-rw-r--r--gcc/testsuite/gdc.dg/gdc142.d15
-rw-r--r--gcc/testsuite/gdc.dg/gdc15.d35
-rw-r--r--gcc/testsuite/gdc.dg/gdc17.d37
-rw-r--r--gcc/testsuite/gdc.dg/gdc170.d21
-rw-r--r--gcc/testsuite/gdc.dg/gdc171.d38
-rw-r--r--gcc/testsuite/gdc.dg/gdc179.d32
-rw-r--r--gcc/testsuite/gdc.dg/gdc183.d60
-rw-r--r--gcc/testsuite/gdc.dg/gdc186.d60
-rw-r--r--gcc/testsuite/gdc.dg/gdc187.d40
-rw-r--r--gcc/testsuite/gdc.dg/gdc19.d8
-rw-r--r--gcc/testsuite/gdc.dg/gdc191.d201
-rw-r--r--gcc/testsuite/gdc.dg/gdc194.d9
-rw-r--r--gcc/testsuite/gdc.dg/gdc196.d21
-rw-r--r--gcc/testsuite/gdc.dg/gdc198.d71
-rw-r--r--gcc/testsuite/gdc.dg/gdc200.d16
-rw-r--r--gcc/testsuite/gdc.dg/gdc204.d12
-rw-r--r--gcc/testsuite/gdc.dg/gdc210.d62
-rw-r--r--gcc/testsuite/gdc.dg/gdc212.d48
-rw-r--r--gcc/testsuite/gdc.dg/gdc213.d17
-rw-r--r--gcc/testsuite/gdc.dg/gdc218.d41
-rw-r--r--gcc/testsuite/gdc.dg/gdc223.d43
-rw-r--r--gcc/testsuite/gdc.dg/gdc231.d13
-rw-r--r--gcc/testsuite/gdc.dg/gdc239.d10
-rw-r--r--gcc/testsuite/gdc.dg/gdc24.d15
-rw-r--r--gcc/testsuite/gdc.dg/gdc240.d16
-rw-r--r--gcc/testsuite/gdc.dg/gdc241.d6
-rw-r--r--gcc/testsuite/gdc.dg/gdc242a.d24
-rw-r--r--gcc/testsuite/gdc.dg/gdc242b.d25
-rw-r--r--gcc/testsuite/gdc.dg/gdc248.d44
-rw-r--r--gcc/testsuite/gdc.dg/gdc250.d18
-rw-r--r--gcc/testsuite/gdc.dg/gdc251.d6
-rw-r--r--gcc/testsuite/gdc.dg/gdc253a.d10
-rw-r--r--gcc/testsuite/gdc.dg/gdc253b.d19
-rw-r--r--gcc/testsuite/gdc.dg/gdc255.d83
-rw-r--r--gcc/testsuite/gdc.dg/gdc256.d5
-rw-r--r--gcc/testsuite/gdc.dg/gdc261.d19
-rw-r--r--gcc/testsuite/gdc.dg/gdc27.d18
-rw-r--r--gcc/testsuite/gdc.dg/gdc273.d19
-rw-r--r--gcc/testsuite/gdc.dg/gdc280.d30
-rw-r--r--gcc/testsuite/gdc.dg/gdc284.d10
-rw-r--r--gcc/testsuite/gdc.dg/gdc285.d15
-rw-r--r--gcc/testsuite/gdc.dg/gdc286.d37
-rw-r--r--gcc/testsuite/gdc.dg/gdc300.d (renamed from gcc/testsuite/gdc.dg/link.d)18
-rw-r--r--gcc/testsuite/gdc.dg/gdc309.d41
-rw-r--r--gcc/testsuite/gdc.dg/gdc31.d25
-rw-r--r--gcc/testsuite/gdc.dg/gdc35.d73
-rw-r--r--gcc/testsuite/gdc.dg/gdc36.d125
-rw-r--r--gcc/testsuite/gdc.dg/gdc37.d16
-rw-r--r--gcc/testsuite/gdc.dg/gdc4.d9
-rw-r--r--gcc/testsuite/gdc.dg/gdc43.d29
-rw-r--r--gcc/testsuite/gdc.dg/gdc47.d12
-rw-r--r--gcc/testsuite/gdc.dg/gdc51.d29
-rw-r--r--gcc/testsuite/gdc.dg/gdc57.d21
-rw-r--r--gcc/testsuite/gdc.dg/gdc66.d14
-rw-r--r--gcc/testsuite/gdc.dg/gdc67.d4
-rw-r--r--gcc/testsuite/gdc.dg/gdc71.d27
-rw-r--r--gcc/testsuite/gdc.dg/gdc77.d11
-rw-r--r--gcc/testsuite/gdc.dg/imports/gdc239.d22
-rw-r--r--gcc/testsuite/gdc.dg/imports/gdc241a.d4
-rw-r--r--gcc/testsuite/gdc.dg/imports/gdc241b.d1
-rw-r--r--gcc/testsuite/gdc.dg/imports/gdc251a.d2
-rw-r--r--gcc/testsuite/gdc.dg/imports/gdc253a.d (renamed from gcc/testsuite/gdc.dg/imports/gdc253.d)2
-rw-r--r--gcc/testsuite/gdc.dg/imports/gdc253b.d12
-rw-r--r--gcc/testsuite/gdc.dg/imports/gdc36.d8
-rw-r--r--gcc/testsuite/gdc.dg/imports/runnable.d23
-rw-r--r--gcc/testsuite/gdc.dg/init1.d9
-rw-r--r--gcc/testsuite/gdc.dg/intrinsics.d123
-rw-r--r--gcc/testsuite/gdc.dg/lto/ltotests_0.d2
-rw-r--r--gcc/testsuite/gdc.dg/pr94970.d20
-rw-r--r--gcc/testsuite/gdc.dg/pr95173.d10
-rw-r--r--gcc/testsuite/gdc.dg/pr95250.d18
-rw-r--r--gcc/testsuite/gdc.dg/pr96140.d15
-rw-r--r--gcc/testsuite/gdc.dg/pr96152.d32
-rw-r--r--gcc/testsuite/gdc.dg/pr96153.d31
-rw-r--r--gcc/testsuite/gdc.dg/pr96154a.d18
-rw-r--r--gcc/testsuite/gdc.dg/pr96154b.d19
-rw-r--r--gcc/testsuite/gdc.dg/pr96254a.d28
-rw-r--r--gcc/testsuite/gdc.dg/pr96254b.d24
-rw-r--r--gcc/testsuite/gdc.dg/pr96429.d26
-rw-r--r--gcc/testsuite/gdc.dg/runnable.d1394
-rw-r--r--gcc/testsuite/gdc.dg/runnable2.d244
-rw-r--r--gcc/testsuite/gdc.dg/simd.d2
-rw-r--r--gcc/testsuite/gdc.test/compilable/b9490.d39
-rw-r--r--gcc/testsuite/gdc.test/compilable/ice14739.d19
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/fail17492.d20
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/ice21060.d15
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/imports/ice21060a/package.d1
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/imports/ice21060b/package.d5
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/imports/ice21060c/package.d1
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/imports/ice21060d/package.d5
-rw-r--r--gcc/testsuite/gdc.test/runnable/b16278.d6
-rw-r--r--gcc/testsuite/gfortran.dg/PR85868A.f9047
-rw-r--r--gcc/testsuite/gfortran.dg/PR85868B.f90144
-rw-r--r--gcc/testsuite/gfortran.dg/PR94022.f90132
-rw-r--r--gcc/testsuite/gfortran.dg/PR95214.f9084
-rw-r--r--gcc/testsuite/gfortran.dg/PR95331.f90163
-rw-r--r--gcc/testsuite/gfortran.dg/assignment_4.f902
-rw-r--r--gcc/testsuite/gfortran.dg/char4-subscript.f9030
-rw-r--r--gcc/testsuite/gfortran.dg/coarray/pr93671.f9024
-rw-r--r--gcc/testsuite/gfortran.dg/coarray_lib_comm_1.f905
-rw-r--r--gcc/testsuite/gfortran.dg/dec_structure_23.f904
-rw-r--r--gcc/testsuite/gfortran.dg/dependency_59.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/diagnostic-format-json-1.F905
-rw-r--r--gcc/testsuite/gfortran.dg/diagnostic-format-json-2.F905
-rw-r--r--gcc/testsuite/gfortran.dg/diagnostic-format-json-3.F905
-rw-r--r--gcc/testsuite/gfortran.dg/do_check_13.f9086
-rw-r--r--gcc/testsuite/gfortran.dg/do_check_14.f9056
-rw-r--r--gcc/testsuite/gfortran.dg/do_check_15.f9058
-rw-r--r--gcc/testsuite/gfortran.dg/do_check_4.f9024
-rw-r--r--gcc/testsuite/gfortran.dg/elemental_optional_args_6.f904
-rw-r--r--gcc/testsuite/gfortran.dg/equiv_11.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/erf_3.F903
-rw-r--r--gcc/testsuite/gfortran.dg/error_recovery_1.f904
-rw-r--r--gcc/testsuite/gfortran.dg/finalize_28.f902
-rw-r--r--gcc/testsuite/gfortran.dg/finalize_33.f902
-rw-r--r--gcc/testsuite/gfortran.dg/finalize_34.f902
-rw-r--r--gcc/testsuite/gfortran.dg/finalize_35.f9048
-rw-r--r--gcc/testsuite/gfortran.dg/finalize_36.f9039
-rw-r--r--gcc/testsuite/gfortran.dg/findloc_8.f9029
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_en.f906
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_en_rd.f90185
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_en_rn.f90185
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_en_ru.f90185
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_en_rz.f90185
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/attach-descriptor.f9029
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/finalize-1.f8
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/mapping-tests-3.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/mapping-tests-4.f9017
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/pure-elemental-procedures-2.f9027
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/uninit-dim-clause.f9512
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/uninit-firstprivate-clause.f952
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/uninit-if-clause.f958
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/uninit-use-device-clause.f952
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/appendix-a/a.24.1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/cancel-2.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/cancel-3.f9035
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/collapse1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/collapse2.f9032
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/combined-if.f90109
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/crayptr3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/gomp.exp2
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/gridify-1.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/if-1.f90122
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-1.f9082
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-2.f9046
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-3.f9061
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-4.f9028
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-5.f9047
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/map-1.f9035
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/map-2.f906
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/map-3.f9038
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/map-4.f907
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/map-alloc-comp-1.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/nontemporal-1.f9025
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/nontemporal-2.f9026
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/openmp-simd-4.f9065
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/order-3.f90227
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/order-4.f9034
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr33439.f907
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr44036-1.f904
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr44085.f902
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr44536.f902
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr79154-1.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr79154-2.f9030
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr79154-simd.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr94672.f90127
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr95869.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/requires-1.f9013
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/requires-2.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/requires-3.f904
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/requires-4.f9036
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/requires-5.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/requires-6.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/requires-7.f9041
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/requires-8.f9022
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/requires-9.f9085
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/sharing-1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/sharing-2.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/sharing-3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/target-exit-data.f9020
-rw-r--r--gcc/testsuite/gfortran.dg/implicit_pure_5.c7
-rw-r--r--gcc/testsuite/gfortran.dg/implicit_pure_5.f9063
-rw-r--r--gcc/testsuite/gfortran.dg/interface_47.f9019
-rw-r--r--gcc/testsuite/gfortran.dg/interface_48.f9031
-rw-r--r--gcc/testsuite/gfortran.dg/loop_interchange_2.f20
-rw-r--r--gcc/testsuite/gfortran.dg/missing_optional_dummy_6a.f903
-rw-r--r--gcc/testsuite/gfortran.dg/module_procedure_4.f9063
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_97.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/pr39695_1.f908
-rw-r--r--gcc/testsuite/gfortran.dg/pr39695_2.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/pr39695_3.f9011
-rw-r--r--gcc/testsuite/gfortran.dg/pr39695_4.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/pr45337_1.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/pr45337_2.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/pr50392.f12
-rw-r--r--gcc/testsuite/gfortran.dg/pr53298.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/pr59107.f9011
-rw-r--r--gcc/testsuite/gfortran.dg/pr66545_2.f908
-rw-r--r--gcc/testsuite/gfortran.dg/pr71706.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/pr88025.f902
-rw-r--r--gcc/testsuite/gfortran.dg/pr88379.f9011
-rw-r--r--gcc/testsuite/gfortran.dg/pr89574.f9029
-rw-r--r--gcc/testsuite/gfortran.dg/pr91589.f902
-rw-r--r--gcc/testsuite/gfortran.dg/pr92993.f9021
-rw-r--r--gcc/testsuite/gfortran.dg/pr93337.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/pr93366.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/pr93423.f9021
-rw-r--r--gcc/testsuite/gfortran.dg/pr93497.f908
-rw-r--r--gcc/testsuite/gfortran.dg/pr93499.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/pr93714_1.f904
-rw-r--r--gcc/testsuite/gfortran.dg/pr93714_2.f904
-rw-r--r--gcc/testsuite/gfortran.dg/pr94397.F9026
-rw-r--r--gcc/testsuite/gfortran.dg/pr95053.f7
-rw-r--r--gcc/testsuite/gfortran.dg/pr95053_2.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/pr95053_3.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/pr95088.f9031
-rw-r--r--gcc/testsuite/gfortran.dg/pr95089.f9011
-rw-r--r--gcc/testsuite/gfortran.dg/pr95090.f9019
-rw-r--r--gcc/testsuite/gfortran.dg/pr95091.f9019
-rw-r--r--gcc/testsuite/gfortran.dg/pr95104.f908
-rw-r--r--gcc/testsuite/gfortran.dg/pr95340.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/pr95373_1.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/pr95373_2.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/pr95446.f9038
-rw-r--r--gcc/testsuite/gfortran.dg/pr95500.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/pr95503.f907
-rw-r--r--gcc/testsuite/gfortran.dg/pr95544.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/pr95584.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/pr95585.f906
-rw-r--r--gcc/testsuite/gfortran.dg/pr95586_1.f909
-rw-r--r--gcc/testsuite/gfortran.dg/pr95586_2.f9011
-rw-r--r--gcc/testsuite/gfortran.dg/pr95587.f9013
-rw-r--r--gcc/testsuite/gfortran.dg/pr95611.f907
-rw-r--r--gcc/testsuite/gfortran.dg/pr95612.f907
-rw-r--r--gcc/testsuite/gfortran.dg/pr95687.f9019
-rw-r--r--gcc/testsuite/gfortran.dg/pr95688.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/pr95689.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/pr95690.f909
-rw-r--r--gcc/testsuite/gfortran.dg/pr95707.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/pr95708.f906
-rw-r--r--gcc/testsuite/gfortran.dg/pr95709.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/pr95826.f9020
-rw-r--r--gcc/testsuite/gfortran.dg/pr95827.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/pr95828.f9021
-rw-r--r--gcc/testsuite/gfortran.dg/pr95829.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/pr95880.f909
-rw-r--r--gcc/testsuite/gfortran.dg/pr95881.f9011
-rw-r--r--gcc/testsuite/gfortran.dg/pr95978.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/pr95980.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/pr95980_2.f9011
-rw-r--r--gcc/testsuite/gfortran.dg/pr95981.f909
-rw-r--r--gcc/testsuite/gfortran.dg/pr96038.f908
-rw-r--r--gcc/testsuite/gfortran.dg/pr96085.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/pr96086.f908
-rw-r--r--gcc/testsuite/gfortran.dg/pr96102.f9027
-rw-r--r--gcc/testsuite/gfortran.dg/pr96312.f9030
-rw-r--r--gcc/testsuite/gfortran.dg/pr96319.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/pr96325.f9021
-rw-r--r--gcc/testsuite/gfortran.dg/random_seed_4.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/recursive_check_16.f9025
-rw-r--r--gcc/testsuite/gfortran.dg/round_3.f0826
-rw-r--r--gcc/testsuite/gfortran.dg/select_type_49.f9043
-rw-r--r--gcc/testsuite/gfortran.dg/use_15.f902
-rw-r--r--gcc/testsuite/gfortran.dg/vect/pr95403.f16
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/execute/forall_5.f908
-rw-r--r--gcc/testsuite/gnat.dg/addr15.adb19
-rw-r--r--gcc/testsuite/gnat.dg/aggr30.adb20
-rw-r--r--gcc/testsuite/gnat.dg/aggr30.ads25
-rw-r--r--gcc/testsuite/gnat.dg/array39.adb13
-rw-r--r--gcc/testsuite/gnat.dg/array39_pkg.adb20
-rw-r--r--gcc/testsuite/gnat.dg/array39_pkg.ads25
-rw-r--r--gcc/testsuite/gnat.dg/array40.adb21
-rw-r--r--gcc/testsuite/gnat.dg/array40_pkg.ads12
-rw-r--r--gcc/testsuite/gnat.dg/debug16.adb27
-rw-r--r--gcc/testsuite/gnat.dg/openacc1.adb12
-rw-r--r--gcc/testsuite/gnat.dg/opt83.adb33
-rw-r--r--gcc/testsuite/gnat.dg/opt84.adb74
-rw-r--r--gcc/testsuite/gnat.dg/opt85.adb20
-rw-r--r--gcc/testsuite/gnat.dg/opt85.ads27
-rw-r--r--gcc/testsuite/gnat.dg/opt86_pkg.ads8
-rw-r--r--gcc/testsuite/gnat.dg/opt86a.adb36
-rw-r--r--gcc/testsuite/gnat.dg/opt86b.adb37
-rw-r--r--gcc/testsuite/gnat.dg/opt86c.adb37
-rw-r--r--gcc/testsuite/gnat.dg/opt87.adb12
-rw-r--r--gcc/testsuite/gnat.dg/opt87_pkg.adb12
-rw-r--r--gcc/testsuite/gnat.dg/opt87_pkg.ads6
-rw-r--r--gcc/testsuite/gnat.dg/renaming16.adb11
-rw-r--r--gcc/testsuite/gnat.dg/renaming16_pkg.ads34
-rw-r--r--gcc/testsuite/gnat.dg/rep_clause8.adb4
-rw-r--r--gcc/testsuite/go.dg/arrayclear.go3
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/issue4085b.go4
-rw-r--r--gcc/testsuite/jit.dg/all-non-failing-tests.h33
-rw-r--r--gcc/testsuite/jit.dg/jit.exp25
-rw-r--r--gcc/testsuite/jit.dg/test-builtin-memcpy.c69
-rw-r--r--gcc/testsuite/jit.dg/test-builtin-unreachable.c49
-rw-r--r--gcc/testsuite/jit.dg/test-error-gcc_jit_context_get_builtin_function-unimplemented-type.c20
-rw-r--r--gcc/testsuite/jit.dg/test-error-gcc_jit_context_new_global-void-type.c25
-rw-r--r--gcc/testsuite/jit.dg/test-error-gcc_jit_function_new_local-void-type.c27
-rw-r--r--gcc/testsuite/jit.dg/test-fuzzer.c2
-rw-r--r--gcc/testsuite/jit.dg/test-pr95306-builtin-types.c23
-rw-r--r--gcc/testsuite/jit.dg/test-pr95314-rvalue-reuse.c56
-rw-r--r--gcc/testsuite/lib/brig.exp2
-rw-r--r--gcc/testsuite/lib/c-compat.exp26
-rw-r--r--gcc/testsuite/lib/gcc-defs.exp67
-rw-r--r--gcc/testsuite/lib/gcc-dg.exp26
-rw-r--r--gcc/testsuite/lib/gcov.exp2
-rw-r--r--gcc/testsuite/lib/gdc-utils.exp18
-rw-r--r--gcc/testsuite/lib/options.exp4
-rw-r--r--gcc/testsuite/lib/profopt.exp14
-rw-r--r--gcc/testsuite/lib/prune.exp21
-rw-r--r--gcc/testsuite/lib/scandump.exp59
-rw-r--r--gcc/testsuite/lib/scanlang.exp51
-rw-r--r--gcc/testsuite/lib/scanltranstree.exp20
-rw-r--r--gcc/testsuite/lib/scanoffload.exp61
-rw-r--r--gcc/testsuite/lib/scanoffloadrtl.exp49
-rw-r--r--gcc/testsuite/lib/scanoffloadtree.exp51
-rw-r--r--gcc/testsuite/lib/scanwpaipa.exp24
-rw-r--r--gcc/testsuite/lib/target-supports-dg.exp28
-rw-r--r--gcc/testsuite/lib/target-supports.exp257
-rw-r--r--gcc/testsuite/lib/ubsan-dg.exp22
-rw-r--r--gcc/testsuite/obj-c++.dg/attributes/method-nonnull-1.mm8
-rw-r--r--gcc/testsuite/obj-c++.dg/property/property-neg-6.mm2
-rw-r--r--gcc/testsuite/obj-c++.dg/syntax-error-10.mm3
-rw-r--r--gcc/testsuite/obj-c++.dg/syntax-error-8.mm2
-rw-r--r--gcc/testsuite/obj-c++.dg/syntax-error-9.mm2
-rw-r--r--gcc/testsuite/obj-c++.dg/try-catch-9.mm2
-rw-r--r--gcc/testsuite/objc.dg/attributes/method-nonnull-1.m8
-rw-r--r--gcc/testsuite/objc/execute/exceptions/matcher-1.m2
3016 files changed, 59186 insertions, 7381 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 92a7e1923a4..9e4e5891b17 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,14 +1,6347 @@
-2020-06-05 Giuliano Belinassi <giuliano.belinassi@usp.br>
+2020-08-14 Martin Sebor <msebor@redhat.com>
- * gcc.dg/driver/driver.exp: New test.
- * gcc.dg/driver/empty.c: New file.
+ PR middle-end/78257
+ * gcc.dg/memchr.c: New test.
+ * gcc.dg/memcmp-2.c: New test.
+ * gcc.dg/memcmp-3.c: New test.
+ * gcc.dg/memcmp-4.c: New test.
-2020-05-27 Giuliano Belinassi <giuliano.belinassi@usp.br>
+2020-08-14 David Malcolm <dmalcolm@redhat.com>
- * gcc.dg/driver/driver.exp: New test.
- * gcc.dg/driver/a.c: New file.
- * gcc.dg/driver/b.c: New file.
- * gcc.dg/driver/a.c: New file.
+ PR analyzer/96611
+ * gcc.dg/analyzer/pr96611.c: New test.
+
+2020-08-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/90254
+ PR c++/93711
+ * g++.dg/cpp1z/aggr-base10.C: New test.
+ * g++.dg/cpp2a/no_unique_address7.C: New test.
+ * g++.dg/cpp2a/no_unique_address7a.C: New test.
+
+2020-08-14 Lewis Hyatt <lhyatt@gmail.com>
+
+ * lib/prune.exp: Change TEST_ALWAYS_FLAGS to use -fdiagnostics-plain-output.
+ * lib/c-compat.exp: Adapt to the prune.exp change.
+
+2020-08-14 Tom de Vries <tdevries@suse.de>
+
+ * gcc.dg/torture/pr92088-1.c: Add require-effective-target alloca.
+ * gcc.dg/torture/pr92088-2.c: Same.
+ * gcc.dg/torture/pr93124.c: Same.
+ * gcc.dg/torture/pr94479.c: Same.
+ * gcc.dg/tree-ssa/builtin-sprintf-warn-22.c: Same.
+
+2020-08-13 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/96598
+ * gcc.dg/analyzer/pr96598.c: New test.
+
+2020-08-13 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/93032
+ PR analyzer/93938
+ PR analyzer/94011
+ PR analyzer/94099
+ PR analyzer/94399
+ PR analyzer/94458
+ PR analyzer/94503
+ PR analyzer/94640
+ PR analyzer/94688
+ PR analyzer/94689
+ PR analyzer/94839
+ PR analyzer/95026
+ PR analyzer/95042
+ PR analyzer/95240
+ * g++.dg/analyzer/pr93212.C: Add dg-warning for dangling
+ reference.
+ * g++.dg/analyzer/pr93950.C: Remove xfail.
+ * g++.dg/analyzer/pr94011.C: New test.
+ * g++.dg/analyzer/pr94028.C: Remove leak false positives; mark as
+ failing on C++98.
+ * g++.dg/analyzer/pr94503.C: New test.
+ * g++.dg/analyzer/pr95042.C: New test.
+ * gcc.dg/analyzer/CVE-2005-1689-dedupe-issue-2.c: New test.
+ * gcc.dg/analyzer/CVE-2005-1689-dedupe-issue.c: Add xfail.
+ * gcc.dg/analyzer/CVE-2005-1689-minimal.c:
+ Include "analyzer-decls.h".
+ (test_4, test_5, test_6, test_7, test_8): New tests.
+ * gcc.dg/analyzer/abs-1.c: New test.
+ * gcc.dg/analyzer/aliasing-1.c: New test.
+ * gcc.dg/analyzer/aliasing-2.c: New test.
+ * gcc.dg/analyzer/analyzer-decls.h (__analyzer_describe): New
+ decl.
+ (__analyzer_dump_num_heap_regions): Remove.
+ * gcc.dg/analyzer/attribute-nonnull.c: Add dg-warnings for cases
+ where NULL is directly used as an argument.
+ * gcc.dg/analyzer/bzero-1.c: New test.
+ * gcc.dg/analyzer/casts-1.c: New test.
+ * gcc.dg/analyzer/casts-2.c: New test.
+ * gcc.dg/analyzer/compound-assignment-1.c
+ (test_4): Remove xfail from leak false positive.
+ (called_by_test_5a): Add "allocated here" expected message.
+ (called_by_test_5b): Make expected leak message more precise.
+ * gcc.dg/analyzer/compound-assignment-3.c: Update expected leak
+ message.
+ * gcc.dg/analyzer/compound-assignment-4.c: New test.
+ * gcc.dg/analyzer/compound-assignment-5.c: New test.
+ * gcc.dg/analyzer/conditionals-notrans.c: Remove xfails.
+ * gcc.dg/analyzer/data-model-1.c (test_12d): Update expected
+ results.
+ (test_13): Remove xfail.
+ (test_14): Remove xfail.
+ (test_15): Remove xfail.
+ (test_16): Remove xfails. Add out-of-bounds access.
+ (test_16_alt): Remove xfails.
+ (test_23): Remove xfail.
+ (test_24): Remove xfail.
+ (test_25): Remove xfail.
+ (test_26): Update expected result. Remove xfail. Add xfail.
+ (test_27): Remove xfails.
+ (test_29): Add __analyzer_eval pointer comparisons.
+ (test_41): Generalize expected output for u.ptr comparison with
+ NULL for targets where this could be known to be false.
+ (test_42): Remove xfail.
+ (test_51): Remove xfails.
+ * gcc.dg/analyzer/data-model-13.c: Update for improvements to
+ source location and wording of leak message.
+ * gcc.dg/analyzer/data-model-14.c: Remove -fanalyzer-fine-grained.
+ (test_1): Update for improvement to expected message.
+ (test_2): Remove xfail.
+ * gcc.dg/analyzer/data-model-18.c: Remove xfail.
+ * gcc.dg/analyzer/data-model-20.c: New test.
+ * gcc.dg/analyzer/data-model-5.c: Add dg-warning for deref of
+ NULL. Add xfailing false leak.
+ * gcc.dg/analyzer/data-model-5b.c: Add xfailing false leak.
+ * gcc.dg/analyzer/data-model-5c.c: Update xfailing false leak.
+ * gcc.dg/analyzer/data-model-5d.c: Reimplement.
+ * gcc.dg/analyzer/data-model-6.c: Delete test.
+ * gcc.dg/analyzer/data-model-8.c: Remove xfail.
+ * gcc.dg/analyzer/describe-1.c: New test.
+ * gcc.dg/analyzer/dot-output.c: Remove xfail.
+ * gcc.dg/analyzer/explode-1.c: Add expected leak warning.
+ * gcc.dg/analyzer/explode-2.c: Add expected leak warnings. Mark
+ double-free warnings as xfail for now.
+ * gcc.dg/analyzer/feasibility-1.c: New test.
+ * gcc.dg/analyzer/first-field-1.c: New test.
+ * gcc.dg/analyzer/first-field-2.c: New test.
+ * gcc.dg/analyzer/init.c: New test.
+ * gcc.dg/analyzer/leak-2.c: New test.
+ * gcc.dg/analyzer/loop-0-up-to-n-by-1-with-iter-obj.c: New test.
+ * gcc.dg/analyzer/loop-0-up-to-n-by-1.c: New test.
+ * gcc.dg/analyzer/loop-2a.c: Update expected behavior.
+ * gcc.dg/analyzer/loop-3.c: Mark use-after-free as xfail. Add
+ expected warning about deref of unchecked pointer.
+ * gcc.dg/analyzer/loop-4.c: Remove -fno-analyzer-state-purge.
+ Update expected behavior.
+ * gcc.dg/analyzer/loop-n-down-to-1-by-1.c: New test.
+ * gcc.dg/analyzer/loop-start-down-to-end-by-1.c: New test.
+ * gcc.dg/analyzer/loop-start-down-to-end-by-step.c: New test.
+ * gcc.dg/analyzer/loop-start-to-end-by-step.c: New test.
+ * gcc.dg/analyzer/loop-start-up-to-end-by-1.c: New test.
+ * gcc.dg/analyzer/loop.c: Remove -fno-analyzer-state-purge.
+ Update expected behavior.
+ * gcc.dg/analyzer/malloc-1.c: Remove xfails from leak false
+ positives. Update expected wording of global_link.m_ptr leak.
+ (test_49): New test.
+ * gcc.dg/analyzer/malloc-4.c: Remove leak false positive. Update
+ expected wording of leak warning.
+ * gcc.dg/analyzer/malloc-in-loop.c: New test.
+ * gcc.dg/analyzer/malloc-ipa-8-double-free.c: Update expected path
+ to show call to wrapped_malloc.
+ * gcc.dg/analyzer/malloc-ipa-8-unchecked.c: Remove
+ -fanalyzer-verbose-state-changes.
+ * gcc.dg/analyzer/malloc-paths-9.c: Remove comment about duplicate
+ warnings. Remove duplicate use-after-free paths.
+ * gcc.dg/analyzer/malloc-vs-local-1a.c: Add dg-warning for deref
+ of unchecked pointer. Update expected number of enodes.
+ * gcc.dg/analyzer/malloc-vs-local-2.c: Likewise.
+ * gcc.dg/analyzer/malloc-vs-local-3.c: Add dg-warning for deref of
+ unchecked pointer. Update expected number of enodes. Avoid
+ overspecifying the leak message.
+ * gcc.dg/analyzer/memset-1.c: New test.
+ * gcc.dg/analyzer/paths-3.c: Update expected number of enodes.
+ * gcc.dg/analyzer/paths-4.c: Likewise.
+ * gcc.dg/analyzer/paths-6.c: Likewise.
+ * gcc.dg/analyzer/paths-7.c: Likewise.
+ * gcc.dg/analyzer/pr93032-mztools-simplified.c: New test.
+ * gcc.dg/analyzer/pr93032-mztools.c: New test.
+ * gcc.dg/analyzer/pr93382.c: Mark taint tests as failing.
+ * gcc.dg/analyzer/pr93938.c: New test.
+ * gcc.dg/analyzer/pr94099.c: Replace uninit dg-warning with
+ dg-warning for NULL dereference.
+ * gcc.dg/analyzer/pr94399.c: New test.
+ * gcc.dg/analyzer/pr94447.c: Add dg-warning for NULL dereference.
+ * gcc.dg/analyzer/pr94458.c: New test.
+ * gcc.dg/analyzer/pr94640.c: New test.
+ * gcc.dg/analyzer/pr94688.c: New test.
+ * gcc.dg/analyzer/pr94689.c: New test.
+ * gcc.dg/analyzer/pr94839.c: New test.
+ * gcc.dg/analyzer/pr95026.c: New test.
+ * gcc.dg/analyzer/pr95240.c: New test.
+ * gcc.dg/analyzer/refcounting-1.c: New test.
+ * gcc.dg/analyzer/single-field.c: New test.
+ * gcc.dg/analyzer/stale-frame-1.c: New test.
+ * gcc.dg/analyzer/symbolic-1.c: New test.
+ * gcc.dg/analyzer/symbolic-2.c: New test.
+ * gcc.dg/analyzer/symbolic-3.c: New test.
+ * gcc.dg/analyzer/symbolic-4.c: New test.
+ * gcc.dg/analyzer/symbolic-5.c: New test.
+ * gcc.dg/analyzer/symbolic-6.c: New test.
+ * gcc.dg/analyzer/taint-1.c: Mark the "gets unchecked value"
+ events as failing for now. Update dg-message directives to avoid
+ relying on numbering.
+ * gcc.dg/analyzer/torture/loop-inc-ptr-1.c: New test.
+ * gcc.dg/analyzer/torture/loop-inc-ptr-2.c: New test.
+ * gcc.dg/analyzer/torture/loop-inc-ptr-3.c: New test.
+ * gcc.dg/analyzer/unknown-fns-2.c: New test.
+ * gcc.dg/analyzer/unknown-fns-3.c: New test.
+ * gcc.dg/analyzer/unknown-fns-4.c: New test.
+ * gcc.dg/analyzer/unknown-fns.c: Update dg-warning to reflect fixed
+ source location for leak diagnostic.
+ * gcc.dg/analyzer/use-after-free.c: New test.
+ * gcc.dg/analyzer/vla-1.c: New test.
+ * gcc.dg/analyzer/zlib-4.c: Rewrite to avoid "exit" calls. Add
+ expected leak warnings.
+ * gfortran.dg/analyzer/pr93993.f90: Remove leak of tm warning,
+ which seems to have been a false positive.
+
+2020-08-13 Peter Bergner <bergner@linux.ibm.com>
+
+ PR target/96506
+ * gcc.target/powerpc/pr96506.c: New test.
+
+2020-08-13 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/93671
+ * gfortran.dg/coarray/pr93671.f90: New test.
+
+2020-08-13 Richard Sandiford <richard.sandiford@arm.com>
+
+ Revert:
+ 2020-08-13 Peixin Qiao <qiaopeixin@huawei.com>
+
+ * gcc.target/aarch64/mgeneral-regs_1.c: Add the comment that
+ -mgeneral-regs-only is compatible with the use of vector type
+ used in the test case.
+
+2020-08-13 Kwok Cheung Yeung <kcy@codesourcery.com>
+
+ * gcc.target/nvptx/ia64-sync-5.c: New.
+
+2020-08-13 Martin Liska <mliska@suse.cz>
+
+ PR ipa/96482
+ * gcc.dg/ipa/pr96482-2.c: New test.
+
+2020-08-13 Hongtao Liu <hongtao.liu@intel.com>
+
+ * gcc.target/i386/avx512bw-pr96246-1.c: New test.
+ * gcc.target/i386/avx512bw-pr96246-2.c: New test.
+ * gcc.target/i386/avx512vl-pr96246-1.c: New test.
+ * gcc.target/i386/avx512vl-pr96246-2.c: New test.
+ * gcc.target/i386/avx512bw-vmovdqu16-1.c: Adjust test.
+ * gcc.target/i386/avx512bw-vmovdqu8-1.c: Ditto.
+ * gcc.target/i386/avx512f-vmovapd-1.c: Ditto.
+ * gcc.target/i386/avx512f-vmovaps-1.c: Ditto.
+ * gcc.target/i386/avx512f-vmovdqa32-1.c: Ditto.
+ * gcc.target/i386/avx512f-vmovdqa64-1.c: Ditto.
+ * gcc.target/i386/avx512vl-pr92686-movcc-1.c: Ditto.
+ * gcc.target/i386/avx512vl-pr96246-1.c: Ditto.
+ * gcc.target/i386/avx512vl-pr96246-2.c: Ditto.
+ * gcc.target/i386/avx512vl-vmovapd-1.c: Ditto.
+ * gcc.target/i386/avx512vl-vmovaps-1.c: Ditto.
+ * gcc.target/i386/avx512vl-vmovdqa32-1.c: Ditto.
+ * gcc.target/i386/avx512vl-vmovdqa64-1.c: Ditto.
+
+2020-08-13 Hans-Peter Nilsson <hp@axis.com>
+
+ PR middle-end/94600
+ * gcc.dg/pr94600-5.c, gcc.dg/pr94600-6.c, gcc.dg/pr94600-7.c,
+ gcc.dg/pr94600-8.c: Align t0 to 4-byte boundary.
+
+2020-08-13 Marek Polacek <polacek@redhat.com>
+
+ PR c++/92812
+ * g++.dg/cpp2a/paren-init27.C: New test.
+ * g++.dg/cpp2a/paren-init28.C: New test.
+ * g++.dg/cpp2a/paren-init29.C: New test.
+ * g++.dg/cpp2a/paren-init30.C: New test.
+ * g++.dg/cpp2a/paren-init31.C: New test.
+ * g++.dg/cpp2a/paren-init32.C: New test.
+
+2020-08-12 Roger Sayle <roger@nextmovesoftware.com>
+ Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/96558
+ * gcc.dg/pr96558.c: New test.
+
+2020-08-12 Martin Liska <mliska@suse.cz>
+
+ PR ipa/96482
+ * gcc.dg/ipa/pr96482.c: New test.
+
+2020-08-12 Peixin Qiao <qiaopeixin@huawei.com>
+
+ * gcc.target/aarch64/mgeneral-regs_1.c: Add the comment that
+ -mgeneral-regs-only is compatible with the use of vector type
+ used in the test case.
+
+2020-08-12 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/gomp/nontemporal-1.f90: New test.
+ * gfortran.dg/gomp/nontemporal-2.f90: New test.
+
+2020-08-12 Tom de Vries <tdevries@suse.de>
+
+ * gcc.target/nvptx/ia64-sync-1.c: New test.
+ * gcc.target/nvptx/ia64-sync-2.c: New test.
+ * gcc.target/nvptx/ia64-sync-3.c: New test.
+ * gcc.target/nvptx/ia64-sync-4.c: New test.
+
+2020-08-12 Kwok Cheung Yeung <kcy@codesourcery.com>
+
+ PR testsuite/96519
+ * gcc.dg/ia64-sync-5.c (AC, init_qi, test_qi): Change element type to
+ signed char.
+
+2020-08-12 Tom de Vries <tdevries@suse.de>
+
+ PR testsuite/96566
+ * lib/target-supports.exp (check_effective_target_large_initializer):
+ New proc.
+ * gcc.dg/builtin-object-size-21.c: Require large_initializer.
+ * gcc.dg/strlenopt-55.c: Same.
+
+2020-08-12 Christophe Lyon <christophe.lyon@linaro.org>
+
+ * gcc.target/arm/stack-protector-1.c: Adapt code to Cortex-M
+ restrictions.
+
+2020-08-12 Christophe Lyon <christophe.lyon@linaro.org>
+
+ * gcc.target/arm/multilib.exp: Fix parameter passing for gcc_opts.
+
+2020-08-12 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ PR target/96308
+ * g++.dg/pr96308.C: New test.
+
+2020-08-12 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ PR target/96456
+ * gcc.target/s390/pr96456.c: New test.
+
+2020-08-12 Alan Modra <amodra@gmail.com>
+
+ PR target/96525
+ * gcc.target/powerpc/pr96493.c: Make it a link test when no
+ power10_hw. Require power10_ok.
+
+2020-08-11 David Edelsohn <dje.gcc@gmail.com>
+
+ * g++.dg/opt/flifetime-dse2.C: Remove AIX xfail.
+ * g++.dg/opt/flifetime-dse4.C: Remove AIX xfail.
+
+2020-08-11 Tom de Vries <tdevries@suse.de>
+
+ * gcc.dg/Warray-bounds-46.c: Add missing require-effective-target
+ directive.
+ * gcc.dg/Warray-bounds-48.c: Same.
+ * gcc.dg/Warray-bounds-50.c: Same.
+ * gcc.dg/Wreturn-local-addr-2.c: Same.
+ * gcc.dg/Wreturn-local-addr-3.c: Same.
+ * gcc.dg/Wreturn-local-addr-4.c: Same.
+ * gcc.dg/Wreturn-local-addr-6.c: Same.
+ * gcc.dg/Wstack-usage.c: Same.
+ * gcc.dg/Wstringop-overflow-15.c: Same.
+ * gcc.dg/Wstringop-overflow-23.c: Same.
+ * gcc.dg/Wstringop-overflow-25.c: Same.
+ * gcc.dg/Wstringop-overflow-27.c: Same.
+ * gcc.dg/Wstringop-overflow-39.c: Same.
+ * gcc.dg/analyzer/alloca-leak.c: Same.
+ * gcc.dg/analyzer/data-model-1.c: Same.
+ * gcc.dg/analyzer/data-model-16.c: Same.
+ * gcc.dg/analyzer/malloc-1.c: Same.
+ * gcc.dg/analyzer/malloc-paths-8.c: Same.
+ * gcc.dg/analyzer/pr93546.c: Same.
+ * gcc.dg/analyzer/setjmp-1.c: Same.
+ * gcc.dg/analyzer/setjmp-2.c: Same.
+ * gcc.dg/analyzer/setjmp-3.c: Same.
+ * gcc.dg/analyzer/setjmp-4.c: Same.
+ * gcc.dg/analyzer/setjmp-5.c: Same.
+ * gcc.dg/analyzer/setjmp-6.c: Same.
+ * gcc.dg/analyzer/setjmp-7.c: Same.
+ * gcc.dg/analyzer/setjmp-7a.c: Same.
+ * gcc.dg/analyzer/setjmp-8.c: Same.
+ * gcc.dg/analyzer/setjmp-9.c: Same.
+ * gcc.dg/analyzer/setjmp-pr93378.c: Same.
+ * gcc.dg/gimplefe-44.c: Same.
+ * gcc.dg/pr84131.c: Same.
+ * gcc.dg/pr93986.c: Same.
+ * gcc.dg/pr95133.c: Same.
+ * gcc.dg/pr95857.c: Same.
+ * gcc.dg/strlenopt-83.c: Same.
+ * gcc.dg/strlenopt-84.c: Same.
+ * gcc.dg/strlenopt-91.c: Same.
+ * gcc.dg/uninit-32.c: Same.
+ * gcc.dg/uninit-36.c: Same.
+
+2020-08-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/96545
+ * c-c++-common/pr96545.c: New test.
+
+2020-08-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/96539
+ * gcc.target/i386/pr96539.c: New test.
+
+2020-08-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/96549
+ * gcc.c-torture/execute/pr96549.c: New test.
+
+2020-08-11 Jan Hubicka <hubicka@ucw.cz>
+
+ * gcc.dg/ipa/ipa-clone-2.c: Lower threshold from 500 to 400.
+
+2020-08-10 Marek Polacek <polacek@redhat.com>
+
+ PR c++/88003
+ * g++.dg/cpp1y/auto-fn61.C: New test.
+
+2020-08-10 Marek Polacek <polacek@redhat.com>
+
+ * lib/gcc-dg.exp (gcc-dg-test-1): Handle dg-ice.
+ (cleanup-after-saved-dg-test): Reset expect_ice.
+ * lib/prune.exp (prune_ices): New.
+ * lib/target-supports-dg.exp (dg-ice): New.
+
+2020-08-10 Roger Sayle <roger@nextmovesoftware.com>
+
+ * gcc.target/i386/minmax-12.c: New test.
+
+2020-08-10 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/96556
+ * gfortran.dg/do_check_15.f90: New test.
+
+2020-08-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/96497
+ * g++.dg/cpp2a/spaceship-constexpr3.C: New test.
+
+2020-08-10 Patrick Palka <ppalka@redhat.com>
+
+ * g++.dg/cpp2a/concepts-fn5.C: New test.
+ * g++.dg/concepts/fn8.C: Generalize dg-error directive to accept
+ "no matching function ..." diagnostic.
+ * g++.dg/cpp2a/concepts-fn1.C: Likewise.
+ * g++.dg/cpp2a/concepts-ts2.C: Likewise.
+ * g++.dg/cpp2a/concepts-ts3.C: Likewise.
+
+2020-08-10 Marc Glisse <marc.glisse@inria.fr>
+
+ PR tree-optimization/95433
+ * gcc.dg/tree-ssa/pr95433-2.c: New file.
+
+2020-08-10 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/96312
+ * gfortran.dg/pr96312.f90: New test.
+
+2020-08-10 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/96102
+ * gfortran.dg/pr96102.f90: New test.
+
+2020-08-10 Hongtao Liu <hongtao.liu@intel.com>
+
+ * gcc.target/i386/pr92865-1.c: Adjust testcase.
+
+2020-08-09 Roger Sayle <roger@nextmovesoftware.com>
+
+ PR target/71321
+ * gcc.target/i386/pr71321.c: Check that the code doesn't use
+ the 4B zero displacement lea, not that it uses lea.
+
+2020-08-09 Iain Sandoe <iain@sandoe.co.uk>
+
+ * gcc.dg/torture/fp-int-convert-timode-3.c: XFAIL run.
+ * gcc.dg/torture/fp-int-convert-timode-4.c: Likewise.
+
+2020-08-09 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/pr44194-1.c: Skip for mmix.
+
+2020-08-09 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/pr30957-1.c: xfail for mmix.
+
+2020-08-08 Peter Bergner <bergner@linux.ibm.com>
+
+ PR target/96530
+ * gcc.target/powerpc/pr96530.c: New test.
+
+2020-08-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/96424
+ * c-c++-common/gomp/pr96424.c: New test.
+
+2020-08-07 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/96514
+ * gcc.dg/pr96514.c: New testcase.
+
+2020-08-07 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * gcc.target/bpf/diag-funargs-2.c: Remove trailing whitespaces.
+ * gcc.target/bpf/skb-ancestor-cgroup-id.c: Likewise.
+ * gcc.target/bpf/helper-xdp-adjust-meta.c: Likewise.
+ * gcc.target/bpf/helper-xdp-adjust-head.c: Likewise.
+ * gcc.target/bpf/helper-tcp-check-syncookie.c: Likewise.
+ * gcc.target/bpf/helper-sock-ops-cb-flags-set.c
+ * gcc.target/bpf/helper-sysctl-set-new-value.c: Likewise.
+ * gcc.target/bpf/helper-sysctl-get-new-value.c: Likewise.
+ * gcc.target/bpf/helper-sysctl-get-name.c: Likewise.
+ * gcc.target/bpf/helper-sysctl-get-current-value.c: Likewise.
+ * gcc.target/bpf/helper-strtoul.c: Likewise.
+ * gcc.target/bpf/helper-strtol.c: Likewise.
+ * gcc.target/bpf/helper-sock-map-update.c: Likewise.
+ * gcc.target/bpf/helper-sk-storage-get.c: Likewise.
+ * gcc.target/bpf/helper-sk-storage-delete.c: Likewise.
+ * gcc.target/bpf/helper-sk-select-reuseport.c: Likewise.
+ * gcc.target/bpf/helper-sk-release.c: Likewise.
+ * gcc.target/bpf/helper-sk-redirect-map.c: Likewise.
+ * gcc.target/bpf/helper-sk-lookup-upd.c: Likewise.
+ * gcc.target/bpf/helper-sk-lookup-tcp.c: Likewise.
+ * gcc.target/bpf/helper-skb-change-head.c: Likewise.
+ * gcc.target/bpf/helper-skb-cgroup-id.c: Likewise.
+ * gcc.target/bpf/helper-skb-adjust-room.c: Likewise.
+ * gcc.target/bpf/helper-set-hash.c: Likewise.
+ * gcc.target/bpf/helper-setsockopt.c: Likewise.
+ * gcc.target/bpf/helper-redirect-map.c: Likewise.
+ * gcc.target/bpf/helper-rc-repeat.c: Likewise.
+ * gcc.target/bpf/helper-rc-keydown.c: Likewise.
+ * gcc.target/bpf/helper-probe-read-str.c: Likewise.
+ * gcc.target/bpf/helper-perf-prog-read-value.c: Likewise.
+ * gcc.target/bpf/helper-perf-event-read-value.c: Likewise.
+ * gcc.target/bpf/helper-override-return.c: Likewise.
+ * gcc.target/bpf/helper-msg-redirect-map.c: Likewise.
+ * gcc.target/bpf/helper-msg-pull-data.c: Likewise.
+ * gcc.target/bpf/helper-msg-cork-bytes.c: Likewise.
+ * gcc.target/bpf/helper-msg-apply-bytes.c: Likewise.
+ * gcc.target/bpf/helper-lwt-seg6-store-bytes.c: Likewise.
+ * gcc.target/bpf/helper-lwt-seg6-adjust-srh.c: Likewise.
+ * gcc.target/bpf/helper-lwt-seg6-action.c: Likewise.
+ * gcc.target/bpf/helper-lwt-push-encap.c: Likewise.
+ * gcc.target/bpf/helper-get-socket-uid.c: Likewise.
+ * gcc.target/bpf/helper-get-socket-cookie.c: Likewise.
+ * gcc.target/bpf/helper-get-local-storage.c: Likewise.
+ * gcc.target/bpf/helper-get-current-cgroup-id.c: Likewise.
+ * gcc.target/bpf/helper-getsockopt.c: Likewise.
+ * gcc.target/bpf/diag-funargs-3.c: Likewise.
+
+2020-08-07 Kwok Cheung Yeung <kcy@codesourcery.com>
+ Tom de Vries <tdevries@suse.de>
+
+ * gcc.dg/ia64-sync-5.c: New test.
+
+2020-08-07 Michael Meissner <meissner@linux.ibm.com>
+
+ * gcc.target/powerpc/bswap-brd.c: New test.
+ * gcc.target/powerpc/bswap-brw.c: New test.
+ * gcc.target/powerpc/bswap-brh.c: New test.
+
+2020-08-07 Alan Modra <amodra@gmail.com>
+
+ * gcc.target/powerpc/pr96493.c: New file.
+
+2020-08-06 Richard Sandiford <richard.sandiford@arm.com>
+
+ * gcc.target/arm/stack-protector-1.c: New test.
+ * gcc.target/arm/stack-protector-2.c: Likewise.
+
+2020-08-06 Peter Bergner <bergner@linux.ibm.com>
+
+ PR target/96446
+ * gcc.target/powerpc/pr96446.c: New test.
+
+2020-08-06 Roger Sayle <roger@nextmovesoftware.com>
+
+ * gcc.target/i386/minmax-9.c: Restrict test to !ia32.
+
+2020-08-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/96480
+ * gcc.dg/tree-ssa/pr96480.c: New test.
+
+2020-08-06 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * gcc.target/bpf/helper-bind.c: Adjust to new kernel helpers
+ mechanism.
+ * gcc.target/bpf/helper-bpf-redirect.c: Likewise.
+ * gcc.target/bpf/helper-clone-redirect.c: Likewise.
+ * gcc.target/bpf/helper-csum-diff.c: Likewise.
+ * gcc.target/bpf/helper-csum-update.c: Likewise.
+ * gcc.target/bpf/helper-current-task-under-cgroup.c: Likewise.
+ * gcc.target/bpf/helper-fib-lookup.c: Likewise.
+ * gcc.target/bpf/helper-get-cgroup-classid.c: Likewise.
+ * gcc.target/bpf/helper-get-current-cgroup-id.c: Likewise.
+ * gcc.target/bpf/helper-get-current-comm.c: Likewise.
+ * gcc.target/bpf/helper-get-current-pid-tgid.c: Likewise.
+ * gcc.target/bpf/helper-get-current-task.c: Likewise.
+ * gcc.target/bpf/helper-get-current-uid-gid.c: Likewise.
+ * gcc.target/bpf/helper-get-hash-recalc.c: Likewise.
+ * gcc.target/bpf/helper-get-listener-sock.c: Likewise.
+ * gcc.target/bpf/helper-get-local-storage.c: Likewise.
+ * gcc.target/bpf/helper-get-numa-node-id.c: Likewise.
+ * gcc.target/bpf/helper-get-prandom-u32.c: Likewise.
+ * gcc.target/bpf/helper-get-route-realm.c: Likewise.
+ * gcc.target/bpf/helper-get-smp-processor-id.c: Likewise.
+ * gcc.target/bpf/helper-get-socket-cookie.c: Likewise.
+ * gcc.target/bpf/helper-get-socket-uid.c: Likewise.
+ * gcc.target/bpf/helper-get-stack.c: Likewise.
+ * gcc.target/bpf/helper-get-stackid.c: Likewise.
+ * gcc.target/bpf/helper-getsockopt.c: Likewise.
+ * gcc.target/bpf/helper-ktime-get-ns.c: Likewise.
+ * gcc.target/bpf/helper-l3-csum-replace.c: Likewise.
+ * gcc.target/bpf/helper-l4-csum-replace.c: Likewise.
+ * gcc.target/bpf/helper-lwt-push-encap.c: Likewise.
+ * gcc.target/bpf/helper-lwt-seg6-action.c: Likewise.
+ * gcc.target/bpf/helper-lwt-seg6-adjust-srh.c: Likewise.
+ * gcc.target/bpf/helper-lwt-seg6-store-bytes.c: Likewise.
+ * gcc.target/bpf/helper-map-delete-elem.c: Likewise.
+ * gcc.target/bpf/helper-map-lookup-elem.c: Likewise.
+ * gcc.target/bpf/helper-map-peek-elem.c: Likewise.
+ * gcc.target/bpf/helper-map-pop-elem.c: Likewise.
+ * gcc.target/bpf/helper-map-push-elem.c: Likewise.
+ * gcc.target/bpf/helper-map-update-elem.c: Likewise.
+ * gcc.target/bpf/helper-msg-apply-bytes.c: Likewise.
+ * gcc.target/bpf/helper-msg-cork-bytes.c: Likewise.
+ * gcc.target/bpf/helper-msg-pop-data.c: Likewise.
+ * gcc.target/bpf/helper-msg-pull-data.c: Likewise.
+ * gcc.target/bpf/helper-msg-push-data.c: Likewise.
+ * gcc.target/bpf/helper-msg-redirect-hash.c: Likewise.
+ * gcc.target/bpf/helper-msg-redirect-map.c: Likewise.
+ * gcc.target/bpf/helper-override-return.c: Likewise.
+ * gcc.target/bpf/helper-perf-event-output.c: Likewise.
+ * gcc.target/bpf/helper-perf-event-read-value.c: Likewise.
+ * gcc.target/bpf/helper-perf-event-read.c: Likewise.
+ * gcc.target/bpf/helper-perf-prog-read-value.c: Likewise.
+ * gcc.target/bpf/helper-probe-read-str.c: Likewise.
+ * gcc.target/bpf/helper-probe-read.c: Likewise.
+ * gcc.target/bpf/helper-probe-write-user.c: Likewise.
+ * gcc.target/bpf/helper-rc-keydown.c: Likewise.
+ * gcc.target/bpf/helper-rc-pointer-rel.c: Likewise.
+ * gcc.target/bpf/helper-rc-repeat.c: Likewise.
+ * gcc.target/bpf/helper-redirect-map.c: Likewise.
+ * gcc.target/bpf/helper-set-hash-invalid.c: Likewise.
+ * gcc.target/bpf/helper-set-hash.c: Likewise.
+ * gcc.target/bpf/helper-setsockopt.c: Likewise.
+ * gcc.target/bpf/helper-sk-fullsock.c: Likewise.
+ * gcc.target/bpf/helper-sk-lookup-tcp.c: Likewise.
+ * gcc.target/bpf/helper-sk-lookup-upd.c: Likewise.
+ * gcc.target/bpf/helper-sk-redirect-hash.c: Likewise.
+ * gcc.target/bpf/helper-sk-redirect-map.c: Likewise.
+ * gcc.target/bpf/helper-sk-release.c: Likewise.
+ * gcc.target/bpf/helper-sk-select-reuseport.c: Likewise.
+ * gcc.target/bpf/helper-sk-storage-delete.c: Likewise.
+ * gcc.target/bpf/helper-sk-storage-get.c: Likewise.
+ * gcc.target/bpf/helper-skb-adjust-room.c: Likewise.
+ * gcc.target/bpf/helper-skb-cgroup-id.c: Likewise.
+ * gcc.target/bpf/helper-skb-change-head.c: Likewise.
+ * gcc.target/bpf/helper-skb-change-proto.c: Likewise.
+ * gcc.target/bpf/helper-skb-change-tail.c: Likewise.
+ * gcc.target/bpf/helper-skb-change-type.c: Likewise.
+ * gcc.target/bpf/helper-skb-ecn-set-ce.c: Likewise.
+ * gcc.target/bpf/helper-skb-get-tunnel-key.c: Likewise.
+ * gcc.target/bpf/helper-skb-get-tunnel-opt.c: Likewise.
+ * gcc.target/bpf/helper-skb-get-xfrm-state.c: Likewise.
+ * gcc.target/bpf/helper-skb-load-bytes-relative.c: Likewise.
+ * gcc.target/bpf/helper-skb-load-bytes.c: Likewise.
+ * gcc.target/bpf/helper-skb-pull-data.c: Likewise.
+ * gcc.target/bpf/helper-skb-set-tunnel-key.c: Likewise.
+ * gcc.target/bpf/helper-skb-set-tunnel-opt.c: Likewise.
+ * gcc.target/bpf/helper-skb-store-bytes.c: Likewise.
+ * gcc.target/bpf/helper-skb-under-cgroup.c: Likewise.
+ * gcc.target/bpf/helper-skb-vlan-pop.c: Likewise.
+ * gcc.target/bpf/helper-skb-vlan-push.c: Likewise.
+ * gcc.target/bpf/helper-skc-lookup-tcp.c: Likewise.
+ * gcc.target/bpf/helper-sock-hash-update.c: Likewise.
+ * gcc.target/bpf/helper-sock-map-update.c: Likewise.
+ * gcc.target/bpf/helper-sock-ops-cb-flags-set.c: Likewise.
+ * gcc.target/bpf/helper-spin-lock.c: Likewise.
+ * gcc.target/bpf/helper-spin-unlock.c: Likewise.
+ * gcc.target/bpf/helper-strtol.c: Likewise.
+ * gcc.target/bpf/helper-strtoul.c: Likewise.
+ * gcc.target/bpf/helper-sysctl-get-current-value.c: Likewise.
+ * gcc.target/bpf/helper-sysctl-get-name.c: Likewise.
+ * gcc.target/bpf/helper-sysctl-get-new-value.c: Likewise.
+ * gcc.target/bpf/helper-sysctl-set-new-value.c: Likewise.
+ * gcc.target/bpf/helper-tail-call.c: Likewise.
+ * gcc.target/bpf/helper-tcp-check-syncookie.c: Likewise.
+ * gcc.target/bpf/helper-tcp-sock.c: Likewise.
+ * gcc.target/bpf/helper-trace-printk.c: Likewise.
+ * gcc.target/bpf/helper-xdp-adjust-head.c: Likewise.
+ * gcc.target/bpf/helper-xdp-adjust-meta.c: Likewise.
+ * gcc.target/bpf/helper-xdp-adjust-tail.c: Likewise.
+ * gcc.target/bpf/skb-ancestor-cgroup-id.c: Likewise.
+
+2020-08-06 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/96491
+ * gcc.dg/torture/pr96491.c: New testcase.
+
+2020-08-06 Roger Sayle <roger@nextmovesoftware.com>
+ Uroš Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/minmax-8.c: New test.
+ * gcc.target/i386/minmax-9.c: New test.
+ * gcc.target/i386/minmax-10.c: New test.
+ * gcc.target/i386/minmax-11.c: New test.
+
+2020-08-05 Patrick Palka <ppalka@redhat.com>
+ Jason Merrill <jason@redhat.com>
+
+ PR c++/96282
+ * g++.dg/cpp0x/constexpr-array26.C: New test.
+ * g++.dg/cpp0x/constexpr-array27.C: New test.
+ * g++.dg/cpp2a/constexpr-init18.C: New test.
+
+2020-08-05 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/96469
+ * gfortran.dg/do_check_14.f90: New test.
+
+2020-08-05 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/96469
+ * gfortran.dg/do_check_4.f90: Hide change in index variable
+ from compile-time analysis.
+ * gfortran.dg/do_check_13.f90: New test.
+
+2020-08-05 Marc Glisse <marc.glisse@inria.fr>
+
+ PR tree-optimization/95906
+ PR target/70314
+ * gcc.dg/tree-ssa/andnot-2.c: New file.
+ * gcc.dg/tree-ssa/pr95906.c: Likewise.
+ * gcc.target/i386/pr70314.c: Likewise.
+
+2020-08-05 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR target/96191
+ * gcc.target/aarch64/stack-protector-1.c: New test.
+ * gcc.target/aarch64/stack-protector-2.c: Likewise.
+
+2020-08-05 2020-08-04 Carl Love <cel@us.ibm.com>
+
+ * gcc.target/powerpc/vec-blend-runnable.c: New test.
+ * gcc.target/powerpc/vec-permute-ext-runnable.c: New test.
+
+2020-08-05 2020-08-04 Carl Love <cel@us.ibm.com>
+
+ * gcc.target/powerpc/vec-splati-runnable.c: New test.
+
+2020-08-05 2020-08-04 Carl Love <cel@us.ibm.com>
+
+ * gcc.target/powerpc/vec-shift-double-runnable.c: New test file.
+
+2020-08-05 2020-08-04 Carl Love <cel@us.ibm.com>
+
+ * gcc.target/powerpc/vec-replace-word-runnable.c: New test.
+
+2020-08-05 2020-08-04 Carl Love <cel@us.ibm.com>
+
+ * gcc.target/powerpc/vec-insert-word-runnable.c: New test case.
+
+2020-08-04 Roger Sayle <roger@nextmovesoftware.com>
+
+ * gcc.target/nvptx/mul-hi.c: New test.
+ * gcc.target/nvptx/umul-hi.c: New test.
+
+2020-08-04 Marek Polacek <polacek@redhat.com>
+
+ PR c++/96082
+ * g++.dg/template/template-keyword3.C: New test.
+
+2020-08-04 Nathan Sidwell <nathan@acm.org>
+
+ * g++.dg/template/pr39425.C: Adjust errors, (unbounded
+ template recursion).
+ * g++.old-deja/g++.pt/spec20.C: Remove fallout diagnostics.
+
+2020-08-04 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/gomp/collapse1.f90: Add dg-error.
+ * gfortran.dg/gomp/collapse2.f90: New test.
+
+2020-08-04 Roger Sayle <roger@nextmovesoftware.com>
+
+ PR rtl-optimization/60473
+ * gcc.target/i386/pr60473.c: New test.
+
+2020-08-04 Marc Glisse <marc.glisse@inria.fr>
+
+ PR tree-optimization/95433
+ * gcc.c-torture/execute/pr23135.c: Add -fwrapv to avoid
+ undefined behavior.
+ * gcc.dg/tree-ssa/pr95433.c: New file.
+
+2020-08-04 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/96153
+ * gdc.dg/pr96153.d: New test.
+
+2020-08-04 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/94024
+ * g++.dg/diagnostic/mem-init1.C: New test.
+
+2020-08-04 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/88240
+ * gcc.target/i386/pr88240.c: New testcase.
+
+2020-08-04 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/gomp/lastprivate-conditional-3.f90: Enable some
+ previously disabled 'lastprivate(conditional:' dg-warnings.
+
+2020-08-04 Sudakshina Das <sudi.das@arm.com>
+
+ * gcc.target/aarch64/cpymem-q-reg_1.c: New test.
+ * gcc.target/aarch64/large_struct_copy_2.c: Update for ldp q regs.
+
+2020-08-04 Andrea Corallo <andrea.corallo@arm.com>
+
+ * gcc.target/aarch64/acle/jcvt_2.c: New testcase.
+ * lib/target-supports.exp
+ (check_effective_target_aarch64_fjcvtzs_hw): Add new check for
+ FJCVTZS hw.
+
+2020-08-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/96426
+ * gcc.c-torture/compile/pr96426.c: New test.
+
+2020-08-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/96354
+ * g++.dg/opt/pr96354.C: New test.
+
+2020-08-04 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/96429
+ * gdc.dg/pr96429.d: New test.
+
+2020-08-04 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/96325
+ * gfortran.dg/pr96325.f90: Change from run to compile.
+
+2020-08-04 Xionghu Luo <luoxhu@linux.ibm.com>
+
+ PR rtl-optimization/71309
+ * gcc.target/powerpc/pr71309.c: New test.
+
+2020-08-03 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * gcc.target/powerpc/vector_float.c: Skip if not lp64.
+
+2020-08-03 Marek Polacek <polacek@redhat.com>
+
+ DR 2032
+ PR c++/96218
+ * g++.dg/cpp1y/var-templ67.C: New test.
+
+2020-08-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/96402
+ * gcc.target/aarch64/pr96402.c: New test.
+
+2020-08-03 Julian Brown <julian@codesourcery.com>
+ Thomas Schwinge <thomas@codesourcery.com>
+
+ * gfortran.dg/goacc/attach-descriptor.f90: Update pattern output. Add
+ scanning of gimplify dump.
+
+2020-08-03 Martin Jambor <mjambor@suse.cz>
+
+ * lib/target-supports.exp (check_effective_target_offload_hsa):
+ Removed.
+ * c-c++-common/gomp/gridify-1.c: Removed test.
+ * c-c++-common/gomp/gridify-2.c: Likewise.
+ * c-c++-common/gomp/gridify-3.c: Likewise.
+ * c-c++-common/gomp/hsa-indirect-call-1.c: Likewise.
+ * gfortran.dg/gomp/gridify-1.f90: Likewise.
+ * gcc.dg/gomp/gomp.exp: Do not pass -Wno-hsa to tests.
+ * g++.dg/gomp/gomp.exp: Likewise.
+ * gfortran.dg/gomp/gomp.exp: Likewise.
+
+2020-08-03 Richard Sandiford <richard.sandiford@arm.com>
+
+ * gcc.dg/pr96377-1.c: Add -Wno-psabi.
+ * gcc.dg/pr96377-2.c: Likewise.
+
+2020-08-03 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/96254
+ * gdc.dg/pr96254a.d: New test.
+ * gdc.dg/pr96254b.d: New test.
+
+2020-08-02 Paul Thomas <pault@gcc.gnu.org>
+
+ PR target/96320
+ * gfortran.dg/module_procedure_4.f90 : New test.
+
+2020-08-02 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/96325
+ * gfortran.dg/pr96325.f90: New test.
+ * gfortran.dg/pr91589.f90: Update error message.
+
+2020-08-01 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR c/96377
+ * gcc.dg/pr96377-1.c: New test.
+ * gcc.dg/pr96377-2.c: Likewise.
+ * gcc.dg/pr96377-3.c: Likewise.
+ * gcc.dg/pr96377-4.c: Likewise.
+ * gcc.dg/pr96377-5.c: Likewise.
+ * gcc.dg/pr96377-6.c: Likewise.
+ * gcc.target/aarch64/pr96377-1.c: Likewise.
+ * gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c: Likewise.
+ * gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c: Likewise.
+ * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C: Likewise.
+ * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C: Likewise.
+
+2020-08-01 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/loop-8.c: Skip for mmix.
+
+2020-07-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/96182
+ * g++.dg/cpp1y/constexpr-96182.C: New test.
+ * g++.dg/other/error35.C (S<T>::g()): Add return statement.
+ * g++.dg/cpp1y/pr63996.C (foo): Likewise.
+ * g++.dg/cpp1y/constexpr-return2.C (f): Likewise.
+ * g++.dg/cpp1y/var-templ44.C (make_array): Add throw 1.
+
+2020-07-31 Roger Sayle <roger@nextmovesoftware.com>
+ Tom de Vries <tdevries@suse.de>
+
+ * gcc.target/nvptx/v2si-cvt.c: Simplify source. Remove
+ scan-assembler directives. Mention PR96403.
+
+2020-07-31 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * gdc.dg/compilable.d: Removed.
+ * gdc.dg/gdc108.d: New test.
+ * gdc.dg/gdc115.d: New test.
+ * gdc.dg/gdc121.d: New test.
+ * gdc.dg/gdc122.d: New test.
+ * gdc.dg/gdc127.d: New test.
+ * gdc.dg/gdc131.d: New test.
+ * gdc.dg/gdc133.d: New test.
+ * gdc.dg/gdc141.d: New test.
+ * gdc.dg/gdc142.d: New test.
+ * gdc.dg/gdc15.d: New test.
+ * gdc.dg/gdc17.d: New test.
+ * gdc.dg/gdc170.d: New test.
+ * gdc.dg/gdc171.d: New test.
+ * gdc.dg/gdc179.d: New test.
+ * gdc.dg/gdc183.d: New test.
+ * gdc.dg/gdc186.d: New test.
+ * gdc.dg/gdc187.d: New test.
+ * gdc.dg/gdc19.d: New test.
+ * gdc.dg/gdc191.d: New test.
+ * gdc.dg/gdc194.d: New test.
+ * gdc.dg/gdc196.d: New test.
+ * gdc.dg/gdc198.d: New test.
+ * gdc.dg/gdc200.d: New test.
+ * gdc.dg/gdc204.d: New test.
+ * gdc.dg/gdc210.d: New test.
+ * gdc.dg/gdc212.d: New test.
+ * gdc.dg/gdc213.d: New test.
+ * gdc.dg/gdc218.d: New test.
+ * gdc.dg/gdc223.d: New test.
+ * gdc.dg/gdc231.d: New test.
+ * gdc.dg/gdc239.d: New test.
+ * gdc.dg/gdc24.d: New test.
+ * gdc.dg/gdc240.d: New test.
+ * gdc.dg/gdc241.d: New test.
+ * gdc.dg/gdc242a.d: New test.
+ * gdc.dg/gdc242b.d: New test.
+ * gdc.dg/gdc248.d: New test.
+ * gdc.dg/gdc250.d: New test.
+ * gdc.dg/gdc251.d: New test.
+ * gdc.dg/gdc253a.d: New test.
+ * gdc.dg/gdc253b.d: New test.
+ * gdc.dg/gdc255.d: New test.
+ * gdc.dg/gdc256.d: New test.
+ * gdc.dg/gdc261.d: New test.
+ * gdc.dg/gdc27.d: New test.
+ * gdc.dg/gdc273.d: New test.
+ * gdc.dg/gdc280.d: New test.
+ * gdc.dg/gdc284.d: New test.
+ * gdc.dg/gdc285.d: New test.
+ * gdc.dg/gdc286.d: New test.
+ * gdc.dg/gdc300.d: New test.
+ * gdc.dg/gdc309.d: New test.
+ * gdc.dg/gdc31.d: New test.
+ * gdc.dg/gdc35.d: New test.
+ * gdc.dg/gdc36.d: New test.
+ * gdc.dg/gdc37.d: New test.
+ * gdc.dg/gdc4.d: New test.
+ * gdc.dg/gdc43.d: New test.
+ * gdc.dg/gdc47.d: New test.
+ * gdc.dg/gdc51.d: New test.
+ * gdc.dg/gdc57.d: New test.
+ * gdc.dg/gdc66.d: New test.
+ * gdc.dg/gdc67.d: New test.
+ * gdc.dg/gdc71.d: New test.
+ * gdc.dg/gdc77.d: New test.
+ * gdc.dg/imports/gdc239.d: Remove phobos dependency.
+ * gdc.dg/imports/gdc241a.d: Updated imports.
+ * gdc.dg/imports/gdc241b.d: Likewise.
+ * gdc.dg/imports/gdc251a.d: Likewise.
+ * gdc.dg/imports/gdc253.d: Rename to...
+ * gdc.dg/imports/gdc253a.d: ...this.
+ * gdc.dg/imports/gdc253b.d: New.
+ * gdc.dg/imports/gdc36.d: New.
+ * gdc.dg/imports/runnable.d: Removed.
+ * gdc.dg/link.d: Removed.
+ * gdc.dg/runnable.d: Removed.
+ * gdc.dg/runnable2.d: Removed.
+ * gdc.dg/simd.d: Remove phobos dependency.
+
+2020-07-31 Martin Sebor <msebor@redhat.com>
+
+ PR c++/96003
+ * g++.dg/warn/Wnonnull7.C: New test.
+
+2020-07-31 Richard Biener <rguenther@suse.de>
+
+ PR debug/96383
+ * gcc.dg/debug/dwarf2/pr96383-1.c: New testcase.
+ * gcc.dg/debug/dwarf2/pr96383-2.c: Likewise.
+
+2020-07-31 Kewen Lin <linkw@linux.ibm.com>
+
+ * gcc.target/aarch64/sve/cost_model_2.c: Adjust due to cost model
+ change.
+
+2020-07-31 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/96369
+ * c-c++-common/pr96369.c: New testcase.
+
+2020-07-31 Martin Liska <mliska@suse.cz>
+
+ * gcc.dg/tree-prof/indir-call-prof-malloc.c: New test.
+
+2020-07-31 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/torture/20200727-0.c: New testcase.
+
+2020-07-31 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/96197
+ * g++.dg/cpp1y/constexpr-array8.C: New test.
+
+2020-07-30 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/96152
+ * gdc.dg/pr96152.d: New test.
+
+2020-07-30 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/96154
+ * gdc.dg/pr96154a.d: New test.
+ * gdc.dg/pr96154b.d: New test.
+
+2020-07-30 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/96140
+ * gdc.dg/pr96140.d: New test.
+
+2020-07-30 Will Schmidt <will_schmidt@vnet.ibm.com>
+
+ * gcc.target/powerpc/lsbb-runnable.c: New test.
+ * gcc.target/powerpc/lsbb.c: New test.
+
+2020-07-30 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * gdc.dg/array1.d: New test.
+
+2020-07-30 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * gdc.dg/intrinsics.d: Add ror and rol tests.
+
+2020-07-30 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * gdc.dg/intrinsics.d: New test.
+
+2020-07-30 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/96370
+ * gcc.dg/pr96370.c: New testcase.
+
+2020-07-30 Roger Sayle <roger@nextmovesoftware.com>
+ Tom de Vries <tdevries@suse.de>
+
+ * gcc.target/nvptx/v2si-vec-set-extract.c: New test.
+
+2020-07-30 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/64194
+ * g++.dg/cpp1y/auto-fn60.C: New test.
+
+2020-07-30 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/95486
+ * g++.dg/cpp2a/class-deduction-alias3.C: New test.
+
+2020-07-30 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/96106
+ * g++.dg/concepts/abbrev7.C: New test.
+
+2020-07-30 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/96164
+ * g++.dg/cpp2a/concepts-explicit-inst5.C: New test.
+
+2020-07-29 Roger Sayle <roger@nextmovesoftware.com>
+
+ * gcc.target/nvptx/recip-1.c: New test.
+
+2020-07-29 Jason Merrill <jason@redhat.com>
+
+ PR c++/91427
+ * g++.dg/coroutines/co-return-syntax-10-movable.C: Extend.
+ * g++.dg/cpp0x/Wredundant-move1.C: Adjust for C++20.
+ * g++.dg/cpp0x/Wredundant-move7.C: Adjust for C++20.
+ * g++.dg/cpp0x/Wredundant-move9.C: Adjust for C++20.
+ * g++.dg/cpp0x/elision_neg.C: Adjust for C++20.
+ * g++.dg/cpp0x/move-return2.C: Adjust for C++20.
+ * g++.dg/cpp0x/ref-qual20.C: Adjust for C++20.
+ * g++.dg/cpp2a/implicit-move1.C: New test.
+ * g++.dg/cpp2a/implicit-move2.C: New test.
+ * g++.dg/cpp2a/implicit-move3.C: New test.
+
+2020-07-29 Jason Merrill <jason@redhat.com>
+
+ PR c++/91212
+ * g++.dg/cpp0x/move-return3.C: New test.
+
+2020-07-29 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/gomp/order-3.f90: New test.
+ * gfortran.dg/gomp/order-4.f90: New test.
+
+2020-07-29 Tiziano Müller <tiziano.mueller@chem.uzh.ch>
+
+ * c-c++-common/cpp/has-include-1-traditional.c: New.
+
+2020-07-29 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/gomp/map-3.f90: New test.
+ * gfortran.dg/gomp/map-4.f90: New test.
+
+2020-07-29 Joe Ramsay <joe.ramsay@arm.com>
+
+ * gcc.target/arm/mve/intrinsics/mve-vldstr16-no-writeback.c: New file.
+
+2020-07-29 Mark Eggleston <markeggleston@gcc.gnu.org>
+
+ PR fortran/96319
+ * gfortran.dg/pr96319.f90: New test.
+
+2020-07-29 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/96349
+ * gcc.dg/torture/pr96349.c: New testcase.
+
+2020-07-29 Mark Eggleston <markeggleston@gcc.gnu.org>
+
+ PR fortran/53298
+ * gfortran.dg/pr53298.f90: New test.
+
+2020-07-29 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/gomp/requires-1.f90: New test.
+ * gfortran.dg/gomp/requires-2.f90: New test.
+ * gfortran.dg/gomp/requires-3.f90: New test.
+ * gfortran.dg/gomp/requires-4.f90: New test.
+ * gfortran.dg/gomp/requires-5.f90: New test.
+ * gfortran.dg/gomp/requires-6.f90: New test.
+ * gfortran.dg/gomp/requires-7.f90: New test.
+ * gfortran.dg/gomp/requires-8.f90: New test.
+ * gfortran.dg/gomp/requires-9.f90: New test.
+
+2020-07-28 Sergei Trofimovich <siarheit@google.com>
+
+ PR ipa/96291
+ * gcc.dg/lto/pr96291_0.c: New testcase.
+ * gcc.dg/lto/pr96291_1.c: Support file.
+ * gcc.dg/lto/pr96291_2.c: Likewise.
+ * gcc.dg/lto/pr96291.h: Likewise.
+
+2020-07-28 Roger Sayle <roger@nextmovesoftware.com>
+ Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/fold-popcount-5.c: New test.
+ * gcc.dg/fold-parity-1.c: Likewise.
+ * gcc.dg/fold-parity-2.c: Likewise.
+ * gcc.dg/fold-parity-3.c: Likewise.
+ * gcc.dg/fold-parity-4.c: Likewise.
+ * gcc.dg/fold-parity-5.c: Likewise.
+
+2020-07-28 Nathan Sidwell <nathan@acm.org>
+
+ * lib/options.exp: Fix spello
+
+2020-07-28 Jakub Jelinek <jakub@redhat.com>
+ Mark Wielaard <mark@klomp.org>
+
+ PR c++/96328
+ * g++.dg/diagnostic/pr96328.C: New test.
+
+2020-07-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/96323
+ * c-c++-common/cpp/pr96323.c: New test.
+
+2020-07-28 Roger Sayle <roger@nextmovesoftware.com>
+ Tom de Vries <tdevries@suse.de>
+
+ * gcc.target/nvptx/cvt.c: New test.
+ * gcc.target/nvptx/shift16.c: New test.
+
+2020-07-28 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.dg/cpp2a/nontype-subob1.C: Allow s1, i1 or x1 instead of l1 for
+ targets with short, int or long long ssize_t.
+
+2020-07-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/96335
+ * gcc.dg/pr96335.c: New test.
+
+2020-07-27 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/torture/pr39074-2.c: Adjust for mmix.
+ * gcc.dg/torture/pr39074.c, gcc.dg/torture/pta-callused-1.c: Ditto.
+
+2020-07-27 Nathan Sidwell <nathan@acm.org>
+
+ * g++.dg/lookup/missing-std-include-10.h: New.
+ * g++.dg/lookup/missing-std-include-10.C: New.
+ * g++.dg/lookup/missing-std-include-11.C: New.
+
+2020-07-27 Martin Sebor <msebor@redhat.com>
+
+ PR tree-optimization/84079
+ * gcc.dg/Warray-bounds-62.c: New test.
+
+2020-07-27 Martin Liska <mliska@suse.cz>
+
+ PR tree-optimization/96128
+ * gcc.target/s390/vector/pr96128.c: New test.
+
+2020-07-27 H.J. Lu <hjl.tools@gmail.com>
+
+ PR bootstrap/96203
+ * gcc.target/i386/pr96203-1.c: New test.
+ * gcc.target/i386/pr96203-2.c: Likewise.
+
+2020-07-27 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/tree-ssa/vector-4.c: Adjust for mmix.
+
+2020-07-27 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/tree-ssa/ssa-dse-26.c: Adjust for mmix.
+
+2020-07-27 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/tree-ssa/ssa-dom-cse-2.c: xfail scan for mmix.
+
+2020-07-27 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/tree-ssa/reassoc-20.c: Adjust for mmix.
+
+2020-07-26 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/79504
+ * g++.dg/cpp0x/decltype79.C: New test.
+
+2020-07-26 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/tree-ssa/forwprop-36.c: Adjust for mmix.
+
+2020-07-26 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/torture/pr59330.c: Disable for mmix.
+
+2020-07-25 Iain Sandoe <iain@sandoe.co.uk>
+
+ * g++.dg/abi/pure-virtual1.C: Add dynamic_lookup option
+ for Darwin.
+
+2020-07-25 Martin Sebor <msebor@redhat.com>
+
+ PR c++/96310
+ * g++.dg/warn/Wnonnull8.C: New file.
+
+2020-07-24 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * gcc.target/powerpc/pr95907.c: New.
+
+2020-07-24 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * c-c++-common/pr56493.c: Allow ":" in label, for mmix.
+
+2020-07-24 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * c-c++-common/patchable_function_entry-decl.c,
+ c-c++-common/patchable_function_entry-default.c,
+ c-c++-common/patchable_function_entry-definition.c: Adjust for mmix.
+
+2020-07-24 Sunil K Pandey <skpgkp2@gmail.com>
+
+ PR target/96192
+ * c-c++-common/pr96192-1.c: New test.
+
+2020-07-24 Alexandre Oliva <oliva@adacore.com>
+
+ * lib/scanoffload.exp (scoff-testname, scoff-adjust): New.
+ (scoff): Call them.
+
+2020-07-24 Alexandre Oliva <oliva@adacore.com>
+
+ PR driver/96230
+ * gcc.misc-tests/outputs.exp: Add tests with -dumpbase-ext,
+ with identical -dumpbase, with -dumpbase "", and without any
+ -dumpbase.
+ (outest): Fix "" expansion in expected outputs, skip
+ adjustments.
+
+2020-07-24 Alexandre Oliva <oliva@adacore.com>
+
+ PR testsuite/95720
+ * lib/gcc-defs.exp (gcc_adjust_linker_flags_list): Split out of...
+ (gcc_adjust_linker_flags): ... this. Protect gluefile and
+ wrap_flags.
+ * gcc.misc-tests/outputs.exp: Use gcc_adjust_linker_flags_list.
+
+2020-07-24 Dominique d'Humieres <dhumieres.dominique@free.fr>
+
+ PR fortran/93567
+ * gfortran.dg/round_3.f08: Add test cases.
+
+2020-07-24 Dominique d'Humieres <dhumieres.dominique@free.fr>
+
+ PR fortran/93592
+ * gfortran.dg/fmt_en.f90: Adjust test.
+ * gfortran.dg/fmt_en_rd.f90: New test.
+ * gfortran.dg/fmt_en_rn.f90: New test.
+ * gfortran.dg/fmt_en_ru.f90: New test.
+ * gfortran.dg/fmt_en_rz.f90: New test.
+
+2020-07-24 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/81339
+ * g++.dg/cpp0x/decltype78.C: New test.
+
+2020-07-24 Thomas Schwinge <thomas@codesourcery.com>
+
+ * lib/scandump.exp (scan-dump-dem-not): Fix TCL syntax error.
+
+2020-07-24 H.J. Lu <hjl.tools@gmail.com>
+
+ PR middle-end/95886
+ * gcc.target/i386/memcpy-pr95886.c: Restrict test to !ia32.
+
+2020-07-23 Martin Sebor <msebor@redhat.com>
+
+ PR testsuite/95886
+ * gcc.target/i386/memcpy-pr95886.c: Restrict test to LP64.
+
+2020-07-23 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/gomp/lastprivate-conditional-1.f90: New test.
+ * gfortran.dg/gomp/lastprivate-conditional-2.f90: New test.
+ * gfortran.dg/gomp/lastprivate-conditional-3.f90: New test.
+ * gfortran.dg/gomp/lastprivate-conditional-4.f90: New test.
+ * gfortran.dg/gomp/lastprivate-conditional-5.f90: New test.
+
+2020-07-23 Kito Cheng <kito.cheng@sifive.com>
+
+ PR target/96260
+ * gcc.target/riscv/pr91441.c: Update warning message.
+ * gcc.target/riscv/pr96260.c: New.
+
+2020-07-23 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * c-c++-common/builtin-has-attribute-4.c: Require visibility.
+
+2020-07-22 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/gomp/cancel-2.f90: New test.
+ * gfortran.dg/gomp/cancel-3.f90: New test.
+ * gfortran.dg/gomp/if-1.f90: New test.
+
+2020-07-22 Peter Bergner <bergner@linux.ibm.com>
+
+ PR target/96236
+ * gcc.target/powerpc/mma-double-test.c: Update storing results for
+ correct little-endian ordering.
+ * gcc.target/powerpc/mma-single-test.c: Likewise.
+
+2020-07-22 H.J. Lu <hjl.tools@gmail.com>
+
+ PR target/95237
+ * c-c++-common/pr95237-6.c: Only run for x86 targets.
+
+2020-07-22 Tobias Burnus <tobias@codesourcery.com>
+
+ * c-c++-common/gomp/critical-hint-1.c: Moved to libgomp/.
+ * c-c++-common/gomp/critical-hint-2.c: Moved to libgomp/.
+ * gfortran.dg/gomp/critical-hint-1.f90: Moved to libgomp/.
+ * gfortran.dg/gomp/critical-hint-2.f90: Moved to libgomp/.
+
+2020-07-22 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
+
+ * gcc.target/aarch64/ldp_vec_v2sf.c: New test.
+ * gcc.target/aarch64/ldp_vec_v2si.c: New test.
+ * gcc.target/aarch64/stp_vec_v2df.c: New test.
+ * gcc.target/aarch64/stp_vec_v2di.c: New test.
+ * gcc.target/aarch64/stp_vec_v2sf.c: New test.
+ * gcc.target/aarch64/stp_vec_v2si.c: New test.
+
+2020-07-22 Tobias Burnus <tobias@codesourcery.com>
+
+ * g++.dg/gomp/critical-3.C: Add nameless critical with hint testcase.
+ * c-c++-common/gomp/critical-hint-1.c: New test.
+ * c-c++-common/gomp/critical-hint-2.c: New test.
+ * gfortran.dg/gomp/critical-hint-1.f90: New test.
+ * gfortran.dg/gomp/critical-hint-2.f90: New test.
+
+2020-07-22 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/no_profile_instrument_function-attr-1.c: Adjust scanned
+ regex for NO_DOT_IN_LABEL.
+
+2020-07-21 Sunil K Pandey <skpgkp2@gmail.com>
+
+ PR target/95237
+ * c-c++-common/pr95237-1.c: New test.
+ * c-c++-common/pr95237-2.c: New test.
+ * c-c++-common/pr95237-3.c: New test.
+ * c-c++-common/pr95237-4.c: New test.
+ * c-c++-common/pr95237-5.c: New test.
+ * c-c++-common/pr95237-6.c: New test.
+ * c-c++-common/pr95237-7.c: New test.
+ * c-c++-common/pr95237-8.c: New test.
+ * c-c++-common/pr95237-9.c: New test.
+
+2020-07-21 Peter Bergner <bergner@linux.ibm.com>
+
+ PR target/92488
+ * gcc.target/powerpc/convert-fp-128.c (bl): Update POWER9 count.
+
+2020-07-21 Nathan Sidwell <nathan@acm.org>
+
+ * g++.dg/parse/pr96257.C: New.
+
+2020-07-21 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/89574
+ * gfortran.dg/pr89574.f90: New file.
+
+2020-07-21 Sandra Loosemore <sandra@codesourcery.com>
+
+ * lib/profopt.exp (auto-profopt-execute): Pass -DFOR_AUTOFDO_TESTING
+ on command line for both compiles.
+ * gcc.dg/tree-prof/cold_partition_label.c: Scale down for
+ non-FDO testing.
+ * gcc.dg/tree-prof/crossmodule-indir-call-topn-1.c: Likewise.
+ * gcc.dg/tree-prof/crossmodule-indir-call-topn-2.c: Likewise.
+ * gcc.dg/tree-prof/indir-call-prof-topn.c: Likewise.
+ * gcc.dg/tree-prof/section-attr-1.c: Likewise.
+ * gcc.dg/tree-prof/section-attr-2.c: Likewise.
+ * gcc.dg/tree-prof/section-attr-3.c: Likewise.
+
+2020-07-21 Dimitar Dimitrov <dimitar@dinux.eu>
+
+ * gcc.dg/attr-copy-4.c: Unpacked may still have alignment of 1
+ on targets with default_packed.
+ * gcc.dg/c11-align-9.c: Remove AVR target filter and replace
+ with default_packed filter.
+
+2020-07-21 Dimitar Dimitrov <dimitar@dinux.eu>
+
+ * gcc.dg/pr53037-1.c: Relax warning pattern.
+
+2020-07-21 Dimitar Dimitrov <dimitar@dinux.eu>
+
+ * c-c++-common/Waddress-of-packed-member-2.c: Add dg-warning for
+ ignored attribute if target is default_packed.
+ * c-c++-common/Wattributes.c: Ditto.
+ * c-c++-common/attr-copy.c: Ditto.
+ * c-c++-common/builtin-has-attribute-4.c: Ditto.
+ * c-c++-common/pr51628-29.c: Ditto.
+ * c-c++-common/pr51628-30.c: Ditto.
+ * c-c++-common/pr51628-32.c: Ditto.
+ * gcc.dg/Wattributes-6.c: Ditto.
+ * gcc.dg/attr-copy-4.c: Ditto.
+ * gcc.dg/attr-copy-8.c: Ditto.
+
+2020-07-21 Dimitar Dimitrov <dimitar@dinux.eu>
+
+ * c-c++-common/Waddress-of-packed-member-1.c: Filter dg-warning
+ for targets who pack by default.
+ * c-c++-common/Waddress-of-packed-member-2.c: Ditto.
+ * c-c++-common/pr51628-13.c: Ditto.
+ * c-c++-common/pr51628-15.c: Ditto.
+ * c-c++-common/pr51628-16.c: Ditto.
+ * c-c++-common/pr51628-26.c: Ditto.
+ * c-c++-common/pr51628-27.c: Ditto.
+ * c-c++-common/pr51628-28.c: Ditto.
+ * c-c++-common/pr51628-29.c: Ditto.
+ * c-c++-common/pr51628-3.c: Ditto.
+ * c-c++-common/pr51628-30.c: Ditto.
+ * c-c++-common/pr51628-31.c: Ditto.
+ * c-c++-common/pr51628-32.c: Ditto.
+ * c-c++-common/pr51628-33.c: Ditto.
+ * c-c++-common/pr51628-35.c: Ditto.
+ * c-c++-common/pr51628-4.c: Ditto.
+ * c-c++-common/pr51628-5.c: Ditto.
+ * c-c++-common/pr51628-6.c: Ditto.
+ * c-c++-common/pr51628-8.c: Ditto.
+ * c-c++-common/pr51628-9.c: Ditto.
+ * c-c++-common/pr88664-2.c: Ditto.
+ * gcc.dg/pr51628-17.c: Ditto.
+ * gcc.dg/pr51628-19.c: Ditto.
+ * gcc.dg/pr51628-20.c: Ditto.
+ * gcc.dg/pr51628-21.c: Ditto.
+ * gcc.dg/pr51628-22.c: Ditto.
+ * gcc.dg/pr51628-24.c: Ditto.
+ * gcc.dg/pr51628-25.c: Ditto.
+ * gcc.dg/pr51628-34.c: Ditto.
+ * gcc.dg/pr88928.c: Ditto.
+
+2020-07-21 Kito Cheng <kito.cheng@sifive.com>
+
+ * gcc.dg/analyzer/signal-1.c: Add dg-require-effective-target
+ signal.
+ * gcc.dg/analyzer/signal-2.c: Ditto.
+ * gcc.dg/analyzer/signal-3.c: Ditto.
+ * gcc.dg/analyzer/signal-4a.c: Ditto.
+ * gcc.dg/analyzer/signal-4b.c: Ditto.
+ * gcc.dg/analyzer/signal-5.c: Ditto.
+ * gcc.dg/analyzer/signal-6.c: Ditto.
+ * gcc.dg/analyzer/signal-exit.c: Ditto.
+
+2020-07-21 Xionghu Luo <luoxhu@linux.ibm.com>
+
+ PR rtl-optimization/89310
+ * gcc.target/powerpc/pr89310.c: New test.
+
+2020-07-21 Kewen Lin <linkw@linux.ibm.com>
+
+ * gcc.target/powerpc/p9-vec-length-1.h: New test.
+ * gcc.target/powerpc/p9-vec-length-2.h: New test.
+ * gcc.target/powerpc/p9-vec-length-3.h: New test.
+ * gcc.target/powerpc/p9-vec-length-4.h: New test.
+ * gcc.target/powerpc/p9-vec-length-5.h: New test.
+ * gcc.target/powerpc/p9-vec-length-6.h: New test.
+ * gcc.target/powerpc/p9-vec-length-7.h: New test.
+ * gcc.target/powerpc/p9-vec-length-8.h: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-1.c: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-2.c: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-3.c: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-4.c: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-5.c: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-6.c: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-7.c: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-8.c: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-run-1.c: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-run-2.c: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-run-3.c: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-run-4.c: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-run-5.c: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-run-6.c: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-run-7.c: New test.
+ * gcc.target/powerpc/p9-vec-length-epil-run-8.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-1.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-2.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-3.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-4.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-5.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-6.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-7.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-8.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-run-1.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-run-2.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-run-3.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-run-4.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-run-5.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-run-6.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-run-7.c: New test.
+ * gcc.target/powerpc/p9-vec-length-full-run-8.c: New test.
+ * gcc.target/powerpc/p9-vec-length-run-1.h: New test.
+ * gcc.target/powerpc/p9-vec-length-run-2.h: New test.
+ * gcc.target/powerpc/p9-vec-length-run-3.h: New test.
+ * gcc.target/powerpc/p9-vec-length-run-4.h: New test.
+ * gcc.target/powerpc/p9-vec-length-run-5.h: New test.
+ * gcc.target/powerpc/p9-vec-length-run-6.h: New test.
+ * gcc.target/powerpc/p9-vec-length-run-7.h: New test.
+ * gcc.target/powerpc/p9-vec-length-run-8.h: New test.
+ * gcc.target/powerpc/p9-vec-length.h: New test.
+
+2020-07-21 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/independent-cloneids-1.c: Skip for mmix.
+ flag_stack_usage_info.
+
+2020-07-21 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/cdce3.c: Update matched line-number.
+
+2020-07-20 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/opt/flifetime-dse7.C: New test.
+
+2020-07-20 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp1z/nontype2.C: No error in C++20.
+ * g++.dg/template/nontype25.C: No error in C++20.
+ * g++.dg/template/nontype8.C: No error in C++20.
+ * g++.dg/cpp2a/nontype-subob1.C: New test.
+ * g++.dg/cpp2a/nontype-subob2.C: New test.
+ * g++.dg/cpp1z/nontype3.C: Now C++17-only.
+ * g++.dg/cpp2a/feat-cxx2a.C: Adjust expected value.
+
+2020-07-20 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp2a/class-deduction-aggr7.C: New test.
+
+2020-07-20 Yang Yang <yangyang305@huawei.com>
+
+ * gcc.target/aarch64/sve/pr96195.c: New test.
+
+2020-07-20 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/95750
+ * gcc.target/i386/pr95750.c: New test.
+
+2020-07-20 Martin Sebor <msebor@redhat.com>
+
+ PR middle-end/95189
+ PR middle-end/95886
+ * gcc.dg/memcmp-pr95189.c: New test.
+ * gcc.dg/strncmp-3.c: New test.
+ * gcc.target/i386/memcpy-pr95886.c: New test.
+
+2020-07-20 Alex Coplan <alex.coplan@arm.com>
+
+ PR jit/69435
+ * jit.dg/jit.exp (fixed_host_execute): Fix regex patterns to
+ always explicitly match newlines.
+
+2020-07-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR libstdc++/93121
+ * gcc.dg/tree-ssa/pr93121-2.c: New test.
+
+2020-07-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR libstdc++/93121
+ * gcc.dg/tree-ssa/pr93121-1.c: New test.
+
+2020-07-20 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/const-uniq-1.c: Adjust scanned pattern for mmix.
+
+2020-07-20 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/cdce3.c: Skip for mmix.
+
+2020-07-20 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/pr87485.c: Require scheduling.
+
+2020-07-19 H.J. Lu <hjl.tools@gmail.com>
+
+ PR target/95973
+ PR target/96238
+ * gcc.target/i386/pr95973.c: New test.
+
+2020-07-19 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/96018
+ * gfortran.dg/implicit_pure_5.c: New file.
+ * gfortran.dg/implicit_pure_5.f90: New file.
+
+2020-07-19 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/attr-copy-6.c: Require visibility.
+
+2020-07-19 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/Wno-frame-address.c: Skip for cris and mmix.
+
+2020-07-18 Jakub Jelinek <jakub@redhat.com>
+
+ * c-c++-common/cpp/pragma-eof.c: Use .+3 instead of 6 in
+ dg-error.
+
+2020-07-18 David Edelsohn <dje.gcc@gmail.com>
+
+ * gfortran.dg/goacc/finalize-1.f: Adjust regex for 32 bits.
+
+2020-07-18 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * c-c++-common/cpp/pragma-eof.c: Require fopenmp.
+
+2020-07-18 Peter Bergner <bergner@linux.ibm.com>
+
+ PR target/92488
+ * gcc.target/powerpc/convert-fp-128.c (bl, drsp, drdpq): Update counts.
+ (__dpd_trunctdsd2): Make conditional on !hard_dfp.
+ (__dpd_extendsddd2, __dpd_extendsdtd2, __dpd_truncddsd2,
+ __dpd_extendddtd2, __dpd_trunctddd2): Use !hard_dfp.
+ * gcc.target/powerpc/pr92488.c: New test.
+
+2020-07-17 Marek Polacek <polacek@redhat.com>
+
+ PR c++/79815
+ * g++.dg/cpp1y/auto-fn59.C: New test.
+
+2020-07-17 H.J. Lu <hjl.tools@gmail.com>
+
+ PR target/96186
+ PR target/88713
+ * gcc.target/i386/pr88713-3.c: New test.
+
+2020-07-17 Tamar Christina <tamar.christina@arm.com>
+
+ * gcc.target/aarch64/cpunative/aarch64-cpunative.exp: New test.
+ * gcc.target/aarch64/cpunative/info_0: New test.
+ * gcc.target/aarch64/cpunative/info_1: New test.
+ * gcc.target/aarch64/cpunative/info_10: New test.
+ * gcc.target/aarch64/cpunative/info_11: New test.
+ * gcc.target/aarch64/cpunative/info_12: New test.
+ * gcc.target/aarch64/cpunative/info_13: New test.
+ * gcc.target/aarch64/cpunative/info_14: New test.
+ * gcc.target/aarch64/cpunative/info_15: New test.
+ * gcc.target/aarch64/cpunative/info_2: New test.
+ * gcc.target/aarch64/cpunative/info_3: New test.
+ * gcc.target/aarch64/cpunative/info_4: New test.
+ * gcc.target/aarch64/cpunative/info_5: New test.
+ * gcc.target/aarch64/cpunative/info_6: New test.
+ * gcc.target/aarch64/cpunative/info_7: New test.
+ * gcc.target/aarch64/cpunative/info_8: New test.
+ * gcc.target/aarch64/cpunative/info_9: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_0.c: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_1.c: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_10.c: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_11.c: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_12.c: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_13.c: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_14.c: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_15.c: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_2.c: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_3.c: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_4.c: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_5.c: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_6.c: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_7.c: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_8.c: New test.
+ * gcc.target/aarch64/cpunative/native_cpu_9.c: New test.
+
+2020-07-17 Tamar Christina <tamar.christina@arm.com>
+
+ * lib/gcc-dg.exp (dg-set-compiler-env-var, dg-set-target-env-var): Add
+ verbose output.
+
+2020-07-17 Andrew Pinski <apinksi@marvell.com>
+ Dmitrij Pochepko <dmitrij.pochepko@bell-sw.com>
+
+ PR target/93720
+ * gcc.target/aarch64/vins-1.c: New test.
+ * gcc.target/aarch64/vins-2.c: New test.
+ * gcc.target/aarch64/vins-3.c: New test.
+
+2020-07-17 Andrew Pinski <apinksi@marvell.com>
+ Dmitrij Pochepko <dmitrij.pochepko@bell-sw.com>
+
+ PR target/82199
+ * gcc.target/aarch64/vdup_n_3.c: New test.
+ * gcc.target/aarch64/vzip_1.c: New test.
+ * gcc.target/aarch64/vzip_2.c: New test.
+ * gcc.target/aarch64/vzip_3.c: New test.
+ * gcc.target/aarch64/vzip_4.c: New test.
+
+2020-07-17 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ PR target/96127
+ * gcc.target/s390/pr96127.c: New test.
+
+2020-07-17 Kewen Lin <linkw@linux.ibm.com>
+
+ * gcc.target/powerpc/conv-vectorize-1.c: Add option
+ -fno-vect-cost-model.
+ * gcc.target/powerpc/conv-vectorize-2.c: Likewise.
+
+2020-07-16 Julian Brown <julian@codesourcery.com>
+ Thomas Schwinge <thomas@codesourcery.com>
+
+ * gfortran.dg/goacc/attach-descriptor.f90: New test.
+
+2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/95591
+ PR c++/95599
+ PR c++/95823
+ PR c++/95824
+ PR c++/95895
+ * g++.dg/coroutines/pr95591.C: New test.
+ * g++.dg/coroutines/pr95599.C: New test.
+ * g++.dg/coroutines/pr95823.C: New test.
+ * g++.dg/coroutines/pr95824.C: New test.
+
+2020-07-16 Jonathan Wakely <jwakely@redhat.com>
+
+ PR testsuite/96014
+ * g++.dg/analyzer/pr94028.C: Replace dynamic exception
+ specification with noexcept-specifier for C++11 and later.
+
+2020-07-16 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/96189
+ * gcc.target/i386/pr96189-1.c: New test.
+
+2020-07-16 Marek Polacek <polacek@redhat.com>
+
+ DR 188
+ * g++.dg/DRs/dr188.C: New test.
+
+2020-07-15 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/96189
+ * gcc.target/i386/pr96189.c: New test.
+
+2020-07-15 Nathan Sidwell <nathan@acm.org>
+
+ * g++.dg/parse/pragma-recovery.C: New.
+
+2020-07-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/96174
+ * gcc.target/i386/avx512f-vcmppd-3.c: New test.
+ * gcc.target/i386/avx512f-vcmpps-3.c: New test.
+
+2020-07-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/96176
+ * gcc.target/i386/pr96176.c: New test.
+
+2020-07-14 Marek Polacek <polacek@redhat.com>
+
+ PR c++/59978
+ * g++.dg/cpp0x/vt-59978.C: New test.
+
+2020-07-14 H.J. Lu <hjl.tools@gmail.com>
+
+ PR target/95443
+ * gcc.target/i386/pr95443-1.c (simple_strstr): Replace
+ __glibc_unlikely with __builtin_expect.
+
+2020-07-14 Marek Polacek <polacek@redhat.com>
+
+ PR c++/95789
+ PR c++/96104
+ PR c++/96179
+ * g++.dg/conversion/ref4.C: New test.
+ * g++.dg/conversion/ref5.C: New test.
+ * g++.dg/conversion/ref6.C: New test.
+
+2020-07-14 Lewis Hyatt <lhyatt@gmail.com>
+
+ PR preprocessor/49973
+ PR other/86904
+ * c-c++-common/Wmisleading-indentation-3.c: Adjust expected output
+ for new defaults.
+ * c-c++-common/Wmisleading-indentation.c: Likewise.
+ * c-c++-common/diagnostic-format-json-1.c: Likewise.
+ * c-c++-common/diagnostic-format-json-2.c: Likewise.
+ * c-c++-common/diagnostic-format-json-3.c: Likewise.
+ * c-c++-common/diagnostic-format-json-4.c: Likewise.
+ * c-c++-common/diagnostic-format-json-5.c: Likewise.
+ * c-c++-common/missing-close-symbol.c: Likewise.
+ * g++.dg/diagnostic/bad-binary-ops.C: Likewise.
+ * g++.dg/parse/error4.C: Likewise.
+ * g++.old-deja/g++.brendan/crash11.C: Likewise.
+ * g++.old-deja/g++.pt/overload2.C: Likewise.
+ * g++.old-deja/g++.robertl/eb109.C: Likewise.
+ * gcc.dg/analyzer/malloc-paths-9.c: Likewise.
+ * gcc.dg/bad-binary-ops.c: Likewise.
+ * gcc.dg/format/branch-1.c: Likewise.
+ * gcc.dg/format/pr79210.c: Likewise.
+ * gcc.dg/plugin/diagnostic-test-expressions-1.c: Likewise.
+ * gcc.dg/plugin/diagnostic-test-string-literals-1.c: Likewise.
+ * gcc.dg/redecl-4.c: Likewise.
+ * gfortran.dg/diagnostic-format-json-1.F90: Likewise.
+ * gfortran.dg/diagnostic-format-json-2.F90: Likewise.
+ * gfortran.dg/diagnostic-format-json-3.F90: Likewise.
+ * go.dg/arrayclear.go: Add a comment explaining why adding a
+ comment was necessary to work around a dejagnu bug.
+ * c-c++-common/diagnostic-units-1.c: New test.
+ * c-c++-common/diagnostic-units-2.c: New test.
+ * c-c++-common/diagnostic-units-3.c: New test.
+ * c-c++-common/diagnostic-units-4.c: New test.
+ * c-c++-common/diagnostic-units-5.c: New test.
+ * c-c++-common/diagnostic-units-6.c: New test.
+ * c-c++-common/diagnostic-units-7.c: New test.
+ * c-c++-common/diagnostic-units-8.c: New test.
+
+2020-07-14 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/goacc/finalize-1.f: Relax scan-tree-dump-times
+ pattern to work on 32bit-pointer systems.
+
+2020-07-14 David Edelsohn <dje.gcc@gmail.com>
+
+ * g++.dg/ipa/pr83667.C: Allow 0 or more dots between THUNK and 0.
+
+2020-07-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/96194
+ * g++.dg/opt/pr96194.C: New test.
+
+2020-07-14 Marek Polacek <polacek@redhat.com>
+
+ PR c++/95820
+ * g++.dg/cpp1y/auto-fn58.C: New test.
+
+2020-07-14 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/95612
+ * gfortran.dg/pr95612.f90: New test.
+
+2020-07-14 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/goacc/finalize-1.f: Update dump scan pattern.
+ * gfortran.dg/gomp/map-1.f90: Update dg-error.
+ * gfortran.dg/gomp/map-2.f90: New test.
+
+2020-07-14 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/96038
+ * gfortran.dg/pr96038.f90: New test.
+
+2020-07-13 Aaron Sawdey <acsawdey@linux.ibm.com>
+
+ * lib/target-supports.exp (is-effective-target):
+ Reorder to put powerpc stuff together.
+ (is-effective-target-keyword): Add power10_hw.
+
+2020-07-13 Nathan Sidwell <nathan@acm.org>
+
+ * lib/scanlang.exp (scan-lang-dump): Fix breakage.
+ (scan-lang-dump-times, scan-lang-dump-not): New.
+
+2020-07-13 Aaron Sawdey <acsawdey@linux.ibm.com>
+
+ * lib/target-supports.exp (check_ppc_mma_hw_available):
+ New function.
+ (is-effective-target): Add ppc_mma_hw.
+ (is-effective-target-keyword): Add ppc_mma_hw.
+ * gcc.target/powerpc/mma-supported.c: New file.
+ * gcc.target/powerpc/mma-single-test.c: Require ppc_mma_hw.
+ * gcc.target/powerpc/mma-double-test.c: Require ppc_mma_hw.
+
+2020-07-13 H.J. Lu <hjl.tools@gmail.com>
+
+ PR target/95443
+ * gcc.target/i386/pr95443-1.c: New test.
+ * gcc.target/i386/pr95443-2.c: Likewise.
+
+2020-07-13 Marek Polacek <polacek@redhat.com>
+
+ PR c++/95288
+ * g++.dg/diagnostic/enum2.C: New test.
+
+2020-07-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR ipa/96130
+ * gcc.dg/torture/pr96130.c: New test.
+
+2020-07-13 Mark Eggleston <markeggleston@gcc.gnu.org>
+
+ PR fortran/45337
+ * gfortran.dg/pr45337_1.f90: New test.
+ * gfortran.dg/pr45337_2.f90: New test.
+
+2020-07-13 Marek Polacek <polacek@redhat.com>
+
+ PR c++/96077
+ * g++.dg/parse/enum14.C: New test.
+
+2020-07-13 Nathan Sidwell <nathan@acm.org>
+
+ * lib/scanlang.exp (scan-lang-dump-not): Fix 3-arg case.
+
+2020-07-13 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/96163
+ * g++.dg/vect/pr96163.cc: New testcase.
+
+2020-07-13 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/95981
+ * gfortran.dg/pr95981.f90: New test.
+
+2020-07-13 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ PR target/94891
+ * gcc.target/aarch64/return_address_sign_1.c: Update test.
+ * gcc.target/aarch64/return_address_sign_b_1.c: Likewise.
+
+2020-07-13 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR middle-end/95114
+ * g++.target/aarch64/pr95114.C: New test.
+
+2020-07-13 Julian Brown <julian@codesourcery.com>
+ Thomas Schwinge <thomas@codesourcery.com>
+
+ * gfortran.dg/goacc/finalize-1.f: Update expected dump output.
+
+2020-07-13 Richard Biener <rguenther@suse.de>
+
+ PR testsuite/96180
+ * gcc.dg/torture/pr96133.c: Align global variable.
+
+2020-07-13 Hans-Peter Nilsson <hp@axis.com>
+
+ * gcc.target/cris/pr93372-44.c, gcc.target/cris/pr93372-46.c: New.
+
+2020-07-13 Hans-Peter Nilsson <hp@axis.com>
+
+ PR target/93372
+ * gcc.target/cris/pr93372-45.c: New test.
+
+2020-07-13 Hans-Peter Nilsson <hp@axis.com>
+
+ PR middle-end/94600
+ * gcc.dg/pr94600-1.c, gcc.dg/pr94600-2.c, gcc.dg/pr94600-3.c,
+ gcc.dg/pr94600-4.c, gcc.dg/pr94600-5.c, gcc.dg/pr94600-6.c,
+ gcc.dg/pr94600-7.c, gcc.dg/pr94600-8.c: New tests.
+
+2020-07-13 Xionghu Luo <luoxhu@linux.ibm.com>
+
+ * gcc.target/powerpc/vector_float.c: New test.
+
+2020-07-12 H.J. Lu <hjl.tools@gmail.com>
+
+ PR target/93492
+ * gcc.target/i386/pr93492-1.c: Require Linux target.
+ * gcc.target/i386/pr93492-2.c: Likewise.
+ * gcc.target/i386/pr93492-3.c: Likewise.
+ * gcc.target/i386/pr93492-4.c: Likewise.
+ * gcc.target/i386/pr93492-5.c: Likewise.
+
+2020-07-11 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/96073
+ * gfortran.dg/interface_48.f90: New test.
+
+2020-07-11 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR tree-optimization/96146
+ * gcc.target/aarch64/sve/acle/general/pr96146.c: New test.
+
+2020-07-11 Simon Cook <simon.cook@embecosm.com>
+
+ * gcc.target/riscv/read-thread-pointer.c: Fix escaping on
+ regular expression.
+
+2020-07-10 Joseph Myers <joseph@codesourcery.com>
+
+ * gcc.dg/c11-bool-limits-1.c, gcc.dg/c2x-bool-limits-1.c: New
+ tests.
+
+2020-07-10 Rajalakshmi Srinivasaraghavan <rajis@linux.vnet.ibm.com>
+ Aaron Sawdey <acsawdey@linux.ibm.com>
+
+ * gcc.target/powerpc/p10-identify.c: New file.
+ * gcc.target/powerpc/p10-arch31.c: New file.
+ * gcc.target/powerpc/mma-single-test.c: New file.
+ * gcc.target/powerpc/mma-double-test.c: New file.
+
+2020-07-10 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95980
+ * gfortran.dg/pr95980_2.f90: New file.
+
+2020-07-10 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/96086
+ * gfortran.dg/pr96086.f90: New file.
+
+2020-07-10 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR target/92789
+ PR target/95726
+ * g++.target/arm/pr95726.C: New test.
+
+2020-07-10 Carl Love <cel@us.ibm.com>
+
+ * gcc.target/powerpc/vsx_mask-count-runnable.c: New test case.
+ * gcc.target/powerpc/vsx_mask-expand-runnable.c: New test case.
+ * gcc.target/powerpc/vsx_mask-extract-runnable.c: New test case.
+ * gcc.target/powerpc/vsx_mask-move-runnable.c: New test case.
+
+2020-07-10 Martin Liska <mliska@suse.cz>
+
+ PR gcov-profile/96148
+ * lib/scanwpaipa.exp: Fix wpa dump file suffix the same way
+ as other in the file.
+
+2020-07-10 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp2a/nontype-class-union1.C: New test.
+
+2020-07-10 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/pr81246.C: No error in C++20.
+ * g++.dg/cpp0x/variadic74.C: No error in C++20.
+ * g++.dg/cpp1z/nontype-auto3.C: No error in C++20.
+ * g++.dg/template/crash106.C: No error in C++20.
+ * g++.dg/template/crash119.C: No error in C++20.
+ * g++.dg/template/nontype12.C: No error in C++20.
+ * g++.dg/template/void3.C: Don't require follow-on message.
+ * g++.dg/template/void7.C: Don't require follow-on message.
+ * g++.dg/template/void9.C: Don't require follow-on message.
+ * g++.dg/cpp2a/nontype-class-equiv1.C: New file.
+
+2020-07-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/96105
+ PR c++/96052
+ PR c++/95976
+ * g++.dg/cpp2a/no_unique_address4.C: New test.
+ * g++.dg/cpp2a/no_unique_address5.C: New test.
+ * g++.dg/cpp2a/no_unique_address6.C: New test.
+
+2020-07-10 Andrea Corallo <andrea.corallo@arm.com>
+ Mihail-Calin Ionescu <mihail.ionescu@arm.com>
+ Iain Apreotesei <iain.apreotesei@arm.com>
+
+ * gcc.target/arm/lob.h: New header.
+ * gcc.target/arm/lob1.c: New testcase.
+ * gcc.target/arm/lob2.c: Likewise.
+ * gcc.target/arm/lob3.c: Likewise.
+ * gcc.target/arm/lob4.c: Likewise.
+ * gcc.target/arm/lob5.c: Likewise.
+ * gcc.target/arm/lob6.c: Likewise.
+ * gcc.target/arm/unsigned-extend-2.c: Do not run when generating
+ low loop overhead.
+ * gcc.target/arm/ivopts.c: Fix check for low loop overhead.
+ * lib/target-supports.exp (check_effective_target_arm_v8_1_lob)
+ (check_effective_target_arm_thumb2_ok_no_arm_v8_1_lob): New procs.
+
+2020-07-10 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/96133
+ * gcc.dg/torture/pr96133.c: New testcase.
+
+2020-07-10 Cui,Lili <lili.cui@intel.com>
+
+ * gcc.target/i386/funcspec-56.inc: Handle new march.
+ * g++.target/i386/mv16.C: Handle new march
+
+2020-07-09 Julian Brown <julian@codesourcery.com>
+ Thomas Schwinge <thomas@codesourcery.com>
+
+ PR middle-end/95270
+ * c-c++-common/goacc/mdc-1.c: Update expected dump output for zero
+ bias.
+
+2020-07-09 Julian Brown <julian@codesourcery.com>
+
+ * gfortran.dg/goacc/mapping-tests-3.f90: New test.
+ * gfortran.dg/goacc/mapping-tests-4.f90: New test.
+
+2020-07-09 Peter Bergner <bergner@linux.ibm.com>
+
+ PR target/96125
+ * gcc.target/powerpc/pr96125.c: New test.
+
+2020-07-09 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/96132
+ * g++.dg/template/incomplete12.C: New test.
+
+2020-07-09 H.J. Lu <hjl.tools@gmail.com>
+
+ PR target/88713
+ * gcc.target/i386/pr88713-1.c: New test.
+ * gcc.target/i386/pr88713-2.c: Likewise.
+
+2020-07-09 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/vect/bb-slp-10.c: Adjust.
+ * gcc.dg/vect/slp-45.c: Likewise.
+ * gcc.dg/vect/vect-109.c: Likewise.
+
+2020-07-09 Bin Cheng <bin.cheng@linux.alibaba.com>
+
+ PR tree-optimization/95804
+ * gcc.dg/tree-ssa/pr95804.c: New test.
+
+2020-07-09 Omar Tahir <omar.tahir@arm.com>
+
+ * gcc.target/aarch64/nospill.c: New test.
+
+2020-07-09 Matthew Malcomson <matthew.malcomson@arm.com>
+
+ * gcc.target/aarch64/sls-mitigation/sls-miti-blr-bti.c: New test.
+ * gcc.target/aarch64/sls-mitigation/sls-miti-blr.c: New test.
+
+2020-07-09 Matthew Malcomson <matthew.malcomson@arm.com>
+
+ * gcc.target/aarch64/sls-mitigation/sls-miti-retbr.c: New test.
+ * gcc.target/aarch64/sls-mitigation/sls-miti-retbr-pacret.c:
+ New test.
+ * gcc.target/aarch64/sls-mitigation/sls-mitigation.exp: New file.
+ * lib/target-supports.exp (check_effective_target_aarch64_asm_sb_ok):
+ New proc.
+
+2020-07-09 Kewen Lin <linkw@linux.ibm.com>
+
+ * gcc.target/aarch64/sve/clastb_1.c: Update dumping string.
+ * gcc.target/aarch64/sve/clastb_2.c: Likewise.
+ * gcc.target/aarch64/sve/clastb_3.c: Likewise.
+ * gcc.target/aarch64/sve/clastb_4.c: Likewise.
+ * gcc.target/aarch64/sve/clastb_5.c: Likewise.
+ * gcc.target/aarch64/sve/clastb_6.c: Likewise.
+ * gcc.target/aarch64/sve/clastb_7.c: Likewise.
+
+2020-07-09 Kito Cheng <kito.cheng@sifive.com>
+
+ * gcc.target/riscv/read-thread-pointer.c: New.
+
+2020-07-09 Kito Cheng <kito.cheng@sifive.com>
+
+ * gcc.target/riscv/save-restore-9.c: New.
+
+2020-07-08 Eric Botcazou <ebotcazou@gcc.gnu.org>
+
+ * gcc.dg/sso-11.c: New test.
+ * gcc.dg/sso/sso.exp: Pass -Wno-scalar-storage-order.
+ * gcc.dg/sso/memcpy-1.c: New test.
+
+2020-07-08 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/96085
+ * gfortran.dg/pr96085.f90: New file.
+
+2020-07-08 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/95497
+ * g++.dg/cpp2a/concepts-pr95497.C: New test.
+
+2020-07-08 Will Schmidt <will_schmidt@vnet.ibm.com>
+
+ * gcc.target/powerpc/builtins-msum-runnable.c: New test.
+ * gcc.target/powerpc/vsx-builtin-msum.c: New test.
+
+2020-07-08 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR middle-end/95694
+ * gcc.dg/pr95694.c: New test.
+
+2020-07-08 Marek Polacek <polacek@redhat.com>
+
+ PR c++/96103
+ * g++.dg/cpp0x/decltype77.C: New test.
+
+2020-07-07 Marek Polacek <polacek@redhat.com>
+
+ PR c++/92427
+ * g++.dg/ext/flexary37.C: New test.
+
+2020-07-07 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/95303
+ * g++.dg/concepts/diagnostic14.C: New test.
+
+2020-07-07 Aaron Sawdey <acsawdey@linux.ibm.com>
+
+ * lib/target-supports.exp (check_power10_hw_available):
+ Return 0 for passing test.
+
+2020-07-07 Nathan Sidwell <nathan@acm.org>
+
+ * c-c++-common/cpp/pragma-eof.c: New
+
+2020-07-07 Nathan Sidwell <nathan@acm.org>
+
+ * c-c++-common/cpp/line-2.c: New.
+ * c-c++-common/cpp/line-2.h: New.
+ * c-c++-common/cpp/line-3.c: New.
+ * c-c++-common/cpp/line-4.c: New.
+ * c-c++-common/cpp/line-4.h: New.
+
+2020-07-07 Martin Sebor <msebor@redhat.com>
+
+ PR c++/96063
+ * g++.dg/warn/Wmismatched-tags-7.C: New test.
+ * g++.dg/warn/Wmismatched-tags-8.C: New test.
+
+2020-07-07 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/vect/slp-47.c: New testcase.
+ * gcc.dg/vect/slp-48.c: Likewise.
+
+2020-07-06 Martin Sebor <msebor@redhat.com>
+
+ PR c++/95984
+ * g++.dg/warn/Wnonnull6.C: New test.
+
+2020-07-06 Nathan Sidwell <nathan@acm.org>
+
+ * g++.dg/eh/builtin10.C: Adjust expected errors.
+ * g++.dg/eh/builtin11.C: Likewise.
+ * g++.dg/eh/builtin5.C: Likewise.
+ * g++.dg/eh/builtin6.C: Likewise.
+ * g++.dg/eh/builtin7.C: Likewise.
+ * g++.dg/eh/builtin9.C: Likewise.
+ * g++.dg/parse/crash55.C: Likewise.
+
+2020-07-06 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95980
+ * gfortran.dg/pr95980.f90: New file.
+
+2020-07-06 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95709
+ * gfortran.dg/pr95709.f90: New file.
+
+2020-07-06 Jonathan Wakely <jwakely@redhat.com>
+
+ * g++.old-deja/g++.bugs/900404_04.C: Add c++98_only selector to
+ dg-error for extra ';'.
+ * g++.old-deja/g++.law/missed-error2.C: Likewise.
+
+2020-07-06 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/96075
+ * gcc.dg/vect/slp-46.c: New testcase.
+
+2020-07-06 Roger Sayle <roger@nextmovesoftware.com>
+
+ * gcc.target/nvptx/vadd_add.c: New test.
+ * gcc.target/nvptx/vsub_add.c: New test.
+
+2020-07-06 Hans-Peter Nilsson <hp@axis.com>
+
+ * gcc.target/cris/peep2-movulsr.c: New test.
+
+2020-07-05 Hans-Peter Nilsson <hp@axis.com>
+
+ * gcc.target/cris/pr93372-39.c: New test.
+
+2020-07-05 Hans-Peter Nilsson <hp@axis.com>
+
+ * gcc.target/cris/pr93372-36.c, gcc.target/cris/pr93372-37.c,
+ gcc.target/cris/pr93372-38.c: New tests.
+
+2020-07-05 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/27318
+ * gfortran.dg/error_recovery_1.f90: Adjust test case.
+ * gfortran.dg/use_15.f90: Likewise.
+ * gfortran.dg/interface_47.f90: New test.
+
+2020-07-04 Iain Sandoe <iain@sandoe.co.uk>
+
+ * g++.dg/coroutines/pr9xxxx-mismatched-traits-and-promise-prev.C: Moved to...
+ * g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C: ...here.
+
+2020-07-03 Eric Botcazou <ebotcazou@gcc.gnu.org>
+
+ * gnat.dg/opt87.adb: New test.
+ * gnat.dg/opt87_pkg.ads: New helper.
+ * gnat.dg/opt87_pkg.adb: Likewise.
+
+2020-07-03 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/96040
+ * gcc.dg/ipa/pr96040.c: New test.
+
+2020-07-03 Roger Sayle <roger@nextmovesoftware.com>
+
+ * gcc.target/nvptx/popc-1.c: New test.
+ * gcc.target/nvptx/popc-2.c: New test.
+ * gcc.target/nvptx/popc-3.c: New test.
+ * gcc.target/nvptx/mul-wide.c: New test.
+ * gcc.target/nvptx/umul-wide.c: New test.
+
+2020-07-03 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/vect/costmodel/x86_64/costmodel-vect-slp-2.c: New
+ testcase.
+
+2020-07-03 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.dg/fixits-pr84852-1.c: Enclose negative line number in braces.
+ * gcc.dg/fixits-pr84852-2.c: Same.
+ * gcc.dg/pr89410-1.c: Same.
+ * gcc.dg/pr89410-2.c: Same.
+
+2020-07-02 David Edelsohn <dje.gcc@gmail.com>
+
+ * gfortran.dg/pr95690.f90: Solaris error appears on line 5.
+
+2020-07-02 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.dg/pr26570.c: dg-prune function not inlinable warning.
+
+2020-07-02 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/93423
+ * gfortran.dg/pr93423.f90: New file.
+
+2020-07-02 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/93337
+ * gfortran.dg/pr93337.f90: New file.
+
+2020-07-02 Jason Merrill <jason@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * g++.dg/cpp2a/consteval-virtual1.C: New test.
+ * g++.dg/cpp2a/consteval-virtual2.C: New test.
+ * g++.dg/cpp2a/consteval-virtual3.C: New test.
+ * g++.dg/cpp2a/consteval-virtual4.C: New test.
+ * g++.dg/cpp2a/consteval-virtual5.C: New test.
+
+2020-07-02 Martin Jambor <mjambor@suse.cz>
+
+ PR debug/95343
+ * gcc.dg/guality/pr95343.c: New test.
+
+2020-07-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/95857
+ * gcc.dg/pr95857.c: New test.
+
+2020-07-02 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/96022
+ * g++.dg/vect/pr96022.cc: New testcase.
+
+2020-07-02 Felix Yang <felix.yang@huawei.com>
+
+ PR tree-optimization/95961
+ * gcc.target/aarch64/sve/pr95961.c: New test.
+
+2020-07-02 Jakub Jelinek <jakub@redhat.com>
+
+ * c-c++-common/gomp/loop-7.c: New test.
+
+2020-07-02 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/95584
+ * gfortran.dg/pr95584.f90: New test.
+
+2020-07-02 Kewen Lin <linkw@linux.ibm.com>
+
+ * g++.dg/vect/slp-pr56812.cc: Ignore line number for basic block
+ vectorization messages.
+
+2020-07-01 Omar Tahir <omar.tahir@arm.com>
+
+ * gcc.target/aarch64/bti-4.c: New test.
+
+2020-07-01 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/94882
+ * gcc.dg/tree-ssa/pr94882.c: New test.
+ * gcc.dg/tree-ssa/pr94882-1.c: New test.
+ * gcc.dg/tree-ssa/pr94882-2.c: New test.
+ * gcc.dg/tree-ssa/pr94882-3.c: New test.
+
+2020-07-01 Jonathan Wakely <jwakely@redhat.com>
+
+ PR testsuite/96014
+ * g++.dg/analyzer/pr94028.C: Make operator new non-throwing so
+ that the compiler doesn't implicitly mark it as returning
+ non-null.
+
+2020-07-01 David Edelsohn <dje.gcc@gmail.com>
+
+ * gfortran.dg/pr95690.f90: Adjust dg-error line number.
+
+2020-07-01 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.target/powerpc/direct-move-double1.c: Require lp64.
+ * gcc.target/powerpc/direct-move-float1.c: Same.
+ * gcc.target/powerpc/direct-move-float3.c: Same.
+ * gcc.target/powerpc/direct-move-vint1.c: Same.
+ * gcc.target/powerpc/vsx-vector-5.c: Same.
+ * gcc.target/powerpc/vsx-vector-6.p7.c: Same.
+ * gcc.target/powerpc/vsx-vector-6.p8.c: Same.
+ * gcc.target/powerpc/vsx-vector-6.p9.c: Same.
+
+2020-07-01 Andrea Corallo <andrea.corallo@arm.com>
+
+ * gcc.target/aarch64/get_fpcr64_1.c: New test.
+ * gcc.target/aarch64/set_fpcr64_1.c: New test.
+ * gcc.target/aarch64/get_fpsr64_1.c: New test.
+ * gcc.target/aarch64/set_fpsr64_1.c: New test.
+
+2020-07-01 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/95446
+ * gfortran.dg/elemental_optional_args_6.f90: Remove check
+ for warnings that were erroneously output.
+ * gfortran.dg/pr95446.f90: New test.
+
+2020-07-01 Christophe Lyon <christophe.lyon@linaro.org>
+
+ PR target/94743
+ * gcc.target/arm/handler-align.c: Add -mgeneral-regs-only.
+
+2020-07-01 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95839
+ * gcc.dg/vect/bb-slp-pr95839-2.c: New testcase.
+
+2020-07-01 Martin Liska <mliska@suse.cz>
+
+ * g++.dg/gcov/loop.C: Use -H option instead of -j option.
+
+2020-07-01 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/95829
+ * gfortran.dg/pr95829.f90: New test.
+
+2020-07-01 Christophe Lyon <christophe.lyon@linaro.org>
+
+ PR target/94743
+ * gcc.target/arm/pr94743-1-hard.c: Add missing quotes in expected
+ warning.
+ * gcc.target/arm/pr94743-1-softfp.c: Likewise.
+
+2020-07-01 Kito Cheng <kito.cheng@sifive.com>
+
+ * gcc.target/riscv/attribute-13.c: New.
+
+2020-07-01 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.target/powerpc/direct-move-double1.c: Remove lp64 requirement.
+ * gcc.target/powerpc/direct-move-double2.c: Same.
+ * gcc.target/powerpc/direct-move-float1.c: Same.
+ * gcc.target/powerpc/direct-move-float2.c: Same.
+ * gcc.target/powerpc/direct-move-float3.c: Same.
+ * gcc.target/powerpc/direct-move-vint1.c: Same.
+ * gcc.target/powerpc/direct-move-vint2.c: Same.
+ * gcc.target/powerpc/direct-move-long1.c: Remove linux requirement..
+ * gcc.target/powerpc/direct-move-long2.c: Same.
+
+2020-07-01 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.target/powerpc/20030218-1.c: Delete.
+ * gcc.target/powerpc/20030505.c: Delete.
+ * gcc.target/powerpc/20081204-1.c: Delete.
+ * gcc.target/powerpc/bcd-1.c: Remove dg-skip-if SPE.
+ * gcc.target/powerpc/bcd-2.c: Same.
+ * gcc.target/powerpc/bcd-3.c: Same.
+ * gcc.target/powerpc/direct-move-double1.c: Same.
+ * gcc.target/powerpc/direct-move-double2.c: Same.
+ * gcc.target/powerpc/direct-move-float1.c: Same.
+ * gcc.target/powerpc/direct-move-float2.c: Same.
+ * gcc.target/powerpc/direct-move-float3.c: Same.
+ * gcc.target/powerpc/direct-move-long1.c: Same.
+ * gcc.target/powerpc/direct-move-long2.c: Same.
+ * gcc.target/powerpc/direct-move-vint1.c: Same.
+ * gcc.target/powerpc/direct-move-vint2.c: Same.
+ * gcc.target/powerpc/extend-divide-1.c: Same.
+ * gcc.target/powerpc/extend-divide-2.c: Same.
+ * gcc.target/powerpc/pack01.c: Same.
+ * gcc.target/powerpc/pack02.c: Same.
+ * gcc.target/powerpc/pack03.c: Same.
+ * gcc.target/powerpc/pr52457.c: Same.
+ * gcc.target/powerpc/pr88845.c: Same.
+ * gcc.target/powerpc/quad-atomic.c: Same.
+ * gcc.target/powerpc/recip-6.c: Same.
+ * gcc.target/powerpc/recip-7.c: Same.
+
+2020-07-01 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.target/powerpc/p8vector-int128-1.c: Require int128 not lp64.
+ * gcc.target/powerpc/p8vector-int128-2.c: Same.
+
+2020-07-01 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.target/powerpc/pr90763.c: Adjust requirements.
+ * gcc.target/powerpc/vsx-vector-1.c: Same.
+ * gcc.target/powerpc/vsx-vector-2.c: Same.
+ * gcc.target/powerpc/vsx-vector-3.c: Same.
+ * gcc.target/powerpc/vsx-vector-4.c: Same.
+ * gcc.target/powerpc/vsx-vector-5.c: Same.
+ * gcc.target/powerpc/vsx-vector-6.p7.c: Same.
+ * gcc.target/powerpc/vsx-vector-6.p8.c: Same.
+ * gcc.target/powerpc/vsx-vector-6.p9.c: Same.
+ * gcc.target/powerpc/vsx-vector-abss.c: Same.
+ * gcc.target/powerpc/vsx-vectorize-1.c: Same.
+ * gcc.target/powerpc/vsx-vectorize-2.c: Same.
+ * gcc.target/powerpc/vsx-vectorize-3.c: Same.
+ * gcc.target/powerpc/vsx-vectorize-4.c: Same.
+ * gcc.target/powerpc/vsx-vectorize-5.c: Same.
+ * gcc.target/powerpc/vsx-vectorize-6.c: Same.
+ * gcc.target/powerpc/vsx-vectorize-7.c: Same.
+ * gcc.target/powerpc/vsx-vectorize-8.c: Same.
+
+2020-07-01 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.target/powerpc/ppc-spe.c: Delete.
+ * gcc.target/powerpc/ppc-spe64-1.c: Delete.
+ * gcc.target/powerpc/pr60102.c: Delete.
+ * gcc.target/powerpc/pr60158.c: Delete.
+ * gcc.target/powerpc/pr60735.c: Delete.
+ * gcc.target/powerpc/pr78458.c: Delete.
+ * gcc.target/powerpc/pr80343.c: Delete.
+ * gcc.target/powerpc/spe-evmerge.c: Delete.
+ * gcc.target/powerpc/spe-small-data-1.c: Delete.
+ * gcc.target/powerpc/spe-small-data-2.c: Delete.
+ * gcc.target/powerpc/spe-unwind-1.c: Delete.
+ * gcc.target/powerpc/spe-vector-memcpy.c: Delete.
+ * gcc.target/powerpc/spe-vector-memset.c: Delete.
+ * gcc.target/powerpc/spe1.c: Delete.
+
+2020-06-30 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.target/powerpc/builtins-2-p9-runnable.c: lp64 to int128.
+ * gcc.target/powerpc/builtins-6-p9-runnable.c: Same.
+ * gcc.target/powerpc/builtins-6-runnable.c: Same.
+ * gcc.target/powerpc/builtins-revb-runnable.c: Same.
+
+2020-06-30 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/88379
+ * gfortran.dg/pr88379.f90: New file.
+
+2020-06-30 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR target/92789
+ PR target/95726
+ * g++.target/aarch64/pr95726.C: New test.
+
+2020-06-30 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.target/powerpc/builtins-1-p9-runnable.c: Fix target requirements.
+ * gcc.target/powerpc/builtins-1.c: Same.
+ * gcc.target/powerpc/builtins-2-p9-runnable.c: Same.
+ * gcc.target/powerpc/builtins-2.c: Same.
+ * gcc.target/powerpc/builtins-3-p9-runnable.c: Same.
+ * gcc.target/powerpc/builtins-3-p9.c: Same.
+ * gcc.target/powerpc/builtins-3-runnable-p8.c: Same.
+ * gcc.target/powerpc/builtins-3.c: Same.
+ * gcc.target/powerpc/builtins-4-p9-runnable.c: Same.
+ * gcc.target/powerpc/builtins-4.c: Same.
+ * gcc.target/powerpc/builtins-5-p9-runnable.c: Same.
+ * gcc.target/powerpc/builtins-5.c: Same.
+ * gcc.target/powerpc/builtins-6-p9-runnable.c: Same.
+ * gcc.target/powerpc/builtins-6-runnable.c: Same.
+ * gcc.target/powerpc/builtins-7-p9-runnable.c: Same.
+ * gcc.target/powerpc/builtins-7-runnable.c: Same.
+ * gcc.target/powerpc/builtins-8-p9-runnable.c: Same.
+ * gcc.target/powerpc/builtins-8-runnable.c: Same.
+ * gcc.target/powerpc/cpu-builtin-1.c: Same.
+ * gcc.target/powerpc/float128-fma1.c: Same.
+ * gcc.target/powerpc/float128-hw.c: Same.
+ * gcc.target/powerpc/float128-hw10.c: Same.
+ * gcc.target/powerpc/float128-hw11.c: Same.
+ * gcc.target/powerpc/float128-hw2.c: Same.
+ * gcc.target/powerpc/float128-hw3.c: Same.
+ * gcc.target/powerpc/float128-hw4.c: Same.
+ * gcc.target/powerpc/float128-hw5.c: Same.
+ * gcc.target/powerpc/float128-hw6.c: Same.
+ * gcc.target/powerpc/float128-hw7.c: Same.
+ * gcc.target/powerpc/float128-hw8.c: Same.
+ * gcc.target/powerpc/float128-hw9.c: Same.
+ * gcc.target/powerpc/float128-minmax.c: Same.
+ * gcc.target/powerpc/float128-odd.c: Same.
+ * gcc.target/powerpc/float128-sqrt1.c: Same.
+
+2020-06-30 David Edelsohn <dje.gcc@gmail.com>
+
+ * gfortran.dg/analyzer/pr93993.f90: Expect leak tm warning.
+
+2020-06-30 Thomas Schwinge <thomas@codesourcery.com>
+
+ * lib/scanoffload.exp (scoff) <offload_targets>: Skip HSA.
+
+2020-06-30 Christophe Lyon <christophe.lyon@linaro.org>
+
+ PR target/94743
+ * gcc.misc-tests/arm-isr.c: Add -mgeneral-regs-only.
+ * gcc.target/arm/empty_fiq_handler.c: Add -mgeneral-regs-only.
+ * gcc.target/arm/interrupt-1.c: Add -mgeneral-regs-only.
+ * gcc.target/arm/interrupt-2.c: Add -mgeneral-regs-only.
+ * gcc.target/arm/pr70830.c: Add -mgeneral-regs-only.
+ * gcc.target/arm/pr94743-1-hard.c: New test.
+ * gcc.target/arm/pr94743-1-soft.c: New test.
+ * gcc.target/arm/pr94743-1-softfp.c: New test.
+ * gcc.target/arm/pr94743-2.c: New test.
+ * gcc.target/arm/pr94743-3.c: New test.
+
+2020-06-30 Yang Yang <yangyang305@huawei.com>
+
+ PR tree-optimization/95855
+ * gcc.dg/tree-ssa/split-path-12.c: New testcase.
+
+2020-06-30 David Edelsohn <dje.gcc@gmail.com>
+
+ * g++.dg/cpp0x/constexpr-is_literal.C: Limit test to -std=c++14.
+
+2020-06-30 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/95355
+ * gfortran.dg/select_type_49.f90: New file.
+
+2020-06-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/95963
+ * g++.dg/cpp1z/launder9.C: New test.
+
+2020-06-29 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95978
+ * gfortran.dg/pr95978.f90: New file.
+
+2020-06-29 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/95743
+ * gfortran.dg/recursive_check_16.f90: New file.
+
+2020-06-29 David Edelsohn <dje.gcc@gmail.com>
+
+ * gfortran.dg/char4-subscript.f90: Simplify regex.
+ Accept big endian or little endian output.
+
+2020-06-29 Marek Polacek <polacek@redhat.com>
+
+ PR c++/94553
+ * g++.dg/cpp1y/pr68578.C: Adjust dg-error.
+ * g++.dg/cpp1y/var-templ66.C: New test.
+ * g++.dg/cpp2a/concepts-redecl1.C: New test.
+
+2020-06-29 Marek Polacek <polacek@redhat.com>
+
+ PR c++/95568
+ * g++.dg/cpp2a/class-deduction-aggr5.C: New test.
+ * g++.dg/cpp2a/class-deduction-aggr6.C: New test.
+
+2020-06-29 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/71706
+ * gfortran.dg/pr71706.f90: New file.
+
+2020-06-29 Martin Liska <mliska@suse.cz>
+
+ PR c++/86568
+ * c-c++-common/builtin-arith-overflow-1.c (generic_3, typed_3_null):
+ Fix coding style.
+
+2020-06-29 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95916
+ * gcc.dg/vect/pr95916.c: New testcase.
+
+2020-06-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/86568
+ * c-c++-common/builtin-arith-overflow-1.c (generic_3, typed_3_null):
+ Adjust dg-warning.
+
+2020-06-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/86568
+ * c-c++-common/builtin-arith-overflow-1.c (generic_3, typed_3_null):
+ Adjust dg-warning.
+
+2020-06-29 Kaipeng Zhou <zhoukaipeng3@huawei.com>
+
+ PR tree-optimization/95854
+ * gcc.dg/pr95854.c: New test.
+
+2020-06-29 Frederik Harwath <frederik@codesourcery.com>
+
+ * lib/scandump.exp (glob-dump-file): New proc.
+ (scan-dump): Use glob-dump-file for file name expansion.
+ (scan-dump-times): Likewise.
+ (scan-dump-dem): Likewise.
+ (scan-dump-dem-not): Likewise.
+
+2020-06-28 Martin Sebor <msebor@redhat.com>
+
+ PR c++/86568
+ * g++.dg/warn/Wnonnull5.C: New test.
+ * c-c++-common/pr28656.c: Adjust text of expected warning.
+ * c-c++-common/pr66208.c: Same.
+ * g++.dg/cpp0x/nullptr22.C: Same.
+ * g++.dg/ext/attr-nonnull.C: Same.
+ * g++.dg/ext/attrib49.C: Same.
+ * g++.dg/pr71973-2.C: Same.
+ * g++.dg/warn/Wnonnull3.C: Same.
+ * g++.dg/warn/Wnonnull4.C: Same.
+ * obj-c++.dg/attributes/method-nonnull-1.mm: Same.
+ * objc.dg/attributes/method-nonnull-1.m: Same.
+
+2020-06-28 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95340
+ * gfortran.dg/pr95340.f90: New file.
+
+2020-06-28 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/95711
+ * g++.dg/coroutines/pr95711.C: New test.
+
+2020-06-28 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95880
+ * gfortran.dg/pr95880.f90: New file.
+
+2020-06-28 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/95519
+ * g++.dg/coroutines/torture/pr95519-02-final_suspend.C:
+ Amend log messages.
+ * g++.dg/coroutines/torture/pr95519-03-return-value.C:
+ Likewise.
+ * g++.dg/coroutines/torture/pr95519-04-yield-value.C:
+ Likewise.
+ * g++.dg/coroutines/torture/pr95519-05-gro.C: Likewise.
+
+2020-06-28 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.target/powerpc/prefix-large-dd.c: Require DFP.
+ * gcc.target/powerpc/prefix-large-sd.c: Require DFP.
+ * gcc.target/powerpc/prefix-large-kf.c: Require float128.
+ * gcc.target/powerpc/prefix-pcrel-dd.c: Require DFP.
+ * gcc.target/powerpc/prefix-pcrel-sd.c: Require DFP.
+ * gcc.target/powerpc/prefix-pcrel-kf.c: Require float128.
+
+2020-06-27 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95881
+ * gfortran.dg/pr95881.f90: New file.
+
+2020-06-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/95903
+ * c-c++-common/pr95903.c: New test.
+
+2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/95736
+ * g++.dg/coroutines/pr95736.C: New test.
+
+2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
+
+ * g++.dg/coroutines/coro-bad-grooaf-01-grooaf-expected.C: New test.
+
+2020-06-27 Michael Meissner <meissner@linux.ibm.com>
+
+ * gcc.target/powerpc/prefix-add.c: New test.
+ * gcc.target/powerpc/prefix-si-constant.c: New test.
+ * gcc.target/powerpc/prefix-di-constant.c: New test.
+ * gcc.target/powerpc/prefix-ds-dq.c: New test.
+ * gcc.target/powerpc/prefix-no-update.c: New test.
+ * gcc.target/powerpc/prefix-large-dd.c: New test.
+ * gcc.target/powerpc/prefix-large-df.c: New test.
+ * gcc.target/powerpc/prefix-large-di.c: New test.
+ * gcc.target/powerpc/prefix-large-hi.c: New test.
+ * gcc.target/powerpc/prefix-large-kf.c: New test.
+ * gcc.target/powerpc/prefix-large-qi.c: New test.
+ * gcc.target/powerpc/prefix-large-sd.c: New test.
+ * gcc.target/powerpc/prefix-large-sf.c: New test.
+ * gcc.target/powerpc/prefix-large-si.c: New test.
+ * gcc.target/powerpc/prefix-large-udi.c: New test.
+ * gcc.target/powerpc/prefix-large-uhi.c: New test.
+ * gcc.target/powerpc/prefix-large-uqi.c: New test.
+ * gcc.target/powerpc/prefix-large-usi.c: New test.
+ * gcc.target/powerpc/prefix-large-v2df.c: New test.
+ * gcc.target/powerpc/prefix-large.h: Include file for new tests.
+ * gcc.target/powerpc/prefix-pcrel-dd.c: New test.
+ * gcc.target/powerpc/prefix-pcrel-df.c: New test.
+ * gcc.target/powerpc/prefix-pcrel-di.c: New test.
+ * gcc.target/powerpc/prefix-pcrel-hi.c: New test.
+ * gcc.target/powerpc/prefix-pcrel-kf.c: New test.
+ * gcc.target/powerpc/prefix-pcrel-qi.c: New test.
+ * gcc.target/powerpc/prefix-pcrel-sd.c: New test.
+ * gcc.target/powerpc/prefix-pcrel-sf.c: New test.
+ * gcc.target/powerpc/prefix-pcrel-si.c: New test.
+ * gcc.target/powerpc/prefix-pcrel-udi.c: New test.
+ * gcc.target/powerpc/prefix-pcrel-uhi.c: New test.
+ * gcc.target/powerpc/prefix-pcrel-uqi.c: New test.
+ * gcc.target/powerpc/prefix-pcrel-usi.c: New test.
+ * gcc.target/powerpc/prefix-pcrel-v2df.c: New test.
+ * gcc.target/powerpc/prefix-pcrel.h: Include file for new tests.
+ * gcc.target/powerpc/prefix-stack-protect.c: New test.
+
+2020-06-26 Yichao Yu <yyc1992@gmail.com>
+
+ * gcc.target/i386/pr95778-1.c: New test.
+ * gcc.target/i386/pr95778-2.c: New test.
+
+2020-06-26 Peter Bergner <bergner@linux.ibm.com>
+
+ * gcc.target/powerpc/cpu-builtin-1.c: Add tests for power10, arch_3_1
+ and mma.
+
+2020-06-26 Marek Polacek <polacek@redhat.com>
+
+ * c-c++-common/torture/vector-subscript-3.c: In C++17, define away
+ the keyword register.
+ * g++.dg/cpp1z/attributes-enum-1a.C: Only run pre-C++17.
+ * g++.dg/cpp1z/fold7a.C: Likewise.
+ * g++.dg/cpp1z/nontype3a.C: Likewise.
+ * g++.dg/cpp1z/utf8-2a.C: Likewise.
+ * g++.dg/parse/error11.C: Update expected diagnostics for C++17.
+ * g++.dg/torture/pr34850.C: Add -Wno-attribute-warning.
+ * g++.dg/torture/pr49394.C: In C++17, use noexcept(false).
+ * g++.dg/torture/pr82154.C: Use -std=c++14.
+ * lib/target-supports.exp: Set to C++17.
+ * obj-c++.dg/try-catch-9.mm: Use -Wno-register.
+
+2020-06-26 Kwok Cheung Yeung <kcy@codesourcery.com>
+
+ * gfortran.dg/gomp/combined-if.f90: Adjust expected number
+ of matches depending on whether nvptx offloading is supported.
+ * lib/target-supports.exp
+ (check_effective_target_offload_nvptx): New.
+
+2020-06-26 Eric Botcazou <ebotcazou@gcc.gnu.org>
+
+ * gnat.dg/opt86_pkg.ads: New helper.
+ * gnat.dg/opt86a.adb: New test.
+ * gnat.dg/opt86b.adb: Likewise.
+ * gnat.dg/opt86c.adb: Likewise.
+
+2020-06-26 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * gdc.dg/pr95250.d: Updated.
+
+2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/95519
+ * g++.dg/coroutines/torture/pr95519-00-return_void.C: New test.
+ * g++.dg/coroutines/torture/pr95519-01-initial-suspend.C: New test.
+ * g++.dg/coroutines/torture/pr95519-02-final_suspend.C: New test.
+ * g++.dg/coroutines/torture/pr95519-03-return-value.C: New test.
+ * g++.dg/coroutines/torture/pr95519-04-yield-value.C: New test.
+ * g++.dg/coroutines/torture/pr95519-05-gro.C: New test.
+ * g++.dg/coroutines/torture/pr95519-06-grooaf.C: New test.
+ * g++.dg/coroutines/torture/pr95519-07-unhandled-exception.C: New test.
+
+2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
+
+ * g++.dg/coroutines/coro1-allocators.h (BAD_GROOAF_STATIC):
+ New.
+ * g++.dg/coroutines/coro-bad-grooaf-00-static.C: New test.
+
+2020-06-26 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95897
+ * gcc.dg/vect/pr95897.c: New testcase.
+
+2020-06-25 Marek Polacek <polacek@redhat.com>
+
+ PR c++/91104
+ * g++.dg/cpp1y/lambda-generic-variadic21.C: New test.
+
+2020-06-25 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95828
+ * gfortran.dg/pr95828.f90: New file.
+
+2020-06-25 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95826
+ * gfortran.dg/pr95826.f90: New file.
+
+2020-06-25 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/95250
+ * gdc.dg/pr95250.d: New test.
+
+2020-06-25 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/95173
+ * gdc.dg/pr95173.d: New test.
+
+2020-06-25 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * gdc.dg/init1.d: New test.
+
+2020-06-25 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * gdc.dg/asm1.d: Don't use deprecated asm syntax.
+ * gdc.dg/compilable.d: Add public to selective import.
+ * gdc.dg/lto/ltotests_0.d: Explicitly catch Throwable.
+ * gdc.dg/runnable.d: Remove empty statement.
+
+2020-06-25 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/95837
+ * gfortran.dg/char4-subscript.f90: New test.
+
+2020-06-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95839
+ * gcc.dg/vect/bb-slp-pr95839.c: New testcase.
+
+2020-06-25 Tobias Burnus <tobias@codesourcery.com>
+ Kwok Cheung Yeung <kcy@codesourery.com>
+
+ PR fortran/95869
+ * gfortran.dg/gomp/combined-if.f90 (test_target_parallel): Re-enable.
+ * gfortran.dg/gomp/pr95869.f90: New.
+
+2020-06-25 Kwok Cheung Yeung <kcy@codesourcery.com>
+
+ * gfortran.dg/gomp/combined-if.f90: New.
+
+2020-06-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95866
+ * gcc.dg/vect/bb-slp-pr95866.c: New testcase.
+
+2020-06-24 Will Schmidt <will_schmidt@vnet.ibm.com>
+
+ PR target/94954
+ * gcc.target/powerpc/builtins-1-p9-runnable.c: Update.
+
+2020-06-24 Alexandre Oliva <oliva@adacore.com>
+
+ PR testsuite/95416
+ PR testsuite/95577
+ * gcc.misc-tests/outputs.exp (gsplit_dwarf): Move -g into it.
+ (outest): Introduce conditionals and string/variable/expr
+ expansion. Drop special-casing of $aout and .dwo.
+ (gspd): New conditional. Guard all .dwo files with it.
+ (ltop): New conditional. Guard files created by the LTO
+ plugin with it. Guard files created by fat LTO compilation
+ with its negation. Add a few -fno-use-linker-plugin tests
+ guarded by it.
+
+2020-06-24 Nicholas Krause <xerofoify@gmail.com>
+
+ PR c++/95672
+ * g++.dg/template/pr95672.C: New test.
+
+2020-06-24 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/95518
+ PR c++/95813
+ * g++.dg/coroutines/pr95518.C: New test.
+ * g++.dg/coroutines/pr95813.C: New test.
+
+2020-06-24 Iain Sandoe <iain@sandoe.co.uk>
+
+ * g++.dg/coroutines/void-gro-non-class-coro.C: Moved to...
+ * g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C: ...here.
+ * g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C: New test.
+
+2020-06-24 Jason Merrill <jason@redhat.com>
+
+ PR c++/95719
+ * g++.dg/tree-ssa/final4.C: New test.
+
+2020-06-24 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95827
+ * gfortran.dg/pr95827.f90: New file.
+
+2020-06-24 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95866
+ * gcc.target/i386/pr95866-1.c: New testcase.
+
+2020-06-24 H.J. Lu <hjl.tools@gmail.com>
+
+ PR target/95660
+ * gcc.target/i386/builtin_target.c (check_detailed): Updated.
+
+2020-06-24 H.J. Lu <hjl.tools@gmail.com>
+
+ PR target/95843
+ * gcc.target/i386/builtin_target.c: Include <stdlib.h>,
+ ../../../common/config/i386/i386-cpuinfo.h and
+ ../../../common/config/i386/cpuinfo.h.
+ (check_amd_cpu_model): Removed.
+ (check_intel_cpu_model): Likewise,
+ (CHECK___builtin_cpu_is): New.
+ (gcc_assert): New. Defined as assert.
+ (gcc_unreachable): New. Defined as abort.
+ (inline): New. Defined as empty.
+ (ISA_NAMES_TABLE_START): Likewise.
+ (ISA_NAMES_TABLE_END): Likewise.
+ (ISA_NAMES_TABLE_ENTRY): New.
+ (check_features): Include
+ "../../../common/config/i386/i386-isas.h".
+ (check_detailed): Call cpu_indicator_init. Always call
+ check_features. Call get_amd_cpu instead of check_amd_cpu_model.
+ Call get_intel_cpu instead of check_intel_cpu_model.
+
+2020-06-24 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95856
+ * gcc.dg/vect/pr95856.c: New testcase.
+
+2020-06-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/95810
+ * gcc.dg/ubsan/pr95810.c: New test.
+
+2020-06-23 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp2a/class-deduction-aggr3.C: New test.
+ * g++.dg/cpp2a/class-deduction-aggr4.C: New test.
+
+2020-06-23 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ * gfortran.fortran-torture/execute/forall_5.f90: Make forall
+ statement conforming.
+
+2020-06-23 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/95477
+ * g++.dg/coroutines/pr95477.C: New test.
+ * g++.dg/coroutines/void-gro-non-class-coro.C: New test.
+
+2020-06-23 Andre Vieira <andre.simoesdiasvieira@arm.com>
+
+ PR target/95646
+ * gcc.target/arm/pr95646.c: New test.
+
+2020-06-23 Alexandre Oliva <oliva@adacore.com>
+
+ * lib/scanoffload.exp: New.
+ * lib/scanoffloadrtl.exp: Load it. Replace ".o" with ""
+ globally, and use scanoffload's scoff wrapper to fill it in.
+ * lib/scanoffloadtree.exp: Likewise.
+
+2020-06-23 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/95812
+ * gfortran.dg/dependency_59.f90: New test.
+
+2020-06-23 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/95586
+ * gfortran.dg/pr95586_1.f90: New test.
+ * gfortran.dg/pr95586_2.f90: New test.
+
+2020-06-22 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * gcc.target/powerpc/cfuged-0.c: I protest.
+ * gcc.target/powerpc/cfuged-1.c: I protest.
+ * gcc.target/powerpc/clone3.c: I protest.
+ * gcc.target/powerpc/cntlzdm-0.c: I protest.
+ * gcc.target/powerpc/cntlzdm-1.c: I protest.
+ * gcc.target/powerpc/cnttzdm-0.c: I protest.
+ * gcc.target/powerpc/cnttzdm-1.c: I protest.
+ * gcc.target/powerpc/cpu-future.c: I protest.
+ * gcc.target/powerpc/dg-future-0.c: I protest.
+ * gcc.target/powerpc/dg-future-1.c: I protest.
+ * gcc.target/powerpc/localentry-1.c: I protest.
+ * gcc.target/powerpc/localentry-detect-1.c: I protest.
+ * gcc.target/powerpc/mma-builtin-1.c: I protest.
+ * gcc.target/powerpc/mma-builtin-2.c: I protest.
+ * gcc.target/powerpc/mma-builtin-3.c: I protest.
+ * gcc.target/powerpc/mma-builtin-4.c: I protest.
+ * gcc.target/powerpc/mma-builtin-5.c: I protest.
+ * gcc.target/powerpc/mma-builtin-6.c: I protest.
+ * gcc.target/powerpc/notoc-direct-1.c: I protest.
+ * gcc.target/powerpc/pcrel-sibcall-1.c: I protest.
+ * gcc.target/powerpc/pdep-0.c: I protest.
+ * gcc.target/powerpc/pdep-1.c: I protest.
+ * gcc.target/powerpc/pextd-0.c: I protest.
+ * gcc.target/powerpc/pextd-1.c: I protest.
+ * gcc.target/powerpc/pr93122.c: I protest.
+ * gcc.target/powerpc/pr94740.c: I protest.
+ * gcc.target/powerpc/setbceq.c: I protest.
+ * gcc.target/powerpc/setbcge.c: I protest.
+ * gcc.target/powerpc/setbcgt.c: I protest.
+ * gcc.target/powerpc/setbcle.c: I protest.
+ * gcc.target/powerpc/setbclt.c: I protest.
+ * gcc.target/powerpc/setbcne.c: I protest.
+ * gcc.target/powerpc/setnbceq.c: I protest.
+ * gcc.target/powerpc/setnbcge.c: I protest.
+ * gcc.target/powerpc/setnbcgt.c: I protest.
+ * gcc.target/powerpc/setnbcle.c: I protest.
+ * gcc.target/powerpc/setnbclt.c: I protest.
+ * gcc.target/powerpc/setnbcne.c: I protest.
+ * gcc.target/powerpc/vec-cfuged-0.c: I protest.
+ * gcc.target/powerpc/vec-cfuged-1.c: I protest.
+ * gcc.target/powerpc/vec-clrl-0.c: I protest.
+ * gcc.target/powerpc/vec-clrl-1.c: I protest.
+ * gcc.target/powerpc/vec-clrl-2.c: I protest.
+ * gcc.target/powerpc/vec-clrl-3.c: I protest.
+ * gcc.target/powerpc/vec-clrr-0.c: I protest.
+ * gcc.target/powerpc/vec-clrr-1.c: I protest.
+ * gcc.target/powerpc/vec-clrr-2.c: I protest.
+ * gcc.target/powerpc/vec-clrr-3.c: I protest.
+ * gcc.target/powerpc/vec-cntlzm-0.c: I protest.
+ * gcc.target/powerpc/vec-cntlzm-1.c: I protest.
+ * gcc.target/powerpc/vec-cnttzm-0.c: I protest.
+ * gcc.target/powerpc/vec-cnttzm-1.c: I protest.
+ * gcc.target/powerpc/vec-extracth-0.c: I protest.
+ * gcc.target/powerpc/vec-extracth-1.c: I protest.
+ * gcc.target/powerpc/vec-extracth-2.c: I protest.
+ * gcc.target/powerpc/vec-extracth-3.c: I protest.
+ * gcc.target/powerpc/vec-extracth-4.c: I protest.
+ * gcc.target/powerpc/vec-extracth-5.c: I protest.
+ * gcc.target/powerpc/vec-extracth-6.c: I protest.
+ * gcc.target/powerpc/vec-extracth-7.c: I protest.
+ * gcc.target/powerpc/vec-extracth-be-0.c: I protest.
+ * gcc.target/powerpc/vec-extracth-be-1.c: I protest.
+ * gcc.target/powerpc/vec-extracth-be-2.c: I protest.
+ * gcc.target/powerpc/vec-extracth-be-3.c: I protest.
+ * gcc.target/powerpc/vec-extractl-0.c: I protest.
+ * gcc.target/powerpc/vec-extractl-1.c: I protest.
+ * gcc.target/powerpc/vec-extractl-2.c: I protest.
+ * gcc.target/powerpc/vec-extractl-3.c: I protest.
+ * gcc.target/powerpc/vec-extractl-4.c: I protest.
+ * gcc.target/powerpc/vec-extractl-5.c: I protest.
+ * gcc.target/powerpc/vec-extractl-6.c: I protest.
+ * gcc.target/powerpc/vec-extractl-7.c: I protest.
+ * gcc.target/powerpc/vec-extractl-be-0.c: I protest.
+ * gcc.target/powerpc/vec-extractl-be-1.c: I protest.
+ * gcc.target/powerpc/vec-extractl-be-2.c: I protest.
+ * gcc.target/powerpc/vec-extractl-be-3.c: I protest.
+ * gcc.target/powerpc/vec-gnb-0.c: I protest.
+ * gcc.target/powerpc/vec-gnb-1.c: I protest.
+ * gcc.target/powerpc/vec-gnb-2.c: I protest.
+ * gcc.target/powerpc/vec-pdep-0.c: I protest.
+ * gcc.target/powerpc/vec-pdep-1.c: I protest.
+ * gcc.target/powerpc/vec-pext-0.c: I protest.
+ * gcc.target/powerpc/vec-pext-1.c: I protest.
+ * gcc.target/powerpc/vec-stril-0.c: I protest.
+ * gcc.target/powerpc/vec-stril-1.c: I protest.
+ * gcc.target/powerpc/vec-stril-10.c: I protest.
+ * gcc.target/powerpc/vec-stril-11.c: I protest.
+ * gcc.target/powerpc/vec-stril-12.c: I protest.
+ * gcc.target/powerpc/vec-stril-13.c: I protest.
+ * gcc.target/powerpc/vec-stril-14.c: I protest.
+ * gcc.target/powerpc/vec-stril-15.c: I protest.
+ * gcc.target/powerpc/vec-stril-16.c: I protest.
+ * gcc.target/powerpc/vec-stril-17.c: I protest.
+ * gcc.target/powerpc/vec-stril-18.c: I protest.
+ * gcc.target/powerpc/vec-stril-19.c: I protest.
+ * gcc.target/powerpc/vec-stril-2.c: I protest.
+ * gcc.target/powerpc/vec-stril-20.c: I protest.
+ * gcc.target/powerpc/vec-stril-21.c: I protest.
+ * gcc.target/powerpc/vec-stril-22.c: I protest.
+ * gcc.target/powerpc/vec-stril-23.c: I protest.
+ * gcc.target/powerpc/vec-stril-3.c: I protest.
+ * gcc.target/powerpc/vec-stril-4.c: I protest.
+ * gcc.target/powerpc/vec-stril-5.c: I protest.
+ * gcc.target/powerpc/vec-stril-6.c: I protest.
+ * gcc.target/powerpc/vec-stril-7.c: I protest.
+ * gcc.target/powerpc/vec-stril-8.c: I protest.
+ * gcc.target/powerpc/vec-stril-9.c: I protest.
+ * gcc.target/powerpc/vec-stril_p-0.c: I protest.
+ * gcc.target/powerpc/vec-stril_p-1.c: I protest.
+ * gcc.target/powerpc/vec-stril_p-10.c: I protest.
+ * gcc.target/powerpc/vec-stril_p-11.c: I protest.
+ * gcc.target/powerpc/vec-stril_p-2.c: I protest.
+ * gcc.target/powerpc/vec-stril_p-3.c: I protest.
+ * gcc.target/powerpc/vec-stril_p-4.c: I protest.
+ * gcc.target/powerpc/vec-stril_p-5.c: I protest.
+ * gcc.target/powerpc/vec-stril_p-6.c: I protest.
+ * gcc.target/powerpc/vec-stril_p-7.c: I protest.
+ * gcc.target/powerpc/vec-stril_p-8.c: I protest.
+ * gcc.target/powerpc/vec-stril_p-9.c: I protest.
+ * gcc.target/powerpc/vec-strir-0.c: I protest.
+ * gcc.target/powerpc/vec-strir-1.c: I protest.
+ * gcc.target/powerpc/vec-strir-10.c: I protest.
+ * gcc.target/powerpc/vec-strir-11.c: I protest.
+ * gcc.target/powerpc/vec-strir-12.c: I protest.
+ * gcc.target/powerpc/vec-strir-13.c: I protest.
+ * gcc.target/powerpc/vec-strir-14.c: I protest.
+ * gcc.target/powerpc/vec-strir-15.c: I protest.
+ * gcc.target/powerpc/vec-strir-16.c: I protest.
+ * gcc.target/powerpc/vec-strir-17.c: I protest.
+ * gcc.target/powerpc/vec-strir-18.c: I protest.
+ * gcc.target/powerpc/vec-strir-19.c: I protest.
+ * gcc.target/powerpc/vec-strir-2.c: I protest.
+ * gcc.target/powerpc/vec-strir-20.c: I protest.
+ * gcc.target/powerpc/vec-strir-21.c: I protest.
+ * gcc.target/powerpc/vec-strir-22.c: I protest.
+ * gcc.target/powerpc/vec-strir-23.c: I protest.
+ * gcc.target/powerpc/vec-strir-3.c: I protest.
+ * gcc.target/powerpc/vec-strir-4.c: I protest.
+ * gcc.target/powerpc/vec-strir-5.c: I protest.
+ * gcc.target/powerpc/vec-strir-6.c: I protest.
+ * gcc.target/powerpc/vec-strir-7.c: I protest.
+ * gcc.target/powerpc/vec-strir-8.c: I protest.
+ * gcc.target/powerpc/vec-strir-9.c: I protest.
+ * gcc.target/powerpc/vec-strir_p-0.c: I protest.
+ * gcc.target/powerpc/vec-strir_p-1.c: I protest.
+ * gcc.target/powerpc/vec-strir_p-10.c: I protest.
+ * gcc.target/powerpc/vec-strir_p-11.c: I protest.
+ * gcc.target/powerpc/vec-strir_p-2.c: I protest.
+ * gcc.target/powerpc/vec-strir_p-3.c: I protest.
+ * gcc.target/powerpc/vec-strir_p-4.c: I protest.
+ * gcc.target/powerpc/vec-strir_p-5.c: I protest.
+ * gcc.target/powerpc/vec-strir_p-6.c: I protest.
+ * gcc.target/powerpc/vec-strir_p-7.c: I protest.
+ * gcc.target/powerpc/vec-strir_p-8.c: I protest.
+ * gcc.target/powerpc/vec-strir_p-9.c: I protest.
+ * gcc.target/powerpc/vec-ternarylogic-0.c: I protest.
+ * gcc.target/powerpc/vec-ternarylogic-1.c: I protest.
+ * gcc.target/powerpc/vec-ternarylogic-10.c: I protest.
+ * gcc.target/powerpc/vec-ternarylogic-2.c: I protest.
+ * gcc.target/powerpc/vec-ternarylogic-3.c: I protest.
+ * gcc.target/powerpc/vec-ternarylogic-4.c: I protest.
+ * gcc.target/powerpc/vec-ternarylogic-5.c: I protest.
+ * gcc.target/powerpc/vec-ternarylogic-6.c: I protest.
+ * gcc.target/powerpc/vec-ternarylogic-7.c: I protest.
+ * gcc.target/powerpc/vec-ternarylogic-8.c: I protest.
+ * gcc.target/powerpc/vec-ternarylogic-9.c: I protest.
+ * gcc.target/powerpc/xxgenpc-runnable.c: I protest.
+ * lib/target-supports.exp: Stuff.
+
+2020-06-22 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
+
+ * gcc.target/arm/mve/intrinsics/mve_scalar_shifts1.c: Modify.
+ * gcc.target/arm/mve/intrinsics/mve_scalar_shifts2.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/mve_scalar_shifts3.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/mve_scalar_shifts4.c: Likewise.
+ * lib/target-supports.exp (check_effective_target_arm_mve_hw): Define.
+
+2020-06-22 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/95708
+ * gfortran.dg/pr95708.f90: New test.
+
+2020-06-22 H.J. Lu <hjl.tools@gmail.com>
+
+ PR target/95791
+ * gcc.target/i386/pr95791.c: New test.
+
+2020-06-22 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/95585
+ * gfortran.dg/pr95585.f90: New test.
+
+2020-06-22 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95770
+ * gcc.dg/pr95770.c: New testcase.
+
+2020-06-22 Kito Cheng <kito.cheng@sifive.com>
+
+ * g++.target/riscv/frflags.C: New.
+
+2020-06-21 Peter Bergner <bergner@linux.ibm.com>
+
+ * gcc.target/powerpc/mma-builtin-1.c: New file.
+ * gcc.target/powerpc/mma-builtin-2.c: New file.
+ * gcc.target/powerpc/mma-builtin-3.c: New file.
+ * gcc.target/powerpc/mma-builtin-4.c: New file.
+ * gcc.target/powerpc/mma-builtin-5.c: New file.
+ * gcc.target/powerpc/mma-builtin-6.c: New file.
+
+2020-06-20 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/95505
+ * g++.dg/coroutines/pr95505.C: New test.
+
+2020-06-20 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp2a/concepts-return-req1.C: Expect error.
+ * g++.dg/cpp2a/concepts-p2113a.C: New test.
+ * g++.dg/cpp2a/concepts-p2113b.C: New test.
+
+2020-06-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95707
+ * gfortran.dg/pr95707.f90: New file.
+
+2020-06-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95688
+ * gfortran.dg/pr95688.f90: New file.
+
+2020-06-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95687
+ * gfortran.dg/pr95687.f90: New file.
+
+2020-06-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95689
+ * gfortran.dg/pr95689.f90: New file.
+
+2020-06-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95587
+ * gfortran.dg/pr95587.f90: New file.
+
+2020-06-20 Bin Cheng <bin.cheng@linux.alibaba.com>
+
+ PR tree-optimization/95638
+ * g++.dg/tree-ssa/pr95638.C: New test.
+
+2020-06-19 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.dg/tree-ssa/popcount4ll.c: Add target lp64.
+ * gcc.dg/tree-ssa/popcount5ll.c: Same.
+
+2020-06-19 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp2a/spaceship-friend1.C: New test.
+ * g++.dg/cpp2a/spaceship-err4.C: Adjust diagnostic.
+
+2020-06-19 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.target/powerpc/vec-extracth-be-0.c: Apply -mbig
+ conditionally for powerpc64le*-*-*.
+ * gcc.target/powerpc/vec-extracth-be-1.c: Same.
+ * gcc.target/powerpc/vec-extracth-be-2.c: Same.
+ * gcc.target/powerpc/vec-extracth-be-3.c: Same.
+ * gcc.target/powerpc/vec-extractl-be-0.c: Same.
+ * gcc.target/powerpc/vec-extractl-be-1.c: Same.
+ * gcc.target/powerpc/vec-extractl-be-2.c: Same.
+ * gcc.target/powerpc/vec-extractl-be-3.c: Same.
+
+2020-06-19 Przemyslaw Wirkus <Przemyslaw.Wirkus@arm.com>
+
+ PR tree-optimization/94880
+ * gcc.dg/tree-ssa/pr94880.c: New Test.
+
+2020-06-19 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95761
+ * gcc.dg/torture/pr95761.c: New testcase.
+
+2020-06-18 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp2a/spaceship-ref1.C: New test.
+ * g++.dg/cpp2a/spaceship-synth-neg4.C: New test.
+ * g++.dg/cpp2a/spaceship-union1.C: New test.
+
+2020-06-18 Uroš Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/pr78904-1a.c: New test.
+ * gcc.target/i386/pr78904-1b.c: Ditto.
+ * gcc.target/i386/pr78904-2a.c: Ditto.
+ * gcc.target/i386/pr78904-2b.c: Ditto.
+ * gcc.target/i386/pr78904-3a.c: Ditto.
+ * gcc.target/i386/pr78904-3b.c: Ditto.
+ * gcc.target/i386/pr78904-4a.c: Ditto.
+ * gcc.target/i386/pr78904-4b.c: Ditto.
+ * gcc.target/i386/pr78904-5a.c: Ditto.
+ * gcc.target/i386/pr78904-5b.c: Ditto.
+ * gcc.target/i386/pr78904-6a.c: Ditto.
+ * gcc.target/i386/pr78904-6b.c: Ditto.
+ * gcc.target/i386/pr78967-1a.c: Ditto.
+ * gcc.target/i386/pr78967-1b.c: Ditto.
+ * gcc.target/i386/pr78967-2a.c: Ditto.
+ * gcc.target/i386/pr78967-2b.c: Ditto.
+
+2020-06-18 Martin Sebor <msebor@redhat.com>
+
+ PR middle-end/95667
+ PR middle-end/92814
+ * gcc.dg/Wstringop-overflow-25.c: Remove xfails.
+ * gcc.dg/Wstringop-overflow-39.c: New test.
+
+2020-06-18 Marek Polacek <polacek@redhat.com>
+
+ PR c++/95735
+ * g++.dg/cpp2a/concepts-err2.C: New test.
+
+2020-06-18 Christophe Lyon <christophe.lyon@linaro.org>
+
+ * g++.target/aarch64/pr94052.C: Give z::ad public access.
+
+2020-06-18 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/gomp/map-alloc-comp-1.f90: New test.
+
+2020-06-18 Marek Polacek <polacek@redhat.com>
+
+ PR c++/95728
+ * g++.dg/template/cast6.C: New test.
+
+2020-06-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/95699
+ * gcc.dg/tree-ssa/pr95699.c: New test.
+
+2020-06-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/95713
+ * gcc.dg/pr95713.c: New test.
+
+2020-06-17 Thomas Schwinge <thomas@codesourcery.com>
+
+ * c-c++-common/gomp/default-1.c: Update.
+ * c-c++-common/gomp/defaultmap-3.c: Likewise.
+ * c-c++-common/gomp/order-4.c: Likewise.
+ * g++.dg/gomp/parallel-2.C: Likewise.
+ * g++.dg/gomp/predetermined-1.C: Likewise.
+ * g++.dg/gomp/sharing-1.C: Likewise.
+ * gcc.dg/gomp/appendix-a/a.24.1.c: Likewise.
+ * gcc.dg/gomp/parallel-2.c: Likewise.
+ * gcc.dg/gomp/pr44085.c: Likewise.
+ * gcc.dg/gomp/sharing-1.c: Likewise.
+ * gcc.dg/gomp/vla-1.c: Likewise.
+ * gfortran.dg/gomp/appendix-a/a.24.1.f90: Likewise.
+ * gfortran.dg/gomp/crayptr3.f90: Likewise.
+ * gfortran.dg/gomp/pr33439.f90: Likewise.
+ * gfortran.dg/gomp/pr44036-1.f90: Likewise.
+ * gfortran.dg/gomp/pr44085.f90: Likewise.
+ * gfortran.dg/gomp/pr44536.f90: Likewise.
+ * gfortran.dg/gomp/pr94672.f90: Likewise.
+ * gfortran.dg/gomp/sharing-1.f90: Likewise.
+ * gfortran.dg/gomp/sharing-2.f90: Likewise.
+ * gfortran.dg/gomp/sharing-3.f90: Likewise.
+
+2020-06-17 Thomas Schwinge <thomas@codesourcery.com>
+
+ * c-c++-common/gomp/hsa-indirect-call-1.c: New file.
+
+2020-06-17 Jonathan Wakely <jwakely@redhat.com>
+
+ PR c++/66159
+ * g++.dg/warn/forward-inner.C: Check alias-declaration using
+ elaborated-type-specifier.
+
+2020-06-17 Bin Cheng <bin.cheng@linux.alibaba.com>
+ Kaipeng Zhou <zhoukaipeng3@huawei.com>
+ Bin Cheng <bin.cheng@linux.alibaba.com>
+ Kaipeng Zhou <zhoukaipeng3@huawei.com>
+
+ PR tree-optimization/95199
+ * gcc.target/aarch64/sve/pr95199.c: New test.
+
+2020-06-17 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp2a/spaceship-synth9.C: New test.
+
+2020-06-17 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp2a/concepts-ca107.C: New test.
+
+2020-06-17 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp2a/consteval17.C: New test.
+
+2020-06-17 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/pr62101.C: Expect error.
+ * g++.dg/cpp0x/pr80259.C: Expect error.
+ * g++.dg/cpp2a/concepts-friend8.C: New test.
+
+2020-06-17 Jonathan Wakely <jwakely@redhat.com>
+
+ * c-c++-common/pr95378.c: New test.
+
+2020-06-17 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ * gcc.target/s390/20200617.c: New test.
+
+2020-06-17 Marek Polacek <polacek@redhat.com>
+
+ PR c++/95508
+ * g++.dg/template/conv16.C: New test.
+
+2020-06-17 Patrick Palka <ppalka@redhat.com>
+
+ PR testsuite/95716
+ * g++.dg/ext/pr85503.C: Give ai::cv public access.
+
+2020-06-17 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95717
+ * g++.dg/torture/pr95717.C: New testcase.
+
+2020-06-17 Martin Liska <mliska@suse.cz>
+
+ PR testsuite/95720
+ * gcc.misc-tests/gcov-pr94029.c: Remove not needed remove-gcda.
+ * lib/gcov.exp: Delete properly .gcov files.
+
+2020-06-17 Martin Liska <mliska@suse.cz>
+
+ * g++.dg/vect/vec-cond-expr-eh.C: New test.
+
+2020-06-17 liuhongt <hongtao.liu@intel.com>
+
+ * gcc.target/i386/avx2-shiftqihi-constant-1.c: New test.
+ * gcc.target/i386/avx2-shiftqihi-constant-2.c: Ditto.
+ * gcc.target/i386/avx512bw-shiftqihi-constant-1.c: Ditto.
+ * gcc.target/i386/avx512bw-shiftqihi-constant-2.c: Ditto.
+ * gcc.target/i386/sse2-shiftqihi-constant-1.c: Ditto.
+ * gcc.target/i386/sse2-shiftqihi-constant-2.c: Ditto.
+
+2020-06-16 Jonathan Wakely <jwakely@redhat.com>
+
+ * g++.dg/torture/pr95493-1.C: New test.
+
+2020-06-16 Aldy Hernandez <aldyh@redhat.com>
+
+ * g++.dg/tree-ssa/pr95649.C: New test.
+ * gcc.dg/tree-ssa/pr95649.c: New test.
+
+2020-06-16 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/goacc/pure-elemental-procedures-2.f90: New test.
+
+2020-06-16 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/gomp/pr79154-simd.f90: New test.
+
+2020-06-16 Marek Polacek <polacek@redhat.com>
+
+ PR c++/95369
+ * g++.dg/cpp2a/desig11.C: Adjust dg-error.
+ * g++.dg/cpp2a/desig16.C: New test.
+
+2020-06-16 Marek Polacek <polacek@redhat.com>
+
+ PR c++/95560
+ * g++.dg/warn/Wshadow-local-3.C: New test.
+
+2020-06-16 Jakub Jelinek <jakub@redhat.com>
+
+ * c-c++-common/asan/inline.c: Add -ffat-lto-objects to dg-options.
+ * c-c++-common/asan/inline-kernel.c: Likewise.
+ * c-c++-common/ubsan/inline.c: Likewise.
+
+2020-06-16 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
+
+ * gcc.target/arm/mve/intrinsics/mve_vaddq_m.c: New test.
+
+2020-06-16 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
+
+ * gcc.target/arm/mve/intrinsics/mve_scalar_shifts1.c: New test.
+ * gcc.target/arm/mve/intrinsics/mve_scalar_shifts2.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/mve_scalar_shifts3.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/mve_scalar_shifts4.c: Likewise.
+
+2020-06-16 Jakub Jelinek <jakub@redhat.com>
+
+ * c-c++-common/gomp/loop-6.c: New test.
+ * gcc.dg/gomp/loop-1.c: Don't expect diagnostics on valid
+ non-rectangular loops.
+ * gcc.dg/gomp/loop-2.c: New test.
+ * g++.dg/gomp/loop-1.C: Don't expect diagnostics on valid
+ non-rectangular loops.
+ * g++.dg/gomp/loop-2.C: Likewise.
+ * g++.dg/gomp/loop-5.C: New test.
+ * g++.dg/gomp/loop-6.C: New test.
+
+2020-06-16 Jakub Jelinek <jakub@redhat.com>
+
+ * c-c++-common/gomp/schedule-modifiers-2.c: New test.
+
+2020-06-16 Tobias Burnus <tobias@codesourcery.com>
+
+ PR middle-end/95622
+ * lib/target-supports.exp (check_effective_target_offloading_enabled):
+ New.
+ * c-c++-common/goacc/kernels-alias-ipa-pta-2.c: Use it for xfail.
+ * c-c++-common/goacc/kernels-alias-ipa-pta-4.c: Likewise.
+ * c-c++-common/goacc/kernels-alias-ipa-pta.c: Likewise.
+
+2020-06-16 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/gomp/pr79154-1.f90: Update dg-*;
+ add an impure elemental example.
+ * gfortran.dg/gomp/pr79154-2.f90: Likewise.
+
+2020-06-16 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/41437
+ PR c++/47346
+ * g++.dg/cpp2a/concepts-using2.C: Adjust.
+ * g++.dg/lto/20081219_1.C: Adjust.
+ * g++.dg/lto/20091002-1_0.C: Adjust.
+ * g++.dg/lto/pr65475c_0.C: Adjust.
+ * g++.dg/opt/dump1.C: Adjust.
+ * g++.dg/other/pr53574.C: Adjust.
+ * g++.dg/template/access30.C: New test.
+ * g++.dg/template/access31.C: New test.
+ * g++.dg/wrappers/wrapper-around-type-pack-expansion.C: Adjust.
+
+2020-06-16 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/95690
+ * gfortran.dg/pr95690.f90: New testcase.
+
+2020-06-16 Thomas Schwinge <thomas@codesourcery.com>
+
+ PR tree-optimization/94988
+ * gcc.dg/graphite/pr80906.c: Un-XFAIL.
+
+2020-06-16 Thomas Schwinge <thomas@codesourcery.com>
+
+ * gcc.dg/lto/pr52634_0.c: Further adjust 'dg-lto-options'.
+
+2020-06-16 Kito Cheng <kito.cheng@sifive.com>
+
+ PR target/95683
+ * gcc.target/riscv/pr95683.c: New.
+
+2020-06-15 Eric Botcazou <ebotcazou@gcc.gnu.org>
+
+ * gnat.dg/aggr30.ads, gnat.dg/aggr30.adb: New test.
+
+2020-06-15 Eric Botcazou <ebotcazou@gcc.gnu.org>
+
+ * gnat.dg/opt85.ads, gnat.dg/opt85.adb: New test.
+
+2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
+
+ * gcc.target/xtensa/mabi-call0.c: New test.
+ * gcc.target/xtensa/mabi-windowed.c: New test.
+
+2020-06-15 Martin Jambor <mjambor@suse.cz>
+
+ * lib/brig.exp (brig_target_compile): Strip hsail extension when
+ gnerating the name of the binary brig file.
+
+2020-06-15 Hongtao Liu <hongtao.liu@intel.com>
+
+ * gcc.target/i386/avx512bw-pr95488-1.c: New test.
+ * gcc.target/i386/avx512bw-pr95488-2.c: Ditto.
+ * gcc.target/i386/avx512vl-pr95488-1.c: Ditto.
+ * gcc.target/i386/avx512vl-pr95488-2.c: Ditto.
+
+2020-06-14 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95088
+ * gfortran.dg/pr95088.f90: New file.
+
+2020-06-14 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ * gfortran.dg/random_seed_4.f90: New test.
+
+2020-06-14 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/94109
+ * gfortran.dg/finalize_34.f90: Adjust free counts.
+ * gfortran.dg/finalize_36.f90: New test.
+
+2020-06-14 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR testsuite/95575
+ * lib/gdc-utils.exp (gdc-do-test): Re-add $subdir link and inclusion
+ in filename.
+
+2020-06-13 Martin Sebor <msebor@redhat.com>
+
+ * gcc.dg/builtin-stringop-chk-5.c: Make assertions independent of
+ data model.
+
+2020-06-13 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ * gfortran.dg/finalize_36.f90: Remove accidentally
+ committed test case.
+
+2020-06-13 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/95313
+ * gfortran.dg/finalize_36.f90: New file.
+
+2020-06-12 Marco Elver <elver@google.com>
+
+ * c-c++-common/tsan/func_entry_exit.c: New test.
+ * c-c++-common/tsan/func_entry_exit_disabled.c: New test.
+
+2020-06-12 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/vect/bb-slp-44.c: New testcase.
+
+2020-06-12 Felix Yang <felix.yang@huawei.com>
+
+ PR tree-optimization/95570
+ * gcc.dg/vect/pr95570.c: New test.
+
+2020-06-12 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat.dg/rep_clause8.adb: Update error location.
+
+2020-06-12 Alexandre Oliva <oliva@adacore.com>
+
+ * lib/prune.exp (prune_gcc_output): Match any executable name
+ in collect messages.
+
+2020-06-12 H.J. Lu <hjl.tools@gmail.com>
+
+ PR target/93492
+ * gcc.target/i386/pr93492-1.c: New test.
+ * gcc.target/i386/pr93492-2.c: Likewise.
+ * gcc.target/i386/pr93492-3.c: Likewise.
+ * gcc.target/i386/pr93492-4.c: Likewise.
+ * gcc.target/i386/pr93492-5.c: Likewise.
+
+2020-06-11 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/93467
+ * g++.dg/cpp2a/concepts-friend6.C: New test.
+ * g++.dg/cpp2a/concepts-friend7.C: New test.
+
+2020-06-11 Harald Anlauf <anlauf@gmx.de>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/95611
+ * gfortran.dg/pr95611.f90: New file.
+
+2020-06-11 Steven G. Kargl <kargl@gcc.gnu.org>
+ Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95544
+ * gfortran.dg/pr95544.f90: New file.
+
+2020-06-11 Tamar Christina <tamar.christina@arm.com>
+
+ * lib/target-supports.exp (check_effective_target_exceptions_enabled):
+ Mark as C++ test input.
+
+2020-06-11 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95503
+ * gfortran.dg/pr95503.f90: New test.
+
+2020-06-11 José Rui Faustino de Sousa <jrfsousa@gmail.com>
+
+ PR fortran/95331
+ * gfortran.dg/PR95331.f90: New test.
+
+2020-06-11 David Edelsohn <dje.gcc@gmail.com>
+
+ * g++.dg/abi/pure-virtual1.C: XFAIL AIX.
+
+2020-06-11 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.dg/spellcheck-inttypes.c: Don't include inttypes.h on AIX.
+
+2020-06-11 José Rui Faustino de Sousa <jrfsousa@gmail.com>
+
+ PR fortran/52351
+ PR fortran/85868
+ * gfortran.dg/coarray_lib_comm_1.f90: Adjust match test for
+ the newly generated descriptor.
+ * gfortran.dg/PR85868A.f90: New test.
+ * gfortran.dg/PR85868B.f90: New test.
+
+2020-06-11 José Rui Faustino de Sousa <jrfsousa@gmail.com>
+
+ PR fortran/94022
+ * gfortran.dg/PR94022.f90: New test.
+
+2020-06-11 Kito Cheng <kito.cheng@sifive.com>
+
+ * gcc.target/riscv/pr95252.c: New.
+
+2020-06-10 Alexandre Oliva <oliva@adacore.com>
+
+ PR rtl-optimization/51447
+ * gcc.c-torture/execute/pr51447.c (main): Preserve call-saved
+ register.
+
+2020-06-10 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/95440
+ * g++.dg/coroutines/pr95440.C: New test.
+
+2020-06-10 Martin Sebor <msebor@redhat.com>
+
+ PR middle-end/95353
+ PR middle-end/92939
+ * c-c++-common/Wstringop-truncation.c: Remove an xfail.
+ * gcc.dg/Warray-bounds-46.c: Remove a bogus warning.
+ * gcc.dg/Wrestrict-9.c: Disable -Wstringop-overflow.
+ * gcc.dg/Wstringop-overflow-12.c: Remove xfails.
+ * gcc.dg/Wstringop-overflow-28.c: Same.
+ * gcc.dg/builtin-stringop-chk-4.c: Same.
+ * gcc.dg/builtin-stringop-chk-5.c: Same.
+ * gcc.dg/builtin-stringop-chk-8.c: Same.
+ * gcc.dg/strlenopt-74.c: Avoid buffer overflow.
+ * gcc.dg/Wstringop-overflow-34.c: New test.
+ * gcc.dg/Wstringop-overflow-35.c: New test.
+ * gcc.dg/Wstringop-overflow-36.c: New test.
+ * gcc.dg/Wstringop-overflow-37.c: New test.
+ * gcc.dg/Wstringop-overflow-38.c: New test.
+
+2020-06-10 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95576
+ * g++.dg/vect/pr95576.cc: New testcase.
+
+2020-06-10 Haijian Zhang <z.zhanghaijian@huawei.com>
+
+ PR target/95523
+ * gcc.target/aarch64/sve/pr95523.c: New test.
+
+2020-06-10 Marek Polacek <polacek@redhat.com>
+
+ PR c++/95562
+ * g++.dg/cpp0x/noexcept60.C: New test.
+
+2020-06-10 Aldy Hernandez <aldyh@redhat.com>
+
+ * gcc.dg/tree-ssa/ssa-dse-30.c: Adjust test for folding of
+ memmove happening later.
+
+2020-06-10 Tamar Christina <tamar.christina@arm.com>
+
+ * gcc.target/aarch64/asimd-mull-elem.c: New test.
+
+2020-06-10 Qian Chao <qianchao9@huawei.com>
+
+ PR tree-optimization/95569
+ * gcc.dg/tm/pr95569.c: New test.
+
+2020-06-09 Michael Meissner <meissner@linux.ibm.com>
+
+ * gcc.target/powerpc/clone3.c: New test for using 'future' with
+ the target_clones attribute.
+
+2020-06-09 Martin Liska <mliska@suse.cz>
+
+ * c-c++-common/asan/inline-kernel.c: Add missing
+ -fno-sanitize-address option.
+
+2020-06-09 Jason Merrill <jason@redhat.com>
+
+ PR c++/95552
+ * g++.dg/ext/vla23.C: New test.
+
+2020-06-09 Marco Elver <elver@google.com>
+
+ * c-c++-common/tsan/volatile.c: New test.
+
+2020-06-09 Michael Meissner <meissner@linux.ibm.com>
+
+ * lib/target-supports.exp (check_effective_target_powerpc_pcrel):
+ New.
+ (check_effective_target_powerpc_prefixed_addr): New.
+
+2020-06-09 Martin Liska <mliska@suse.cz>
+
+ * c-c++-common/asan/inline.c: New test.
+ * c-c++-common/asan/inline-kernel.c: New test.
+ * c-c++-common/tsan/inline.c: New test.
+ * c-c++-common/ubsan/inline.c: New test.
+
+2020-06-09 Joe Ramsay <joe.ramsay@arm.com>
+
+ * gcc.target/aarch64/sve/logical_unpacked_abs.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_bic_1.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_bic_2.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_bic_3.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_bic_4.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_neg.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_not.c: New test.
+
+2020-06-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/95580
+ * gcc.dg/pr95580.c: New test.
+
+2020-06-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/95527
+ * gcc.dg/tree-ssa/pr95527.c: New test.
+
+2020-06-09 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.dg/torture/pr95493.C: Add -Wno-psabi -w to dg-additional-options.
+
+2020-06-09 Max Filippov <jcmvbkbc@gmail.com>
+
+ * g++.target/xtensa/pr95571.C: New test.
+ * g++.target/xtensa/xtensa.exp: New testsuite.
+
+2020-06-09 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * gcc.target/powerpc/fold-vec-perm-char.c: Allow both vperm/vpermr and
+ xxperm/xxpermr.
+ * gcc.target/powerpc/fold-vec-perm-double.c: Ditto.
+ * gcc.target/powerpc/fold-vec-perm-float.c: Ditto.
+ * gcc.target/powerpc/fold-vec-perm-int.c: Ditto.
+ * gcc.target/powerpc/fold-vec-perm-longlong.c: Ditto.
+ * gcc.target/powerpc/fold-vec-perm-pixel.c: Ditto.
+ * gcc.target/powerpc/fold-vec-perm-short.c: Ditto.
+ * gcc.target/powerpc/lvsl-lvsr.c: Ditto.
+ * gcc.target/powerpc/vec-mult-char-2.c: Ditto.
+ * gcc.target/powerpc/vsx-vector-6.p9.c: Also allow xxpermr.
+
+2020-06-09 Michael Meissner <meissner@linux.ibm.com>
+
+ * gcc.target/powerpc/clone3.c: New test for using 'future' with
+ the target_clones attribute.
+
+2020-06-09 Michael Meissner <meissner@linux.ibm.com>
+
+ * lib/target-supports.exp (check_effective_target_powerpc_pcrel):
+ New.
+ (check_effective_target_powerpc_prefixed_addr): New.
+
+2020-06-08 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95195
+ * gfortran.dg/namelist_97.f90: Adjust testcase.
+
+2020-06-08 Mark Eggleston <markeggleston@gcc.gnu.org>
+
+ PR fortran/92993
+ * gfortran.dg/pr92993.f90: New test.
+
+2020-06-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/95528
+ * g++.dg/opt/pr95528.C: New test.
+
+2020-06-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR lto/95548
+ * g++.dg/torture/pr95548.C: Change from dg-do compile to dg-do link,
+ add return type for main, for __SIZEOF_INT128__ test with __uint128_t
+ enumerator constants and add a test with unsigned long long
+ enumerators for all targets.
+
+2020-06-07 Roger Sayle <roger@nextmovesoftware.com>
+
+ * gcc.target/i386/parity-3.c: New test.
+ * gcc.target/i386/parity-4.c: Likewise.
+ * gcc.target/i386/parity-5.c: Likewise.
+ * gcc.target/i386/parity-6.c: Likewise.
+ * gcc.target/i386/parity-7.c: Likewise.
+ * gcc.target/i386/parity-8.c: Likewise.
+ * gcc.target/i386/parity-9.c: Likewise.
+
+2020-06-07 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95091
+ * gfortran.dg/pr95091.f90: New file.
+
+2020-06-07 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR tree-optimization/50439
+ * gfortran.dg/loop_interchange_2.f: New test.
+
+2020-06-06 Jan Hubicka <hubicka@ucw.cz>
+
+ * g++.dg/torture/pr95548.C: New test.
+
+2020-06-05 Martin Sebor <msebor@redhat.com>
+
+ * g++.dg/warn/Wnonnull5.C: Temporarily remove.
+
+2020-06-05 Marek Polacek <polacek@redhat.com>
+
+ PR c++/95369
+ * g++.dg/cpp2a/nontype-class38.C: New test.
+
+2020-06-05 Mark Wielaard <mark@klomp.org>
+
+ * gcc.dg/missing-header-fixit-3.c: Add
+ -Wno-implicit-function-declaration.
+ * gcc.dg/missing-header-fixit-4.c: Add new expected output.
+ * gcc.dg/missing-header-fixit-5.c: New testcase.
+ * gcc.dg/Wbuiltin-declaration-mismatch-ignore.c: Likewise.
+
+2020-06-05 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/constexpr-ptrsub2.C: New test.
+
+2020-06-05 Thomas Schwinge <thomas@codesourcery.com>
+ Julian Brown <julian@codesourcery.com>
+
+ * c-c++-common/goacc/struct-enter-exit-data-1.c: New file.
+
+2020-06-05 Martin Sebor <msebor@redhat.com>
+
+ * c-c++-common/goacc/uninit-use-device-clause.c: Adjust.
+ * c-c++-common/pr59223.c: Same.
+ * g++.dg/warn/Wnonnull5.C: Same.
+ * gcc.dg/pr59924.c: Same.
+ * gcc.dg/ubsan/pr81981.c: Same.
+ * gcc.dg/ubsan/pr89284.c: Same.
+ * gfortran.dg/goacc/uninit-use-device-clause.f95: Same.
+
+2020-06-05 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95539
+ * gcc.dg/vect/pr95539.c: New testcase.
+
+2020-06-05 Felix Yang <felix.yang@huawei.com>
+
+ PR target/95254
+ * gcc.target/aarch64/pr95254.c: New test.
+ * gcc.target/i386/pr67609.c: Check "movq\t%xmm0" instead of "movdqa".
+
+2020-06-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/95535
+ * gcc.target/i386/pr95535-1.c: New test.
+ * gcc.target/i386/pr95535-2.c: New test.
+
+2020-06-05 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/95493
+ * g++.dg/torture/pr95493.C: New testcase.
+
+2020-06-04 Martin Sebor <msebor@redhat.com>
+
+ PR middle-end/10138
+ PR middle-end/95136
+ * c-c++-common/Wsizeof-pointer-memaccess1.c: Prune out valid
+ Wuninitialized.
+ * c-c++-common/uninit-pr51010.c: Adjust expected warning format.
+ * c-c++-common/goacc/uninit-dim-clause.c: Same.
+ * c-c++-common/goacc/uninit-firstprivate-clause.c: Same.
+ * c-c++-common/goacc/uninit-if-clause.c: Same.
+ * c-c++-common/gomp/pr70550-1.c: Same.
+ * c-c++-common/gomp/pr70550-2.c: Adjust.
+ * g++.dg/20090107-1.C: Same.
+ * g++.dg/20090121-1.C: Same.
+ * g++.dg/ext/attr-access.C: Avoid -Wuninitialized.
+ * gcc.dg/tree-ssa/forwprop-6.c: Prune out -Wuninitialized.
+ * gcc.dg/Warray-bounds-52.c: Prune out valid -Wuninitialized.
+ * gcc.dg/Warray-bounds-53.c: Same.
+ * gcc.dg/Warray-bounds-54.c: Same.
+ * gcc.dg/Wstringop-overflow-33.c: New test.
+ * gcc.dg/attr-access-none.c: New test.
+ * gcc.dg/attr-access-read-only.c: Adjust.
+ * gcc.dg/attr-access-read-write.c: Same.
+ * gcc.dg/attr-access-write-only.c: Same.
+ * gcc.dg/pr71581.c: Adjust text of expected warning.
+ * gcc.dg/uninit-15.c: Same.
+ * gcc.dg/uninit-32.c: New test.
+ * gcc.dg/uninit-33.c: New test.
+ * gcc.dg/uninit-34.c: New test.
+ * gcc.dg/uninit-36.c: New test.
+ * gcc.dg/uninit-B-O0.c: Adjust text of expected warning.
+ * gcc.dg/uninit-I-O0.c: Same.
+ * gcc.dg/uninit-pr19430-O0.c: Same.
+ * gcc.dg/uninit-pr19430.c: Same.
+ * gcc.dg/uninit-pr95136.c: New test.
+ * gfortran.dg/assignment_4.f90: Expect -Wuninitialized.
+ * gfortran.dg/goacc/uninit-dim-clause.f95: Adjust text of expected
+ warning.
+ * gfortran.dg/goacc/uninit-firstprivate-clause.f95
+ * gfortran.dg/goacc/uninit-if-clause.f95
+ * gfortran.dg/pr66545_2.f90
+
+2020-06-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/93310
+ * g++.dg/cpp2a/constexpr-virtual16.C: New test.
+ * g++.dg/cpp2a/constexpr-virtual17.C: New test.
+ * g++.dg/cpp2a/constexpr-new12.C: Adjust diagnostic.
+
+2020-06-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/95158
+ * g++.dg/template/virtual5.C: New test.
+
+2020-06-04 Steven G. Kargl <kargl@gcc.gnu.org>
+ Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95500
+ * gfortran.dg/pr95500.f90: New test.
+
+2020-06-04 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/95346
+ * g++.dg/coroutines/pr95346.C: New test.
+
+2020-06-04 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR middle-end/95464
+ * gcc.target/i386/pr95464.c: New.
+
+2020-06-04 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/95113
+ * gcc.dg/ipa/pr95113.c: New test.
+
+2020-06-04 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
+
+ PR target/94735
+ * gcc.target/arm/mve/intrinsics/mve_vstore_scatter_base.c: New test.
+ * gcc.target/arm/mve/intrinsics/mve_vstore_scatter_base_p.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/mve_vstore_scatter_offset.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/mve_vstore_scatter_offset_p.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/mve_vstore_scatter_shifted_offset.c:
+ Likewise.
+ * gcc.target/arm/mve/intrinsics/mve_vstore_scatter_shifted_offset_p.c:
+ Likewise.
+
+2020-06-04 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
+
+ * gcc.target/arm/mve/intrinsics/vbicq_f16.c: Modify.
+ * gcc.target/arm/mve/intrinsics/vbicq_f32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vbicq_n_s16.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vbicq_n_s32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vbicq_n_u16.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vbicq_n_u32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vbicq_s16.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vbicq_s32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vbicq_s8.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vbicq_u16.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vbicq_u32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vbicq_u8.c: Likewise.
+
+2020-06-04 Hongtao Liu <hongtao.liu@inte.com>
+
+ * gcc.target/i386/avx512f-vcvtps2ph-pr95254.c: New test.
+ * gcc.target/i386/avx512vl-vcvtps2ph-pr95254.c: Ditto.
+
+2020-06-04 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat.dg/openacc1.adb: Remove testcase.
+
+2020-06-04 Hao Liu <hliu@os.amperecomputing.com>
+
+ PR tree-optimization/89430
+ * gcc.dg/tree-ssa/pr89430-1.c: Remove xfail.
+ * gcc.dg/tree-ssa/pr89430-2.c: Remove xfail.
+ * gcc.dg/tree-ssa/pr89430-5.c: Remove xfail.
+ * gcc.dg/tree-ssa/pr89430-6.c: Remove xfail.
+ * gcc.dg/tree-ssa/pr89430-7-comp-ref.c: New test.
+ * gcc.dg/tree-ssa/pr89430-8-mem-ref-size.c: New test.
+ * gcc.dg/tree-ssa/ssa-pre-17.c: Add -fno-tree-cselim.
+
+2020-06-04 Andreas Schwab <schwab@suse.de>
+
+ PR libfortran/59227
+ * gfortran.dg/erf_3.F90: Remove XFAIL on ia64-*-linux*.
+
+2020-06-04 Hongtao.liu <hongtao.liu@intel.com>
+
+ * gcc.target/i386/pr92658-avx512bw-trunc.c: Adjust testcase.
+
+2020-06-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/82304
+ PR c++/95307
+ * g++.dg/template/pr79650.C: Expect different diagnostics and expect
+ it on all lines that do pointer to integer casts.
+ * g++.dg/cpp1y/constexpr-shift1.C: Expect different diagnostics.
+ * g++.dg/cpp1y/constexpr-82304.C: New test.
+ * g++.dg/cpp0x/constexpr-95307.C: New test.
+
+2020-06-03 Mark Wielaard <mark@klomp.org>
+
+ * g++.dg/spellcheck-inttypes.C: Add string-literal testcases.
+
+2020-06-03 Mark Wielaard <mark@klomp.org>
+
+ * gcc.dg/spellcheck-inttypes.c: New test.
+ * g++.dg/spellcheck-inttypes.C: Likewise.
+
+2020-06-03 Mark Wielaard <mark@klomp.org>
+
+ * c-c++-common/missing-close-func-paren.c: New test.
+
+2020-06-03 Vitor Guidi <vitor.guidi@usp.br>
+
+ * gcc.dg/tanhbysinh.c: New testcase.
+
+2020-06-03 Patrick Palka <ppalka@redhat.com>
+
+ * g++.dg/cpp2a/concepts-partial-spec8.C: New test.
+
+2020-06-03 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/92103
+ * g++.dg/cpp2a/concepts-partial-spec7.C: New test.
+
+2020-06-03 Jan Hubicka <hubicka@ucw.cz>
+
+ * g++.dg/lto/pr84805_0.C: Update.
+
+2020-06-03 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/95345
+ * g++.dg/coroutines/pr95345.C: New test.
+
+2020-06-03 Jason Merrill <jason@redhat.com>
+
+ PR c++/95232
+ * g++.dg/ubsan/vla-2.C: New test.
+
+2020-06-03 José Rui Faustino de Sousa <jrfsousa@gmail.com>
+
+ PR fortran/95214
+ PR fortran/66833
+ PR fortran/67938
+ * gfortran.dg/PR95214.f90: New test.
+
+2020-06-03 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95487
+ * g++.dg/vect/pr95487.cc: New testcase.
+
+2020-06-03 David Malcolm <dmalcolm@redhat.com>
+
+ PR jit/95306
+ * jit.dg/test-pr95306-builtin-types.c (create_code): Add
+ test of getting __atomic_load.
+
+2020-06-03 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95495
+ * gcc.dg/vect/pr95495.c: New testcase.
+
+2020-06-03 Thomas Schwinge <thomas@codesourcery.com>
+ Tobias Burnus <tobias@codesourcery.com>
+
+ PR middle-end/94874
+ * c-c++-common/gomp/pr94874.c: New.
+
+2020-06-02 David Malcolm <dmalcolm@redhat.com>
+
+ PR jit/95426
+ * jit.dg/all-non-failing-tests.h: Add note about...
+ * jit.dg/test-builtin-unreachable.c: New test.
+
+2020-06-02 Jason Merrill <jason@redhat.com>
+
+ PR c++/95193
+ * g++.dg/cpp1z/lambda-this7.C: New test.
+
+2020-06-02 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/95050
+ * g++.dg/coroutines/pr95050.C: New test.
+
+2020-06-02 Alexandre Oliva <oliva@adacore.com>
+
+ * gcc.misc-tests/outputs.exp: Spell ldscript correctly.
+ * lib/gcc-defs.exp (gcc_adjust_linker_flags): Likewise.
+
+2020-06-02 Felix Yang <felix.yang@huawei.com>
+
+ PR target/95459
+ * gcc.target/aarch64/mgeneral-regs_6.c: New test.
+
+2020-06-02 Andrew Stubbs <ams@codesourcery.com>
+
+ * gcc.dg/intermod-1.c: Don't use -mlocal-symbol-id.
+
+2020-06-02 Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>
+
+ * gcc.target/s390/vector/align-1.c: Change target architecture
+ to z13.
+ * gcc.target/s390/vector/align-2.c: Change target architecture
+ to z13.
+
+2020-06-02 Kito Cheng <kito.cheng@sifive.com>
+
+ * lib/ubsan-dg.exp (orig_ubsan_options_saved): New
+ (orig_ubsan_options): Ditto.
+ (ubsan_init): Store UBSAN_OPTIONS and set UBSAN_OPTIONS.
+ (ubsan_finish): Restore UBSAN_OPTIONS.
+
+2020-06-02 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/92633
+ PR c++/92838
+ * g++.dg/cpp2a/concepts-lambda11.C: New test.
+ * g++.dg/cpp2a/concepts-lambda12.C: New test.
+
+2020-06-01 Jason Merrill <jason@redhat.com>
+
+ PR c++/95466
+ * g++.dg/ubsan/vptr-17.C: New test.
+
+2020-06-01 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/95350
+ * g++.dg/coroutines/torture/func-params-08.C: Adjust test to
+ reflect that all rvalue refs are dangling.
+ * g++.dg/coroutines/torture/func-params-09-awaitable-parms.C:
+ Likewise.
+ * g++.dg/coroutines/pr95350.C: New test.
+
+2020-06-01 Feng Xue <fxue@os.amperecomputing.com>
+
+ PR ipa/93429
+ * gcc.dg/ipa/ipcp-agg-8.c: Change dump string.
+ * gcc.dg/ipa/ipcp-agg-13.c: New test.
+
+2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/95087
+ * g++.dg/coroutines/co-return-syntax-08-bad-return.C:
+ Adjust the testcase to do the compile (rather than an
+ -fsyntax-only parse).
+
+2020-05-31 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/94361
+ * gfortran.dg/finalize_28.f90: Adjusted free counts.
+ * gfortran.dg/finalize_33.f90: Likewise.
+ * gfortran.dg/finalize_34.f90: Likewise.
+ * gfortran.dg/finalize_35.f90: New test.
+
+2020-05-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/95052
+ * gcc.dg/pr95052.c: New test.
+
+2020-05-31 Jim Wilson <jimw@sifive.com>
+
+ * gcc.target/riscv/zero-extend-5.c: New.
+
+2020-05-30 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95373
+ * gfortran.dg/pr95373_1.f90: Adjust error messages.
+ * gfortran.dg/pr95373_2.f90: Adjust error message.
+
+2020-05-30 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/95386
+ * g++.dg/concepts/pr95386.C: New test.
+
+2020-05-29 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * gcc.target/powerpc/vsx-vector-6.p9.c: Allow xxperm as perm as well.
+
+2020-05-29 Patrick Palka <ppalka@redhat.com>
+ Jason Merrill <jason@redhat.com>
+
+ PR c++/95181
+ * g++.dg/concepts/pr95181.C: New test.
+ * g++.dg/concepts/pr95181-2.C: New test.
+
+2020-05-29 Jason Merrill <jason@redhat.com>
+
+ PR c++/95371
+ * g++.dg/cpp2a/concepts-ttp1.C: New test.
+
+2020-05-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR libfortran/95390
+ * gfortran.dg/findloc_8.f90: New test.
+
+2020-05-29 Marek Polacek <polacek@redhat.com>
+
+ PR c++/95344
+ * c-c++-common/Wparentheses-2.c: New test.
+
+2020-05-29 Jason Merrill <jason@redhat.com>
+
+ PR c++/95311
+ * g++.dg/ubsan/vptr-16.C: New test.
+
+2020-05-29 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/92652
+ PR c++/93698
+ PR c++/94128
+ * g++.dg/cpp2a/concepts-lambda8.C: New test.
+ * g++.dg/cpp2a/concepts-lambda9.C: New test.
+ * g++.dg/cpp2a/concepts-lambda10.C: New test.
+
+2020-05-29 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/95241
+ * g++.dg/cpp0x/constexpr-array25.C: New test.
+
+2020-05-29 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95272
+ * gcc.dg/vect/pr95272.c: New testcase.
+
+2020-05-29 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95403
+ * gfortran.dg/vect/pr95403.f: New testcase.
+
+2020-05-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/95315
+ * gcc.dg/gomp/pr95315-2.c: New test.
+
+2020-05-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/95052
+ * gcc.target/i386/pr95052.c: New test.
+
+2020-05-29 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95393
+ * gcc.dg/tree-ssa/phi-opt-21.c: New testcase.
+ * g++.dg/vect/slp-pr87105.cc: Adjust.
+
+2020-05-29 Joe Ramsay <joe.ramsay@arm.com>
+
+ * gcc.target/aarch64/sve/load_const_offset_2.c: Force using packed
+ vectors.
+ * gcc.target/aarch64/sve/logical_unpacked_and_1.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_and_2.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_and_3.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_and_4.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_and_5.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_and_6.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_and_7.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_eor_1.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_eor_2.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_eor_3.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_eor_4.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_eor_5.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_eor_6.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_eor_7.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_orr_1.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_orr_2.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_orr_3.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_orr_4.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_orr_5.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_orr_6.c: New test.
+ * gcc.target/aarch64/sve/logical_unpacked_orr_7.c: New test.
+ * gcc.target/aarch64/sve/scatter_store_6.c: Force using packed vectors.
+ * gcc.target/aarch64/sve/scatter_store_7.c: Force using packed vectors.
+ * gcc.target/aarch64/sve/strided_load_3.c: Force using packed vectors.
+ * gcc.target/aarch64/sve/strided_store_3.c: Force using packed vectors.
+ * gcc.target/aarch64/sve/unpack_signed_1.c: Force using packed vectors.
+
+2020-05-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/95328
+ * g++.dg/cpp1z/decomp53.C: New test.
+
+2020-05-28 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95373
+ * gfortran.dg/pr95373_1.f90: New test.
+ * gfortran.dg/pr95373_2.f90: New test.
+
+2020-05-28 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp1z/pr86648.C: Expect error.
+ * g++.dg/cpp1z/static2.C: Expect error.
+ * g++.dg/cpp0x/nsdmi16.C: New test.
+
+2020-05-28 Marek Polacek <polacek@redhat.com>
+
+ * g++.dg/cpp0x/initlist-array12.C: Fix the definition of
+ initializer_list for ilp32 target.
+
+2020-05-28 Marek Polacek <polacek@redhat.com>
+
+ * g++.dg/ext/tmplattr10.C: Only run in c++11.
+
+2020-05-28 H.J. Lu <hjl.tools@gmail.com>
+
+ * gcc.dg/builtin-bswap-10.c: Check "! int128" instead of ilp32
+
+2020-05-28 Steven G. Kargl <kargl@gcc.gnu.org>
+ Mark Eggleston <markeggleston@gcc.gnu.org>
+
+ PR fortran/94397
+ * gfortran.dg/pr94397.F90: New test.
+
+2020-05-28 Richard Sandiford <richard.sandiford@arm.com>
+
+ * gcc.target/aarch64/shrink_wrap_1.c: New test.
+
+2020-05-28 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR testsuite/95361
+ * gcc.target/aarch64/sve/pr95361.c: New test.
+
+2020-05-28 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95273
+ PR tree-optimization/95356
+ * gcc.target/i386/pr95356.c: New testcase.
+
+2020-05-28 Richard Biener <rguenther@suse.de>
+
+ PR testsuite/95363
+ * gcc.dg/vect/bb-slp-pr95271.c: Fix on ilp32 targets.
+
+2020-05-28 Alexandre Oliva <oliva@adacore.com>
+
+ * lib/gcc-defs.exp: Avoid introducing empty arguments between
+ consecutive blanks in board linking options.
+ * gcc.misc-tests/outputs.exp: Likewise. Document
+ -gsplit-dwarf testing, skip LTO tests if -flto is not
+ supported, detect the default linker output name, cope with
+ the need for an explicit executable output.
+
+2020-05-27 Eric Botcazou <ebotcazou@gcc.gnu.org>
+
+ * gcc.dg/builtin-bswap-10.c: New test.
+ * gcc.dg/builtin-bswap-11.c: Likewise.
+ * gcc.dg/builtin-bswap-12.c: Likewise.
+ * gcc.target/i386/builtin-bswap-5.c: Likewise.
+
+2020-05-27 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95090
+ * gfortran.dg/pr95090.f90: New test.
+
+2020-05-27 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/95355
+ * gcc.target/i386/pr95355.c: New test.
+
+2020-05-27 David Malcolm <dmalcolm@redhat.com>
+
+ PR jit/95314
+ * jit.dg/all-non-failing-tests.h: Add test-pr95314-rvalue-reuse.c.
+ * jit.dg/test-pr95314-rvalue-reuse.c: New test.
+
+2020-05-27 Jason Merrill <jason@redhat.com>
+
+ PR c++/95319
+ * g++.dg/cpp0x/initlist-array12.C: New test.
+
+2020-05-27 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/50392
+ * gfortran.dg/pr50392.f: New test.
+
+2020-05-27 Uroš Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/vperm-v2sf.c: New test.
+
+2020-05-27 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp2a/spaceship-synth2.C: Add
+ -Wzero-as-null-pointer-constant.
+
+2020-05-27 Jason Merrill <jason@redhat.com>
+
+ PR c++/95222
+ * g++.dg/ext/tmplattr10.C: New test.
+
+2020-05-27 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/95263
+ * g++.dg/template/pr95263.C: New file.
+
+2020-05-27 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95295
+ * gcc.dg/torture/pr95295-3.c: New testcase.
+
+2020-05-27 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95335
+ * gcc.dg/vect/bb-slp-pr95335.c: New testcase.
+
+2020-05-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/95315
+ * gcc.dg/gomp/pr95315.c: New test.
+
+2020-05-26 David Malcolm <dmalcolm@redhat.com>
+
+ PR jit/95306
+ * jit.dg/all-non-failing-tests.h: Add test-builtin-memcpy.c and
+ test-pr95306-builtin-types.c.
+ * jit.dg/test-builtin-memcpy.c: New test.
+ * jit.dg/test-error-gcc_jit_context_get_builtin_function-unimplemented-type.c:
+ New test.
+ * jit.dg/test-pr95306-builtin-types.c: New test.
+
+2020-05-26 Harald Anlauf <anlauf@gmx.de>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR libfortran/95104
+ * gfortran.dg/pr95104.f90: New test.
+
+2020-05-26 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95195
+ * gfortran.dg/namelist_97.f90: New test.
+
+2020-05-26 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95089
+ * gfortran.dg/pr95089.f90: New test.
+
+2020-05-26 David Malcolm <dmalcolm@redhat.com>
+
+ PR jit/95296
+ * jit.dg/test-error-gcc_jit_context_new_global-void-type.c: New
+ test.
+ * jit.dg/test-error-gcc_jit_function_new_local-void-type.c: New
+ test.
+ * jit.dg/test-fuzzer.c (fuzzer_init): Allow for make_random_type
+ to return NULL.
+ (get_random_type): Allow for elements in f->types to be NULL.
+
+2020-05-26 Uroš Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/vperm-v2si.c: New test.
+ * gcc.target/i386/vperm-v4hi.c: Ditto.
+
+2020-05-26 Iain Sandoe <iain@sandoe.co.uk>
+
+ * g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C: Check for
+ promise destruction via a global variable.
+
+2020-05-26 Alexandre Oliva <oliva@adacore.com>
+
+ * gcc.misc-tests/outputs.exp: New.
+ * gcc.misc-tests/outputs-0.c: New.
+ * gcc.misc-tests/outputs-1.c: New.
+ * gcc.misc-tests/outputs-2.c: New.
+ * lib/gcc-defs.exp (gcc_adjusted_linker_flags): New.
+ (gcc_adjust_linker_flags): New.
+ (dg-additional-files-options): Call it. Pass -dumpbase ""
+ when there are additional sources.
+ * lib/profopt.exp (profopt-execute): Pass the executable
+ suffix with -dumpbase-ext.
+ * lib/scandump.exp (dump-base): Mention -dumpbase "" use.
+ * lib/scanltranstree.exp: Adjust dump suffix expectation.
+ * lib/scanwpaipa.exp: Likewise.
+
+2020-05-26 Hongtao Liu <hongtao.liu@intel.com>
+ Uroš Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/pr95211.c: New test.
+
+2020-05-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/opt84.adb: New test.
+
+2020-05-25 Uroš Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/sse2-mmx-18a.c (dg-options): Remove -mno-avx512vl.
+ * gcc.target/i386/sse2-mmx-19a.c (dg-options): Remove -mno-avx.
+ * gcc.target/i386/sse2-mmx-18b.c: Remove.
+ * gcc.target/i386/sse2-mmx-18c.c: Ditto.
+ * gcc.target/i386/sse2-mmx-19b.c: Ditto.
+ * gcc.target/i386/sse2-mmx-19c.c: Ditto.
+ * gcc.target/i386/sse2-mmx-19d.c: Ditto.
+ * gcc.target/i386/sse2-mmx-19e.c: Ditto.
+
+2020-05-25 Martin Jambor <mjambor@suse.cz>
+
+ * brig.dg/test/gimple/packed.hsail: Fix scan dump patterns.
+
+2020-05-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95308
+ * g++.dg/torture/pr95308.C: New testcase.
+
+2020-05-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95295
+ * gcc.dg/torture/pr95295-1.c: New testcase.
+ * gcc.dg/torture/pr95295-2.c: Likewise.
+ * gcc.dg/torture/pr95283.c: Likewise.
+
+2020-05-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95271
+ * gcc.dg/vect/bb-slp-pr95271.c: New testcase.
+
+2020-05-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95297
+ * g++.dg/vect/pr95297.cc: New testcase.
+ * g++.dg/vect/pr95290.cc: Likewise.
+
+2020-05-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95284
+ * g++.dg/torture/pr95284.C: New testcase.
+
+2020-05-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/renaming16.adb: New test.
+ * gnat.dg/renaming16_pkg.ads: New helper.
+
+2020-05-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/array40.adb: New test.
+ * gnat.dg/array40_pkg.ads: New helper.
+
+2020-05-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/array39.adb: New test.
+ * gnat.dg/array39_pkg.ads: New helper.
+ * gnat.dg/array39_pkg.adb: Likewise.
+
+2020-05-25 Hongtao Liu <hongtao.liu@intel.com>
+
+ * gcc.target/i386/pr95125-avx.c: New test.
+ * gcc.target/i386/pr95125-avx512f.c: Ditto.
+
+2020-05-24 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95106
+ * gfortran.dg/equiv_11.f90: New test.
+
+2020-05-23 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/94038
+ * g++.dg/warn/pr94038-3.C: New test.
+
+2020-05-22 Mark Wielaard <mark@klomp.org>
+
+ * gcc.dg/spellcheck-stdint.c: New test.
+ * g++.dg/spellcheck-stdint.C: Likewise.
+
+2020-05-22 Mark Wielaard <mark@klomp.org>
+
+ * gcc.dg/spellcheck-stdbool.c: New test.
+
+2020-05-22 Mark Wielaard <mark@klomp.org>
+
+ * gcc.dg/analyzer/signal-exit.c: New testcase.
+
+2020-05-22 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/95255
+ * gcc.target/i386/pr95255.c: New test.
+
+2020-05-22 Hongtao.liu <hongtao.liu@intel.com>
+
+ * gcc.target/i386/pr92658-avx512f.c: New test.
+ * gcc.target/i386/pr92658-avx512vl.c: Ditto.
+ * gcc.target/i386/pr92658-avx512bw-trunc.c: Ditto.
+
+2020-05-22 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95268
+ * g++.dg/torture/pr95268.C: New testcase.
+
+2020-05-22 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95248
+ * gcc.dg/torture/pr95248.c: New testcase.
+
+2020-05-21 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/94038
+ * g++.dg/warn/pr94038-2.C: New test.
+
+2020-05-21 Martin Liska <mliska@suse.cz>
+
+ PR target/95229
+ * g++.target/i386/pr95229.C: Fix
+ error: unnamed type with no linkage used
+ to declare variable ‘<unnamed class> e’ with linkage
+ with -std=gnu++98.
+
+2020-05-21 Nathan Sidwell <nathan@acm.org>
+
+ * c-c++-common/cpp/cmd-1.c: Delete.
+ * c-c++-common/cpp/cmd-1.h: Delete.
+
+2020-05-21 Martin Liska <mliska@suse.cz>
+
+ * gcc.target/aarch64/target_attr_20.c: New test.
+ * gcc.target/aarch64/target_attr_21.c: New test.
+
+2020-05-20 Jozef Lawrynowicz <jozef.l@mittosystems.com>
+
+ * g++.dg/warn/Wconversion-null-2.C: Add explicit declarations for l()
+ and g() with int, long, long long and __int20 arguments.
+ * g++.dg/warn/Wconversion-null.C: Likewise.
+
+2020-05-20 Marek Polacek <polacek@redhat.com>
+
+ DR 2237
+ * g++.dg/DRs/dr2237.C: New test.
+ * g++.dg/parse/constructor2.C: Add dg-error for C++20.
+ * g++.dg/parse/dtor12.C: Likewise.
+ * g++.dg/parse/dtor4.C: Likewise.
+ * g++.dg/template/dtor4.C: Adjust dg-error.
+ * g++.dg/template/error34.C: Likewise.
+ * g++.old-deja/g++.other/inline15.C: Only run for C++17 and lesses.
+ * g++.old-deja/g++.pt/ctor2.C: Add dg-error for C++20.
+
+2020-05-20 Marek Polacek <polacek@redhat.com>
+
+ DR 2289
+ PR c++/94553
+ * g++.dg/cpp1z/decomp52.C: New test.
+
+2020-05-20 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/95229
+ * g++.target/i386/pr95229.C: New test.
+
+2020-05-20 Mark Eggleston <markeggleston@gcc.gnu.org>
+
+ PR fortran/39695
+ * gfortran.dg/pr39695_1.f90: New test.
+ * gfortran.dg/pr39695_2.f90: New test.
+ * gfortran.dg/pr39695_3.f90: New test.
+ * gfortran.dg/pr39695_4.f90: New test.
+
+2020-05-20 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/95223
+ * g++.dg/template/typename23.C: New test.
+
+2020-05-20 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
+
+ PR target/94959
+ * gcc.target/arm/mve/intrinsics/mve_vector_float2.c: Modify.
+ * gcc.target/arm/mve/intrinsics/mve_vldr.c: New test.
+ * gcc.target/arm/mve/intrinsics/mve_vldr_z.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/mve_vstr.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/mve_vstr_p.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vld1q_f16.c: Modify.
+ * gcc.target/arm/mve/intrinsics/vld1q_f32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vld1q_s16.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vld1q_s32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vld1q_s8.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vld1q_u16.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vld1q_u32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vld1q_u8.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vld1q_z_f16.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vld1q_z_f32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vld1q_z_s16.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vld1q_z_s32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vld1q_z_s8.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vld1q_z_u16.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vld1q_z_u32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vld1q_z_u8.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrbq_s8.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrbq_u8.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrbq_z_s8.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrbq_z_u8.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_s64.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_u64.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_s64.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_u64.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrhq_f16.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrhq_s16.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrhq_s32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrhq_u16.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrhq_u32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrhq_z_f16.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrhq_z_s16.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrhq_z_s32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrhq_z_u16.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrhq_z_u32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrwq_f32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_f32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_s32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_u32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_f32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_s32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_u32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrwq_s32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrwq_u32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrwq_z_f32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrwq_z_s32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vldrwq_z_u32.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vuninitializedq_float.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vuninitializedq_float1.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vuninitializedq_int.c: Likewise.
+ * gcc.target/arm/mve/intrinsics/vuninitializedq_int1.c: Likewise.
+
+2020-05-20 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95219
+ * tree-vect-loop.c (vectorizable_induction): Reduce
+ group_size before computing the number of required IVs.
+
+2020-05-20 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/95231
+ * g++.dg/other/pr95231.C: New testcase.
+
+2020-05-30 Richard Biener <rguenther@suse.de>
+
+ PR c/95141
+ * gcc.dg/pr95141.c: New testcase.
+
+2020-05-19 Alex Coplan <alex.coplan@arm.com>
+
+ PR target/94591
+ * gcc.c-torture/execute/pr94591.c: New test.
+
+2020-05-19 Nathan Sidwell <nathan@acm.org>
+
+ * c-c++-common/raw-string-14.c: Adjust errors.
+ * c-c++-common/raw-string-16.c: Likewise.
+ * c-c++-common/raw-string-5.c: Likewise.
+
+2020-05-19 Richard Biener <rguenther@suse.de>
+
+ * gcc.target/i386/pr92645-4.c: Adjust expected pattern.
+
+2020-05-19 Jozef Lawrynowicz <jozef.l@mittosystems.com>
+
+ * c-c++-common/builtin-has-attribute-7.c: Require size24plus.
+ * c-c++-common/cpp/pr63831-1.c: Store result in _has_cpp_attribute in a
+ long.
+ * c-c++-common/pr81376.c: Skip scan-tree-dump for short_eq_int. Extend
+ test for short_eq_int.
+ * g++.dg/abi/scoped1.C: Skip dg-warning tests for short_eq_int.
+ * g++.dg/cpp0x/constexpr-70001-1.C: Require size24plus.
+ * g++.dg/cpp0x/constexpr-bitfield3.C: Require int32plus.
+ * g++.dg/cpp0x/enum13.C: Skip dg-warning for short_eq_int.
+ * g++.dg/cpp0x/initlist5.C: Add dg-error for short_eq_int.
+ * g++.dg/cpp0x/initlist7.C: Add dg-warning for !int32plus.
+ * g++.dg/cpp0x/nullptr04.C: Skip dg-error for ptr_eq_short.
+ * g++.dg/cpp0x/variadic-value1.C: Add typedef for int32_t.
+ * g++.dg/cpp1y/constexpr-arith-overflow.C: Fix test for
+ sizeof(int) == sizeof(short).
+ * g++.dg/cpp1y/digit-sep-neg.C: Add typedef for int32_t.
+ * g++.dg/cpp1y/pr57644.C: Add typedef for uint32_t.
+ * g++.dg/cpp1y/pr77321.C: Require size24plus.
+ * g++.dg/cpp1y/var-templ4.C: Add typedef for int32_t.
+ * g++.dg/cpp1z/direct-enum-init1.C: Skip dg-error for short_eq_int.
+ * g++.dg/delayedfold/fwrapv1.C: Skip for int16.
+ * g++.dg/expr/bitfield9.C: Add typedef for int32_t.
+ * g++.dg/ext/attribute-test-1.C: Add typedef for uint32_t.
+ * g++.dg/ext/bitfield1.C: Add typedef for int32_t.
+ * g++.dg/ext/flexary13.C: Add typedef for int32_t.
+ * g++.dg/ext/utf-cvt.C: Adjust dg-warning for int16.
+ * g++.dg/ext/vector28.C: Add typedef for int32_t.
+ * g++.dg/ext/vla15.C: Add typedef for int32_t.
+ * g++.dg/init/array11.C: Require size32plus.
+ * g++.dg/init/array15.C: Require size24plus.
+ * g++.dg/init/array4.C: Require size20plus.
+ * g++.dg/init/const7.C: Skip dg-message for ptr_eq_short.
+ * g++.dg/init/new38.C: Relax regex in dg-error.
+ * g++.dg/init/new44.C: Skip dg-error for msp430_small.
+ Adjust test for 16-bit size_t.
+ Add special case for msp430 -mlarge.
+ * g++.dg/init/value9.C: Add typedef for int32_t.
+ * g++.dg/ipa/pr77333.C: Add typedef for int32_t.
+ * g++.dg/lto/20080908-1_0.C: Add typedef for int32_t.
+ * g++.dg/opt/pr55717.C: Add typedef for uint32_t.
+ * g++.dg/opt/pr60597.C: Add typedef for int32_t.
+ * g++.dg/opt/pr81715.C: Require size20plus.
+ * g++.dg/opt/reload3.C: Add typedef for uint32_t.
+ * g++.dg/opt/temp2.C: Require size20plus.
+ * g++.dg/opt/thunk1.C: Likewise.
+ * g++.dg/other/error23.C: Dont assume __SIZEOF_INT__ == 4.
+ * g++.dg/other/pr31078.C: Adjust typedef for 32-bit int.
+ * g++.dg/parse/concat1.C: Skip dg-error for size20plus.
+ * g++.dg/parse/defarg5.C: Add typedef for int32_t and uint32_t.
+ * g++.dg/pr48484.C: Add typedef for int32_t.
+ * g++.dg/pr53037-2.C: Likewise.
+ * g++.dg/pr53037-3.C: Likewise.
+ * g++.dg/pr66655.C: Use int32_t.
+ * g++.dg/pr66655.h: Add typedef for int32_t.
+ * g++.dg/pr66655_1.cc: Use int32_t.
+ * g++.dg/pr67351.C: Define 32-bit uint.
+ * g++.dg/template/array30.C: Add typedef for int32_t.
+ * g++.dg/template/constant1.C: Extend test for 8-bit and 16-bit int.
+ * g++.dg/template/constant2.C: Likewise.
+ * g++.dg/template/friend18.C: Add typedef for int32_t.
+ * g++.dg/template/pr68978.C: Likewise.
+ * g++.dg/torture/pr37421.C: Require int_eq_float.
+ * g++.dg/torture/pr88861.C: Handle 16-bit int.
+ * g++.dg/tree-ssa/pr19807.C: Likewise.
+ * g++.dg/tree-ssa/pr27291.C: Fix typedef for uint32_t.
+ * g++.dg/tree-ssa/pr49516.C: Fix typedefs for int{16,32}_t and
+ uint{32,64}_t.
+ * g++.dg/warn/Wconversion-integer.C: Add typedefs for {u,}int32_t.
+ * g++.dg/warn/Wconversion-null-2.C: Adjust g() declaration.
+ * g++.dg/warn/Wconversion-null.C: Likewise.
+ * g++.dg/warn/Wconversion3.C: Skip dg-warning for short_eq_int.
+ * g++.dg/warn/Wduplicated-branches1.C: Add dg-warning for short_eq_int.
+ * g++.dg/warn/Wplacement-new-size-5.C: Add typedef for int32_t.
+ * g++.dg/warn/Wplacement-new-size.C: Likewise.
+ * g++.dg/warn/Wstrict-aliasing-5.C: Add typedef for uint32_t.
+ * g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C: Add typedef for
+ {u,}int32_t.
+ * g++.dg/warn/Wtype-limits-Wextra.C: Adjust dg-warning for
+ short_eq_int.
+ * g++.dg/warn/Wtype-limits.C: Likewise.
+ * g++.old-deja/g++.brendan/enum11.C: Add typedef for uint32_t.
+ * g++.old-deja/g++.bugs/900227_01.C: Skip dg-error for ptr_eq_short.
+ * g++.old-deja/g++.mike/ns15.C: Require size20plus.
+ * g++.old-deja/g++.other/exprstmt1.C: Add typedef for uint32_t.
+ * g++.old-deja/g++.other/inline12.C: Adjust udword typedef.
+ * g++.old-deja/g++.other/new6.C: Add typedef for int32_t.
+ * g++.old-deja/g++.pt/crash16.C: Skip for int16.
+ * g++.old-deja/g++.robertl/eb76.C: Likewise.
+ * g++.old-deja/g++.warn/flow1.C: Add typedef for int32_t.
+ * gcc.dg/Walloca-14.c: Adjust -Walloca-larger-than= parameter for
+ !ptr32plus.
+ * gcc.dg/Warray-bounds-32.c: Adjust dg-warning for size20plus.
+ * gcc.dg/Wbuiltin-declaration-mismatch-4.c: Adjust dg-warning for
+ short_eq_int.
+ Handle case where ptrdiff_t/size_t is __int20.
+ * gcc.dg/concat2.c: Skip dg-error for size20plus.
+ * gcc.dg/fold-convmaxconv-1.c: Add typedef for {u,}int32_t.
+ * gcc.dg/fold-convminconv-1.c: Likewise.
+ * gcc.dg/graphite/scop-4.c: Require size20plus.
+ * gcc.dg/loop-versioning-1.c: Adjust test for small size_t.
+ * gcc.dg/loop-versioning-2.c: Require size20plus.
+ * gcc.dg/lto/20081210-1_0.c: Adjust typedef for uintptr_t.
+ * gcc.dg/lto/pr85870_0.c: Add typedef for uint32_t.
+ * gcc.dg/lto/pr85870_1.c: Likewise.
+ * gcc.dg/pr36227.c: Adjust typedef for ptrcast.
+ * gcc.dg/pr42611.c: First check for size_t equality with void *
+ before trying other types.
+ * gcc.dg/pr59963-2.c: Skip dg-warning for int16 instead of
+ xfail.
+ * gcc.dg/pr68317.c: Add typedef for int32_t.
+ * gcc.dg/pr78973.c: Adjust dg-warning for int16.
+ * gcc.dg/pr85859.c: Cast using __INTPTR_TYPE__ instead of long.
+ * gcc.dg/pr86179.c: Add typedef for {u,}int32_t.
+ * gcc.dg/torture/20181024-1.c: Require size32plus.
+ * gcc.dg/torture/pr71598-2.c: Skip for short_eq_int.
+ * gcc.dg/torture/pr86034.c: Add typedef for int32_t.
+ * gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Adjust dg-warning
+ for int16 and msp430 -mlarge.
+ * gcc.dg/tree-ssa/integer-addr.c: Use __INTPTR_MAX__ for a large
+ constant that is a valid address.
+ * gcc.dg/tree-ssa/loop-interchange-10.c: Add typedef for
+ int32_t.
+ * gcc.dg/tree-ssa/pr84436-3.c: Adjust dg-final for int16.
+ * gcc.dg/tree-ssa/pr84648.c: Add typedef for uint32_t.
+ * gcc.dg/tree-ssa/scev-8.c: Cast to char if sizeof(int) ==
+ sizeof(short).
+ * gcc.dg/tree-ssa/ssa-dom-thread-8.c: Adjust test for msp430 -mlarge.
+ * lib/target-supports.exp (check_effective_target_size24plus): New.
+ (check_effective_target_short_eq_int): New.
+ (check_effective_target_ptr_eq_short): New.
+ (check_effective_target_msp430_small): New.
+ (check_effective_target_msp430_large): New.
+
+2020-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * gcc.target/bpf/xbpf-callee-saved-regs-1.c: New test.
+ * gcc.target/bpf/xbpf-callee-saved-regs-2.c: Likewise.
+
+2020-05-19 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/92658
+ * gcc.target/i386/pr92658-sse4.c: New test.
+ * gcc.target/i386/pr92658-avx2.c: New test.
+ * gcc.target/i386/pr92658-avx512bw.c: New test.
+
+2020-05-19 Kito Cheng <kito.cheng@sifive.com>
+
+ * gcc.target/riscv/arch-6.c: New.
+ * gcc.target/riscv/attribute-11.c: New.
+ * gcc.target/riscv/attribute-12.c: New.
+
+2020-05-19 Kito Cheng <kito.cheng@sifive.com>
+
+ * gcc.target/riscv/arch-3.c: Adjust option.
+ * gcc.target/riscv/arch-5.c: New.
+ * gcc.target/riscv/attribute-9.c: Adjust option and test
+ condition.
+
+2020-05-19 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/66439
+ * g++.dg/cpp2a/concepts-ts4.C: Expect a "type/value mismatch"
+ diagnostic.
+ * g++.dg/cpp2a/concepts-ts6.C: Likewise.
+ * g++.dg/template/error56.C: Likewise.
+ * g++.dg/template/error59.C: New test.
+
+2020-05-18 Marek Polacek <polacek@redhat.com>
+
+ PR c++/94955
+ * g++.dg/cpp0x/constexpr-shift2.C: New test.
+
+2020-05-18 Marek Polacek <polacek@redhat.com>
+
+ PR c++/94937
+ * g++.dg/cpp1z/constexpr-if34.C: New test.
+ * g++.dg/cpp2a/is-constant-evaluated10.C: New test.
+
+2020-05-18 Martin Sebor <msebor@redhat.com>
+
+ PR c++/94923
+ * g++.dg/Wclass-memaccess.C: Add tests for std::byte.
+
+2020-05-18 Martin Sebor <msebor@redhat.com>
+
+ PR middle-end/92815
+ * gcc.dg/builtin-object-size-20.c: Adjust to avoid failures in
+ ILP32 mode.
+
+2020-05-18 Marek Polacek <polacek@redhat.com>
+
+ PR c++/90915
+ * g++.dg/ext/builtin-has-attribute.C: New test.
+
+2020-05-18 Martin Sebor <msebor@redhat.com>
+
+ PR middle-end/92815
+ * gcc.dg/Warray-bounds-56.c: Remove xfails.
+ * gcc.dg/builtin-object-size-20.c: New test.
+ * gcc.dg/builtin-object-size-21.c: New test.
+
+2020-05-18 Martin Sebor <msebor@redhat.com>
+
+ PR middle-end/94940
+ * gcc.dg/Warray-bounds-61.c: New test.
+
+2020-05-18 Marek Polacek <polacek@redhat.com>
+
+ DR 1512
+ PR c++/87699
+ * g++.dg/cpp0x/constexpr-array-ptr10.C: Change dg-warning to dg-error
+ and adjust the expected messages in dg-error.
+ * g++.dg/expr/composite-ptr-type.C: New test.
+ * g++.dg/expr/ptr-comp1.C: New test.
+ * g++.dg/expr/ptr-comp2.C: New test.
+ * g++.dg/expr/ptr-comp3.C: New test.
+ * g++.dg/overload/builtin4.C: New test.
+ * g++.dg/warn/Wextra-3.C: Change dg-warning to dg-error.
+
+2020-05-18 Marek Polacek <polacek@redhat.com>
+
+ * g++.dg/overload/builtin5.C: New test.
+
+2020-05-18 Doug Rupp <rupp@adacore.com>
+
+ * gcc.target/powerpc/pr71763.c: Require powerpc_vsx_ok.
+
+2020-05-18 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95053
+ * gfortran.dg/dec_structure_23.f90: Adjust to new error messages.
+ * gfortran.dg/pr93499.f90: Adjust to new error messages.
+ * gfortran.dg/pr95053_2.f90: New test.
+ * gfortran.dg/pr95053_3.f90: New test.
+
+2020-05-18 Marek Polacek <polacek@redhat.com>
+
+ PR c++/95143
+ * g++.dg/cpp0x/sfinae66.C: New test.
+
+2020-05-18 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/95169
+ * gcc.target/i386/pr95169.c: New test.
+
+2020-05-18 Alex Coplan <alex.coplan@arm.com>
+
+ * gcc.c-torture/compile/packed-aligned-1.c: New test.
+ * gcc.c-torture/execute/packed-aligned.c: New test.
+
+2020-05-18 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/95171
+ * gcc.dg/pr95171.c: New testcase.
+
+2020-05-18 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95172
+ * gcc.dg/torture/pr95172.c: New testcase.
+
+2020-05-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/95021
+ * c-c++-common/dfp/func-vararg-mixed-2.c: Removed.
+ * gcc.target/i386/pr95021-1.c: New test.
+ * gcc.target/i386/pr95021-2.c: Likewise.
+ * gcc.target/i386/pr95021-3.c: Likewise.
+ * gcc.target/i386/pr95021-4.c: Likewise.
+ * gcc.target/i386/pr95021-5.c: Likewise.
+
+2020-05-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.target/i386/strncmp-1.c: New test.
+
+2020-05-16 Iain Sandoe <iain@sandoe.co.uk>
+
+ * g++.dg/coroutines/co-return-syntax-10-movable.C: New test.
+
+2020-05-16 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/57943
+ * g++.dg/cpp0x/decltype76.C: New test.
+
+2020-05-15 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/coroutines/coro.h: Always #include <utility>.
+ * g++.dg/coroutines/coroutines.exp (DEFAULT_COROFLAGS): Use
+ -std=c++20.
+
+2020-05-15 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * gcc.target/powerpc/vec-gnb-0.c: Use int128 effective target.
+ * gcc.target/powerpc/vec-gnb-1.c: Ditto.
+ * gcc.target/powerpc/vec-gnb-2.c: Ditto.
+ * gcc.target/powerpc/vec-ternarylogic-8.c: Ditto.
+ * gcc.target/powerpc/vec-ternarylogic-9.c: Ditto.
+ * gcc.target/powerpc/vec-ternarylogic-10.c: Ditto.
+
+2020-05-15 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * gcc.target/powerpc/cnttzdm-0.c: Use lp64.
+
+2020-05-15 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * gcc.target/powerpc/cntlzdm-0.c: Use lp64 instead of powerpc64.
+ * gcc.target/powerpc/cntlzdm-1.c: Ditto.
+ * gcc.target/powerpc/cnttzdm-1.c: Ditto.
+ * gcc.target/powerpc/pdep-0.c: Ditto.
+ * gcc.target/powerpc/pdep-1.c: Ditto.
+ * gcc.target/powerpc/pextd-0.c: Ditto.
+ * gcc.target/powerpc/pextd-1.c: Ditto.
+
+2020-05-15 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * gcc.target/powerpc/pdep-0.c: Change -mcpu= to -mdejagnu-cpu=.
+ * gcc.target/powerpc/pdep-1.c: Ditto.
+ * gcc.target/powerpc/pextd-0.c: Ditto.
+ * gcc.target/powerpc/pextd-1.c: Ditto.
+ * gcc.target/powerpc/pr90763.c: Ditto.
+ * gcc.target/powerpc/pr91275.c: Ditto.
+ * gcc.target/powerpc/pr92796.c: Ditto.
+ * gcc.target/powerpc/pr93658.c: Ditto.
+ * gcc.target/powerpc/pr93800.c: Ditto.
+ * gcc.target/powerpc/setbceq.c: Ditto.
+ * gcc.target/powerpc/setbcge.c: Ditto.
+ * gcc.target/powerpc/setbcgt.c: Ditto.
+ * gcc.target/powerpc/setbcle.c: Ditto.
+ * gcc.target/powerpc/setbclt.c: Ditto.
+ * gcc.target/powerpc/setbcne.c: Ditto.
+ * gcc.target/powerpc/setnbceq.c: Ditto.
+ * gcc.target/powerpc/setnbcge.c: Ditto.
+ * gcc.target/powerpc/setnbcgt.c: Ditto.
+ * gcc.target/powerpc/setnbcle.c: Ditto.
+ * gcc.target/powerpc/setnbclt.c: Ditto.
+ * gcc.target/powerpc/setnbcne.c: Ditto.
+ * gcc.target/powerpc/xxgenpc-runnable.c: Ditto.
+
+2020-05-15 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/90996
+ * g++.dg/cpp1y/pr90996.C: Turn into execution test to verify that each
+ PLACEHOLDER_EXPR gets correctly resolved.
+
+2020-05-15 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/94690
+ * gfortran.dg/gomp/openmp-simd-4.f90: New test.
+
+2020-05-15 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95133
+ * gcc.dg/pr95133.c: New testcase.
+
+2020-05-15 Tobias Burnus <tobias@codesourcery.com>
+
+ PR middle-end/94635
+ * gfortran.dg/gomp/target-exit-data.f90: New.
+
+2020-05-15 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/95046
+ * gcc.target/i386/pr95046-8.c: New test.
+
+2020-05-15 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/33315
+ * gcc.dg/tree-ssa/ssa-sink-13.c: New testcase.
+ * gcc.dg/tree-ssa/ssa-sink-14.c: Likewise.
+ * gcc.dg/tree-ssa/split-path-7.c: Disable sinking.
+
+2020-05-14 Xiong Hu Luo <luoxhu@linux.ibm.com>
+
+ PR rtl-optimization/37451, part of PR target/61837
+ * gcc.target/powerpc/doloop-2.c: New test.
+
+2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR jit/94778
+ * jit.dg/jit.exp: Skip jit tests for targets that don't support
+ -lgccjit.
+ * lib/target-supports.exp (check_effective_target_lgccjit): New.
+
+2020-05-14 Andrew Stubbs <ams@codesourcery.com>
+
+ * testsuite/gcc.target/gcn/gcn.exp: New file.
+ * testsuite/gcc.target/gcn/vcc-clobber.c: New file.
+
+2020-05-14 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/95046
+ * gcc.target/i386/pr95046-7.c: New test.
+
+2020-05-14 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/78446
+ * g++.dg/template/sfinae31.C: New test.
+
+2020-05-14 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/95046
+ * gcc.target/i386/pr95046-6.c: New test.
+
+2020-05-14 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR target/95105
+ * gcc.target/aarch64/sve/acle/general/attributes_8.c: New test.
+ * g++.target/aarch64/sve/acle/general-c++/attributes_1.C: Likewise.
+
+2020-05-14 Richard Biener <rguenther@suse.de>
+
+ PR testsuite/94703
+ * gcc.dg/tree-ssa/pr94703.c: Skip for strict-align targets.
+
+2020-05-14 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/95118
+ * gcc.dg/pr95118.c: New testcase.
+
+2020-05-14 Jakub Jelinek <jakub@redhat.com>
+
+ * c-c++-common/gomp/declare-variant-14.c: New test.
+
+ PR middle-end/95108
+ * gcc.dg/gomp/pr95108.c: New test.
+
+2020-05-14 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/95046
+ * gcc.target/i386/pr95046-5.c: New test.
+
+2020-05-14 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ * gcc.target/s390/stack-clash-2.c: New test.
+
+2020-05-14 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ * gcc.target/s390/stack-clash-1.c: New test.
+
+2020-05-14 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ * gcc.target/s390/stack-clash-3.c: New test.
+
+2020-05-13 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ * gcc.target/powerpc/vec-extracth-0.c: New.
+ * gcc.target/powerpc/vec-extracth-1.c: New.
+ * gcc.target/powerpc/vec-extracth-2.c: New.
+ * gcc.target/powerpc/vec-extracth-3.c: New.
+ * gcc.target/powerpc/vec-extracth-4.c: New.
+ * gcc.target/powerpc/vec-extracth-5.c: New.
+ * gcc.target/powerpc/vec-extracth-6.c: New.
+ * gcc.target/powerpc/vec-extracth-7.c: New.
+ * gcc.target/powerpc/vec-extracth-be-0.c: New.
+ * gcc.target/powerpc/vec-extracth-be-1.c: New.
+ * gcc.target/powerpc/vec-extracth-be-2.c: New.
+ * gcc.target/powerpc/vec-extracth-be-3.c: New.
+ * gcc.target/powerpc/vec-extractl-0.c: New.
+ * gcc.target/powerpc/vec-extractl-1.c: New.
+ * gcc.target/powerpc/vec-extractl-2.c: New.
+ * gcc.target/powerpc/vec-extractl-3.c: New.
+ * gcc.target/powerpc/vec-extractl-4.c: New.
+ * gcc.target/powerpc/vec-extractl-5.c: New.
+ * gcc.target/powerpc/vec-extractl-6.c: New.
+ * gcc.target/powerpc/vec-extractl-7.c: New.
+ * gcc.target/powerpc/vec-extractl-be-0.c: New.
+ * gcc.target/powerpc/vec-extractl-be-1.c: New.
+ * gcc.target/powerpc/vec-extractl-be-2.c: New.
+ * gcc.target/powerpc/vec-extractl-be-3.c: New.
+
+2020-05-13 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/79706
+ * g++.dg/template/sfinae30.C: New test.
+
+2020-05-13 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/95020
+ * g++.dg/cpp2a/concepts-lambda7.C: New test.
+
+2020-05-13 Marek Polacek <polacek@redhat.com>
+
+ PR c++/95066
+ * g++.dg/cpp2a/explicit16.C: New test.
+
+2020-05-13 Jason Merrill <jason@redhat.com>
+
+ * lib/target-supports.exp (check_effective_target_c++20_only)
+ (check_effective_target_c++20): New.
+
+2020-05-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR testsuite/95110
+ * gcc.dg/tree-ssa/pr94969.c: Swap scan-tree-dump-not arguments.
+
+2020-05-13 Marek Polacek <polacek@redhat.com>
+
+ * g++.dg/parse/attr4.C: Use c++11 in a target selector.
+
+2020-05-13 Mark Eggleston <markeggleston@gcc.gnu.org>
+
+ PR fortran/93497
+ * gfortran.dg/pr88025.f90: Change in wording of error.
+ * gfortran.dg/pr93497.f90: New test.
+ * gfortran.dg/pr93714_1.f90: Change in wording of errors.
+ * gfortran.dg/pr93714_2.f90: Change in wording of errors.
+
+2020-05-13 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/70642
+ * g++.dg/cpp0x/alias-decl-70.C: New test.
+
+2020-05-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/95080
+ * g++.dg/opt/pr95080.C: New test.
+
+ PR tree-optimization/95060
+ * gcc.target/i386/avx512f-pr95060.c: New test.
+ * gcc.target/i386/fma_double_1.c: Adjust expected insn counts.
+ * gcc.target/i386/fma_double_2.c: Likewise.
+ * gcc.target/i386/fma_double_3.c: Likewise.
+ * gcc.target/i386/fma_double_4.c: Likewise.
+ * gcc.target/i386/fma_double_5.c: Likewise.
+ * gcc.target/i386/fma_double_6.c: Likewise.
+ * gcc.target/i386/fma_float_1.c: Likewise.
+ * gcc.target/i386/fma_float_2.c: Likewise.
+ * gcc.target/i386/fma_float_3.c: Likewise.
+ * gcc.target/i386/fma_float_4.c: Likewise.
+ * gcc.target/i386/fma_float_5.c: Likewise.
+ * gcc.target/i386/fma_float_6.c: Likewise.
+ * gcc.target/i386/l_fma_double_1.c: Likewise.
+ * gcc.target/i386/l_fma_double_2.c: Likewise.
+ * gcc.target/i386/l_fma_double_3.c: Likewise.
+ * gcc.target/i386/l_fma_double_4.c: Likewise.
+ * gcc.target/i386/l_fma_double_5.c: Likewise.
+ * gcc.target/i386/l_fma_double_6.c: Likewise.
+ * gcc.target/i386/l_fma_float_1.c: Likewise.
+ * gcc.target/i386/l_fma_float_2.c: Likewise.
+ * gcc.target/i386/l_fma_float_3.c: Likewise.
+ * gcc.target/i386/l_fma_float_4.c: Likewise.
+ * gcc.target/i386/l_fma_float_5.c: Likewise.
+ * gcc.target/i386/l_fma_float_6.c: Likewise.
+
+2020-05-13 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/95051
+ * gcc.dg/asan/pr95051.c: Simplify options as -fsanitize=address
+ and -O2 were enough to trigger the original ICE.
+
+2020-05-13 Christophe Lyon <christophe.lyon@linaro.org>
+
+ PR preprocessor/95013
+ * gcc.dg/unclosed-init.c: Add missing comment in dg-error.
+
+2020-05-13 Bin Cheng <bin.cheng@linux.alibaba.com>
+
+ PR tree-optimization/94969
+ * gcc.dg/tree-ssa/pr94969.c: New test.
+
+2020-05-12 Craig Blackmore <craig.blackmore@embecosm.com>
+
+ * gcc.target/riscv/shorten-memrefs-1.c: New test.
+ * gcc.target/riscv/shorten-memrefs-2.c: New test.
+ * gcc.target/riscv/shorten-memrefs-3.c: New test.
+ * gcc.target/riscv/shorten-memrefs-4.c: New test.
+ * gcc.target/riscv/shorten-memrefs-5.c: New test.
+ * gcc.target/riscv/shorten-memrefs-6.c: New test.
+ * gcc.target/riscv/shorten-memrefs-7.c: New test.
+
+2020-05-12 Nathan Sidwell <nathan@acm.org>
+
+ PR preprocessor/95013
+ * c-c++-common/goacc/pr79428-1.c: Adjust EOF diagnostic location.
+ * c-c++-common/gomp/pr79428-2.c: Likewise.
+ * g++.dg/cpp0x/decltype63.C: Likewise.
+ * g++.dg/cpp0x/gen-attrs-64.C: Likewise.
+ * g++.dg/cpp0x/pr68726.C: Likewise.
+ * g++.dg/cpp0x/pr78341.C: Likewise.
+ * g++.dg/cpp1y/pr65202.C: Likewise.
+ * g++.dg/cpp1y/pr65340.C: Likewise.
+ * g++.dg/cpp1y/pr68578.C: Likewise.
+ * g++.dg/cpp1z/class-deduction44.C: Likewise.
+ * g++.dg/diagnostic/unclosed-extern-c.C: Likewise.
+ * g++.dg/diagnostic/unclosed-function.C: Likewise.
+ * g++.dg/diagnostic/unclosed-namespace.C: Likewise.
+ * g++.dg/diagnostic/unclosed-struct.C: Likewise.
+ * g++.dg/ext/pr84598.C: Likewise.
+ * g++.dg/other/switch4.C: Likewise.
+ * g++.dg/parse/attr4.C: Likewise.
+ * g++.dg/parse/cond4.C: Likewise.
+ * g++.dg/parse/crash10.C: Likewise.
+ * g++.dg/parse/crash18.C: Likewise.
+ * g++.dg/parse/crash27.C: Likewise.
+ * g++.dg/parse/crash34.C: Likewise.
+ * g++.dg/parse/crash35.C: Likewise.
+ * g++.dg/parse/crash52.C: Likewise.
+ * g++.dg/parse/crash59.C: Likewise.
+ * g++.dg/parse/crash61.C: Likewise.
+ * g++.dg/parse/crash67.C: Likewise.
+ * g++.dg/parse/error14.C: Likewise.
+ * g++.dg/parse/error56.C: Likewise.
+ * g++.dg/parse/invalid1.C: Likewise.
+ * g++.dg/parse/parameter-declaration-1.C: Likewise.
+ * g++.dg/parse/parser-pr28152-2.C: Likewise.
+ * g++.dg/parse/parser-pr28152.C: Likewise.
+ * g++.dg/parse/pr68722.C: Likewise.
+ * g++.dg/pr46852.C: Likewise.
+ * g++.dg/pr46868.C: Likewise.
+ * g++.dg/template/crash115.C: Likewise.
+ * g++.dg/template/crash43.C: Likewise.
+ * g++.dg/template/crash90.C: Likewise.
+ * g++.dg/template/error-recovery1.C: Likewise.
+ * g++.dg/template/error57.C: Likewise.
+ * g++.old-deja/g++.other/crash31.C: Likewise.
+ * gcc.dg/empty-source-2.c: Likewise.
+ * gcc.dg/empty-source-3.c: Likewise.
+ * gcc.dg/noncompile/pr30552-3.c: Likewise.
+ * gcc.dg/noncompile/pr35447-1.c: Likewise.
+ * gcc.dg/pr20245-1.c: Likewise.
+ * gcc.dg/pr28419.c: Likewise.
+ * gcc.dg/rtl/truncated-rtl-file.c: Likewise.
+ * gcc.dg/unclosed-init.c: Likewise.
+ * obj-c++.dg/property/property-neg-6.mm: Likewise.
+ * obj-c++.dg/syntax-error-10.mm: Likewise.
+ * obj-c++.dg/syntax-error-8.mm: Likewise.
+ * obj-c++.dg/syntax-error-9.mm: Likewise.
+
+2020-05-12 Marek Polacek <polacek@redhat.com>
+
+ PR c++/95074
+ * g++.dg/lookup/koenig15.C: New test.
+
+2020-05-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/95051
+ * gcc.dg/asan/pr95051.c: Add -fno-sanitize=all to dg-options.
+
+2020-05-12 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/95046
+ * gcc.target/i386/pr95046-4.c: New test.
+
+2020-05-12 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/78752
+ * g++.dg/cpp2a/concepts-pr78752-2.C: New test.
+
+2020-05-12 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/95046
+ * gcc.target/i386/pr95046-3.c: New test.
+
+2020-05-12 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/95046
+ * gcc.target/i386/pr95046-2.c: New test.
+
+2020-05-12 Jozef Lawrynowicz <jozef.l@mittosystems.com>
+
+ * gcc.c-torture/execute/noinit-attribute.c: Skip for msp430
+ in the large memory model.
+
+2020-05-12 Jozef Lawrynowicz <jozef.l@mittosystems.com>
+
+ * gcc.target/msp430/region-attribute-misuse.c: Allow a .bss section to
+ be created.
+
+2020-05-12 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/95033
+ PR sanitizer/95051
+ * g++.dg/asan/function-argument-4.C: New test.
+ * gcc.dg/asan/pr95033.c: New test.
+ * gcc.dg/asan/pr95051.c: New test.
+
+2020-05-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/95063
+ * g++.dg/gomp/pr95063.C: New test.
+
+2020-05-12 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR tree-optimization/94980
+ * gcc.target/i386/pr94980.c: New test.
+
+2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ * gcc.target/powerpc/vec-clzm-0.c: Rename to...
+ * gcc.target/powerpc/vec-cntlzm-0.c: ...this.
+ * gcc.target/powerpc/vec-clzm-1.c: Rename to...
+ * gcc.target/powerpc/vec-cntlzm-1.c: ...this.
+ * gcc.target/powerpc/vec-ctzm-0.c: Rename to...
+ * gcc.target/powerpc/vec-cnttzm-0.c: ...this.
+ * gcc.target/powerpc/vec-ctzm-1.c: Rename to...
+ * gcc.target/powerpc/vec-cnttzm-1.c: ...this.
+ * gcc.target/powerpc/vec-gnb-8.c: Rename to...
+ * gcc.target/powerpc/vec-gnb-0.c: ...this, deleting the old file.
+ * gcc.target/powerpc/vec-gnb-9.c: Rename to...
+ * gcc.target/powerpc/vec-gnb-1.c: ...this, deleting the old file.
+ * gcc.target/powerpc/vec-gnb-10.c: Rename to...
+ * gcc.target/powerpc/vec-gnb-2.c: ...this, deleting the old file.
+ * gcc.target/powerpc/vec-gnb-3.c: Delete.
+ * gcc.target/powerpc/vec-gnb-4.c: Delete.
+ * gcc.target/powerpc/vec-gnb-5.c: Delete.
+ * gcc.target/powerpc/vec-gnb-6.c: Delete.
+ * gcc.target/powerpc/vec-gnb-7.c: Delete.
+
+2020-05-11 Carl Love <cel@us.ibm.com>
+
+ * gcc.target/powerpc/xxgenpc-runnable.c: New.
+
+2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ * gcc.target/powerpc/vec-stril-0.c: New.
+ * gcc.target/powerpc/vec-stril-1.c: New.
+ * gcc.target/powerpc/vec-stril-10.c: New.
+ * gcc.target/powerpc/vec-stril-11.c: New.
+ * gcc.target/powerpc/vec-stril-12.c: New.
+ * gcc.target/powerpc/vec-stril-13.c: New.
+ * gcc.target/powerpc/vec-stril-14.c: New.
+ * gcc.target/powerpc/vec-stril-15.c: New.
+ * gcc.target/powerpc/vec-stril-16.c: New.
+ * gcc.target/powerpc/vec-stril-17.c: New.
+ * gcc.target/powerpc/vec-stril-18.c: New.
+ * gcc.target/powerpc/vec-stril-19.c: New.
+ * gcc.target/powerpc/vec-stril-2.c: New.
+ * gcc.target/powerpc/vec-stril-20.c: New.
+ * gcc.target/powerpc/vec-stril-21.c: New.
+ * gcc.target/powerpc/vec-stril-22.c: New.
+ * gcc.target/powerpc/vec-stril-23.c: New.
+ * gcc.target/powerpc/vec-stril-3.c: New.
+ * gcc.target/powerpc/vec-stril-4.c: New.
+ * gcc.target/powerpc/vec-stril-5.c: New.
+ * gcc.target/powerpc/vec-stril-6.c: New.
+ * gcc.target/powerpc/vec-stril-7.c: New.
+ * gcc.target/powerpc/vec-stril-8.c: New.
+ * gcc.target/powerpc/vec-stril-9.c: New.
+ * gcc.target/powerpc/vec-stril_p-0.c: New.
+ * gcc.target/powerpc/vec-stril_p-1.c: New.
+ * gcc.target/powerpc/vec-stril_p-10.c: New.
+ * gcc.target/powerpc/vec-stril_p-11.c: New.
+ * gcc.target/powerpc/vec-stril_p-2.c: New.
+ * gcc.target/powerpc/vec-stril_p-3.c: New.
+ * gcc.target/powerpc/vec-stril_p-4.c: New.
+ * gcc.target/powerpc/vec-stril_p-5.c: New.
+ * gcc.target/powerpc/vec-stril_p-6.c: New.
+ * gcc.target/powerpc/vec-stril_p-7.c: New.
+ * gcc.target/powerpc/vec-stril_p-8.c: New.
+ * gcc.target/powerpc/vec-stril_p-9.c: New.
+ * gcc.target/powerpc/vec-strir-0.c: New.
+ * gcc.target/powerpc/vec-strir-1.c: New.
+ * gcc.target/powerpc/vec-strir-10.c: New.
+ * gcc.target/powerpc/vec-strir-11.c: New.
+ * gcc.target/powerpc/vec-strir-12.c: New.
+ * gcc.target/powerpc/vec-strir-13.c: New.
+ * gcc.target/powerpc/vec-strir-14.c: New.
+ * gcc.target/powerpc/vec-strir-15.c: New.
+ * gcc.target/powerpc/vec-strir-16.c: New.
+ * gcc.target/powerpc/vec-strir-17.c: New.
+ * gcc.target/powerpc/vec-strir-18.c: New.
+ * gcc.target/powerpc/vec-strir-19.c: New.
+ * gcc.target/powerpc/vec-strir-2.c: New.
+ * gcc.target/powerpc/vec-strir-20.c: New.
+ * gcc.target/powerpc/vec-strir-21.c: New.
+ * gcc.target/powerpc/vec-strir-22.c: New.
+ * gcc.target/powerpc/vec-strir-23.c: New.
+ * gcc.target/powerpc/vec-strir-3.c: New.
+ * gcc.target/powerpc/vec-strir-4.c: New.
+ * gcc.target/powerpc/vec-strir-5.c: New.
+ * gcc.target/powerpc/vec-strir-6.c: New.
+ * gcc.target/powerpc/vec-strir-7.c: New.
+ * gcc.target/powerpc/vec-strir-8.c: New.
+ * gcc.target/powerpc/vec-strir-9.c: New.
+ * gcc.target/powerpc/vec-strir_p-0.c: New.
+ * gcc.target/powerpc/vec-strir_p-1.c: New.
+ * gcc.target/powerpc/vec-strir_p-10.c: New.
+ * gcc.target/powerpc/vec-strir_p-11.c: New.
+ * gcc.target/powerpc/vec-strir_p-2.c: New.
+ * gcc.target/powerpc/vec-strir_p-3.c: New.
+ * gcc.target/powerpc/vec-strir_p-4.c: New.
+ * gcc.target/powerpc/vec-strir_p-5.c: New.
+ * gcc.target/powerpc/vec-strir_p-6.c: New.
+ * gcc.target/powerpc/vec-strir_p-7.c: New.
+ * gcc.target/powerpc/vec-strir_p-8.c: New.
+ * gcc.target/powerpc/vec-strir_p-9.c: New.
+
+2020-05-11 Kelvin Nilsen <wschmidt@linux.ibm.com>
+
+ * gcc.target/powerpc/vec-ternarylogic-0.c: New.
+ * gcc.target/powerpc/vec-ternarylogic-1.c: New.
+ * gcc.target/powerpc/vec-ternarylogic-10.c: New.
+ * gcc.target/powerpc/vec-ternarylogic-2.c: New.
+ * gcc.target/powerpc/vec-ternarylogic-3.c: New.
+ * gcc.target/powerpc/vec-ternarylogic-4.c: New.
+ * gcc.target/powerpc/vec-ternarylogic-5.c: New.
+ * gcc.target/powerpc/vec-ternarylogic-6.c: New.
+ * gcc.target/powerpc/vec-ternarylogic-7.c: New.
+ * gcc.target/powerpc/vec-ternarylogic-8.c: New.
+ * gcc.target/powerpc/vec-ternarylogic-9.c: New.
+
+2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ * gcc.target/powerpc/pdep-0.c: New.
+ * gcc.target/powerpc/pdep-1.c: New.
+ * gcc.target/powerpc/pextd-0.c: New.
+ * gcc.target/powerpc/pextd-1.c: New.
+
+2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ * gcc.target/powerpc/vec-clrl-0.c: New.
+ * gcc.target/powerpc/vec-clrl-1.c: New.
+ * gcc.target/powerpc/vec-clrr-0.c: New.
+ * gcc.target/powerpc/vec-clrr-1.c: New.
+
+2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ * gcc.target/powerpc/cntlzdm-0.c: New test.
+ * gcc.target/powerpc/cntlzdm-1.c: New test.
+ * gcc.target/powerpc/cnttzdm-0.c: New test.
+ * gcc.target/powerpc/cnttzdm-1.c: New test.
+
+2020-05-11 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95053
+ * gfortran.dg/pr95053.f: New test.
+
+2020-05-11 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/95046
+ * gcc.target/i386/pr95046-1.c (test_sqrt): Add.
+
+2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ * gcc.target/powerpc/vec-cfuged-0.c: New test.
+ * gcc.target/powerpc/vec-cfuged-1.c: New test.
+
+2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ * gcc.target.powerpc/cfuged-0.c: New test.
+ * gcc.target.powerpc/cfuged-1.c: New test.
+
+2020-05-11 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95049
+ * gcc.dg/torture/pr95049.c: New testcase.
+
+2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
+ Bill Schmidt <wschmidt@linux.ibm.com>
+
+ * gcc.target/powerpc/vec-gnb-0.c: New test.
+ * gcc.target/powerpc/vec-gnb-1.c: New test.
+ * gcc.target/powerpc/vec-gnb-10.c: New test.
+ * gcc.target/powerpc/vec-gnb-2.c: New test.
+ * gcc.target/powerpc/vec-gnb-3.c: New test.
+ * gcc.target/powerpc/vec-gnb-4.c: New test.
+ * gcc.target/powerpc/vec-gnb-5.c: New test.
+ * gcc.target/powerpc/vec-gnb-6.c: New test.
+ * gcc.target/powerpc/vec-gnb-7.c: New test.
+ * gcc.target/powerpc/vec-gnb-8.c: New test.
+ * gcc.target/powerpc/vec-gnb-9.c: New test.
+
+2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ * gcc.target/powerpc/vec-pdep-0.c: New.
+ * gcc.target/powerpc/vec-pdep-1.c: New.
+ * gcc.target/powerpc/vec-pext-0.c: New.
+ * gcc.target/powerpc/vec-pext-1.c: New.
+
+2020-05-11 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/94988
+ PR tree-optimization/95025
+ * gcc.dg/torture/pr94988.c: New testcase.
+ * gcc.dg/torture/pr95025.c: Likewise.
+ * gcc.dg/torture/pr95045.c: Likewise.
+ * g++.dg/asan/pr95025.C: New testcase.
+
+2020-05-11 Jakub Jelinek <jakub@redhat.com>
+ Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/94672
+ * gfortran.dg/gomp/pr94672.f90: New.
+ * gfortran.dg/missing_optional_dummy_6a.f90: Update scan-tree.
+
+2020-05-11 Felix Yang <felix.yang@huawei.com>
+
+ PR target/94991
+ * gcc.target/aarch64/mgeneral-regs_5.c: New test.
+
+2020-05-11 Alex Coplan <alex.coplan@arm.com>
+
+ * gcc.target/aarch64/csinv-neg.c: New test.
+
+2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ * gcc.target/powerpc/vec-clzm-0.c: New test.
+ * gcc.target/powerpc/vec-clzm-1.c: New test.
+ * gcc.target/powerpc/vec-ctzm-0.c: New test.
+ * gcc.target/powerpc/vec-ctzm-1.c: New test.
+
+2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ * gcc.target/powerpc/dg-future-0.c: New.
+ * gcc.target/powerpc/dg-future-1.c: New.
+ * lib/target-supports.exp (check_powerpc_future_hw_available):
+ Replace -mfuture with -mcpu=future.
+ (check_effective_target_powerpc_future_ok): Likewise.
+ (is-effective-target): Add powerpc_future_hw.
+
+2020-05-11 Kito Cheng <kito.cheng@sifive.com>
+
+ * gcc/testsuite/g++.dg/ipa/pr94856.C: Require fgnu-tm.
+
+2020-05-11 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/95046
+ * gcc.target/i386/pr95046-1.c: New test.
+
+2020-05-11 Mark Eggleston <markeggleston@gcc.gnu.org>
+
+ PR fortran/59107
+ * gfortran.dg/pr59107.f90: New test.
+
+2020-05-11 Xiong Hu Luo <luoxhu@linux.ibm.com>
+
+ PR tree-optimization/83403
+ * gcc.dg/tree-ssa/pr83403-1.c: New test.
+ * gcc.dg/tree-ssa/pr83403-2.c: New test.
+ * gcc.dg/tree-ssa/pr83403.h: New header.
+
+2020-05-10 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/93499
+ * gfortran.dg/pr93499.f90: New test.
+
+2020-05-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR testsuite/95008
+ * gcc.dg/two-types-6.c: Remove dg-warning directive that never
+ triggered.
+ * gcc.dg/analyzer/pr93382.c: Properly escape ()s in the diagnostic
+ message.
+
+2020-05-09 Hans-Peter Nilsson <hp@axis.com>
+
+ * gcc.target/cris/: Adjust for removing crisv32-* and cris-linux-*.
+ * gcc.dg/20020919-1.c, gcc.dg/pr31866.c, gcc.dg/pr46647.c,
+ gcc.dg/sibcall-10.c, gcc.dg/sibcall-3.c, gcc.dg/sibcall-4.c,
+ gcc.dg/sibcall-9.c, gcc.dg/torture/cris-asm-mof-1.c,
+ gcc.dg/torture/cris-volatile-1.c, gcc.dg/torture/pr38948.c,
+ gcc.dg/tree-ssa/20040204-1.c, gcc.dg/tree-ssa/loop-1.c,
+ gcc.dg/weak/typeof-2.c, lib/target-supports.exp: Remove remaining
+ traces of crisv32-*.
+
+2020-05-08 Vladimir Makarov <vmakarov@redhat.com>
+
+ * gcc.target/i386/pr92807-1.c: Improve the regex.
+
+2020-05-08 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/95003
+ * g++.dg/coroutines/torture/pr95003.C: New test.
+
+2020-05-08 Nathan Sidwell <nathan@acm.org>
+
+ * gcc.dg/cpp/counter-[23].c: Move to c-c+_-common/cpp.
+ * gcc.dg/cpp/dir-only-*: Likewise.
+ * c-c++-common/cpp/dir-only-[78].c: New.
+
+2020-05-08 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/vect/bb-slp-pr68892.c: Adjust for not supported
+ SLP permutations becoming builds from scalars.
+ * gcc.dg/vect/bb-slp-pr78205.c: Likewise.
+ * gcc.dg/vect/bb-slp-34.c: Likewise.
+
+2020-05-08 Nathan Sidwell <nathan@acm.org>
+
+ * c-c++-common/raw-string-6.c: Adjust EOF error location.
+ * g++.dg/cpp0x/decltype63.C: Likewise.
+ * g++.dg/cpp0x/gen-attrs-64.C: Likewise.
+ * g++.dg/cpp0x/pr68726.C: Likewise.
+ * g++.dg/cpp0x/pr78341.C: Likewise.
+ * g++.dg/cpp1y/pr65202.C: Likewise.
+ * g++.dg/cpp1z/class-deduction44.C: Likewise.
+ * g++.dg/diagnostic/unclosed-extern-c.C: Likewise.
+ * g++.dg/diagnostic/unclosed-function.C: Likewise.
+ * g++.dg/diagnostic/unclosed-namespace.C: Likewise.
+ * g++.dg/diagnostic/unclosed-struct.C: Likewise.
+ * g++.dg/ext/pr84598.C: Likewise.
+ * g++.dg/other/switch4.C: Likewise.
+ * g++.dg/parse/crash10.C: Likewise.
+ * g++.dg/parse/crash18.C: Likewise.
+ * g++.dg/parse/crash35.C: Likewise.
+ * g++.dg/parse/crash59.C: Likewise.
+ * g++.dg/parse/crash61.C: Likewise.
+ * g++.dg/parse/crash67.C: Likewise.
+ * g++.dg/parse/ctor3.C: Likewise.
+ * g++.dg/parse/error14.C: Likewise.
+ * g++.dg/parse/error5.C: Likewise.
+ * g++.dg/parse/error56.C: Likewise.
+ * g++.dg/parse/invalid1.C: Likewise.
+ * g++.dg/parse/parameter-declaration-1.C: Likewise.
+ * g++.dg/parse/parser-pr28152-2.C: Likewise.
+ * g++.dg/parse/parser-pr28152.C: Likewise.
+ * g++.dg/parse/pr68722.C: Likewise.
+ * g++.dg/pr46852.C: Likewise.
+ * g++.dg/pr46868.C: Likewise.
+ * g++.dg/template/crash115.C: Likewise.
+ * g++.dg/template/crash43.C: Likewise.
+ * g++.dg/template/error-recovery1.C: Likewise.
+ * g++.dg/template/error57.C: Likewise.
+ * g++.old-deja/g++.other/crash31.C: Likewise.
+
+2020-05-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/addr15.adb: New test.
+
+2020-05-08 Richard Biener <rguenther@suse.de>
+
+ * gnat.dg/opt83.adb: New testcase.
+
+2020-05-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/94786
+ * gcc.dg/tree-ssa/pr94786.c: New test.
+
+ PR target/94857
+ * gcc.target/i386/pr94857.c: New test.
+
+ PR tree-optimization/94783
+ * gcc.dg/tree-ssa/pr94783.c: New test.
+
+ PR tree-optimization/94956
+ * gcc.target/i386/pr94956.c: New test.
+
+ PR tree-optimization/94913
+ * gcc.dg/tree-ssa/pr94913.c: New test.
+
+2020-05-07 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * gcc.target/powerpc/setnbc.h: New.
+ * gcc.target/powerpc/setnbceq.c: New.
+ * gcc.target/powerpc/setnbcge.c: New.
+ * gcc.target/powerpc/setnbcgt.c: New.
+ * gcc.target/powerpc/setnbcle.c: New.
+ * gcc.target/powerpc/setnbclt.c: New.
+ * gcc.target/powerpc/setnbcne.c: New.
+
+2020-05-07 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * gcc.target/powerpc/setbc.h: New.
+ * gcc.target/powerpc/setbceq.c: New.
+ * gcc.target/powerpc/setbcge.c: New.
+ * gcc.target/powerpc/setbcgt.c: New.
+ * gcc.target/powerpc/setbcle.c: New.
+ * gcc.target/powerpc/setbclt.c: New.
+ * gcc.target/powerpc/setbcne.c: New.
+
+2020-05-07 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/94817
+ PR c++/94829
+ * g++.dg/coroutines/coro-missing-final-suspend.C: New test.
+ * g++.dg/coroutines/coro-missing-initial-suspend.C: New test.
+ * g++.dg/coroutines/coro-missing-promise-yield.C: Check for
+ continuation of compilation.
+ * g++.dg/coroutines/coro-missing-promise.C: Likewise.
+ * g++.dg/coroutines/coro-missing-ret-value.C: Likewise
+ * g++.dg/coroutines/coro-missing-ret-void.C: Likewise
+ * g++.dg/coroutines/coro-missing-ueh-3.C: Likewise
+ * g++.dg/coroutines/pr94817.C: New test.
+ * g++.dg/coroutines/pr94829.C: New test.
+
+2020-05-07 Marek Polacek <polacek@redhat.com>
+
+ PR c++/94590 - Detect long double -> double narrowing.
+ * g++.dg/cpp0x/Wnarrowing18.C: New test.
+
+2020-05-07 Marek Polacek <polacek@redhat.com>
+
+ PR c++/94255
+ * g++.dg/template/spec41.C: New test.
+
+2020-05-07 Marek Polacek <polacek@redhat.com>
+
+ P1957R2
+ * g++.dg/cpp0x/initlist92.C: Don't expect an error in C++20 only.
+
+2020-05-07 Manfred Schwarb <manfred99@gmx.ch>
+
+ * gcc.dg/20050121-1.c: Fix broken dg directives.
+ * gcc.dg/analzyer/pr93382.c: Likewise.
+ * gcc.dg/autopar/pr68460.c: Likewise.
+ * gcc.dg/c90-fordecl-1.c: Likewise.
+ * gcc.dg/cpp/trad/funlike-5.c: Likewise.
+ * gcc.dg/debug/dwarf2/dwarf-dfp.c: Likewise.
+ * gcc.dg/debug/dwarf2/dwarf-float.c: Likewise.
+ * gcc.dg/lto/pr52634_0.c: Likewise.
+ * gcc.dg/pr32069.c: Likewise.
+ * gcc.dg/pr35445.c: Likewise.
+ * gcc.dg/pr40172-3.c: Likewise.
+ * gcc.dg/pr87347.c: Likewise.
+ * gcc.dg/pr88660.c: Likewise.
+ * gcc.dg/pr89689.c: Likewise.
+ * gcc.dg/sinatan-2.c: Likewise.
+ * gcc.dg/sinhatanh-1.c: Likewise.
+ * gcc.dg/sinhovercosh-1.c: Likewise.
+ * gcc.dg/tls/opt-9.c: Likewise.
+ * gcc.dg/torture/builtins-1.c: Likewise.
+ * gcc.dg/torture/pr51106-1.c: Likewise.
+ * gcc.dg/torture/pr51106-2.c: Likewise.
+ * gcc.dg/torture/pr80281.c: Likewise.
+ * gcc.dg/torture/pr92252.c: Likewise.
+ * gcc.dg/tree-ssa/pr79448-2.c: Likewise.
+ * gcc.dg/tree-ssa/pr79448.c: Likewise.
+ * gcc.dg/tree-ssa/pr92163.c: Likewise.
+ * gcc.dg/tree-ssa/reassoc-28.c: Likewise.
+ * gcc.dg/tree-ssa/upcast-1.c: Likewise.
+ * gcc.dg/two-types-6.c: Likewise.
+ * gcc.dg/ubsan/c-shift-1.c: Likewise.
+ * gcc.dg/var-expand3.c: Likewise.
+ * gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c: Likewise.
+ * gcc.dg/vect/pr71264.c: Likewise.
+
+2020-05-07 Marek Polacek <polacek@redhat.com>
+
+ * g++.dg/other/operator1.C: Adjust expected message.
+ * g++.dg/overload/operator2.C: Likewise.
+ * g++.dg/template/error30.C: Likewise.
+ * g++.old-deja/g++.jason/operator.C: Likewise.
+
+2020-05-07 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/94703
+ * gcc.dg/tree-ssa/pr94703.c: New testcase.
+
+2020-05-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/94946
+ * g++.dg/ext/attr-parm-1.C: Enable the test also for lp64 x86, use
+ sysv_abi and ms_abi attributes in that case instead of fastcall and
+ no attribute.
+
+ PR c/94968
+ * gcc.dg/pr94968.c: New test.
+
+2020-05-07 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/57359
+ * gcc.dg/torture/pr57359-1.c: New testcase.
+ * gcc.dg/torture/pr57359-1.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-lim-14.c: Likewise.
+ * gcc.dg/graphite/pr80906.c: XFAIL.
+
+2020-05-07 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/debug16.adb: New test.
+
+2020-05-06 Marek Polacek <polacek@redhat.com>
+
+ PR c++/94938
+ * g++.dg/warn/Wdiv-by-zero-3.C: New test.
+ * g++.dg/warn/Wtype-limits4.C: New test.
+ * g++.dg/warn/template-2.C: New test.
+ * g++.old-deja/g++.pt/crash10.C: Add dg-warning.
+
+2020-05-06 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/94970
+ * gdc.dg/pr94970.d: New test.
+
+2020-05-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/94951
+ * g++.dg/warn/Wstrict-aliasing-bogus-tmpl.C: New test.
+
+ PR c++/94907
+ * g++.dg/cpp2a/spaceship-synth8.C: New test.
+
+2020-05-06 qing zhao <qing.zhao@oracle.com>
+
+ PR c/94230
+ * gcc.dg/plugin/location-overflow-test-1.c (fn_1): New message to
+ provide hint to use the new -flarge-source-files option.
+
+2020-05-06 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/94913
+ * gcc.target/i386/pr94913-1.c: New test.
+ * gcc.target/i386/pr94913-2.c: Ditto.
+
+2020-05-06 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/94963
+ * gcc.dg/pr94963.c: New testcase.
+
+2020-05-06 Hongtao Liu <hongtao.liu@intel.com>
+
+ * g++.dg/other/i386-2.c: Add -mtsxldtrk.
+ * g++.dg/other/i386-3.c: Likewise.
+ * gcc.target/i386/sse-12.c: Likewise.
+ * gcc.target/i386/sse-13.c: Likewise.
+ * gcc.target/i386/sse-14.c: Likewise.
+ * gcc.target/i386/sse-22.c: Likewsie.
+ * gcc.target/i386/sse-23.c: Likewise.
+ * gcc.target/i386/tsxldtrk-1.c: New test.
+ * gcc.target/i386/funcspec-56.inc: Add target attribute tests
+ for tsxldtrk.
+
+2020-05-06 Hongtao Liu <hongtao.liu@intel.com>
+
+ * gcc.target/i386/funcspec-56.inc: Add enqcmd, avx512bf16,
+ avx512vp2intersect.
+
+2020-05-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/94921
+ * match.pd (~(~X - Y) -> X + Y, ~(~X + Y) -> X - Y): New
+ simplifications.
+
+ PR rtl-optimization/94873
+ * gcc.dg/pr94873.c: New test.
+
+2020-05-06 Hongtao.liu <hongtao.liu@intel.com>
+ Wei Xiao <wei3.xiao@intel.com>
+
+ * gcc/testsuite/gcc.target/i386/serialize-1.c: New test.
+ * gcc/testsuite/g++.dg/other/i386-2.C: Add -mserialize.
+ * gcc/testsuite/g++.dg/other/i386-3.C: Ditto.
+ * gcc/testsuite/gcc.target/i386/funcspec-56.inc: Ditto.
+ * gcc/testsuite/gcc.target/i386/sse-12.c: Ditto.
+ * gcc/testsuite/gcc.target/i386/sse-13.c: Ditto.
+ * gcc/testsuite/gcc.target/i386/sse-14.c: Ditto.
+ * gcc/testsuite/gcc.target/i386/sse-22.c: Ditto.
+ * gcc/testsuite/gcc.target/i386/sse-23.c: Ditto.
+
+2020-05-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR testsuite/84324
+ * objc/execute/exceptions/matcher-1.m (my_exception_matcher):
+ Change return type to int.
+
+2020-05-05 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/93366
+ * gfortran.dg/pr93366.f90: New test.
+
+2020-05-05 Michael Meissner <meissner@linux.ibm.com>
+
+ * gcc.dg/nextafter-2.c: Delete changes meant for a private branch.
+ * gcc.target/powerpc/pr70117.c: Likewise.
+
+2020-05-05 Dimitar Dimitrov <dimitar@dinux.eu>
+
+ * gcc.target/pru/clobber-sp.c: New test.
+
+2020-05-05 Dimitar Dimitrov <dimitar@dinux.eu>
+
+ * gcc.target/pru/lra-framepointer-fragmentation-1.c: Update test to
+ take into account additional available registers.
+ * gcc.target/pru/lra-framepointer-fragmentation-2.c: Ditto.
+
+2020-05-05 Marek Polacek <polacek@redhat.com>
+
+ PR c++/94799
+ * g++.dg/lookup/this1.C: Adjust dg-error.
+ * g++.dg/template/lookup12.C: New test.
+ * g++.dg/template/lookup13.C: New test.
+ * g++.dg/template/lookup14.C: New test.
+ * g++.dg/template/lookup15.C: New test.
+
+2020-05-05 Martin Liska <mliska@suse.cz>
+
+ * gcc.dg/spellcheck-options-22.c: New test.
+
+2020-05-05 Martin Liska <mliska@suse.cz>
+
+ * g++.dg/concepts/diagnostic1.C: Merge dg-options and
+ dg-additional-options if len <= 120 chars.
+ * g++.dg/cpp1y/new1.C: Likewise.
+ * g++.dg/cpp1y/new2.C: Likewise.
+ * g++.dg/debug/dwarf2/pr61433.C: Likewise.
+ * g++.dg/init/new18.C: Likewise.
+ * g++.dg/ipa/devirt-19.C: Likewise.
+ * g++.dg/ipa/devirt-52.C: Likewise.
+ * g++.dg/ipa/pr44372.C: Likewise.
+ * g++.dg/ipa/pr58371.C: Likewise.
+ * g++.dg/ipa/pr63587-2.C: Likewise.
+ * g++.dg/ipa/pr78211.C: Likewise.
+ * g++.dg/opt/dump1.C: Likewise.
+ * g++.dg/opt/pr44919.C: Likewise.
+ * g++.dg/opt/pr47615.C: Likewise.
+ * g++.dg/opt/pr82159-2.C: Likewise.
+ * g++.dg/other/pr52048.C: Likewise.
+ * g++.dg/pr57662.C: Likewise.
+ * g++.dg/pr59510.C: Likewise.
+ * g++.dg/pr67989.C: Likewise.
+ * g++.dg/pr81194.C: Likewise.
+ * g++.dg/template/canon-type-8.C: Likewise.
+ * g++.dg/template/crash107.C: Likewise.
+ * g++.dg/template/show-template-tree-3.C: Likewise.
+ * g++.dg/tm/cgraph_edge.C: Likewise.
+ * g++.dg/torture/20141013.C: Likewise.
+ * g++.dg/torture/pr34641.C: Likewise.
+ * g++.dg/torture/pr34850.C: Likewise.
+ * g++.dg/torture/pr36745.C: Likewise.
+ * g++.dg/torture/pr40991.C: Likewise.
+ * g++.dg/torture/pr48271.C: Likewise.
+ * g++.dg/torture/pr53602.C: Likewise.
+ * g++.dg/torture/pr53752.C: Likewise.
+ * g++.dg/torture/pr54838.C: Likewise.
+ * g++.dg/torture/pr58252.C: Likewise.
+ * g++.dg/tree-ssa/pr22444.C: Likewise.
+ * g++.dg/tree-ssa/pr24351-3.C: Likewise.
+ * g++.dg/tree-ssa/pr27283.C: Likewise.
+ * g++.dg/tree-ssa/pr27291.C: Likewise.
+ * g++.dg/tree-ssa/pr27548.C: Likewise.
+ * g++.dg/tree-ssa/pr42337.C: Likewise.
+ * g++.dg/ubsan/pr65583.C: Likewise.
+ * g++.old-deja/g++.robertl/eb27.C: Likewise.
+ * gcc.dg/tree-ssa/dse-points-to.c: Likewise.
+ * gcc.target/arm/simd/vmmla_1.c: Likewise.
+ * gcc.target/i386/vect-pr67800.c: Likewise.
+ * gcc.target/mips/cfgcleanup-jalr2.c: Likewise.
+ * gcc.target/mips/cfgcleanup-jalr3.c: Likewise.
+
+2020-05-05 Richard Biener <rguenther@suse.de>
+
+ PR testsuite/92177
+ * gcc.dg/vect/bb-slp-22.c: Adjust.
+
+2020-05-05 Richard Biener <rguenther@suse.de>
+
+ PR ipa/94947
+ * gcc.dg/torture/pr94947-1.c: New testcase.
+ * gcc.dg/torture/pr94947-2.c: Likewise.
2020-05-05 Eric Botcazou <ebotcazou@adacore.com>
@@ -685,7 +7018,7 @@
* g++.dg/coroutines/torture/local-var-4.C: Rename to...
* g++.dg/coroutines/torture/local-var-04-hiding-nested-scopes.C: this.
* g++.dg/coroutines/torture/local-var-5-awaitable.C: Rename to...
- * g++.dg/coroutines/torture/local-var-05-awaitable.C: ...this.
+ * g++.dg/coroutines/torture/local-var-05-awaitable.C: ...this.
2020-04-22 Iain Sandoe <iain@sandoe.co.uk>
diff --git a/gcc/testsuite/brig.dg/test/gimple/packed.hsail b/gcc/testsuite/brig.dg/test/gimple/packed.hsail
index 9137490b2ab..1e2bb53de0d 100644
--- a/gcc/testsuite/brig.dg/test/gimple/packed.hsail
+++ b/gcc/testsuite/brig.dg/test/gimple/packed.hsail
@@ -61,10 +61,10 @@ prog kernel &Kernel(kernarg_u64 %input_ptr, kernarg_u64 %output_ptr)
/* For the add_ss we assume performing the computation over the whole vector is cheaper than */
/* extracting the scalar and performing a scalar operation. This aims to stay in the vector
/* datapath as long as possible. */
-/* { dg-final { scan-tree-dump "_\[0-9\]+ = q2 \\\+ q3;" "gimple" } } */
+/* { dg-final { scan-tree-dump "new_output.\[0-9\]+ = q2 \\\+ q3;" "gimple" } } */
/* Insert the lowest element of the result to the lowest element of the result register. */
-/* { dg-final { scan-tree-dump "= VEC_PERM_EXPR <new_output.\[0-9\]+_\[0-9\]+, \[a-z0-9_\]+, { 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }>;" "gimple" } } */
+/* { dg-final { scan-tree-dump "= VEC_PERM_EXPR <new_output.\[0-9\]+, \[a-z0-9_\]+, { 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }>;" "gimple" } } */
/* FIXME */
/* { dg-final { scan-tree-dump "q4 = \(VIEW_CONVERT_EXPR<uint128_t>\\\()?s_output.\[0-9\]+\(_\[0-9\]+\)*\\\)?;" "gimple" } } */
diff --git a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c
index afad603dfa2..95a376664da 100644
--- a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c
+++ b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c
@@ -52,28 +52,28 @@ void foo (void)
f0 = *&__real__ t0.f; /* { dg-bogus "may result in an unaligned pointer value" } */
f0 = *&__imag__ t0.f; /* { dg-bogus "may result in an unaligned pointer value" } */
i1 = (&t0.c, (int*) 0); /* { dg-bogus "may result in an unaligned pointer value" } */
- t2 = (struct t**) t10; /* { dg-warning "may result in an unaligned pointer value" } */
- t2 = (struct t**) t100; /* { dg-warning "may result in an unaligned pointer value" } */
- t2 = (struct t**) t1; /* { dg-warning "may result in an unaligned pointer value" } */
- t2 = (struct t**) bar(); /* { dg-warning "may result in an unaligned pointer value" } */
- t2 = (struct t**) baz(); /* { dg-warning "may result in an unaligned pointer value" } */
- t2 = (struct t**) bazz(); /* { dg-warning "may result in an unaligned pointer value" } */
- i1 = &t0.b; /* { dg-warning "may result in an unaligned pointer value" } */
- i1 = &t1->b; /* { dg-warning "may result in an unaligned pointer value" } */
- i1 = &t10[0].b; /* { dg-warning "may result in an unaligned pointer value" } */
- i1 = t0.d; /* { dg-warning "may result in an unaligned pointer value" } */
- i1 = t1->d; /* { dg-warning "may result in an unaligned pointer value" } */
- i1 = t10[0].d; /* { dg-warning "may result in an unaligned pointer value" } */
- i1 = (int*) &t10[0].e[0]; /* { dg-warning "may result in an unaligned pointer value" } */
- i1 = (int*) t10[0].e; /* { dg-warning "may result in an unaligned pointer value" } */
- i2 = &t10[0].e[0]; /* { dg-warning "may result in an unaligned pointer value" } */
- i2 = t10[0].e; /* { dg-warning "may result in an unaligned pointer value" } */
- i2 = &*&t0.c; /* { dg-warning "may result in an unaligned pointer value" } */
- i2 = &*&*&t0.c; /* { dg-warning "may result in an unaligned pointer value" } */
- f1 = &__real__ t0.f; /* { dg-warning "may result in an unaligned pointer value" } */
- f1 = &__imag__ t0.f; /* { dg-warning "may result in an unaligned pointer value" } */
- i1 = (0, (int*) &t0.c); /* { dg-warning "may result in an unaligned pointer value" } */
- i1 = (int*) (0, &t0.c); /* { dg-warning "may result in an unaligned pointer value" } */
- i1 = (0, (int*)(0, &t0.c));/* { dg-warning "may result in an unaligned pointer value" } */
- i1 = (int*)(0, 1, (void*)(2, 3, (int*)(4, 5, &t0.c)));/* { dg-warning "may result in an unaligned pointer value" } */
+ t2 = (struct t**) t10; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ t2 = (struct t**) t100; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ t2 = (struct t**) t1; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ t2 = (struct t**) bar(); /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ t2 = (struct t**) baz(); /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ t2 = (struct t**) bazz(); /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i1 = &t0.b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i1 = &t1->b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i1 = &t10[0].b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i1 = t0.d; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i1 = t1->d; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i1 = t10[0].d; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i1 = (int*) &t10[0].e[0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i1 = (int*) t10[0].e; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i2 = &t10[0].e[0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i2 = t10[0].e; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i2 = &*&t0.c; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i2 = &*&*&t0.c; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ f1 = &__real__ t0.f; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ f1 = &__imag__ t0.f; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i1 = (0, (int*) &t0.c); /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i1 = (int*) (0, &t0.c); /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i1 = (0, (int*)(0, &t0.c));/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i1 = (int*)(0, 1, (void*)(2, 3, (int*)(4, 5, &t0.c)));/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
}
diff --git a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c
index 65ec5140c9c..802dd8156cb 100644
--- a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c
+++ b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c
@@ -15,6 +15,7 @@ struct s {
struct t {
char c;
struct r p __attribute__((packed));
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
struct r u;
};
@@ -24,24 +25,24 @@ int *i0;
void foo (void)
{
- i0 = s0.p.a; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = t0.p.a; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = s0.p.b[0]; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = t0.p.b[0]; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = &s0.p.a[0]; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = &t0.p.a[0]; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = &s0.p.b[0][0]; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = &t0.p.b[0][0]; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = *s0.p.b; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = *t0.p.b; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = &**s0.p.b; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = &**t0.p.b; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = **&s0.p.b; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = **&t0.p.b; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = &*s0.p.a; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = &*t0.p.a; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = *&s0.p.a; /* { dg-warning "may result in an unaligned pointer value" } */
- i0 = *&t0.p.a; /* { dg-warning "may result in an unaligned pointer value" } */
+ i0 = s0.p.a; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = t0.p.a; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = s0.p.b[0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = t0.p.b[0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = &s0.p.a[0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = &t0.p.a[0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = &s0.p.b[0][0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = &t0.p.b[0][0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = *s0.p.b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = *t0.p.b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = &**s0.p.b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = &**t0.p.b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = **&s0.p.b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = **&t0.p.b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = &*s0.p.a; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = &*t0.p.a; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = *&s0.p.a; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
+ i0 = *&t0.p.a; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */
i0 = t0.u.a; /* { dg-bogus "may result in an unaligned pointer value" } */
i0 = t0.u.b[0]; /* { dg-bogus "may result in an unaligned pointer value" } */
i0 = &t0.u.a[0]; /* { dg-bogus "may result in an unaligned pointer value" } */
diff --git a/gcc/testsuite/c-c++-common/Wattributes.c b/gcc/testsuite/c-c++-common/Wattributes.c
index 3f176a04660..4ad90441b4d 100644
--- a/gcc/testsuite/c-c++-common/Wattributes.c
+++ b/gcc/testsuite/c-c++-common/Wattributes.c
@@ -21,7 +21,7 @@ PackedAligned { int i; };
struct ATTR ((aligned (2)))
AlignedMemberPacked
{
- int ATTR ((packed)) i;
+ int ATTR ((packed)) i; // { dg-warning "attribute ignored" "" { target default_packed } }
};
struct ATTR ((packed))
diff --git a/gcc/testsuite/c-c++-common/Wmisleading-indentation-3.c b/gcc/testsuite/c-c++-common/Wmisleading-indentation-3.c
index 870ba720c5f..2314ad42402 100644
--- a/gcc/testsuite/c-c++-common/Wmisleading-indentation-3.c
+++ b/gcc/testsuite/c-c++-common/Wmisleading-indentation-3.c
@@ -36,20 +36,20 @@ int fn_6 (int a, int b, int c)
/* ... */
if ((err = foo (a)) != 0)
goto fail;
- if ((err = foo (b)) != 0) /* { dg-message "2: this 'if' clause does not guard..." } */
+ if ((err = foo (b)) != 0) /* { dg-message "9: this 'if' clause does not guard..." } */
goto fail;
- goto fail; /* { dg-message "3: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'" } */
+ goto fail; /* { dg-message "17: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'" } */
if ((err = foo (c)) != 0)
goto fail;
/* ... */
/* { dg-begin-multiline-output "" }
- if ((err = foo (b)) != 0)
- ^~
+ if ((err = foo (b)) != 0)
+ ^~
{ dg-end-multiline-output "" } */
/* { dg-begin-multiline-output "" }
- goto fail;
- ^~~~
+ goto fail;
+ ^~~~
{ dg-end-multiline-output "" } */
fail:
diff --git a/gcc/testsuite/c-c++-common/Wmisleading-indentation.c b/gcc/testsuite/c-c++-common/Wmisleading-indentation.c
index 5cdeba1cbba..202c6bc7fdf 100644
--- a/gcc/testsuite/c-c++-common/Wmisleading-indentation.c
+++ b/gcc/testsuite/c-c++-common/Wmisleading-indentation.c
@@ -65,9 +65,9 @@ int fn_6 (int a, int b, int c)
/* ... */
if ((err = foo (a)) != 0)
goto fail;
- if ((err = foo (b)) != 0) /* { dg-message "2: this 'if' clause does not guard..." } */
+ if ((err = foo (b)) != 0) /* { dg-message "9: this 'if' clause does not guard..." } */
goto fail;
- goto fail; /* { dg-message "3: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'" } */
+ goto fail; /* { dg-message "17: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'" } */
if ((err = foo (c)) != 0)
goto fail;
/* ... */
@@ -178,7 +178,7 @@ void fn_16_tabs (void)
while (flagA)
if (flagB) /* { dg-message "7: this 'if' clause does not guard..." } */
foo (0);
- foo (1);/* { dg-message "2: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'" } */
+ foo (1);/* { dg-message "9: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'" } */
}
void fn_17_spaces (void)
diff --git a/gcc/testsuite/c-c++-common/Wparentheses-2.c b/gcc/testsuite/c-c++-common/Wparentheses-2.c
new file mode 100644
index 00000000000..1aa5d314ae7
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/Wparentheses-2.c
@@ -0,0 +1,18 @@
+// PR c++/95344 - bogus -Wparentheses warning.
+// { dg-do compile }
+// { dg-options "-Wparentheses" }
+
+#ifndef __cplusplus
+# define bool _Bool
+# define true 1
+# define false 0
+#endif
+
+void
+f (int i)
+{
+ bool b = false;
+ if (i == 99 ? (b = true) : false) // { dg-bogus "suggest parentheses" }
+ {
+ }
+}
diff --git a/gcc/testsuite/c-c++-common/Wsizeof-pointer-memaccess1.c b/gcc/testsuite/c-c++-common/Wsizeof-pointer-memaccess1.c
index 4281e3b5a8e..c4127b805ab 100644
--- a/gcc/testsuite/c-c++-common/Wsizeof-pointer-memaccess1.c
+++ b/gcc/testsuite/c-c++-common/Wsizeof-pointer-memaccess1.c
@@ -161,3 +161,5 @@ f4 (char x[64], char *y, __builtin_va_list ap)
snprintf (p, sizeof (buf), "%s", y);
vsnprintf (p, sizeof (buf), "%s", ap);
}
+
+/* { dg-prune-output "-Wuninitialized" } */
diff --git a/gcc/testsuite/c-c++-common/Wstringop-truncation.c b/gcc/testsuite/c-c++-common/Wstringop-truncation.c
index 5e43405fde8..f29eee29e85 100644
--- a/gcc/testsuite/c-c++-common/Wstringop-truncation.c
+++ b/gcc/testsuite/c-c++-common/Wstringop-truncation.c
@@ -269,7 +269,7 @@ void test_strncpy_array (Dest *pd, int i, const char* s)
CPY (dst7, s, 7); /* { dg-warning "specified bound 7 equals destination size" } */
CPY (dst7, s, sizeof dst7); /* { dg-warning "specified bound 7 equals destination size" } */
- CPY (dst2_5[0], s, sizeof dst2_5[0]); /* { dg-warning "specified bound 5 equals destination size" "bug 77293" { xfail *-*-* } } */
+ CPY (dst2_5[0], s, sizeof dst2_5[0]); /* { dg-warning "specified bound 5 equals destination size" "bug 77293" } */
CPY (dst2_5[1], s, sizeof dst2_5[1]); /* { dg-warning "specified bound 5 equals destination size" } */
/* Verify that copies that nul-terminate are not diagnosed. */
diff --git a/gcc/testsuite/c-c++-common/asan/inline-kernel.c b/gcc/testsuite/c-c++-common/asan/inline-kernel.c
new file mode 100644
index 00000000000..20689f86626
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/asan/inline-kernel.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-sanitize=address -fsanitize=kernel-address -c -O3 -fdump-tree-optimized -ffat-lto-objects" } */
+
+int x;
+
+static inline
+__attribute__((no_sanitize("kernel-address")))
+void do_not_sanitize(void)
+{
+ x++;
+}
+
+void
+sanitize_this(void)
+{
+ x++;
+ do_not_sanitize();
+}
+
+/* { dg-final { scan-tree-dump-times "Function do_not_sanitize" 1 "optimized" } } */
diff --git a/gcc/testsuite/c-c++-common/asan/inline.c b/gcc/testsuite/c-c++-common/asan/inline.c
new file mode 100644
index 00000000000..7c7c9244b06
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/asan/inline.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fsanitize=address -c -O3 -fdump-tree-optimized -ffat-lto-objects" } */
+
+int x;
+
+static inline
+__attribute__((no_sanitize("address")))
+void do_not_sanitize(void)
+{
+ x++;
+}
+
+void
+sanitize_this(void)
+{
+ x++;
+ do_not_sanitize();
+}
+
+/* { dg-final { scan-tree-dump-times "Function do_not_sanitize" 1 "optimized" } } */
diff --git a/gcc/testsuite/c-c++-common/attr-copy.c b/gcc/testsuite/c-c++-common/attr-copy.c
index 284088a8b97..f0db0fd1a27 100644
--- a/gcc/testsuite/c-c++-common/attr-copy.c
+++ b/gcc/testsuite/c-c++-common/attr-copy.c
@@ -21,6 +21,7 @@ struct C
{
char c;
ATTR (copy ((bar (), ((struct A *)(0))[0]))) int i;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
};
/* Verify the attribute has been copied. */
diff --git a/gcc/testsuite/c-c++-common/builtin-arith-overflow-1.c b/gcc/testsuite/c-c++-common/builtin-arith-overflow-1.c
index e119d2491d3..25c792ee2e2 100644
--- a/gcc/testsuite/c-c++-common/builtin-arith-overflow-1.c
+++ b/gcc/testsuite/c-c++-common/builtin-arith-overflow-1.c
@@ -43,10 +43,10 @@ generic_2 (int a, int b)
int x = __builtin_add_overflow (a, b);/* { dg-error "too few arguments to function" } */
x += __builtin_sub_overflow (a, b); /* { dg-error "too few arguments to function" } */
x += __builtin_mul_overflow (a, b); /* { dg-error "too few arguments to function" } */
- x += __builtin_add_overflow (a, 1); /* { dg-error "too few arguments to function" } */
+ x += __builtin_add_overflow (a, 1); /* { dg-error "too few arguments to function" } */
x += __builtin_sub_overflow (a, 2); /* { dg-error "too few arguments to function" } */
x += __builtin_mul_overflow (a, 3); /* { dg-error "too few arguments to function" } */
- x += __builtin_add_overflow (4, b); /* { dg-error "too few arguments to function" } */
+ x += __builtin_add_overflow (4, b); /* { dg-error "too few arguments to function" } */
x += __builtin_sub_overflow (5, b); /* { dg-error "too few arguments to function" } */
x += __builtin_mul_overflow (6, b); /* { dg-error "too few arguments to function" } */
return x;
@@ -79,23 +79,22 @@ generic_3 (int a, int b, int c)
x += __builtin_add_overflow (0, 0, (bool *)0);
enum E { e0 };
- x += __builtin_add_overflow (0, 0, (enum E *)0);
- */
-
- x += __builtin_sub_overflow (0, 0, (char *)0); /* { dg-warning "null argument" } */
- x += __builtin_add_overflow (0, 0, (short *)0); /* { dg-warning "null argument" } */
- x += __builtin_add_overflow (a, b, (int *)0); /* { dg-warning "null argument" } */
- x += __builtin_sub_overflow (a, b, (int *)0); /* { dg-warning "null argument" } */
- x += __builtin_mul_overflow (a, b, (int *)0); /* { dg-warning "null argument" } */
- x += __builtin_add_overflow (a, 1, (int *)0); /* { dg-warning "null argument" } */
- x += __builtin_sub_overflow (a, 2, (int *)0); /* { dg-warning "null argument" } */
- x += __builtin_mul_overflow (a, 3, (int *)0); /* { dg-warning "null argument" } */
- x += __builtin_add_overflow (4, b, (int *)0); /* { dg-warning "null argument" } */
- x += __builtin_sub_overflow (5, b, (int *)0); /* { dg-warning "null argument" } */
- x += __builtin_mul_overflow (6, b, (int *)0); /* { dg-warning "null argument" } */
- x += __builtin_add_overflow (7, 8, (int *)0); /* { dg-warning "null argument" } */
- x += __builtin_sub_overflow (9, 10, (int *)0); /* { dg-warning "null argument" } */
- x += __builtin_mul_overflow (11, 12, (int *)0); /* { dg-warning "null argument" } */
+ x += __builtin_add_overflow (0, 0, (enum E *)0); */
+
+ x += __builtin_sub_overflow (0, 0, (char *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_add_overflow (0, 0, (short *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_add_overflow (a, b, (int *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_sub_overflow (a, b, (int *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_mul_overflow (a, b, (int *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_add_overflow (a, 1, (int *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_sub_overflow (a, 2, (int *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_mul_overflow (a, 3, (int *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_add_overflow (4, b, (int *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_sub_overflow (5, b, (int *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_mul_overflow (6, b, (int *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_add_overflow (7, 8, (int *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_sub_overflow (9, 10, (int *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_mul_overflow (11, 12, (int *)0); /* { dg-warning "argument 3 null" } */
return x;
}
@@ -167,34 +166,34 @@ typed_3_null (int a, int b)
{
int x = 0;
- x += __builtin_sadd_overflow (a, b, (int *)0); /* { dg-warning "null argument" } */
- x += __builtin_uadd_overflow (a, b, (unsigned *)0); /* { dg-warning "null argument" } */
+ x += __builtin_sadd_overflow (a, b, (int *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_uadd_overflow (a, b, (unsigned *)0); /* { dg-warning "argument 3 null" } */
- x += __builtin_saddl_overflow (a, b, (long *)0); /* { dg-warning "null argument" } */
- x += __builtin_uaddl_overflow (a, b, (unsigned long *)0); /* { dg-warning "null argument" } */
+ x += __builtin_saddl_overflow (a, b, (long *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_uaddl_overflow (a, b, (unsigned long *)0); /* { dg-warning "argument 3 null" } */
- x += __builtin_saddll_overflow (a, b, (long long *)0); /* { dg-warning "null argument" } */
- x += __builtin_uaddll_overflow (a, b, (unsigned long long *)0); /* { dg-warning "null argument" } */
+ x += __builtin_saddll_overflow (a, b, (long long *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_uaddll_overflow (a, b, (unsigned long long *)0); /* { dg-warning "argument 3 null" } */
- x += __builtin_ssub_overflow (a, b, (int *)0); /* { dg-warning "null argument" } */
- x += __builtin_usub_overflow (a, b, (unsigned *)0); /* { dg-warning "null argument" } */
+ x += __builtin_ssub_overflow (a, b, (int *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_usub_overflow (a, b, (unsigned *)0); /* { dg-warning "argument 3 null" } */
- x += __builtin_ssubl_overflow (a, b, (long *)0); /* { dg-warning "null argument" } */
- x += __builtin_usubl_overflow (a, b, (unsigned long *)0); /* { dg-warning "null argument" } */
+ x += __builtin_ssubl_overflow (a, b, (long *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_usubl_overflow (a, b, (unsigned long *)0); /* { dg-warning "argument 3 null" } */
- x += __builtin_ssubll_overflow (a, b, (long long *)0); /* { dg-warning "null argument" } */
- x += __builtin_usubll_overflow (a, b, (unsigned long long *)0); /* { dg-warning "null argument" } */
+ x += __builtin_ssubll_overflow (a, b, (long long *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_usubll_overflow (a, b, (unsigned long long *)0); /* { dg-warning "argument 3 null" } */
- x += __builtin_smul_overflow (a, b, (int *)0); /* { dg-warning "null argument" } */
- x += __builtin_umul_overflow (a, b, (unsigned *)0); /* { dg-warning "null argument" } */
+ x += __builtin_smul_overflow (a, b, (int *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_umul_overflow (a, b, (unsigned *)0); /* { dg-warning "argument 3 null" } */
- x += __builtin_smull_overflow (a, b, (long *)0); /* { dg-warning "null argument" } */
- x += __builtin_umull_overflow (a, b, (unsigned long *)0); /* { dg-warning "null argument" } */
+ x += __builtin_smull_overflow (a, b, (long *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_umull_overflow (a, b, (unsigned long *)0); /* { dg-warning "argument 3 null" } */
- x += __builtin_smulll_overflow (a, b, (long long *)0); /* { dg-warning "null argument" } */
- x += __builtin_umulll_overflow (a, b, (unsigned long long *)0); /* { dg-warning "null argument" } */
+ x += __builtin_smulll_overflow (a, b, (long long *)0); /* { dg-warning "argument 3 null" } */
+ x += __builtin_umulll_overflow (a, b, (unsigned long long *)0); /* { dg-warning "argument 3 null" } */
return x;
}
diff --git a/gcc/testsuite/c-c++-common/builtin-has-attribute-4.c b/gcc/testsuite/c-c++-common/builtin-has-attribute-4.c
index ec3127794b5..c9ab9cf3c79 100644
--- a/gcc/testsuite/c-c++-common/builtin-has-attribute-4.c
+++ b/gcc/testsuite/c-c++-common/builtin-has-attribute-4.c
@@ -4,6 +4,7 @@
{ dg-options "-Wall -ftrack-macro-expansion=0" }
{ dg-options "-Wall -Wno-narrowing -Wno-unused -ftrack-macro-expansion=0" { target c++ } }
{ dg-additional-options "-DSKIP_ALIAS" { target *-*-darwin* } }
+ { dg-require-visibility "hidden" }
*/
#define ATTR(...) __attribute__ ((__VA_ARGS__))
@@ -130,7 +131,7 @@ struct PackedMember
char c;
short s;
int i;
- ATTR (packed) int a[2];
+ ATTR (packed) int a[2]; /* { dg-warning "attribute ignored" "" { target default_packed } } */
} gpak[2];
void test_packed (struct PackedMember *p)
diff --git a/gcc/testsuite/c-c++-common/builtin-has-attribute-7.c b/gcc/testsuite/c-c++-common/builtin-has-attribute-7.c
index 6ea2e9e7192..1326aed32a7 100644
--- a/gcc/testsuite/c-c++-common/builtin-has-attribute-7.c
+++ b/gcc/testsuite/c-c++-common/builtin-has-attribute-7.c
@@ -2,7 +2,8 @@
and packed in various forms of array dereferencing and indirection
expressions correspondingly to __alignof__.
{ dg-do compile }
- { dg-options "-Wall -Wno-unused -ftrack-macro-expansion=0" } */
+ { dg-options "-Wall -Wno-unused -ftrack-macro-expansion=0" }
+ { dg-require-effective-target size24plus } */
#define ATTR(...) __attribute__ ((__VA_ARGS__))
#define ALIGN(N) ATTR (aligned (N))
diff --git a/gcc/testsuite/gcc.dg/cpp/counter-2.c b/gcc/testsuite/c-c++-common/cpp/counter-2.c
index 7d6578d9ce3..7d6578d9ce3 100644
--- a/gcc/testsuite/gcc.dg/cpp/counter-2.c
+++ b/gcc/testsuite/c-c++-common/cpp/counter-2.c
diff --git a/gcc/testsuite/gcc.dg/cpp/counter-3.c b/gcc/testsuite/c-c++-common/cpp/counter-3.c
index 3b1824f25d5..3b1824f25d5 100644
--- a/gcc/testsuite/gcc.dg/cpp/counter-3.c
+++ b/gcc/testsuite/c-c++-common/cpp/counter-3.c
diff --git a/gcc/testsuite/gcc.dg/cpp/dir-only-1.c b/gcc/testsuite/c-c++-common/cpp/dir-only-1.c
index 3c2261683c9..3c2261683c9 100644
--- a/gcc/testsuite/gcc.dg/cpp/dir-only-1.c
+++ b/gcc/testsuite/c-c++-common/cpp/dir-only-1.c
diff --git a/gcc/testsuite/gcc.dg/cpp/dir-only-1.h b/gcc/testsuite/c-c++-common/cpp/dir-only-1.h
index 96dbcc0483c..96dbcc0483c 100644
--- a/gcc/testsuite/gcc.dg/cpp/dir-only-1.h
+++ b/gcc/testsuite/c-c++-common/cpp/dir-only-1.h
diff --git a/gcc/testsuite/gcc.dg/cpp/dir-only-2.c b/gcc/testsuite/c-c++-common/cpp/dir-only-2.c
index 489b4d6ee34..489b4d6ee34 100644
--- a/gcc/testsuite/gcc.dg/cpp/dir-only-2.c
+++ b/gcc/testsuite/c-c++-common/cpp/dir-only-2.c
diff --git a/gcc/testsuite/gcc.dg/cpp/dir-only-3.c b/gcc/testsuite/c-c++-common/cpp/dir-only-3.c
index e6eaa018096..e6eaa018096 100644
--- a/gcc/testsuite/gcc.dg/cpp/dir-only-3.c
+++ b/gcc/testsuite/c-c++-common/cpp/dir-only-3.c
diff --git a/gcc/testsuite/gcc.dg/cpp/dir-only-3a.h b/gcc/testsuite/c-c++-common/cpp/dir-only-3a.h
index 6644bbfb0d4..6644bbfb0d4 100644
--- a/gcc/testsuite/gcc.dg/cpp/dir-only-3a.h
+++ b/gcc/testsuite/c-c++-common/cpp/dir-only-3a.h
diff --git a/gcc/testsuite/gcc.dg/cpp/dir-only-3b.h b/gcc/testsuite/c-c++-common/cpp/dir-only-3b.h
index 4edaa7b6ba5..4edaa7b6ba5 100644
--- a/gcc/testsuite/gcc.dg/cpp/dir-only-3b.h
+++ b/gcc/testsuite/c-c++-common/cpp/dir-only-3b.h
diff --git a/gcc/testsuite/gcc.dg/cpp/dir-only-4.c b/gcc/testsuite/c-c++-common/cpp/dir-only-4.c
index 25f1b463b6d..25f1b463b6d 100644
--- a/gcc/testsuite/gcc.dg/cpp/dir-only-4.c
+++ b/gcc/testsuite/c-c++-common/cpp/dir-only-4.c
diff --git a/gcc/testsuite/gcc.dg/cpp/dir-only-5.c b/gcc/testsuite/c-c++-common/cpp/dir-only-5.c
index ad8e11e5937..747006a682b 100644
--- a/gcc/testsuite/gcc.dg/cpp/dir-only-5.c
+++ b/gcc/testsuite/c-c++-common/cpp/dir-only-5.c
@@ -1,6 +1,7 @@
/* Copyright 2007 Free Software Foundation, Inc.
Contributed by Ollie Wild <aaw@google.com>. */
-/* { dg-do preprocess } */
+/* C++ silently ignores traditional! */
+/* { dg-do preprocess { target c } } */
/* { dg-options "-fdirectives-only -traditional" } */
/* { dg-error "'-fdirectives-only' is incompatible with '-traditional'\n" "'-traditional' check" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/cpp/dir-only-6.c b/gcc/testsuite/c-c++-common/cpp/dir-only-6.c
index 0023205faf7..0023205faf7 100644
--- a/gcc/testsuite/gcc.dg/cpp/dir-only-6.c
+++ b/gcc/testsuite/c-c++-common/cpp/dir-only-6.c
diff --git a/gcc/testsuite/c-c++-common/cpp/dir-only-7.c b/gcc/testsuite/c-c++-common/cpp/dir-only-7.c
new file mode 100644
index 00000000000..b9fb4d88528
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/dir-only-7.c
@@ -0,0 +1,35 @@
+// { dg-do preprocess }
+// { dg-options "-std=c++11" { target c++ } }
+// { dg-options "-std=gnu99" { target c } }
+// { dg-additional-options -fdirectives-only }
+
+R"stuff(
+)nope"
+#error in raw literal
+)stuff"
+// comment
+#define bob 1
+// " comment
+#if !bob
+#error "no bob"
+#endif
+
+bob\
+\
+R"regular string not an erroneous raw one"
+
+"regular"R"***(not a raw string"
+#define HERE 1
+ //)***"
+#ifndef HERE
+#error "oops no HERE"
+#endif
+ /* comment */
+
+
+0e+R"*(not a raw string"
+#define CPP_NUM 1
+ //)*"
+#ifndef CPP_NUM
+#error "oops no CPP_NUM"
+#endif
diff --git a/gcc/testsuite/c-c++-common/cpp/dir-only-8.c b/gcc/testsuite/c-c++-common/cpp/dir-only-8.c
new file mode 100644
index 00000000000..b0e00f5b542
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/dir-only-8.c
@@ -0,0 +1,38 @@
+// { dg-do preprocess { target c++ } }
+// { dg-options "-std=c++14" }
+// { dg-additional-options -fdirectives-only }
+
+012'bcd
+#define A 1
+// '
+#ifndef A
+#error Fell into first char const
+#endif
+enum { A = 195'936'478 }; 'a'
+#define AA 1
+ // 'a
+#ifndef AA
+#error Fell into early char const
+#endif
+
+012\
+'bcd
+#define B 1
+// '
+#ifndef B
+#error Fell into second char const
+#endif
+
+.012'b
+#define C 1
+// '
+#ifndef C
+#error Fell into third char const
+#endif
+
+.0e+12'b
+#define D 1
+// '
+#ifndef D
+#error Fell into fourth char const
+#endif
diff --git a/gcc/testsuite/c-c++-common/cpp/eof-1.c b/gcc/testsuite/c-c++-common/cpp/eof-1.c
new file mode 100644
index 00000000000..0a06f091d93
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/eof-1.c
@@ -0,0 +1,7 @@
+/* PR preprocess/95183 */
+
+/* { dg-do preprocess } */
+
+#define f(x) x
+
+f( /* { dg-error "-:unterminated" "unterminated macro" } */
diff --git a/gcc/testsuite/c-c++-common/cpp/eof-2.c b/gcc/testsuite/c-c++-common/cpp/eof-2.c
new file mode 100644
index 00000000000..3a4af7f6850
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/eof-2.c
@@ -0,0 +1,8 @@
+/* PR preprocess/95183 */
+
+/* { dg-do preprocess } */
+
+#define f(x) x
+
+#include "eof-2.h"
+ /* { dg-regexp {[^\n]*eof-2.h:4: error: unterminated argument list invoking macro "f"\n} } */
diff --git a/gcc/testsuite/c-c++-common/cpp/eof-2.h b/gcc/testsuite/c-c++-common/cpp/eof-2.h
new file mode 100644
index 00000000000..48ad85791db
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/eof-2.h
@@ -0,0 +1,4 @@
+
+#define f(x) x
+
+f( /* Error here */
diff --git a/gcc/testsuite/c-c++-common/cpp/eof-3.c b/gcc/testsuite/c-c++-common/cpp/eof-3.c
new file mode 100644
index 00000000000..316918e3a6c
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/eof-3.c
@@ -0,0 +1,8 @@
+/* PR preprocess/95183 */
+
+/* { dg-do preprocess } */
+/* { dg-additional-options "-include $srcdir/c-c++-common/cpp/eof-2.h" } */
+
+ /* { dg-regexp {[^\n]*eof-2.h:4: error: unterminated argument list invoking macro "f"\n} } */
+
+token )
diff --git a/gcc/testsuite/c-c++-common/cpp/has-include-1-traditional.c b/gcc/testsuite/c-c++-common/cpp/has-include-1-traditional.c
new file mode 100644
index 00000000000..b0acdbece4d
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/has-include-1-traditional.c
@@ -0,0 +1,38 @@
+/* { dg-do preprocess { target c } } */
+/* { dg-options "-traditional-cpp" } */
+
+#if __has_include ("stdlib.h")
+#else
+#error error 1
+#endif
+#if __has_include (<stdlib.h>)
+#else
+#error error 2
+#endif
+#if !__has_include ("stdlib.h")
+#error error 3
+#elif !__has_include (<stdlib.h>)
+#error error 4
+#endif
+#if __has_include ("stdlib.h") && __has_include (<stdlib.h>)
+#else
+#error error 5
+#endif
+#if !defined(__has_include)
+#error error 6
+#endif
+#ifndef __has_include
+#error error 7
+#endif
+#ifdef __has_include
+#else
+#error error 8
+#endif
+#define m1 __has_include("stdlib.h")
+#define m2 <stdlib.h>
+#if !m1
+#error error 9
+#endif
+#if !__has_include (m2)
+#error error 13
+#endif
diff --git a/gcc/testsuite/c-c++-common/cpp/line-2.c b/gcc/testsuite/c-c++-common/cpp/line-2.c
new file mode 100644
index 00000000000..97cf398f64c
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/line-2.c
@@ -0,0 +1,11 @@
+int line1;
+int f = bob;
+int bill(1);
+int line4;
+
+// { dg-do preprocess }
+// { dg-options "-dD -include $srcdir/c-c++-common/cpp/line-2.h -nostdinc" }
+
+// { dg-regexp {In file included from <command-line>:\n[^\n]*/line-2.h:4:2: error: #error wrong\n} }
+
+// { dg-regexp {[^\n]*/line-2.c:3:11: error: macro "bill" passed 1 arguments, but takes just 0\nIn file included from <command-line>:\n[^\n]*/line-2.h:3: note: macro "bill" defined here\n} }
diff --git a/gcc/testsuite/c-c++-common/cpp/line-2.h b/gcc/testsuite/c-c++-common/cpp/line-2.h
new file mode 100644
index 00000000000..737bdfa2926
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/line-2.h
@@ -0,0 +1,5 @@
+#define bob 1
+/* Comment */
+#define bill() 2
+#error wrong
+
diff --git a/gcc/testsuite/c-c++-common/cpp/line-3.c b/gcc/testsuite/c-c++-common/cpp/line-3.c
new file mode 100644
index 00000000000..2ffc44907a2
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/line-3.c
@@ -0,0 +1,20 @@
+# 0 ".../line-1.c"
+# 0 "<built-in>"
+# 0 "<command-line>"
+# 1 "./line-2.h" 1
+#define bob 1
+
+#define bill() 2
+#error wrong
+# 0 "<command-line>" 2
+# 1 ".../line-3.c"
+int line1;
+int f = bob;
+int bill(1);
+int line4;
+
+// { dg-regexp {In file included from <command-line>:\n[^\n]*/line-2.h:4:2: error: #error wrong\n} }
+
+// { dg-regexp {[^\n]*/line-3.c:3:11: error: macro "bill" passed 1 arguments, but takes just 0\nIn file included from <command-line>:\n[^\n]*/line-2.h:3: note: macro "bill" defined here\n} }
+
+// { dg-options "-fpreprocessed -fdirectives-only" }
diff --git a/gcc/testsuite/c-c++-common/cpp/line-4.c b/gcc/testsuite/c-c++-common/cpp/line-4.c
new file mode 100644
index 00000000000..810f15929c2
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/line-4.c
@@ -0,0 +1,11 @@
+int line1;
+int f = bob;
+int b = bill();
+int line4;
+
+// { dg-do preprocess }
+// { dg-options "-dD -include $srcdir/c-c++-common/cpp/line-4.h -nostdinc" }
+
+// { dg-final { scan-file line-4.i {# 0 "[^\n]*/line-4.c"\n# 0 "<built-in>"\n} } }
+// { dg-final { scan-file line-4.i {# 0 "<command-line>"\n# 1 "[^\n]*/line-4.h" 1\n#define bob 1\n} } }
+// { dg-final { scan-file line-4.i {#define bill\(\) 2\n# 0 "<command-line>" 2\n# 1 "[^\n]*/line-4.c"\nint line1;\n} } }
diff --git a/gcc/testsuite/c-c++-common/cpp/line-4.h b/gcc/testsuite/c-c++-common/cpp/line-4.h
new file mode 100644
index 00000000000..6ee05a3d137
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/line-4.h
@@ -0,0 +1,3 @@
+#define bob 1
+/* Comment */
+#define bill() 2
diff --git a/gcc/testsuite/c-c++-common/cpp/pr63831-1.c b/gcc/testsuite/c-c++-common/cpp/pr63831-1.c
index 135baf6c406..6e97521ecde 100644
--- a/gcc/testsuite/c-c++-common/cpp/pr63831-1.c
+++ b/gcc/testsuite/c-c++-common/cpp/pr63831-1.c
@@ -61,4 +61,4 @@ T18 t18;
T19 t19;
T20 t20;
#endif
-int t21 = __has_attribute (noreturn) + __has_cpp_attribute (__malloc__);
+long t21 = __has_attribute (noreturn) + __has_cpp_attribute (__malloc__);
diff --git a/gcc/testsuite/c-c++-common/cpp/pr96323.c b/gcc/testsuite/c-c++-common/cpp/pr96323.c
new file mode 100644
index 00000000000..7a8edff27cc
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/pr96323.c
@@ -0,0 +1,8 @@
+/* PR preprocessor/96323 */
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu99 -Wno-c++-compat -trigraphs" { target c } } */
+/* { dg-options "-std=c++0x" { target c++ } } */
+/* { dg-error "invalid new-line in raw string delimiter" "" { target *-*-* } .+2 } */
+/* { dg-warning "missing terminating . character" "" { target *-*-* } .+2 } */
+const char tu[] = R"a";
+const char tua[] = "(R)a";
diff --git a/gcc/testsuite/c-c++-common/cpp/pragma-eof.c b/gcc/testsuite/c-c++-common/cpp/pragma-eof.c
new file mode 100644
index 00000000000..37c9bd86785
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/pragma-eof.c
@@ -0,0 +1,7 @@
+/* { dg-require-effective-target fopenmp } */
+/* { dg-additional-options -fopenmp } */
+
+/* { dg-error "expected" "" { target *-*-* } .+3 } */
+/* Make sure we see pragma_eol even though lacking new line. *
+/* no newline at end of file. */
+#pragma omp parallel \ No newline at end of file
diff --git a/gcc/testsuite/c-c++-common/dfp/func-vararg-mixed-2.c b/gcc/testsuite/c-c++-common/dfp/func-vararg-mixed-2.c
deleted file mode 100644
index 02cafb016d1..00000000000
--- a/gcc/testsuite/c-c++-common/dfp/func-vararg-mixed-2.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
-/* { dg-options "-mpreferred-stack-boundary=2" } */
-
-/* C99 6.5.2.2 Function calls.
- Test passing varargs of the combination of decimal float types and
- other types. */
-
-#include <stdarg.h>
-#include "dfp-dbg.h"
-
-/* Supposing the list of varying number of arguments is:
- unsigned int, _Decimal128, double, _Decimal32, _Decimal64. */
-
-static _Decimal32
-vararg_d32 (unsigned arg, ...)
-{
- va_list ap;
- _Decimal32 result;
-
- va_start (ap, arg);
-
- va_arg (ap, unsigned int);
- va_arg (ap, _Decimal128);
- va_arg (ap, double);
- result = va_arg (ap, _Decimal32);
-
- va_end (ap);
- return result;
-}
-
-static _Decimal32
-vararg_d64 (unsigned arg, ...)
-{
- va_list ap;
- _Decimal64 result;
-
- va_start (ap, arg);
-
- va_arg (ap, unsigned int);
- va_arg (ap, _Decimal128);
- va_arg (ap, double);
- va_arg (ap, _Decimal32);
- result = va_arg (ap, _Decimal64);
-
- va_end (ap);
- return result;
-}
-
-static _Decimal128
-vararg_d128 (unsigned arg, ...)
-{
- va_list ap;
- _Decimal128 result;
-
- va_start (ap, arg);
-
- va_arg (ap, unsigned int);
- result = va_arg (ap, _Decimal128);
-
- va_end (ap);
- return result;
-}
-
-static unsigned int
-vararg_int (unsigned arg, ...)
-{
- va_list ap;
- unsigned int result;
-
- va_start (ap, arg);
-
- result = va_arg (ap, unsigned int);
-
- va_end (ap);
- return result;
-}
-
-static double
-vararg_double (unsigned arg, ...)
-{
- va_list ap;
- float result;
-
- va_start (ap, arg);
-
- va_arg (ap, unsigned int);
- va_arg (ap, _Decimal128);
- result = va_arg (ap, double);
-
- va_end (ap);
- return result;
-}
-
-
-int
-main ()
-{
- if (vararg_d32 (3, 0, 1.0dl, 2.0, 3.0df, 4.0dd) != 3.0df) FAILURE
- if (vararg_d64 (4, 0, 1.0dl, 2.0, 3.0df, 4.0dd) != 4.0dd) FAILURE
- if (vararg_d128 (1, 0, 1.0dl, 2.0, 3.0df, 4.0dd) != 1.0dl) FAILURE
- if (vararg_int (0, 0, 1.0dl, 2.0, 3.0df, 4.0dd) != 0) FAILURE
- if (vararg_double (2, 0, 1.0dl, 2.0, 3.0df, 4.0dd) != 2.0) FAILURE
-
- FINISH
-}
diff --git a/gcc/testsuite/c-c++-common/diagnostic-format-json-1.c b/gcc/testsuite/c-c++-common/diagnostic-format-json-1.c
index 9359db48c17..740becb5548 100644
--- a/gcc/testsuite/c-c++-common/diagnostic-format-json-1.c
+++ b/gcc/testsuite/c-c++-common/diagnostic-format-json-1.c
@@ -8,17 +8,22 @@
We can't rely on any ordering of the keys. */
/* { dg-regexp "\"kind\": \"error\"" } */
+/* { dg-regexp "\"column-origin\": 1" } */
/* { dg-regexp "\"message\": \"#error message\"" } */
/* { dg-regexp "\"caret\": \{" } */
/* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-1.c\"" } */
/* { dg-regexp "\"line\": 4" } */
/* { dg-regexp "\"column\": 2" } */
+/* { dg-regexp "\"display-column\": 2" } */
+/* { dg-regexp "\"byte-column\": 2" } */
/* { dg-regexp "\"finish\": \{" } */
/* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-1.c\"" } */
/* { dg-regexp "\"line\": 4" } */
/* { dg-regexp "\"column\": 6" } */
+/* { dg-regexp "\"display-column\": 6" } */
+/* { dg-regexp "\"byte-column\": 6" } */
/* { dg-regexp "\"locations\": \[\[\{\}, \]*\]" } */
/* { dg-regexp "\"children\": \[\[\]\[\]\]" } */
diff --git a/gcc/testsuite/c-c++-common/diagnostic-format-json-2.c b/gcc/testsuite/c-c++-common/diagnostic-format-json-2.c
index 557ccf8378b..2f24a6c6596 100644
--- a/gcc/testsuite/c-c++-common/diagnostic-format-json-2.c
+++ b/gcc/testsuite/c-c++-common/diagnostic-format-json-2.c
@@ -8,6 +8,7 @@
We can't rely on any ordering of the keys. */
/* { dg-regexp "\"kind\": \"warning\"" } */
+/* { dg-regexp "\"column-origin\": 1" } */
/* { dg-regexp "\"message\": \"#warning message\"" } */
/* { dg-regexp "\"option\": \"-Wcpp\"" } */
/* { dg-regexp "\"option_url\": \"https:\[^\n\r\"\]*#index-Wcpp\"" } */
@@ -16,11 +17,15 @@
/* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-2.c\"" } */
/* { dg-regexp "\"line\": 4" } */
/* { dg-regexp "\"column\": 2" } */
+/* { dg-regexp "\"display-column\": 2" } */
+/* { dg-regexp "\"byte-column\": 2" } */
/* { dg-regexp "\"finish\": \{" } */
/* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-2.c\"" } */
/* { dg-regexp "\"line\": 4" } */
/* { dg-regexp "\"column\": 8" } */
+/* { dg-regexp "\"display-column\": 8" } */
+/* { dg-regexp "\"byte-column\": 8" } */
/* { dg-regexp "\"locations\": \[\[\{\}, \]*\]" } */
/* { dg-regexp "\"children\": \[\[\]\[\]\]" } */
diff --git a/gcc/testsuite/c-c++-common/diagnostic-format-json-3.c b/gcc/testsuite/c-c++-common/diagnostic-format-json-3.c
index 378205c5bf5..afe96a9048f 100644
--- a/gcc/testsuite/c-c++-common/diagnostic-format-json-3.c
+++ b/gcc/testsuite/c-c++-common/diagnostic-format-json-3.c
@@ -8,6 +8,7 @@
We can't rely on any ordering of the keys. */
/* { dg-regexp "\"kind\": \"error\"" } */
+/* { dg-regexp "\"column-origin\": 1" } */
/* { dg-regexp "\"message\": \"#warning message\"" } */
/* { dg-regexp "\"option\": \"-Werror=cpp\"" } */
/* { dg-regexp "\"option_url\": \"https:\[^\n\r\"\]*#index-Wcpp\"" } */
@@ -16,11 +17,15 @@
/* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-3.c\"" } */
/* { dg-regexp "\"line\": 4" } */
/* { dg-regexp "\"column\": 2" } */
+/* { dg-regexp "\"display-column\": 2" } */
+/* { dg-regexp "\"byte-column\": 2" } */
/* { dg-regexp "\"finish\": \{" } */
/* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-3.c\"" } */
/* { dg-regexp "\"line\": 4" } */
/* { dg-regexp "\"column\": 8" } */
+/* { dg-regexp "\"display-column\": 8" } */
+/* { dg-regexp "\"byte-column\": 8" } */
/* { dg-regexp "\"locations\": \[\[\{\}, \]*\]" } */
/* { dg-regexp "\"children\": \[\[\]\[\]\]" } */
diff --git a/gcc/testsuite/c-c++-common/diagnostic-format-json-4.c b/gcc/testsuite/c-c++-common/diagnostic-format-json-4.c
index 2738be6548f..ae51091e0ea 100644
--- a/gcc/testsuite/c-c++-common/diagnostic-format-json-4.c
+++ b/gcc/testsuite/c-c++-common/diagnostic-format-json-4.c
@@ -24,15 +24,20 @@ int test (void)
/* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-4.c\"" } */
/* { dg-regexp "\"line\": 8" } */
/* { dg-regexp "\"column\": 5" } */
+/* { dg-regexp "\"display-column\": 5" } */
+/* { dg-regexp "\"byte-column\": 5" } */
/* { dg-regexp "\"finish\": \{" } */
/* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-4.c\"" } */
/* { dg-regexp "\"line\": 8" } */
/* { dg-regexp "\"column\": 10" } */
+/* { dg-regexp "\"display-column\": 10" } */
+/* { dg-regexp "\"byte-column\": 10" } */
/* The outer diagnostic. */
/* { dg-regexp "\"kind\": \"warning\"" } */
+/* { dg-regexp "\"column-origin\": 1" } */
/* { dg-regexp "\"message\": \"this 'if' clause does not guard...\"" } */
/* { dg-regexp "\"option\": \"-Wmisleading-indentation\"" } */
/* { dg-regexp "\"option_url\": \"https:\[^\n\r\"\]*#index-Wmisleading-indentation\"" } */
@@ -41,11 +46,15 @@ int test (void)
/* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-4.c\"" } */
/* { dg-regexp "\"line\": 6" } */
/* { dg-regexp "\"column\": 3" } */
+/* { dg-regexp "\"display-column\": 3" } */
+/* { dg-regexp "\"byte-column\": 3" } */
/* { dg-regexp "\"finish\": \{" } */
/* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-4.c\"" } */
/* { dg-regexp "\"line\": 6" } */
/* { dg-regexp "\"column\": 4" } */
+/* { dg-regexp "\"display-column\": 4" } */
+/* { dg-regexp "\"byte-column\": 4" } */
/* More from the nested diagnostic (we can't guarantee what order the
"file" keys are consumed). */
diff --git a/gcc/testsuite/c-c++-common/diagnostic-format-json-5.c b/gcc/testsuite/c-c++-common/diagnostic-format-json-5.c
index f36e896d228..e0e9ce4be98 100644
--- a/gcc/testsuite/c-c++-common/diagnostic-format-json-5.c
+++ b/gcc/testsuite/c-c++-common/diagnostic-format-json-5.c
@@ -13,6 +13,7 @@ int test (struct s *ptr)
We can't rely on any ordering of the keys. */
/* { dg-regexp "\"kind\": \"error\"" } */
+/* { dg-regexp "\"column-origin\": 1" } */
/* { dg-regexp "\"message\": \".*\"" } */
/* Verify fix-it hints. */
@@ -23,11 +24,15 @@ int test (struct s *ptr)
/* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-5.c\"" } */
/* { dg-regexp "\"line\": 8" } */
/* { dg-regexp "\"column\": 15" } */
+/* { dg-regexp "\"display-column\": 15" } */
+/* { dg-regexp "\"byte-column\": 15" } */
/* { dg-regexp "\"next\": \{" } */
/* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-5.c\"" } */
/* { dg-regexp "\"line\": 8" } */
/* { dg-regexp "\"column\": 21" } */
+/* { dg-regexp "\"display-column\": 21" } */
+/* { dg-regexp "\"byte-column\": 21" } */
/* { dg-regexp "\"fixits\": \[\[\{\}, \]*\]" } */
@@ -35,11 +40,15 @@ int test (struct s *ptr)
/* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-5.c\"" } */
/* { dg-regexp "\"line\": 8" } */
/* { dg-regexp "\"column\": 15" } */
+/* { dg-regexp "\"display-column\": 15" } */
+/* { dg-regexp "\"byte-column\": 15" } */
/* { dg-regexp "\"finish\": \{" } */
/* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-5.c\"" } */
/* { dg-regexp "\"line\": 8" } */
/* { dg-regexp "\"column\": 20" } */
+/* { dg-regexp "\"display-column\": 20" } */
+/* { dg-regexp "\"byte-column\": 20" } */
/* { dg-regexp "\"locations\": \[\[\{\}, \]*\]" } */
/* { dg-regexp "\"children\": \[\[\]\[\]\]" } */
diff --git a/gcc/testsuite/c-c++-common/diagnostic-units-1.c b/gcc/testsuite/c-c++-common/diagnostic-units-1.c
new file mode 100644
index 00000000000..8d38b7de03e
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/diagnostic-units-1.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fdiagnostics-column-unit=byte -fshow-column -fdiagnostics-show-caret -Wmultichar" } */
+
+/* column units: bytes (via arg)
+ column origin: 1 (via default)
+ tabstop: 8 (via default) */
+
+/* This line starts with a tab. */
+ int c1 = 'c1'; /* { dg-warning "11: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c1 = 'c1';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces. */
+ int c2 = 'c2'; /* { dg-warning "18: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c2 = 'c2';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces and has an internal tab after
+ a space. */
+ int c3 = 'c3'; /* { dg-warning "19: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c3 = 'c3';
+ ^~~~
+ { dg-end-multiline-output "" } */
diff --git a/gcc/testsuite/c-c++-common/diagnostic-units-2.c b/gcc/testsuite/c-c++-common/diagnostic-units-2.c
new file mode 100644
index 00000000000..29a2edefd9f
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/diagnostic-units-2.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fdiagnostics-column-unit=display -fshow-column -fdiagnostics-show-caret -Wmultichar" } */
+
+/* column units: display (via arg)
+ column origin: 1 (via default)
+ tabstop: 8 (via default) */
+
+/* This line starts with a tab. */
+ int c1 = 'c1'; /* { dg-warning "18: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c1 = 'c1';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces. */
+ int c2 = 'c2'; /* { dg-warning "18: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c2 = 'c2';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces and has an internal tab after
+ a space. */
+ int c3 = 'c3'; /* { dg-warning "25: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c3 = 'c3';
+ ^~~~
+ { dg-end-multiline-output "" } */
diff --git a/gcc/testsuite/c-c++-common/diagnostic-units-3.c b/gcc/testsuite/c-c++-common/diagnostic-units-3.c
new file mode 100644
index 00000000000..714ee8f2de4
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/diagnostic-units-3.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fdiagnostics-column-unit=byte -fshow-column -fdiagnostics-show-caret -ftabstop=200 -Wmultichar" } */
+
+/* column units: bytes (via arg)
+ column origin: 1 (via fallback from overly large argument)
+ tabstop: 8 (via default) */
+
+/* This line starts with a tab. */
+ int c1 = 'c1'; /* { dg-warning "11: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c1 = 'c1';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces. */
+ int c2 = 'c2'; /* { dg-warning "18: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c2 = 'c2';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces and has an internal tab after
+ a space. */
+ int c3 = 'c3'; /* { dg-warning "19: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c3 = 'c3';
+ ^~~~
+ { dg-end-multiline-output "" } */
diff --git a/gcc/testsuite/c-c++-common/diagnostic-units-4.c b/gcc/testsuite/c-c++-common/diagnostic-units-4.c
new file mode 100644
index 00000000000..f9c9da914b2
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/diagnostic-units-4.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fdiagnostics-column-unit=byte -fshow-column -fdiagnostics-show-caret -fdiagnostics-column-origin=0 -Wmultichar" } */
+
+/* column units: bytes (via arg)
+ column origin: 0 (via arg)
+ tabstop: 8 (via default) */
+
+/* This line starts with a tab. */
+ int c1 = 'c1'; /* { dg-warning "10: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c1 = 'c1';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces. */
+ int c2 = 'c2'; /* { dg-warning "17: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c2 = 'c2';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces and has an internal tab after
+ a space. */
+ int c3 = 'c3'; /* { dg-warning "18: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c3 = 'c3';
+ ^~~~
+ { dg-end-multiline-output "" } */
diff --git a/gcc/testsuite/c-c++-common/diagnostic-units-5.c b/gcc/testsuite/c-c++-common/diagnostic-units-5.c
new file mode 100644
index 00000000000..99d5299a732
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/diagnostic-units-5.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fdiagnostics-column-unit=display -fshow-column -fdiagnostics-show-caret -fdiagnostics-column-origin=0 -Wmultichar" } */
+
+/* column units: display (via arg)
+ column origin: 0 (via arg)
+ tabstop: 8 (via default) */
+
+/* This line starts with a tab. */
+ int c1 = 'c1'; /* { dg-warning "17: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c1 = 'c1';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces. */
+ int c2 = 'c2'; /* { dg-warning "17: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c2 = 'c2';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces and has an internal tab after
+ a space. */
+ int c3 = 'c3'; /* { dg-warning "24: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c3 = 'c3';
+ ^~~~
+ { dg-end-multiline-output "" } */
diff --git a/gcc/testsuite/c-c++-common/diagnostic-units-6.c b/gcc/testsuite/c-c++-common/diagnostic-units-6.c
new file mode 100644
index 00000000000..c1e6e4ed477
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/diagnostic-units-6.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fdiagnostics-column-unit=byte -fshow-column -fdiagnostics-show-caret -fdiagnostics-column-origin=100 -Wmultichar" } */
+
+/* column units: bytes (via arg)
+ column origin: 100 (via arg)
+ tabstop: 8 (via default) */
+
+/* This line starts with a tab. */
+ int c1 = 'c1'; /* { dg-warning "110: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c1 = 'c1';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces. */
+ int c2 = 'c2'; /* { dg-warning "117: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c2 = 'c2';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces and has an internal tab after
+ a space. */
+ int c3 = 'c3'; /* { dg-warning "118: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c3 = 'c3';
+ ^~~~
+ { dg-end-multiline-output "" } */
diff --git a/gcc/testsuite/c-c++-common/diagnostic-units-7.c b/gcc/testsuite/c-c++-common/diagnostic-units-7.c
new file mode 100644
index 00000000000..dab221ae235
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/diagnostic-units-7.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fdiagnostics-column-unit=byte -fshow-column -fdiagnostics-show-caret -ftabstop=9 -Wmultichar" } */
+
+/* column units: bytes (via arg)
+ column origin: 1 (via default)
+ tabstop: 9 (via arg) */
+
+/* This line starts with a tab. */
+ int c1 = 'c1'; /* { dg-warning "11: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c1 = 'c1';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces. */
+ int c2 = 'c2'; /* { dg-warning "19: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c2 = 'c2';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces and has an internal tab after
+ a space. */
+ int c3 = 'c3'; /* { dg-warning "20: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c3 = 'c3';
+ ^~~~
+ { dg-end-multiline-output "" } */
diff --git a/gcc/testsuite/c-c++-common/diagnostic-units-8.c b/gcc/testsuite/c-c++-common/diagnostic-units-8.c
new file mode 100644
index 00000000000..d713b32dabc
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/diagnostic-units-8.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fshow-column -fdiagnostics-show-caret -ftabstop=9 -Wmultichar" } */
+
+/* column units: display (via default)
+ column origin: 1 (via default)
+ tabstop: 9 (via arg) */
+
+/* This line starts with a tab. */
+ int c1 = 'c1'; /* { dg-warning "19: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c1 = 'c1';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces. */
+ int c2 = 'c2'; /* { dg-warning "19: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c2 = 'c2';
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+/* This line starts with <tabstop> spaces and has an internal tab after
+ a space. */
+ int c3 = 'c3'; /* { dg-warning "28: multi-character character constant" } */
+/* { dg-begin-multiline-output "" }
+ int c3 = 'c3';
+ ^~~~
+ { dg-end-multiline-output "" } */
diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-alias-ipa-pta-2.c b/gcc/testsuite/c-c++-common/goacc/kernels-alias-ipa-pta-2.c
index f16d698af0d..1f62337ff51 100644
--- a/gcc/testsuite/c-c++-common/goacc/kernels-alias-ipa-pta-2.c
+++ b/gcc/testsuite/c-c++-common/goacc/kernels-alias-ipa-pta-2.c
@@ -32,6 +32,7 @@ foo (void)
free (c);
}
-/* { dg-final { scan-tree-dump-times "(?n)= 0;$" 2 "optimized" } } */
+/* XFAIL: see PR middle-end/95622; fails if ENABLE_OFFLOAD is set. */
+/* { dg-final { scan-tree-dump-times "(?n)= 0;$" 2 "optimized" { xfail offloading_enabled } } } */
/* { dg-final { scan-tree-dump-times "(?n)= 1;$" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "(?n)= \\*a" 0 "optimized" } } */
diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-alias-ipa-pta-4.c b/gcc/testsuite/c-c++-common/goacc/kernels-alias-ipa-pta-4.c
index 20b21dcb577..d7bc6cd6ff1 100644
--- a/gcc/testsuite/c-c++-common/goacc/kernels-alias-ipa-pta-4.c
+++ b/gcc/testsuite/c-c++-common/goacc/kernels-alias-ipa-pta-4.c
@@ -16,6 +16,7 @@ foo (void)
}
}
-/* { dg-final { scan-tree-dump-times "(?n)= 0;$" 2 "optimized" } } */
+/* XFAIL: see PR middle-end/95622; fails if ENABLE_OFFLOAD is set. */
+/* { dg-final { scan-tree-dump-times "(?n)= 0;$" 2 "optimized" { xfail offloading_enabled } } } */
/* { dg-final { scan-tree-dump-times "(?n)= 1;$" 1 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "(?n)= \\*_\[0-9\];$" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "(?n)= \\*_\[0-9\];$" 0 "optimized" { xfail offloading_enabled } } } */
diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-alias-ipa-pta.c b/gcc/testsuite/c-c++-common/goacc/kernels-alias-ipa-pta.c
index 969b466e8a8..a6339283876 100644
--- a/gcc/testsuite/c-c++-common/goacc/kernels-alias-ipa-pta.c
+++ b/gcc/testsuite/c-c++-common/goacc/kernels-alias-ipa-pta.c
@@ -18,6 +18,7 @@ foo (void)
}
}
-/* { dg-final { scan-tree-dump-times "(?n)= 0;$" 2 "optimized" } } */
+/* XFAIL: see PR middle-end/95622; fails if ENABLE_OFFLOAD is set. */
+/* { dg-final { scan-tree-dump-times "(?n)= 0;$" 2 "optimized" { xfail offloading_enabled } } } */
/* { dg-final { scan-tree-dump-times "(?n)= 1;$" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "(?n)= \\*_\[0-9\]\\\[0\\\];$" 0 "optimized" } } */
diff --git a/gcc/testsuite/c-c++-common/goacc/mdc-1.c b/gcc/testsuite/c-c++-common/goacc/mdc-1.c
index fb5841a709d..337c1f7cc77 100644
--- a/gcc/testsuite/c-c++-common/goacc/mdc-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/mdc-1.c
@@ -45,12 +45,12 @@ t1 ()
/* { dg-final { scan-tree-dump-times "pragma omp target oacc_enter_exit_data map.to:s .len: 32.." 1 "omplower" } } */
/* { dg-final { scan-tree-dump-times "pragma omp target oacc_data map.tofrom:.z .len: 40.. map.struct:s .len: 1.. map.alloc:s.a .len: 8.. map.tofrom:._1 .len: 40.. map.attach:s.a .bias: 0.." 1 "omplower" } } */
-/* { dg-final { scan-tree-dump-times "pragma omp target oacc_parallel map.attach:s.e .bias: 8.. map.tofrom:s .len: 32" 1 "omplower" } } */
-/* { dg-final { scan-tree-dump-times "pragma omp target oacc_enter_exit_data map.attach:a .bias: 8.." 1 "omplower" } } */
-/* { dg-final { scan-tree-dump-times "pragma omp target oacc_enter_exit_data map.detach:a .bias: 8.." 1 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "pragma omp target oacc_parallel map.attach:s.e .bias: 0.. map.tofrom:s .len: 32" 1 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "pragma omp target oacc_enter_exit_data map.attach:a .bias: 0.." 1 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "pragma omp target oacc_enter_exit_data map.detach:a .bias: 0.." 1 "omplower" } } */
/* { dg-final { scan-tree-dump-times "pragma omp target oacc_enter_exit_data map.to:a .len: 8.." 1 "omplower" } } */
-/* { dg-final { scan-tree-dump-times "pragma omp target oacc_enter_exit_data map.detach:s.e .bias: 8.." 1 "omplower" } } */
-/* { dg-final { scan-tree-dump-times "pragma omp target oacc_data map.attach:s.e .bias: 8.." 1 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "pragma omp target oacc_enter_exit_data map.detach:s.e .bias: 0.." 1 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "pragma omp target oacc_data map.attach:s.e .bias: 0.." 1 "omplower" } } */
/* { dg-final { scan-tree-dump-times "pragma omp target oacc_enter_exit_data map.release:a .len: 8.." 1 "omplower" } } */
-/* { dg-final { scan-tree-dump-times "pragma omp target oacc_enter_exit_data finalize map.force_detach:a .bias: 8.." 1 "omplower" } } */
-/* { dg-final { scan-tree-dump-times "pragma omp target oacc_enter_exit_data finalize map.force_detach:s.a .bias: 8.." 1 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "pragma omp target oacc_enter_exit_data finalize map.force_detach:a .bias: 0.." 1 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "pragma omp target oacc_enter_exit_data finalize map.force_detach:s.a .bias: 0.." 1 "omplower" } } */
diff --git a/gcc/testsuite/c-c++-common/goacc/pr79428-1.c b/gcc/testsuite/c-c++-common/goacc/pr79428-1.c
index cf4aeaf6841..68dea5b145e 100644
--- a/gcc/testsuite/c-c++-common/goacc/pr79428-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/pr79428-1.c
@@ -3,4 +3,6 @@
void
foo ()
{
-#pragma acc routine /* { dg-error ".#pragma acc routine. must be at file scope|expected" } */
+#pragma acc routine /* { dg-error ".#pragma acc routine. must be at file scope" } */
+// { dg-error "expected" "end" { target c } .-1 }
+// { dg-error "-:expected" "end" { target c++ } .+1 }
diff --git a/gcc/testsuite/c-c++-common/goacc/struct-enter-exit-data-1.c b/gcc/testsuite/c-c++-common/goacc/struct-enter-exit-data-1.c
new file mode 100644
index 00000000000..df405e448b2
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/goacc/struct-enter-exit-data-1.c
@@ -0,0 +1,27 @@
+/* Check 'GOMP_MAP_STRUCT' mapping, and in particular that it gets removed from
+ OpenACC 'exit data' directives. */
+
+/* { dg-additional-options "-fdump-tree-gimple" } */
+
+struct str {
+ int a;
+ int *b;
+ int *c;
+ int d;
+ int *e;
+ int f;
+};
+
+#define N 1024
+
+void
+test (int *b, int *c, int *e)
+{
+ struct str s = { .a = 0, .b = b, .c = c, .d = 0, .e = e, .f = 0 };
+
+#pragma acc enter data copyin(s.a, s.b[0:N], s.c[0:N] /* , s.d */ /* , s.e[0:N] */, s.f)
+ /* { dg-final { scan-tree-dump {(?n)#pragma omp target oacc_enter_exit_data map\(struct:s \[len: 4\]\) map\(to:s.a \[len: [0-9]+\]\) map\(alloc:s.b \[len: [0-9]+\]\) map\(alloc:s.c \[len: [0-9]+\]\) map\(to:s.f \[len: [0-9]+\]\) map\(to:\*[_0-9]+ \[len: [0-9]+\]\) map\(attach:s.b \[bias: 0\]\) map\(to:\*[_0-9]+ \[len: [0-9]+\]\) map\(attach:s.c \[bias: 0\]\)$} gimple } } */
+
+#pragma acc exit data copyout(s.a, s.b[0:N], s.c[0:N] /* , s.d */ /* , s.e[0:N] */, s.f)
+ /* { dg-final { scan-tree-dump {(?n)#pragma omp target oacc_enter_exit_data map\(from:s.a \[len: [0-9]+\]\) map\(release:s.b \[len: [0-9]+\]\) map\(release:s.c \[len: [0-9]+\]\) map\(from:s.f \[len: [0-9]+\]\) map\(from:\*[_0-9]+ \[len: [0-9]+\]\) map\(detach:s.b \[bias: 0\]\) map\(from:\*[_0-9]+ \[len: [0-9]+\]\) map\(detach:s.c \[bias: 0\]\)$} gimple } } */
+}
diff --git a/gcc/testsuite/c-c++-common/goacc/uninit-dim-clause.c b/gcc/testsuite/c-c++-common/goacc/uninit-dim-clause.c
index 9f11196bdbe..827dac71519 100644
--- a/gcc/testsuite/c-c++-common/goacc/uninit-dim-clause.c
+++ b/gcc/testsuite/c-c++-common/goacc/uninit-dim-clause.c
@@ -4,13 +4,13 @@ void acc_parallel()
{
int i, j, k;
- #pragma acc parallel num_gangs(i) /* { dg-warning "is used uninitialized in this function" } */
+ #pragma acc parallel num_gangs(i) /* { dg-warning "is used uninitialized" } */
;
- #pragma acc parallel num_workers(j) /* { dg-warning "is used uninitialized in this function" } */
+ #pragma acc parallel num_workers(j) /* { dg-warning "is used uninitialized" } */
;
- #pragma acc parallel vector_length(k) /* { dg-warning "is used uninitialized in this function" } */
+ #pragma acc parallel vector_length(k) /* { dg-warning "is used uninitialized" } */
;
}
@@ -18,12 +18,12 @@ void acc_kernels()
{
int i, j, k;
- #pragma acc kernels num_gangs(i) /* { dg-warning "is used uninitialized in this function" } */
+ #pragma acc kernels num_gangs(i) /* { dg-warning "is used uninitialized" } */
;
- #pragma acc kernels num_workers(j) /* { dg-warning "is used uninitialized in this function" } */
+ #pragma acc kernels num_workers(j) /* { dg-warning "is used uninitialized" } */
;
- #pragma acc kernels vector_length(k) /* { dg-warning "is used uninitialized in this function" } */
+ #pragma acc kernels vector_length(k) /* { dg-warning "is used uninitialized" } */
;
}
diff --git a/gcc/testsuite/c-c++-common/goacc/uninit-firstprivate-clause.c b/gcc/testsuite/c-c++-common/goacc/uninit-firstprivate-clause.c
index 2584033a8c5..334567d3337 100644
--- a/gcc/testsuite/c-c++-common/goacc/uninit-firstprivate-clause.c
+++ b/gcc/testsuite/c-c++-common/goacc/uninit-firstprivate-clause.c
@@ -18,7 +18,7 @@ foo2 (void)
{
int i;
-#pragma acc parallel firstprivate (i) /* { dg-warning "is used uninitialized in this function" } */
+#pragma acc parallel firstprivate (i) /* { dg-warning "is used uninitialized" } */
{
i = 1;
}
diff --git a/gcc/testsuite/c-c++-common/goacc/uninit-if-clause.c b/gcc/testsuite/c-c++-common/goacc/uninit-if-clause.c
index 55caa4c2c7f..7f78d729681 100644
--- a/gcc/testsuite/c-c++-common/goacc/uninit-if-clause.c
+++ b/gcc/testsuite/c-c++-common/goacc/uninit-if-clause.c
@@ -11,28 +11,28 @@ main (void)
bool b, b2, b3, b4;
int i, i2;
- #pragma acc parallel if(l) /* { dg-warning "is used uninitialized in this function" } */
+ #pragma acc parallel if(l) /* { dg-warning "is used uninitialized" } */
;
- #pragma acc parallel if(b) /* { dg-warning "is used uninitialized in this function" "" { xfail c++ } } */
+ #pragma acc parallel if(b) /* { dg-warning "is used uninitialized" "" { xfail c++ } } */
;
- #pragma acc kernels if(l2) /* { dg-warning "is used uninitialized in this function" } */
+ #pragma acc kernels if(l2) /* { dg-warning "is used uninitialized" } */
;
- #pragma acc kernels if(b2) /* { dg-warning "is used uninitialized in this function" "" { xfail c++ } } */
+ #pragma acc kernels if(b2) /* { dg-warning "is used uninitialized" "" { xfail c++ } } */
;
- #pragma acc data if(l3) /* { dg-warning "is used uninitialized in this function" } */
+ #pragma acc data if(l3) /* { dg-warning "is used uninitialized" } */
;
- #pragma acc data if(b3) /* { dg-warning "is used uninitialized in this function" "" { xfail c++ } } */
+ #pragma acc data if(b3) /* { dg-warning "is used uninitialized" "" { xfail c++ } } */
;
- #pragma acc update if(l4) self(i) /* { dg-warning "is used uninitialized in this function" } */
+ #pragma acc update if(l4) self(i) /* { dg-warning "is used uninitialized" } */
;
- #pragma acc update if(b4) self(i2) /* { dg-warning "is used uninitialized in this function" "" { xfail c++ } } */
+ #pragma acc update if(b4) self(i2) /* { dg-warning "is used uninitialized" "" { xfail c++ } } */
;
}
diff --git a/gcc/testsuite/c-c++-common/goacc/uninit-use-device-clause.c b/gcc/testsuite/c-c++-common/goacc/uninit-use-device-clause.c
index c5d327caf80..02fb99a1e24 100644
--- a/gcc/testsuite/c-c++-common/goacc/uninit-use-device-clause.c
+++ b/gcc/testsuite/c-c++-common/goacc/uninit-use-device-clause.c
@@ -8,7 +8,7 @@ foo (void)
{
int i;
-#pragma acc host_data use_device(i) /* { dg-warning "is used uninitialized in this function" "" { xfail *-*-* } } */
+#pragma acc host_data use_device(i) /* { dg-warning "is used uninitialized" "" { xfail *-*-* } } */
{
}
}
diff --git a/gcc/testsuite/c-c++-common/gomp/declare-variant-14.c b/gcc/testsuite/c-c++-common/gomp/declare-variant-14.c
new file mode 100644
index 00000000000..cdb0bb34f50
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/declare-variant-14.c
@@ -0,0 +1,28 @@
+/* { dg-do compile { target vect_simd_clones } } */
+/* { dg-additional-options "-fdump-tree-gimple -fdump-tree-optimized" } */
+/* { dg-additional-options "-mno-sse3" { target { i?86-*-* x86_64-*-* } } } */
+
+int f01 (int);
+int f02 (int);
+int f03 (int);
+#pragma omp declare variant (f01) match (device={isa("avx512f")}) /* 4 or 8 */
+#pragma omp declare variant (f02) match (implementation={vendor(score(3):gnu)},device={kind(cpu)}) /* (1 or 2) + 3 */
+#pragma omp declare variant (f03) match (implementation={vendor(score(5):gnu)},device={kind(host)}) /* (1 or 2) + 5 */
+int f04 (int);
+
+#pragma omp declare simd
+int
+test1 (int x)
+{
+ /* At gimplification time, we can't decide yet which function to call. */
+ /* { dg-final { scan-tree-dump-times "f04 \\\(x" 2 "gimple" } } */
+ /* After simd clones are created, the original non-clone test1 shall
+ call f03 (score 6), the sse2/avx/avx2 clones too, but avx512f clones
+ shall call f01 with score 8. */
+ /* { dg-final { scan-tree-dump-not "f04 \\\(x" "optimized" } } */
+ /* { dg-final { scan-tree-dump-times "f03 \\\(x" 14 "optimized" } } */
+ /* { dg-final { scan-tree-dump-times "f01 \\\(x" 4 "optimized" } } */
+ int a = f04 (x);
+ int b = f04 (x);
+ return a + b;
+}
diff --git a/gcc/testsuite/c-c++-common/gomp/default-1.c b/gcc/testsuite/c-c++-common/gomp/default-1.c
index 6525483c44e..eab46892dad 100644
--- a/gcc/testsuite/c-c++-common/gomp/default-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/default-1.c
@@ -2,20 +2,20 @@ void
foo (void)
{
int x = 0, i;
- #pragma omp task default(none) /* { dg-error "enclosing 'task'" } */
+ #pragma omp task default(none) /* { dg-message "note: enclosing 'task'" } */
{
x++; /* { dg-error "'x' not specified in enclosing 'task'" } */
}
- #pragma omp taskloop default(none) /* { dg-error "enclosing 'taskloop'" } */
+ #pragma omp taskloop default(none) /* { dg-message "note: enclosing 'taskloop'" } */
for (i = 0; i < 64; i++)
{
x++; /* { dg-error "'x' not specified in enclosing 'taskloop'" } */
}
- #pragma omp teams default(none) /* { dg-error "enclosing 'teams'" } */
+ #pragma omp teams default(none) /* { dg-message "note: enclosing 'teams'" } */
{
x++; /* { dg-error "'x' not specified in enclosing 'teams'" } */
}
- #pragma omp parallel default(none) /* { dg-error "enclosing 'parallel'" } */
+ #pragma omp parallel default(none) /* { dg-message "note: enclosing 'parallel'" } */
{
x++; /* { dg-error "'x' not specified in enclosing 'parallel'" } */
}
diff --git a/gcc/testsuite/c-c++-common/gomp/defaultmap-3.c b/gcc/testsuite/c-c++-common/gomp/defaultmap-3.c
index 2f5b303958f..8be23fd1473 100644
--- a/gcc/testsuite/c-c++-common/gomp/defaultmap-3.c
+++ b/gcc/testsuite/c-c++-common/gomp/defaultmap-3.c
@@ -11,7 +11,7 @@ f1 (int sc1, struct S ag1, int *pt1)
{
char ar1[N];
foo (ar1);
- #pragma omp target defaultmap(default:scalar) defaultmap(to:aggregate) defaultmap(none:pointer) /* { dg-error "enclosing 'target'" } */
+ #pragma omp target defaultmap(default:scalar) defaultmap(to:aggregate) defaultmap(none:pointer) /* { dg-message "note: enclosing 'target'" } */
bar (sc1, ar1, ag1, pt1); /* { dg-error "'pt1' not specified in enclosing 'target'" } */
}
@@ -20,7 +20,7 @@ f2 (int sc2, struct S ag2, int *pt2)
{
char ar2[N];
foo (ar2);
- #pragma omp target defaultmap(none:scalar) defaultmap(from:aggregate) defaultmap(default:pointer) /* { dg-error "enclosing 'target'" } */
+ #pragma omp target defaultmap(none:scalar) defaultmap(from:aggregate) defaultmap(default:pointer) /* { dg-message "note: enclosing 'target'" } */
bar (sc2, ar2, ag2, pt2); /* { dg-error "'sc2' not specified in enclosing 'target'" } */
}
@@ -29,6 +29,6 @@ f3 (int sc3, struct S ag3, int *pt3)
{
char ar3[N];
foo (ar3);
- #pragma omp target defaultmap(firstprivate:scalar) defaultmap(none:aggregate) defaultmap(to:pointer) /* { dg-error "enclosing 'target'" } */
+ #pragma omp target defaultmap(firstprivate:scalar) defaultmap(none:aggregate) defaultmap(to:pointer) /* { dg-message "note: enclosing 'target'" } */
bar (sc3, ar3, ag3, pt3); /* { dg-error "'ar3' not specified in enclosing 'target'" } */
} /* { dg-error "'ag3' not specified in enclosing 'target'" "" { target *-*-* } .-1 } */
diff --git a/gcc/testsuite/c-c++-common/gomp/depend-iterator-2.c b/gcc/testsuite/c-c++-common/gomp/depend-iterator-2.c
index 127528271ee..fff32a4761f 100644
--- a/gcc/testsuite/c-c++-common/gomp/depend-iterator-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/depend-iterator-2.c
@@ -41,7 +41,7 @@ f1 (void)
;
#pragma omp task depend (iterator (int i = 0:4, \
struct U { int (*p)[i + 2]; } *p = 0:2) , in : a) /* { dg-error "type of iterator 'p' refers to outer iterator 'i'" "" { target c } } */
- ; /* { dg-error "types may not be defined in iterator type|not an integer constant" "" { target c++ } .-1 } */
+ ; /* { dg-error "types may not be defined in iterator type|not an integral constant" "" { target c++ } .-1 } */
#pragma omp task depend (iterator (i = 0:4, j = i:16) , in : a) /* { dg-error "begin expression refers to outer iterator 'i'" } */
;
#pragma omp task depend (iterator (i = 0:4, j = 2:i:1) , in : a) /* { dg-error "end expression refers to outer iterator 'i'" } */
diff --git a/gcc/testsuite/c-c++-common/gomp/gridify-1.c b/gcc/testsuite/c-c++-common/gomp/gridify-1.c
deleted file mode 100644
index f9b03ebd96f..00000000000
--- a/gcc/testsuite/c-c++-common/gomp/gridify-1.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* { dg-do compile } */
-/* { dg-require-effective-target offload_hsa } */
-/* { dg-options "-fopenmp -fdump-tree-omplower-details" } */
-
-void
-foo1 (int n, int *a, int workgroup_size)
-{
- int i;
-#pragma omp target
-#pragma omp teams thread_limit(workgroup_size)
-#pragma omp distribute parallel for shared(a) firstprivate(n) private(i)
- for (i = 0; i < n; i++)
- a[i]++;
-}
-
-void
-foo2 (int j, int n, int *a)
-{
- int i;
-#pragma omp target teams
-#pragma omp distribute parallel for shared(a) firstprivate(n) private(i) firstprivate(j)
- for (i = j + 1; i < n; i++)
- a[i] = i;
-}
-
-void
-foo3 (int j, int n, int *a)
-{
- int i;
-#pragma omp target teams
-#pragma omp distribute parallel for shared(a) firstprivate(n) private(i) firstprivate(j)
- for (i = j + 1; i < n; i += 3)
- a[i] = i;
-}
-
-void
-foo4 (int j, int n, int *a)
-{
-#pragma omp parallel
- {
- #pragma omp single
- {
- int i;
-#pragma omp target
-#pragma omp teams
-#pragma omp distribute parallel for shared(a) firstprivate(n) private(i) firstprivate(j)
- for (i = j + 1; i < n; i += 3)
- a[i] = i;
- }
- }
-}
-
-
-/* { dg-final { scan-tree-dump-times "Target construct will be turned into a gridified HSA kernel" 4 "omplower" } } */
diff --git a/gcc/testsuite/c-c++-common/gomp/gridify-2.c b/gcc/testsuite/c-c++-common/gomp/gridify-2.c
deleted file mode 100644
index 6b5cc9a8a7d..00000000000
--- a/gcc/testsuite/c-c++-common/gomp/gridify-2.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* { dg-do compile } */
-/* { dg-require-effective-target offload_hsa } */
-/* { dg-options "-fopenmp -fdump-tree-omplower-details" } */
-
-#define BLOCK_SIZE 16
-
-
-void tiled_sgemm_tt(const int M, const int N, const int K, const float alpha, const float*A, const int LDA,
- const float*B, const int LDB, const float beta, float*C, const int LDC){
-
-#pragma omp target teams map(to:A[M*K],B[K*N]) map(from:C[M*N])
-#pragma omp distribute collapse(2)
- for (int C_row_start=0 ; C_row_start < M ; C_row_start+=BLOCK_SIZE)
- for (int C_col_start=0 ; C_col_start < N ; C_col_start+=BLOCK_SIZE)
- {
-// Each team has a local copy of these mini matrices
- float As[BLOCK_SIZE][BLOCK_SIZE];
- float Bs[BLOCK_SIZE][BLOCK_SIZE];
-#pragma omp parallel
- {
- int C_row, C_col;
- float Cval = 0.0;
-
- for (int kblock = 0; kblock < K ; kblock += BLOCK_SIZE )
- {
-#pragma omp for collapse(2)
- for (int row=0 ; row < BLOCK_SIZE ; row++)
- for (int col=0 ; col < BLOCK_SIZE ; col++)
- {
- C_row = C_row_start + row;
- C_col = C_col_start + col;
- if ((C_row < M) && (kblock + col < K))
- As[row][col] = A[(C_row*LDA)+ kblock + col];
- else
- As[row][col] = 0;
- if ((kblock + row < K) && C_col < N)
- Bs[row][col] = B[((kblock+row)*LDB)+ C_col];
- else
- Bs[row][col] = 0;
- }
-
-#pragma omp for collapse(2)
- for (int row=0 ; row < BLOCK_SIZE ; row++)
- for (int col=0 ; col < BLOCK_SIZE ; col++)
- {
- for (int e = 0; e < BLOCK_SIZE; ++e)
- Cval += As[row][e] * Bs[e][col];
- }
- } /* End for kblock .. */
-
-
-#pragma omp for collapse(2)
- for (int row=0 ; row < BLOCK_SIZE ; row++)
- for (int col=0 ; col < BLOCK_SIZE ; col++)
- {
- C_row = C_row_start + row;
- C_col = C_col_start + col;
- if ((C_row < M) && (C_col < N))
- C[(C_row*LDC)+C_col] = alpha*Cval + beta*C[(C_row*LDC)+C_col];
-
- }
- } /* end parallel */
- } /* end target teams distribute */
-}
-
-/* { dg-final { scan-tree-dump "Target construct will be turned into a gridified HSA kernel" "omplower" } } */
diff --git a/gcc/testsuite/c-c++-common/gomp/gridify-3.c b/gcc/testsuite/c-c++-common/gomp/gridify-3.c
deleted file mode 100644
index 8dbeaef74cd..00000000000
--- a/gcc/testsuite/c-c++-common/gomp/gridify-3.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* { dg-do compile } */
-/* { dg-require-effective-target offload_hsa } */
-/* { dg-options "-fopenmp -fdump-tree-omplower-details" } */
-
-#define BLOCK_SIZE 16
-
-void tiled_sgemm_tt(const int M, const int N, const int K, const float alpha, const float*A, const int LDA,
- const float*B, const int LDB, const float beta, float*C, const int LDC)
-{
-#pragma omp target teams map(to:A[M*K],B[K*N]) map(from:C[M*N])
-#pragma omp distribute collapse(2)
- for (int C_row_start=0 ; C_row_start < M ; C_row_start+=BLOCK_SIZE)
- for (int C_col_start=0 ; C_col_start < N ; C_col_start+=BLOCK_SIZE)
- {
- float As[BLOCK_SIZE][BLOCK_SIZE];
- float Bs[BLOCK_SIZE][BLOCK_SIZE];
- float Cs[BLOCK_SIZE][BLOCK_SIZE];
- int C_row, C_col;
-
-#pragma omp parallel for collapse(2)
- for (int row=0 ; row < BLOCK_SIZE ; row++)
- for (int col=0 ; col < BLOCK_SIZE ; col++)
- {
- Cs[row][col] = 0.0;
- }
-
-
- for (int kblock = 0; kblock < K ; kblock += BLOCK_SIZE )
- {
-#pragma omp parallel for collapse(2)
- for (int row=0 ; row < BLOCK_SIZE ; row++)
- for (int col=0 ; col < BLOCK_SIZE ; col++)
- {
- C_row = C_row_start + row;
- C_col = C_col_start + col;
- if ((C_row < M) && (kblock + col < K))
- As[row][col] = A[(C_row*LDA)+ kblock + col];
- else
- As[row][col] = 0;
- if ((kblock + row < K) && C_col < N)
- Bs[row][col] = B[((kblock+row)*LDB)+ C_col];
- else
- Bs[row][col] = 0;
- }
-
-#pragma omp parallel for collapse(2)
- for (int row=0 ; row < BLOCK_SIZE ; row++)
- for (int col=0 ; col < BLOCK_SIZE ; col++)
- {
- for (int e = 0; e < BLOCK_SIZE; ++e)
- Cs[row][col] += As[row][e] * Bs[e][col];
- }
- } /* End for kblock .. */
-
-
-#pragma omp parallel for collapse(2)
- for (int row=0 ; row < BLOCK_SIZE ; row++)
- for (int col=0 ; col < BLOCK_SIZE ; col++)
- {
- C_row = C_row_start + row;
- C_col = C_col_start + col;
- if ((C_row < M) && (C_col < N))
- C[(C_row*LDC)+C_col] = alpha*Cs[row][col] + beta*C[(C_row*LDC)+C_col];
- }
- } /* End distribute */
-}
-
-/* { dg-final { scan-tree-dump "Target construct will be turned into a gridified HSA kernel" "omplower" } } */
diff --git a/gcc/testsuite/c-c++-common/gomp/loop-6.c b/gcc/testsuite/c-c++-common/gomp/loop-6.c
new file mode 100644
index 00000000000..0d4474dbebb
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/loop-6.c
@@ -0,0 +1,113 @@
+int bar (int);
+int baz (int *);
+
+void
+f1 (int x)
+{
+ int i = 0, j = 0, k = 0;
+ long long l = 0;
+ #pragma omp for collapse(2)
+ for (i = 0; i < 16; i = i + 2)
+ for (j = i * i; j < 16; j += 2) /* { dg-error "initializer expression refers to iteration variable" } */
+ ;
+ #pragma omp for collapse(2)
+ for (i = 0; i < 16; i = i + 2)
+ for (j = i + 3; j < (i + 1) * 2; j += 2) /* { dg-error "condition expression refers to iteration variable" } */
+ ;
+ #pragma omp for collapse(2)
+ for (i = 0; i < 16; i = i + 2)
+ for (j = (i + 1) * 2; j < i * 8; j += 2) /* { dg-error "initializer expression refers to iteration variable" } */
+ ;
+ #pragma omp for collapse(3)
+ for (i = 0; i < 16; i = i + 2)
+ for (j = 0; j < 16; j++)
+ for (k = i + j; k < 32; k++) /* { dg-error "initializer expression refers to iteration variable" } */
+ ;
+ #pragma omp for collapse(2)
+ for (l = 0; l < 16; l++)
+ for (j = 0; j < l; j++) /* { dg-error "outer iteration variable 'l' used in condition expression has type other than 'int'" } */
+ ;
+ #pragma omp for collapse(2) /* { dg-error "outer iteration variable 'l' used in initializer expression has type other than 'int'" "" { target c } } */
+ for (l = 0; l < 16; l++) /* { dg-error "outer iteration variable 'l' used in initializer expression has type other than 'int'" "" { target c++ } } */
+ for (j = 7LL * l; j < 32; j++)
+ ;
+ #pragma omp for collapse(2)
+ for (i = 0; i < 16; i = i + 2)
+ for (j = i + 3; j < i * 2 + 2; j += 2)
+ ;
+ #pragma omp for collapse(2)
+ for (i = 0; i < 16; i = i + 2)
+ for (j = i * 2 + 2; j < i * 6 + 2; j += 2)
+ ;
+ #pragma omp for collapse(3)
+ for (i = 0; i < 16; i = i + 2)
+ for (j = 0; j < 16; j++)
+ for (k = 14 + 7 * i; k < 32 * j; k++) /* { dg-error "two different outer iteration variables 'i' and 'j' used in a single loop" } */
+ ;
+ #pragma omp for schedule(static, 2) collapse(2) /* { dg-error "'schedule' clause may not appear on non-rectangular 'for'" } */
+ for (i = 0; i < 16; i++)
+ for (j = 1; j < i; j++)
+ ;
+ #pragma omp for schedule(static) collapse(2) /* { dg-error "'schedule' clause may not appear on non-rectangular 'for'" } */
+ for (i = 0; i < 16; i++)
+ for (j = 1; j < i; j++)
+ ;
+ #pragma omp for schedule(dynamic, 5) collapse(2) /* { dg-error "'schedule' clause may not appear on non-rectangular 'for'" } */
+ for (i = 0; i < 16; i++)
+ for (j = 1; j < i; j++)
+ ;
+ #pragma omp for ordered collapse(2) /* { dg-error "'ordered' clause may not appear on non-rectangular 'for'" } */
+ for (i = 0; i < 16; i++)
+ for (j = 1; j < i; j++)
+ ;
+ #pragma omp for ordered collapse(2) /* { dg-error "'ordered' clause may not appear on non-rectangular 'for'" } */
+ for (i = 0; i < 16; i++)
+ for (j = 1; j < i; j++)
+ ;
+ #pragma omp for ordered (3) collapse (2) /* { dg-error "'ordered' clause may not appear on non-rectangular 'for'" } */
+ for (i = 0; i < 64; i++)
+ for (j = 0; j < i; j++)
+ for (k = 0; k < 64; k++)
+ {
+ #pragma omp ordered depend (sink: i - 1, j - 2, k - 3)
+ #pragma omp ordered depend (source)
+ }
+ #pragma omp for ordered (3) collapse (2) /* { dg-error "'ordered' clause may not appear on non-rectangular 'for'" } */
+ for (i = 0; i < 64; i++)
+ for (j = 0; j < 64; j++)
+ for (k = i; k < 64; k++)
+ {
+ #pragma omp ordered depend (sink: i - 1, j - 2, k - 3)
+ #pragma omp ordered depend (source)
+ }
+ #pragma omp for simd schedule(simd: static) collapse(2) /* { dg-error "'schedule' clause may not appear on non-rectangular 'for'" } */
+ for (i = 0; i < 16; i++)
+ for (j = 1; j < i; j++)
+ ;
+}
+
+void
+f2 (void)
+{
+ int i = 0, j = 0;
+ #pragma omp distribute dist_schedule(static, 4) collapse(2) /* { dg-error "'dist_schedule' clause may not appear on non-rectangular 'distribute'" } */
+ for (i = 0; i < 64; i++)
+ for (j = i; j < 64; j++)
+ ;
+ #pragma omp distribute collapse(2) dist_schedule(static) /* { dg-error "'dist_schedule' clause may not appear on non-rectangular 'distribute'" } */
+ for (i = 0; i < 64; i++)
+ for (j = i; j < 64; j++)
+ ;
+ #pragma omp distribute parallel for simd schedule(simd: static) collapse(2) /* { dg-error "'schedule' clause may not appear on non-rectangular 'for'" } */
+ for (i = 0; i < 16; i++)
+ for (j = 1; j < i; j++)
+ ;
+ #pragma omp distribute parallel for simd collapse(2) dist_schedule(static) /* { dg-error "'dist_schedule' clause may not appear on non-rectangular 'distribute'" } */
+ for (i = 0; i < 64; i++)
+ for (j = i; j < 64; j++)
+ ;
+ #pragma omp distribute simd collapse(2) dist_schedule(static) /* { dg-error "'dist_schedule' clause may not appear on non-rectangular 'distribute'" } */
+ for (i = 0; i < 64; i++)
+ for (j = i; j < 64; j++)
+ ;
+}
diff --git a/gcc/testsuite/c-c++-common/gomp/loop-7.c b/gcc/testsuite/c-c++-common/gomp/loop-7.c
new file mode 100644
index 00000000000..4c8f27e76a5
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/loop-7.c
@@ -0,0 +1,24 @@
+void
+foo (void)
+{
+ #pragma omp for collapse(2) /* { dg-error "invalid OpenMP non-rectangular loop step" } */
+ for (int i = 0; i < 6; i++)
+ for (int j = 4 * i; j < 7 * i; j += 2)
+ ;
+ #pragma omp for collapse(2) /* { dg-error "invalid OpenMP non-rectangular loop step" } */
+ for (int i = 0; i < 32; i += 7)
+ for (int j = 3 * i; j < 7 * i; j += 30)
+ ;
+ #pragma omp for collapse(2)
+ for (int i = 0; i < 6; i++)
+ for (int j = 4 * i; j < 6 * i; j += 2)
+ ;
+ #pragma omp for collapse(2)
+ for (int i = 0; i < 6; i += 2)
+ for (int j = 4 * i; j < 7 * i; j += 2)
+ ;
+ #pragma omp for collapse(2)
+ for (int i = 0; i < 6; i += 5)
+ for (int j = 4 * i; j < 7 * i; j += 15)
+ ;
+}
diff --git a/gcc/testsuite/c-c++-common/gomp/order-4.c b/gcc/testsuite/c-c++-common/gomp/order-4.c
index f916772ceea..d1109bb13b3 100644
--- a/gcc/testsuite/c-c++-common/gomp/order-4.c
+++ b/gcc/testsuite/c-c++-common/gomp/order-4.c
@@ -5,7 +5,7 @@ void
f1 (void)
{
int i;
- #pragma omp simd order(concurrent) /* { dg-error "enclosing region" } */
+ #pragma omp simd order(concurrent) /* { dg-message "note: enclosing region" } */
for (i = 0; i < 64; i++)
t++; /* { dg-error "threadprivate variable 't' used in a region with 'order\\(concurrent\\)' clause" } */
}
@@ -14,8 +14,8 @@ void
f2 (void)
{
int i;
- #pragma omp for simd order(concurrent) /* { dg-error "enclosing region" } */
- for (i = 0; i < 64; i++) /* { dg-error "enclosing region" "" { target c++ } } */
+ #pragma omp for simd order(concurrent) /* { dg-message "note: enclosing region" } */
+ for (i = 0; i < 64; i++) /* { dg-message "note: enclosing region" "" { target c++ } } */
t++; /* { dg-error "threadprivate variable 't' used in a region with 'order\\(concurrent\\)' clause" } */
}
@@ -23,7 +23,7 @@ void
f3 (void)
{
int i;
- #pragma omp for order(concurrent) /* { dg-error "enclosing region" } */
+ #pragma omp for order(concurrent) /* { dg-message "note: enclosing region" } */
for (i = 0; i < 64; i++)
t++; /* { dg-error "threadprivate variable 't' used in a region with 'order\\(concurrent\\)' clause" } */
}
diff --git a/gcc/testsuite/c-c++-common/gomp/pr70550-1.c b/gcc/testsuite/c-c++-common/gomp/pr70550-1.c
index 493d4175993..d0d2fa53e03 100644
--- a/gcc/testsuite/c-c++-common/gomp/pr70550-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/pr70550-1.c
@@ -16,7 +16,7 @@ foo (void)
{
{
int i;
- #pragma omp target defaultmap(tofrom:scalar) /* { dg-bogus "is used uninitialized in this function" } */
+ #pragma omp target defaultmap(tofrom:scalar) /* { dg-bogus "is used uninitialized" } */
{
i = 26;
bar (i);
@@ -24,7 +24,7 @@ foo (void)
}
{
T j;
- #pragma omp target defaultmap(tofrom:scalar) /* { dg-bogus "is used uninitialized in this function" } */
+ #pragma omp target defaultmap(tofrom:scalar) /* { dg-bogus "is used uninitialized" } */
{
j = 37;
bar (j);
@@ -32,7 +32,7 @@ foo (void)
}
{
int i;
- #pragma omp target /* { dg-bogus "is used uninitialized in this function" } */
+ #pragma omp target /* { dg-bogus "is used uninitialized" } */
{
i = 26;
bar (i);
@@ -40,7 +40,7 @@ foo (void)
}
{
T j;
- #pragma omp target /* { dg-bogus "is used uninitialized in this function" } */
+ #pragma omp target /* { dg-bogus "is used uninitialized" } */
{
j = 37;
bar (j);
@@ -48,7 +48,7 @@ foo (void)
}
{
int i;
- #pragma omp target firstprivate (i) /* { dg-warning "is used uninitialized in this function" } */
+ #pragma omp target firstprivate (i) /* { dg-warning "is used uninitialized" } */
{
i = 26;
bar (i);
@@ -56,7 +56,7 @@ foo (void)
}
{
T j;
- #pragma omp target firstprivate (j) /* { dg-warning "is used uninitialized in this function" } */
+ #pragma omp target firstprivate (j) /* { dg-warning "is used uninitialized" } */
{
j = 37;
bar (j);
@@ -64,7 +64,7 @@ foo (void)
}
{
int i;
- #pragma omp target private (i) /* { dg-bogus "is used uninitialized in this function" } */
+ #pragma omp target private (i) /* { dg-bogus "is used uninitialized" } */
{
i = 26;
bar (i);
@@ -72,7 +72,7 @@ foo (void)
}
{
T j;
- #pragma omp target private (j) /* { dg-bogus "is used uninitialized in this function" } */
+ #pragma omp target private (j) /* { dg-bogus "is used uninitialized" } */
{
j = 37;
bar (j);
diff --git a/gcc/testsuite/c-c++-common/gomp/pr70550-2.c b/gcc/testsuite/c-c++-common/gomp/pr70550-2.c
index 31c34da4711..936d907deb8 100644
--- a/gcc/testsuite/c-c++-common/gomp/pr70550-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/pr70550-2.c
@@ -8,45 +8,45 @@ void
foo (void)
{
int i, j, k, l, m, n, o, p, q;
- #pragma omp task /* { dg-bogus "is used uninitialized in this function" } */
+ #pragma omp task /* { dg-bogus "is used uninitialized" } */
{
i = 2;
bar (i);
}
- #pragma omp taskloop /* { dg-bogus "is used uninitialized in this function" } */
+ #pragma omp taskloop /* { dg-bogus "is used uninitialized" } */
for (j = 0; j < 10; j++)
{
k = 7;
bar (k);
}
- #pragma omp task firstprivate (l) /* { dg-warning "is used uninitialized in this function" } */
+ #pragma omp task firstprivate (l) /* { dg-warning "is used uninitialized" } */
{
l = 2;
bar (l);
}
- #pragma omp taskloop firstprivate (m) /* { dg-warning "is used uninitialized in this function" } */
+ #pragma omp taskloop firstprivate (m) /* { dg-warning "is used uninitialized" } */
for (j = 0; j < 10; j++)
{
m = 7;
bar (m);
}
- #pragma omp task shared (n) /* { dg-bogus "is used uninitialized in this function" } */
+ #pragma omp task shared (n) /* { dg-bogus "is used uninitialized" } */
{
n = 2;
bar (n);
}
- #pragma omp taskloop shared (o) /* { dg-bogus "is used uninitialized in this function" } */
+ #pragma omp taskloop shared (o) /* { dg-bogus "is used uninitialized" } */
for (j = 0; j < 10; j++)
{
o = 7;
bar (o);
}
- #pragma omp task private (p) /* { dg-bogus "is used uninitialized in this function" } */
+ #pragma omp task private (p) /* { dg-bogus "is used uninitialized" } */
{
p = 2;
bar (p);
}
- #pragma omp taskloop shared (q) /* { dg-bogus "is used uninitialized in this function" } */
+ #pragma omp taskloop shared (q) /* { dg-bogus "is used uninitialized" } */
for (j = 0; j < 10; j++)
{
q = 7;
diff --git a/gcc/testsuite/c-c++-common/gomp/pr79428-2.c b/gcc/testsuite/c-c++-common/gomp/pr79428-2.c
index a26c462dbbd..0914963b8f9 100644
--- a/gcc/testsuite/c-c++-common/gomp/pr79428-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/pr79428-2.c
@@ -4,4 +4,6 @@ void
foo ()
{
#pragma omp sections
-#pragma omp section /* { dg-error "'#pragma omp section' may only be used in '#pragma omp sections' construct|not allowed|expected" } */
+#pragma omp section /* { dg-error "'#pragma omp section' may only be used in '#pragma omp sections' construct|not allowed" } */
+// { dg-error "expected" "end" { target c } .-1 }
+// { dg-error "-:expected" "end" { target c++ } .+1 }
diff --git a/gcc/testsuite/c-c++-common/gomp/pr94874.c b/gcc/testsuite/c-c++-common/gomp/pr94874.c
new file mode 100644
index 00000000000..9c67f83a5da
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr94874.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fdump-tree-gimple" } */
+
+#include <stddef.h>
+
+size_t
+vla (int array_li)
+{
+ float array[array_li];
+ size_t size1, size2;
+
+#pragma omp parallel default(none) shared(size1, array)
+ size1 = sizeof array;
+
+#pragma omp target defaultmap(none) map(from:size2) map(alloc:array)
+ size2 = sizeof array;
+
+ return size1 + size2;
+}
+
+/* { dg-final { scan-tree-dump "omp parallel .*shared\\(array_li\.\[0-9\]\\)" "gimple" } } */
+/* C */
+/* { dg-final { scan-tree-dump "omp target .*private\\(array_li\.\[0-9\]\\)" "gimple" { target { ! c++ } } } } */
+/* C++ */
+/* { dg-final { scan-tree-dump "omp target .*firstprivate\\(array_li\.\[0-9\]\\)" "gimple" { target { c++ } } } } */
diff --git a/gcc/testsuite/c-c++-common/gomp/pr96424.c b/gcc/testsuite/c-c++-common/gomp/pr96424.c
new file mode 100644
index 00000000000..2a3dd007730
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr96424.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/96424 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -O0 -fexceptions -fnon-call-exceptions -fprofile-use -Wno-missing-profile" } */
+
+void
+foo (void)
+{
+ int i, j;
+#pragma omp for collapse (2)
+ for (i = 0; i < 10; ++i)
+ for (j = 0; j <= i; ++j)
+ ;
+}
+
+void
+bar (void)
+{
+ int i, j;
+#pragma omp for collapse (2)
+ for (i = 0; i < 10; ++i)
+ for (j = 0; j < i; ++j)
+ ;
+}
diff --git a/gcc/testsuite/c-c++-common/gomp/schedule-modifiers-2.c b/gcc/testsuite/c-c++-common/gomp/schedule-modifiers-2.c
new file mode 100644
index 00000000000..79d7d432450
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/schedule-modifiers-2.c
@@ -0,0 +1,14 @@
+void
+foo (void)
+{
+ int i = 0;
+ #pragma omp for simd schedule(simd, static) /* { dg-error "expected ':'" } */
+ for (i = 0; i < 16; i++)
+ ;
+ #pragma omp for simd schedule(monotonic, dynamic) /* { dg-error "expected ':'" } */
+ for (i = 0; i < 16; i++)
+ ;
+ #pragma omp for simd schedule(nonmonotonic, guided, 1) /* { dg-error "expected ':'" } */
+ for (i = 0; i < 16; i++)
+ ;
+}
diff --git a/gcc/testsuite/c-c++-common/missing-close-func-paren.c b/gcc/testsuite/c-c++-common/missing-close-func-paren.c
new file mode 100644
index 00000000000..3177e250e1c
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/missing-close-func-paren.c
@@ -0,0 +1,40 @@
+/* { dg-options "-fdiagnostics-show-caret" } */
+
+/* Verify that the C/C++ frontends show the pertinent opening symbol when
+ a closing symbol is missing for a function call. */
+
+/* Verify that, when they are on the same line, that the opening symbol is
+ shown as a secondary range within the main diagnostic. */
+
+extern int __attribute__((const)) foo (int a, int b, int c);
+
+void single_func ()
+{
+ int single =
+ foo (1, (1 + 2), (1 + 2 + 3):); /* { dg-error "expected '\\)' before ':' token" } */
+ /* { dg-begin-multiline-output "" }
+ foo (1, (1 + 2), (1 + 2 + 3):);
+ ~ ^
+ )
+ { dg-end-multiline-output "" } */
+}
+
+/* Verify that, when they are on different lines, that the opening symbol is
+ shown via a secondary diagnostic. */
+
+void multi_func ()
+{
+ int multi =
+ foo (1, /* { dg-message "to match this '\\('" } */
+ (1 + 2),
+ (1 + 2 + 3):); /* { dg-error "expected '\\)' before ':' token" } */
+ /* { dg-begin-multiline-output "" }
+ (1 + 2 + 3):);
+ ^
+ )
+ { dg-end-multiline-output "" } */
+ /* { dg-begin-multiline-output "" }
+ foo (1,
+ ^
+ { dg-end-multiline-output "" } */
+}
diff --git a/gcc/testsuite/c-c++-common/missing-close-symbol.c b/gcc/testsuite/c-c++-common/missing-close-symbol.c
index abeb83748c1..9f1de3d0c47 100644
--- a/gcc/testsuite/c-c++-common/missing-close-symbol.c
+++ b/gcc/testsuite/c-c++-common/missing-close-symbol.c
@@ -24,9 +24,9 @@ void test_static_assert_different_line (void)
_Static_assert(sizeof(int) >= sizeof(char), /* { dg-message "to match this '\\('" } */
"msg"; /* { dg-error "expected '\\)' before ';' token" } */
/* { dg-begin-multiline-output "" }
- "msg";
- ^
- )
+ "msg";
+ ^
+ )
{ dg-end-multiline-output "" } */
/* { dg-begin-multiline-output "" }
_Static_assert(sizeof(int) >= sizeof(char),
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
index 4f707b31f0d..3ce7a5b8790 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
@@ -1,7 +1,7 @@
/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
/* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */
-/* { dg-final { scan-assembler-times "nop|NOP" 2 { target { ! { alpha*-*-* } } } } } */
+/* { dg-final { scan-assembler-times "nop|NOP|SWYM" 2 { target { ! { alpha*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 2 { target alpha*-*-* } } } */
extern int a;
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
index 97d8a81fbc6..7036f7bfbea 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
@@ -1,7 +1,7 @@
/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
/* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */
-/* { dg-final { scan-assembler-times "nop|NOP" 3 { target { ! { alpha*-*-* } } } } } */
+/* { dg-final { scan-assembler-times "nop|NOP|SWYM" 3 { target { ! { alpha*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 3 { target alpha*-*-* } } } */
extern int a;
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
index ab94533ffec..ad7d7a9e076 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
@@ -1,7 +1,7 @@
/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
/* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */
-/* { dg-final { scan-assembler-times "nop|NOP" 1 { target { ! { alpha*-*-* } } } } } */
+/* { dg-final { scan-assembler-times "nop|NOP|SWYM" 1 { target { ! { alpha*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 1 { target alpha*-*-* } } } */
extern int a;
diff --git a/gcc/testsuite/c-c++-common/pr28656.c b/gcc/testsuite/c-c++-common/pr28656.c
index 903d7e51f1d..ed97f6c4cb3 100644
--- a/gcc/testsuite/c-c++-common/pr28656.c
+++ b/gcc/testsuite/c-c++-common/pr28656.c
@@ -18,12 +18,12 @@ void
foo (void)
{
memcpy (0, 0, 0);
- /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 1" "" { target *-*-* } .-1 } */
- /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 2" "" { target *-*-* } .-2 } */
+ /* { dg-warning "argument 1 null where non-null expected" "" { target *-*-* } .-1 } */
+ /* { dg-warning "argument 2 null where non-null expected" "" { target *-*-* } .-2 } */
bar (0, 0, 0, 0, 0);
- /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 1" "" { target *-*-* } .-1 } */
- /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 3" "" { target *-*-* } .-2 } */
- /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 4" "" { target *-*-* } .-3 } */
- /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 5" "" { target *-*-* } .-4 } */
+ /* { dg-warning "argument 1 null where non-null expected" "" { target *-*-* } .-1 } */
+ /* { dg-warning "argument 3 null where non-null expected" "" { target *-*-* } .-2 } */
+ /* { dg-warning "argument 4 null where non-null expected" "" { target *-*-* } .-3 } */
+ /* { dg-warning "argument 5 null where non-null expected" "" { target *-*-* } .-4 } */
}
diff --git a/gcc/testsuite/c-c++-common/pr51628-13.c b/gcc/testsuite/c-c++-common/pr51628-13.c
index 0edd5e7f84d..b77e16c408f 100644
--- a/gcc/testsuite/c-c++-common/pr51628-13.c
+++ b/gcc/testsuite/c-c++-common/pr51628-13.c
@@ -6,4 +6,4 @@ struct B { int i; };
struct C { struct B b; } __attribute__ ((packed));
int* h4 (struct C *p) { return &p->b.i; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/c-c++-common/pr51628-15.c b/gcc/testsuite/c-c++-common/pr51628-15.c
index bcac6d70ad5..2ce3406481f 100644
--- a/gcc/testsuite/c-c++-common/pr51628-15.c
+++ b/gcc/testsuite/c-c++-common/pr51628-15.c
@@ -10,5 +10,5 @@ int*
f (struct A *p, int *q)
{
return q ? q : &p->i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/c-c++-common/pr51628-16.c b/gcc/testsuite/c-c++-common/pr51628-16.c
index cd502fe76b8..b02cd8df1fc 100644
--- a/gcc/testsuite/c-c++-common/pr51628-16.c
+++ b/gcc/testsuite/c-c++-common/pr51628-16.c
@@ -8,6 +8,6 @@ struct B {
} b;
int *p = (int*)&b.a.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
int *q = (int*)&b.a;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/c-c++-common/pr51628-26.c b/gcc/testsuite/c-c++-common/pr51628-26.c
index 2042379860a..5ca381dba5d 100644
--- a/gcc/testsuite/c-c++-common/pr51628-26.c
+++ b/gcc/testsuite/c-c++-common/pr51628-26.c
@@ -15,19 +15,19 @@ void
foo1 (void)
{
addr = (i = -1, &p.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
void
foo2 (void)
{
addr = (i = -1, j = -2, &p.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
void
foo3 (void)
{
addr = (i = -1, (j = -2, &p.i));
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/c-c++-common/pr51628-27.c b/gcc/testsuite/c-c++-common/pr51628-27.c
index 9ae1efd7afb..016a68f6549 100644
--- a/gcc/testsuite/c-c++-common/pr51628-27.c
+++ b/gcc/testsuite/c-c++-common/pr51628-27.c
@@ -9,4 +9,4 @@ struct C { struct B b; };
extern struct C *p;
int* g8 (void) { return &p->b.a.i; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/c-c++-common/pr51628-28.c b/gcc/testsuite/c-c++-common/pr51628-28.c
index 3cc1fec1f71..80d0c605670 100644
--- a/gcc/testsuite/c-c++-common/pr51628-28.c
+++ b/gcc/testsuite/c-c++-common/pr51628-28.c
@@ -11,9 +11,9 @@ foo3 (struct A *p1, int *q1, int *q2, struct A *p2)
{
return (q1
? &p1->i
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
: (q2 ? &p2->i : q2));
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
int*
@@ -21,11 +21,11 @@ foo4 (struct A *p1, int **q1, int *q2, int *q3, struct A *p2)
{
return (q1
? (*q1 = q2, &p1->i)
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
: (q2
? (*q1 = &p1->i,
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
*q2 = 2, &p2->i)
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
: q2));
}
diff --git a/gcc/testsuite/c-c++-common/pr51628-29.c b/gcc/testsuite/c-c++-common/pr51628-29.c
index 94b3722d2c8..1ad9a7d2d9f 100644
--- a/gcc/testsuite/c-c++-common/pr51628-29.c
+++ b/gcc/testsuite/c-c++-common/pr51628-29.c
@@ -5,6 +5,7 @@
struct A { int i; };
struct B { struct A a; };
struct C { struct B b __attribute__ ((packed)); };
+/* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
extern struct C *p;
@@ -12,5 +13,5 @@ int*
g8 (void)
{
return &p->b.a.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/c-c++-common/pr51628-3.c b/gcc/testsuite/c-c++-common/pr51628-3.c
index 0ea94c845a0..805ce7d0509 100644
--- a/gcc/testsuite/c-c++-common/pr51628-3.c
+++ b/gcc/testsuite/c-c++-common/pr51628-3.c
@@ -13,7 +13,7 @@ extern int *x;
extern void bar (int *);
int *addr = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
int *
foo (void)
@@ -21,15 +21,15 @@ foo (void)
struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } };
int *p0, *p1;
p0 = &arr[0].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
bar (p0);
p1 = &arr[1].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
bar (p1);
bar (&p.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
x = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
return &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/c-c++-common/pr51628-30.c b/gcc/testsuite/c-c++-common/pr51628-30.c
index 578edf4e8f9..387fc71db13 100644
--- a/gcc/testsuite/c-c++-common/pr51628-30.c
+++ b/gcc/testsuite/c-c++-common/pr51628-30.c
@@ -5,6 +5,7 @@
struct A { __complex int i; };
struct B { struct A a; };
struct C { struct B b __attribute__ ((packed)); };
+/* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
extern struct C *p;
@@ -12,12 +13,12 @@ int*
foo1 (void)
{
return &__real(p->b.a.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
int*
foo2 (void)
{
return &__imag(p->b.a.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/c-c++-common/pr51628-31.c b/gcc/testsuite/c-c++-common/pr51628-31.c
index 9730f53f582..b2963581dcb 100644
--- a/gcc/testsuite/c-c++-common/pr51628-31.c
+++ b/gcc/testsuite/c-c++-common/pr51628-31.c
@@ -12,5 +12,5 @@ int *
foo()
{
return &x.x[1];
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/c-c++-common/pr51628-32.c b/gcc/testsuite/c-c++-common/pr51628-32.c
index a62e57d5b46..908c0b8cbf4 100644
--- a/gcc/testsuite/c-c++-common/pr51628-32.c
+++ b/gcc/testsuite/c-c++-common/pr51628-32.c
@@ -11,9 +11,10 @@ struct B
{
char c;
__attribute ((packed)) struct A ar[4];
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
};
struct B b;
int *p = &b.ar[1].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/c-c++-common/pr51628-33.c b/gcc/testsuite/c-c++-common/pr51628-33.c
index 0092f32202f..6b5e277b7c6 100644
--- a/gcc/testsuite/c-c++-common/pr51628-33.c
+++ b/gcc/testsuite/c-c++-common/pr51628-33.c
@@ -15,5 +15,5 @@ void
foo (struct pair_t *p)
{
bar (p ? p->i : (int *) 0);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/c-c++-common/pr51628-35.c b/gcc/testsuite/c-c++-common/pr51628-35.c
index 20877792fd8..fa37d99beb7 100644
--- a/gcc/testsuite/c-c++-common/pr51628-35.c
+++ b/gcc/testsuite/c-c++-common/pr51628-35.c
@@ -12,12 +12,12 @@ long *
foo1 (void)
{
return (long *) p;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
long *
foo2 (void)
{
return (long *) bar ();
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/c-c++-common/pr51628-4.c b/gcc/testsuite/c-c++-common/pr51628-4.c
index c4c1fb72d6d..ba88f5d0a39 100644
--- a/gcc/testsuite/c-c++-common/pr51628-4.c
+++ b/gcc/testsuite/c-c++-common/pr51628-4.c
@@ -13,7 +13,7 @@ extern int *x;
extern void bar (int *);
int *addr = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
int *
foo (void)
@@ -21,15 +21,15 @@ foo (void)
struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } };
int *p0, *p1;
p0 = &arr[0].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
bar (p0);
p1 = &arr[1].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
bar (p1);
bar (&p.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
x = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
return &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/c-c++-common/pr51628-5.c b/gcc/testsuite/c-c++-common/pr51628-5.c
index 9d7c309a0ef..86d01e9f3b3 100644
--- a/gcc/testsuite/c-c++-common/pr51628-5.c
+++ b/gcc/testsuite/c-c++-common/pr51628-5.c
@@ -13,7 +13,7 @@ extern int *x;
extern void bar (int *);
int *addr = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
int *
foo (void)
@@ -21,15 +21,15 @@ foo (void)
struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } };
int *p0, *p1;
p0 = &arr[0].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
bar (p0);
p1 = &arr[1].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
bar (p1);
bar (&p.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
x = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
return &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/c-c++-common/pr51628-6.c b/gcc/testsuite/c-c++-common/pr51628-6.c
index 52aa07a4cf3..e7be7fbffc5 100644
--- a/gcc/testsuite/c-c++-common/pr51628-6.c
+++ b/gcc/testsuite/c-c++-common/pr51628-6.c
@@ -13,7 +13,7 @@ extern int *x;
extern void bar (int *);
int *addr = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
int *
foo (void)
@@ -21,15 +21,15 @@ foo (void)
struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } };
int *p0, *p1;
p0 = &arr[0].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
bar (p0);
p1 = &arr[1].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
bar (p1);
bar (&p.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
x = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
return &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/c-c++-common/pr51628-8.c b/gcc/testsuite/c-c++-common/pr51628-8.c
index cc2dae096ae..dd4f1904c11 100644
--- a/gcc/testsuite/c-c++-common/pr51628-8.c
+++ b/gcc/testsuite/c-c++-common/pr51628-8.c
@@ -13,24 +13,24 @@ extern int *x;
extern void bar (int *);
int *addr = p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
int *
foo (struct pair_t *p)
{
int *p0, *p1;
p0 = p->i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
bar (p0);
p1 = &p->i[1];
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
bar (p1);
bar (p->i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
bar (&p->i[2]);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
x = p->i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
return &p->i[3];
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/c-c++-common/pr51628-9.c b/gcc/testsuite/c-c++-common/pr51628-9.c
index 0470aa3b93d..aa3d5292d43 100644
--- a/gcc/testsuite/c-c++-common/pr51628-9.c
+++ b/gcc/testsuite/c-c++-common/pr51628-9.c
@@ -13,24 +13,24 @@ extern int *x;
extern void bar (int *);
int *addr = p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
int *
foo (struct pair_t *p)
{
int *p0, *p1;
p0 = p->i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
bar (p0);
p1 = &p->i[1];
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
bar (p1);
bar (p->i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
bar (&p->i[2]);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
x = p->i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
return &p->i[3];
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/c-c++-common/pr56493.c b/gcc/testsuite/c-c++-common/pr56493.c
index bc9928da941..3d85b5503be 100644
--- a/gcc/testsuite/c-c++-common/pr56493.c
+++ b/gcc/testsuite/c-c++-common/pr56493.c
@@ -12,4 +12,4 @@ foo (void)
}
/* Verify we narrow the addition from unsigned long long to unsigned int type. */
-/* { dg-final { scan-tree-dump " (\[a-zA-Z._0-9$]*) = \\(unsigned int\\) \[^;\n\r]*;.* (\[a-zA-Z._0-9$]*) = \\(unsigned int\\) \[^;\n\r]*;.* = \\1 \\+ \\2;" "gimple" { target { ilp32 || lp64 } } } } */
+/* { dg-final { scan-tree-dump " (\[a-zA-Z._0-9$:]*) = \\(unsigned int\\) \[^;\n\r]*;.* (\[a-zA-Z._0-9$:]*) = \\(unsigned int\\) \[^;\n\r]*;.* = \\1 \\+ \\2;" "gimple" { target { ilp32 || lp64 } } } } */
diff --git a/gcc/testsuite/c-c++-common/pr59223.c b/gcc/testsuite/c-c++-common/pr59223.c
index 471c0625df3..f91e4430058 100644
--- a/gcc/testsuite/c-c++-common/pr59223.c
+++ b/gcc/testsuite/c-c++-common/pr59223.c
@@ -9,5 +9,5 @@ int foo (int x)
y = 1;
else if (x == 1)
y = 2;
- return y; /* { dg-warning "may be used uninitialized in this function" } */
+ return y; /* { dg-warning "may be used uninitialized" } */
}
diff --git a/gcc/testsuite/c-c++-common/pr66208.c b/gcc/testsuite/c-c++-common/pr66208.c
index d394c42b76d..fd67373042b 100644
--- a/gcc/testsuite/c-c++-common/pr66208.c
+++ b/gcc/testsuite/c-c++-common/pr66208.c
@@ -2,7 +2,7 @@
/* { dg-options "-Wnonnull" } */
void foox (char*, ...) __attribute__ ((nonnull (1)));
-#define foo(p) foox (p, "p is null") /* { dg-warning "null argument" } */
+#define foo(p) foox (p, "p is null") /* { dg-warning "argument 1 null" } */
void baz (void)
{
diff --git a/gcc/testsuite/c-c++-common/pr81376.c b/gcc/testsuite/c-c++-common/pr81376.c
index e67f41e7356..f96a840d6f1 100644
--- a/gcc/testsuite/c-c++-common/pr81376.c
+++ b/gcc/testsuite/c-c++-common/pr81376.c
@@ -35,7 +35,14 @@ void f4(unsigned short a, int b)
{
volatile int us_i;
us_i = (double) a < (double) b;
- /* { dg-final { scan-tree-dump "us_i = \\(int\\) a < b" "original" } } */
+ /* { dg-final { scan-tree-dump "us_i = \\(int\\) a < b" "original" { target { ! short_eq_int } } } } */
+}
+
+void f4_short_eq_int(unsigned short a, long b)
+{
+ volatile long us_l;
+ us_l = (double) a < (double) b;
+ /* { dg-final { scan-tree-dump "us_l = \\(long int\\) a < b" "original" { target { short_eq_int } } } } */
}
/* We don't optimize here because neither of integral types is
diff --git a/gcc/testsuite/c-c++-common/pr88664-2.c b/gcc/testsuite/c-c++-common/pr88664-2.c
index d2d880a66d7..9a81b751802 100644
--- a/gcc/testsuite/c-c++-common/pr88664-2.c
+++ b/gcc/testsuite/c-c++-common/pr88664-2.c
@@ -11,12 +11,12 @@ void **
fun1 (struct data *p)
{
return &p->ptr;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
int *
fun2 (struct data *p, int *x)
{
return p ? (*x = 1, (int *) &p->ptr) : (int *) 0;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/c-c++-common/pr95237-1.c b/gcc/testsuite/c-c++-common/pr95237-1.c
new file mode 100644
index 00000000000..8947a9fed26
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr95237-1.c
@@ -0,0 +1,16 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ia32 } */
+/* { dg-options "-mpreferred-stack-boundary=2" { target { i?86-*-* x86_64-*-* } } } */
+typedef __UINTPTR_TYPE__ uintptr_t;
+void __attribute__((noipa)) foo (long long *p, uintptr_t a)
+{
+ if ((uintptr_t)p & (a-1))
+ __builtin_abort ();
+}
+int main()
+{
+ long long x;
+ uintptr_t a = __alignof__(x);
+ foo(&x, a);
+ return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/pr95237-2.c b/gcc/testsuite/c-c++-common/pr95237-2.c
new file mode 100644
index 00000000000..87949a9e122
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr95237-2.c
@@ -0,0 +1,10 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ia32 } */
+/* { dg-options "-mpreferred-stack-boundary=2" { target { i?86-*-* x86_64-*-* } } } */
+long long x;
+int main()
+{
+ if (__alignof__(x) != 8)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/pr95237-3.c b/gcc/testsuite/c-c++-common/pr95237-3.c
new file mode 100644
index 00000000000..6941b6f154b
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr95237-3.c
@@ -0,0 +1,10 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ia32 } */
+/* { dg-options "-mpreferred-stack-boundary=2" { target { i?86-*-* x86_64-*-* } } } */
+int main()
+{
+ long long x;
+ if (__alignof__(x) != 4)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/pr95237-4.c b/gcc/testsuite/c-c++-common/pr95237-4.c
new file mode 100644
index 00000000000..deace53cc26
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr95237-4.c
@@ -0,0 +1,10 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ia32 } */
+/* { dg-options "-mpreferred-stack-boundary=4" { target { i?86-*-* x86_64-*-* } } } */
+int main()
+{
+ long long x;
+ if (__alignof__(x) != 8)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/pr95237-5.c b/gcc/testsuite/c-c++-common/pr95237-5.c
new file mode 100644
index 00000000000..9dc5cfcd739
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr95237-5.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-mpreferred-stack-boundary=2 -Os -w" { target { i?86-*-* x86_64-*-* } } } */
+
+int a;
+
+long long __attribute__((noinline))
+b (void)
+{
+}
+
+void
+c (void)
+{
+ if (b())
+ a = 1;
+}
diff --git a/gcc/testsuite/c-c++-common/pr95237-6.c b/gcc/testsuite/c-c++-common/pr95237-6.c
new file mode 100644
index 00000000000..5e7396d7f4e
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr95237-6.c
@@ -0,0 +1,24 @@
+/* { dg-do run { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-options "-O2" } */
+#include <stddef.h>
+#ifdef __x86_64__
+# define EXP_ALIGN 8
+#else
+# define EXP_ALIGN 4
+#endif
+
+struct test
+{
+ char a;
+ long long b;
+};
+struct test global_var;
+int main()
+{
+ struct test local_var;
+ if (__alignof__(global_var) != EXP_ALIGN
+ || __alignof__(local_var) != EXP_ALIGN
+ || offsetof(struct test, b) != EXP_ALIGN)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/pr95237-7.c b/gcc/testsuite/c-c++-common/pr95237-7.c
new file mode 100644
index 00000000000..8410009d00e
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr95237-7.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ia32 } */
+/* { dg-options "-mpreferred-stack-boundary=2" { target { i?86-*-* x86_64-*-* } } } */
+#include <stddef.h>
+struct test
+{
+ char a;
+ long long b;
+};
+struct test global_var;
+int main()
+{
+ struct test local_var;
+ if (__alignof__(global_var) != 4
+ || __alignof__(local_var) != 4
+ || offsetof(struct test, b) != 4)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/pr95237-8.c b/gcc/testsuite/c-c++-common/pr95237-8.c
new file mode 100644
index 00000000000..8ba98abafc9
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr95237-8.c
@@ -0,0 +1,10 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ia32 } */
+/* { dg-options "-mpreferred-stack-boundary=2" { target { i?86-*-* x86_64-*-* } } } */
+int main()
+{
+ extern long long x;
+ if (__alignof__(x) != 8)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/pr95237-9.c b/gcc/testsuite/c-c++-common/pr95237-9.c
new file mode 100644
index 00000000000..687517cbc0a
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr95237-9.c
@@ -0,0 +1,10 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ia32 } */
+/* { dg-options "-mpreferred-stack-boundary=2" { target { i?86-*-* x86_64-*-* } } } */
+int main()
+{
+ static long long x;
+ if (__alignof__(x) != 8)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/pr95378.c b/gcc/testsuite/c-c++-common/pr95378.c
new file mode 100644
index 00000000000..a547d1febf5
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr95378.c
@@ -0,0 +1,111 @@
+/* { dg-do compile } */
+
+#define seq_cst __ATOMIC_SEQ_CST
+
+extern int *i;
+extern int *j;
+extern const int *c;
+extern volatile int *v;
+extern const volatile int *cv;
+
+void
+load()
+{
+ __atomic_load(c, i, seq_cst);
+ __atomic_load(cv, i, seq_cst);
+
+ __atomic_load(i, c, seq_cst);
+ /* { dg-error "argument 2 of '__atomic_load' must not be a pointer to a 'const' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 2 of '__atomic_load' discards 'const' qualifier" "" { target c } .-2 } */
+ __atomic_load(i, v, seq_cst);
+ /* { dg-error "argument 2 of '__atomic_load' must not be a pointer to a 'volatile' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 2 of '__atomic_load' discards 'volatile' qualifier" "" { target c } .-2 } */
+ __atomic_load(i, cv, seq_cst);
+ /* { dg-error "argument 2 of '__atomic_load' must not be a pointer to a 'const' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 2 of '__atomic_load' discards 'const' qualifier" "" { target c } .-2 } */
+ /* { dg-warning "argument 2 of '__atomic_load' discards 'volatile' qualifier" "" { target c } .-3 } */
+}
+
+void
+store()
+{
+ __atomic_store(i, c, seq_cst);
+ __atomic_store(v, c, seq_cst);
+
+ __atomic_store(c, i, seq_cst);
+ /* { dg-error "argument 1 of '__atomic_store' must not be a pointer to a 'const' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 1 of '__atomic_store' discards 'const' qualifier" "" { target c } .-2 } */
+ __atomic_store(cv, i, seq_cst);
+ /* { dg-error "argument 1 of '__atomic_store' must not be a pointer to a 'const' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 1 of '__atomic_store' discards 'const' qualifier" "" { target c } .-2 } */
+
+ __atomic_store(i, v, seq_cst);
+ /* { dg-error "argument 2 of '__atomic_store' must not be a pointer to a 'volatile' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 2 of '__atomic_store' discards 'volatile' qualifier" "" { target c } .-2 } */
+}
+
+void
+exchange()
+{
+ __atomic_exchange(i, c, j, seq_cst);
+ __atomic_exchange(v, i, j, seq_cst);
+ __atomic_exchange(v, c, j, seq_cst);
+
+ __atomic_exchange(c, i, j, seq_cst);
+ /* { dg-error "argument 1 of '__atomic_exchange' must not be a pointer to a 'const' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 1 of '__atomic_exchange' discards 'const' qualifier" "" { target c } .-2 } */
+ __atomic_exchange(cv, i, j, seq_cst);
+ /* { dg-error "argument 1 of '__atomic_exchange' must not be a pointer to a 'const' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 1 of '__atomic_exchange' discards 'const' qualifier" "" { target c } .-2 } */
+
+ __atomic_exchange(i, v, j, seq_cst);
+ /* { dg-error "argument 2 of '__atomic_exchange' must not be a pointer to a 'volatile' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 2 of '__atomic_exchange' discards 'volatile' qualifier" "" { target c } .-2 } */
+ __atomic_exchange(i, cv, j, seq_cst);
+ /* { dg-error "argument 2 of '__atomic_exchange' must not be a pointer to a 'volatile' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 2 of '__atomic_exchange' discards 'volatile' qualifier" "" { target c } .-2 } */
+
+ __atomic_exchange(i, j, c, seq_cst);
+ /* { dg-error "argument 3 of '__atomic_exchange' must not be a pointer to a 'const' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 3 of '__atomic_exchange' discards 'const' qualifier" "" { target c } .-2 } */
+ __atomic_exchange(i, j, v, seq_cst);
+ /* { dg-error "argument 3 of '__atomic_exchange' must not be a pointer to a 'volatile' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 3 of '__atomic_exchange' discards 'volatile' qualifier" "" { target c } .-2 } */
+ __atomic_exchange(i, j, cv, seq_cst);
+ /* { dg-error "argument 3 of '__atomic_exchange' must not be a pointer to a 'const' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 3 of '__atomic_exchange' discards 'const' qualifier" "" { target c } .-2 } */
+ /* { dg-warning "argument 3 of '__atomic_exchange' discards 'volatile' qualifier" "" { target c } .-3 } */
+}
+
+void
+compare_exchange()
+{
+ __atomic_compare_exchange(i, j, c, 1, seq_cst, seq_cst);
+ __atomic_compare_exchange(v, i, j, 1, seq_cst, seq_cst);
+ __atomic_compare_exchange(v, i, c, 1, seq_cst, seq_cst);
+
+ __atomic_compare_exchange(c, i, j, 1, seq_cst, seq_cst);
+ /* { dg-error "argument 1 of '__atomic_compare_exchange' must not be a pointer to a 'const' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 1 of '__atomic_compare_exchange' discards 'const' qualifier" "" { target c } .-2 } */
+ __atomic_compare_exchange(cv, i, j, 1, seq_cst, seq_cst);
+ /* { dg-error "argument 1 of '__atomic_compare_exchange' must not be a pointer to a 'const' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 1 of '__atomic_compare_exchange' discards 'const' qualifier" "" { target c } .-2 } */
+
+ __atomic_compare_exchange(i, c, j, 1, seq_cst, seq_cst);
+ /* { dg-error "argument 2 of '__atomic_compare_exchange' must not be a pointer to a 'const' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 2 of '__atomic_compare_exchange' discards 'const' qualifier" "" { target c } .-2 } */
+ __atomic_compare_exchange(i, v, j, 1, seq_cst, seq_cst);
+ /* { dg-error "argument 2 of '__atomic_compare_exchange' must not be a pointer to a 'volatile' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 2 of '__atomic_compare_exchange' discards 'volatile' qualifier" "" { target c } .-2 } */
+ __atomic_compare_exchange(i, cv, j, 1, seq_cst, seq_cst);
+ /* { dg-error "argument 2 of '__atomic_compare_exchange' must not be a pointer to a 'const' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 2 of '__atomic_compare_exchange' discards 'const" "" { target c } .-2 } */
+ /* { dg-warning "argument 2 of '__atomic_compare_exchange' discards 'volatile' qualifier" "" { target c } .-3 } */
+
+ __atomic_compare_exchange(i, j, v, 1, seq_cst, seq_cst);
+ /* { dg-error "argument 3 of '__atomic_compare_exchange' must not be a pointer to a 'volatile' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 3 of '__atomic_compare_exchange' discards 'volatile' qualifier" "" { target c } .-2 } */
+ __atomic_compare_exchange(i, j, cv, 1, seq_cst, seq_cst);
+ /* { dg-error "argument 3 of '__atomic_compare_exchange' must not be a pointer to a 'volatile' type" "" { target c++ } .-1 } */
+ /* { dg-warning "argument 3 of '__atomic_compare_exchange' discards 'volatile' qualifier" "" { target c } .-2 } */
+}
diff --git a/gcc/testsuite/c-c++-common/pr95903.c b/gcc/testsuite/c-c++-common/pr95903.c
new file mode 100644
index 00000000000..6e9f68e200f
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr95903.c
@@ -0,0 +1,19 @@
+/* PR middle-end/95903 */
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-O2 -fwrapv -fdump-tree-optimized" } */
+/* Verify that for -fwrapv the + 1 addition is performed in the parameter's
+ type before sign extending it. */
+/* { dg-final { scan-tree-dump-times "off_\[0-9]+\\\(D\\\) \\+ 1" 2 "optimized" } } */
+
+char
+foo (const char *ptr, int off)
+{
+ off += 1;
+ return ptr[off];
+}
+
+char
+bar (const char *ptr, int off)
+{
+ return ptr[off + 1];
+}
diff --git a/gcc/testsuite/c-c++-common/pr96192-1.c b/gcc/testsuite/c-c++-common/pr96192-1.c
new file mode 100644
index 00000000000..4d9be06a045
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr96192-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-mpreferred-stack-boundary=2 -Os -w" } */
+
+int a;
+
+long long
+b (void)
+{
+}
+
+void
+c (void)
+{
+ if (b())
+ a = 1;
+}
diff --git a/gcc/testsuite/c-c++-common/pr96369.c b/gcc/testsuite/c-c++-common/pr96369.c
new file mode 100644
index 00000000000..8c468d9fec2
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr96369.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+int main()
+{
+ const long ONE = 1L;
+ long y = 0L;
+ long x = ((long) (ONE || (y = 1L)) % 8L);
+ if (y != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/pr96545.c b/gcc/testsuite/c-c++-common/pr96545.c
new file mode 100644
index 00000000000..bc6b0cf345c
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr96545.c
@@ -0,0 +1,31 @@
+/* PR c/96545 */
+/* { dg-do compile } */
+
+extern char x[], y[], z[];
+struct S;
+extern struct S s, t, u;
+int v, w;
+
+void
+foo (void)
+{
+ __atomic_exchange (&x, &y, &z, 0); /* { dg-error "must be a pointer to a complete type" } */
+}
+
+void
+bar (void)
+{
+ __atomic_exchange (&s, &t, &u, 0); /* { dg-error "must be a pointer to a complete type" } */
+}
+
+void
+baz (void)
+{
+ __atomic_exchange (&v, &t, &w, 0); /* { dg-error "size mismatch in argument 2 of" } */
+}
+
+void
+qux (void)
+{
+ __atomic_exchange (&v, &w, &t, 0); /* { dg-error "size mismatch in argument 3 of" } */
+}
diff --git a/gcc/testsuite/c-c++-common/raw-string-14.c b/gcc/testsuite/c-c++-common/raw-string-14.c
index b2e395c3f73..fba826c4c51 100644
--- a/gcc/testsuite/c-c++-common/raw-string-14.c
+++ b/gcc/testsuite/c-c++-common/raw-string-14.c
@@ -4,36 +4,33 @@
// { dg-options "-std=c++11" { target c++ } }
const void *s0 = R"abc\
-def()abcdef";
- // { dg-error "invalid character" "invalid" { target *-*-* } 6 }
- // { dg-error "stray" "stray" { target *-*-* } 6 }
+def()abcdef" 0;
+ // { dg-error "invalid character" "invalid" { target *-*-* } .-2 }
+ // { dg-error "stray" "stray" { target *-*-* } .-3 }
const void *s1 = R"??/
-()??/";
- // { dg-error "invalid new-line" "invalid" { target *-*-* } 10 }
- // { dg-error "stray" "stray" { target *-*-* } 10 }
- // { dg-warning "missing terminating" "missing" { target *-*-* } 10 }
- // { dg-error "19:missing terminating" "missing" { target *-*-* } 10 }
-const void *s2 = R"abcdefghijklmn??/(a)abcdefghijklmn???";
+()??/" 0;
+ // { dg-error "invalid new-line" "invalid" { target *-*-* } .-2 }
+ // { dg-error "stray" "stray" { target *-*-* } .-3 }
+const void *s2 = R"abcdefghijklmn??/(a)abcdefghijklmn???" 0;
// { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
// { dg-error "stray" "stray" { target *-*-* } .-2 }
- // { dg-error "expected" "expected" { target *-*-* } .-3 }
-const void *s3 = R"abcdefghijklmno??/(a)abcdefghijklmno???";
+const void *s3 = R"abcdefghijklmno??/(a)abcdefghijklmno???" 0;
// { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
// { dg-error "stray" "stray" { target *-*-* } .-2 }
-const void *s4 = R"abcdefghijklmnop??=(a)abcdefghijklmnop??=";
+const void *s4 = R"abcdefghijklmnop??=(a)abcdefghijklmnop??=" 0;
// { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
// { dg-error "stray" "stray" { target *-*-* } .-2 }
const void *s5 = R"abc\
-()abcdef";
- // { dg-error "invalid character" "invalid" { target *-*-* } 26 }
- // { dg-error "stray" "stray" { target *-*-* } 26 }
+()abcdef" 0;
+ // { dg-error "invalid character" "invalid" { target *-*-* } .-2 }
+ // { dg-error "stray" "stray" { target *-*-* } .-3 }
const void *s6 = R"\
-()";
- // { dg-error "invalid character" "invalid" { target *-*-* } 30 }
- // { dg-error "stray" "stray" { target *-*-* } 30 }
+()" 0;
+ // { dg-error "invalid character" "invalid" { target *-*-* } .-2 }
+ // { dg-error "stray" "stray" { target *-*-* } .-3 }
const void *s7 = R"\
-a()a";
- // { dg-error "invalid character" "invalid" { target *-*-* } 34 }
- // { dg-error "stray" "stray" { target *-*-* } 34 }
+a()a" 0;
+ // { dg-error "invalid character" "invalid" { target *-*-* } .-2 }
+ // { dg-error "stray" "stray" { target *-*-* } .-3 }
int main () {}
diff --git a/gcc/testsuite/c-c++-common/raw-string-16.c b/gcc/testsuite/c-c++-common/raw-string-16.c
index 1185c0e377e..1bf16dd5a1e 100644
--- a/gcc/testsuite/c-c++-common/raw-string-16.c
+++ b/gcc/testsuite/c-c++-common/raw-string-16.c
@@ -4,29 +4,29 @@
// { dg-options "-std=gnu++11 -Wtrigraphs" { target c++ } }
const void *s0 = R"abc\
-def()abcdef";
+def()abcdef" 0;
// { dg-error "invalid character" "invalid" { target *-*-* } 6 }
// { dg-error "stray" "stray" { target *-*-* } 6 }
-const void *s1 = R"abcdefghijklmn??/(a)abcdefghijklmn???";
+const void *s1 = R"abcdefghijklmn??/(a)abcdefghijklmn???" 0;
// { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
// { dg-error "stray" "stray" { target *-*-* } .-2 }
-const void *s2 = R"abcdefghijklmno??/(a)abcdefghijklmno???";
+const void *s2 = R"abcdefghijklmno??/(a)abcdefghijklmno???" 0;
// { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
// { dg-error "stray" "stray" { target *-*-* } .-2 }
-const void *s3 = R"abcdefghijklmnop??=(a)abcdefghijklmnop??=?"; // { dg-warning "trigraph ..= ignored" }
+const void *s3 = R"abcdefghijklmnop??=(a)abcdefghijklmnop??=?" 0;
// { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
// { dg-error "stray" "stray" { target *-*-* } .-2 }
const void *s4 = R"abc\
-()abcdef";
+()abcdef" 0;
// { dg-error "invalid character" "invalid" { target *-*-* } 20 }
// { dg-error "stray" "stray" { target *-*-* } 20 }
const void *s5 = R"\
-()";
+()" 0;
// { dg-error "invalid character" "invalid" { target *-*-* } 24 }
// { dg-error "stray" "stray" { target *-*-* } 24 }
const void *s6 = R"\
-a()a";
+a()a" 0;
// { dg-error "invalid character" "invalid" { target *-*-* } 28 }
// { dg-error "stray" "stray" { target *-*-* } 28 }
diff --git a/gcc/testsuite/c-c++-common/raw-string-5.c b/gcc/testsuite/c-c++-common/raw-string-5.c
index 78602dcb725..dbf31333213 100644
--- a/gcc/testsuite/c-c++-common/raw-string-5.c
+++ b/gcc/testsuite/c-c++-common/raw-string-5.c
@@ -2,25 +2,25 @@
// { dg-options "-std=gnu99" { target c } }
// { dg-options "-std=c++0x" { target c++ } }
-const void *s0 = R"0123456789abcdefg()0123456789abcdefg";
+const void *s0 = R"0123456789abcdefg()0123456789abcdefg" 0;
// { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
// { dg-error "stray" "stray" { target *-*-* } .-2 }
-const void *s1 = R" () ";
+const void *s1 = R" () " 0;
// { dg-error "invalid character" "invalid" { target *-*-* } .-1 }
// { dg-error "stray" "stray" { target *-*-* } .-2 }
-const void *s2 = R" () ";
+const void *s2 = R" () " 0;
// { dg-error "invalid character" "invalid" { target *-*-* } .-1 }
// { dg-error "stray" "stray" { target *-*-* } .-2 }
-const void *s3 = R")())";
+const void *s3 = R")())" 0;
// { dg-error "invalid character" "invalid" { target *-*-* } .-1 }
// { dg-error "stray" "stray" { target *-*-* } .-2 }
-const void *s4 = R"@()@";
+const void *s4 = R"@()@" 0;
// { dg-error "invalid character" "invalid" { target *-*-* } .-1 }
// { dg-error "stray" "stray" { target *-*-* } .-2 }
-const void *s5 = R"$()$";
+const void *s5 = R"$()$" 0;
// { dg-error "invalid character" "invalid" { target *-*-* } .-1 }
// { dg-error "stray" "stray" { target *-*-* } .-2 }
-const void *s6 = R"\u0040()\u0040";
+const void *s6 = R"\u0040()\u0040" 0;
// { dg-error "invalid character" "invalid" { target *-*-* } .-1 }
// { dg-error "stray" "stray" { target *-*-* } .-2 }
diff --git a/gcc/testsuite/c-c++-common/raw-string-6.c b/gcc/testsuite/c-c++-common/raw-string-6.c
index 2c2d5b2d9ef..a2cb30e96c9 100644
--- a/gcc/testsuite/c-c++-common/raw-string-6.c
+++ b/gcc/testsuite/c-c++-common/raw-string-6.c
@@ -2,5 +2,6 @@
// { 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" "end" }
- // { dg-error "unterminated raw string" "unterminated" { target *-*-* } .-1 }
+const void *s0 = R"ouch()ouCh"; // { dg-error "unterminated raw string" "unterminated" }
+// { dg-error "at end of input" "end" { target c } .-1 }
+// { dg-error "-:at end of input" "end" { target c++ } .+1 }
diff --git a/gcc/testsuite/c-c++-common/torture/vector-subscript-3.c b/gcc/testsuite/c-c++-common/torture/vector-subscript-3.c
index bb5c91485d7..05d24f49011 100644
--- a/gcc/testsuite/c-c++-common/torture/vector-subscript-3.c
+++ b/gcc/testsuite/c-c++-common/torture/vector-subscript-3.c
@@ -10,6 +10,9 @@ struct vec_s {
vector short member;
};
+#if defined(__cplusplus) && __cplusplus >= 201703L
+#define register /* nothing */
+#endif
int main () {
register short vector v0 = {1,2,3,4,5,6,7};
diff --git a/gcc/testsuite/c-c++-common/tsan/func_entry_exit.c b/gcc/testsuite/c-c++-common/tsan/func_entry_exit.c
new file mode 100644
index 00000000000..9c1b697411c
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/tsan/func_entry_exit.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple -fdump-tree-optimized" } */
+
+int x;
+
+__attribute__((noinline))
+void fn1(void)
+{
+ x++;
+}
+
+__attribute__((noinline))
+void fn2(void)
+{
+ fn1();
+}
+
+__attribute__((noinline))
+int main(int argc, char *argv[])
+{
+ fn1();
+ fn2();
+ return 0;
+}
+
+// { dg-final { scan-tree-dump "TSAN_FUNC_EXIT" "gimple" } }
+// { dg-final { scan-tree-dump-times "__tsan_func_entry" 3 "optimized" } }
+// { dg-final { scan-tree-dump-times "__tsan_func_exit" 3 "optimized" } }
+// { dg-final { scan-tree-dump "__tsan_write" "optimized" } }
diff --git a/gcc/testsuite/c-c++-common/tsan/func_entry_exit_disabled.c b/gcc/testsuite/c-c++-common/tsan/func_entry_exit_disabled.c
new file mode 100644
index 00000000000..63cc73b9eba
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/tsan/func_entry_exit_disabled.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "--param=tsan-instrument-func-entry-exit=0 -fdump-tree-gimple -fdump-tree-optimized" } */
+
+int x;
+
+__attribute__((noinline))
+void fn1(void)
+{
+ x++;
+}
+
+__attribute__((noinline))
+void fn2(void)
+{
+ fn1();
+}
+
+__attribute__((noinline))
+int main(int argc, char *argv[])
+{
+ fn1();
+ fn2();
+ return 0;
+}
+
+// { dg-final { scan-tree-dump-not "TSAN_FUNC_EXIT" "gimple" } }
+// { dg-final { scan-tree-dump-not "__tsan_func_entry" "optimized" } }
+// { dg-final { scan-tree-dump-not "__tsan_func_exit" "optimized" } }
+// { dg-final { scan-tree-dump "__tsan_write" "optimized" } }
diff --git a/gcc/testsuite/c-c++-common/tsan/inline.c b/gcc/testsuite/c-c++-common/tsan/inline.c
new file mode 100644
index 00000000000..7fb3e576f54
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/tsan/inline.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fsanitize=thread -c -O3 -fdump-tree-optimized" } */
+
+int x;
+
+static inline
+__attribute__((no_sanitize("thread")))
+void do_not_sanitize(void)
+{
+ x++;
+}
+
+void
+sanitize_this(void)
+{
+ x++;
+ do_not_sanitize();
+}
+
+/* { dg-final { scan-tree-dump-times "Function do_not_sanitize" 1 "optimized" } } */
diff --git a/gcc/testsuite/c-c++-common/tsan/volatile.c b/gcc/testsuite/c-c++-common/tsan/volatile.c
new file mode 100644
index 00000000000..68379921685
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/tsan/volatile.c
@@ -0,0 +1,67 @@
+/* { dg-options "--param=tsan-distinguish-volatile=1 -fdump-tree-optimized" } */
+
+#include <assert.h>
+#include <stdint.h>
+#include <stdio.h>
+
+int32_t Global4;
+volatile int32_t VolatileGlobal4;
+volatile int64_t VolatileGlobal8;
+
+static int nvolatile_reads;
+static int nvolatile_writes;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+__attribute__((no_sanitize_thread))
+void __tsan_volatile_read4(void *addr) {
+ assert(addr == &VolatileGlobal4);
+ nvolatile_reads++;
+}
+__attribute__((no_sanitize_thread))
+void __tsan_volatile_write4(void *addr) {
+ assert(addr == &VolatileGlobal4);
+ nvolatile_writes++;
+}
+__attribute__((no_sanitize_thread))
+void __tsan_volatile_read8(void *addr) {
+ assert(addr == &VolatileGlobal8);
+ nvolatile_reads++;
+}
+__attribute__((no_sanitize_thread))
+void __tsan_volatile_write8(void *addr) {
+ assert(addr == &VolatileGlobal8);
+ nvolatile_writes++;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+__attribute__((no_sanitize_thread))
+static void check() {
+ assert(nvolatile_reads == 4);
+ assert(nvolatile_writes == 4);
+}
+
+int main() {
+ Global4 = 1;
+
+ VolatileGlobal4 = 1;
+ Global4 = VolatileGlobal4;
+ VolatileGlobal4 = 1 + VolatileGlobal4;
+
+ VolatileGlobal8 = 1;
+ Global4 = (int32_t)VolatileGlobal8;
+ VolatileGlobal8 = 1 + VolatileGlobal8;
+
+ check();
+ return 0;
+}
+
+// { dg-final { scan-tree-dump-times "__tsan_volatile_read4 \\(&VolatileGlobal4" 2 "optimized" } }
+// { dg-final { scan-tree-dump-times "__tsan_volatile_read8 \\(&VolatileGlobal8" 2 "optimized" } }
+// { dg-final { scan-tree-dump-times "__tsan_volatile_write4 \\(&VolatileGlobal4" 2 "optimized" } }
+// { dg-final { scan-tree-dump-times "__tsan_volatile_write8 \\(&VolatileGlobal8" 2 "optimized" } }
diff --git a/gcc/testsuite/c-c++-common/ubsan/bounds-13.c b/gcc/testsuite/c-c++-common/ubsan/bounds-13.c
index 25b0467ec67..a8bce370f8f 100644
--- a/gcc/testsuite/c-c++-common/ubsan/bounds-13.c
+++ b/gcc/testsuite/c-c++-common/ubsan/bounds-13.c
@@ -1,6 +1,7 @@
/* PR sanitizer/71498 */
/* { dg-do run } */
/* { dg-options "-fsanitize=bounds -Wno-array-bounds" } */
+/* { dg-options "-fsanitize=bounds -Wno-array-bounds -Wno-volatile" { target c++ } } */
struct S { int a[100]; int b, c; } s;
diff --git a/gcc/testsuite/c-c++-common/ubsan/bounds-2.c b/gcc/testsuite/c-c++-common/ubsan/bounds-2.c
index 56654486f65..ec4ef7eed20 100644
--- a/gcc/testsuite/c-c++-common/ubsan/bounds-2.c
+++ b/gcc/testsuite/c-c++-common/ubsan/bounds-2.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-fsanitize=bounds -Wall -Wextra -Wno-unused -Wno-array-bounds -Wno-uninitialized" } */
+/* { dg-options "-fsanitize=bounds -Wall -Wextra -Wno-unused -Wno-array-bounds -Wno-uninitialized -Wno-volatile" { target c++ } } */
/* Test runtime errors. */
diff --git a/gcc/testsuite/c-c++-common/ubsan/div-by-zero-1.c b/gcc/testsuite/c-c++-common/ubsan/div-by-zero-1.c
index 479ced038fb..8b62ae743d8 100644
--- a/gcc/testsuite/c-c++-common/ubsan/div-by-zero-1.c
+++ b/gcc/testsuite/c-c++-common/ubsan/div-by-zero-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-fsanitize=integer-divide-by-zero -Wno-div-by-zero" } */
+/* { dg-options "-fsanitize=integer-divide-by-zero -Wno-div-by-zero -Wno-volatile" { target c++ } } */
int
main (void)
diff --git a/gcc/testsuite/c-c++-common/ubsan/div-by-zero-6.c b/gcc/testsuite/c-c++-common/ubsan/div-by-zero-6.c
index 27a18bb096e..be017ad8179 100644
--- a/gcc/testsuite/c-c++-common/ubsan/div-by-zero-6.c
+++ b/gcc/testsuite/c-c++-common/ubsan/div-by-zero-6.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-fsanitize=integer-divide-by-zero -Wno-div-by-zero" } */
+/* { dg-options "-fsanitize=integer-divide-by-zero -Wno-div-by-zero -Wno-volatile" { target c++ } } */
#include <stdio.h>
diff --git a/gcc/testsuite/c-c++-common/ubsan/div-by-zero-7.c b/gcc/testsuite/c-c++-common/ubsan/div-by-zero-7.c
index 5f53bef74ea..643b76af143 100644
--- a/gcc/testsuite/c-c++-common/ubsan/div-by-zero-7.c
+++ b/gcc/testsuite/c-c++-common/ubsan/div-by-zero-7.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-fsanitize=integer-divide-by-zero -Wno-div-by-zero -fno-sanitize-recover=integer-divide-by-zero" } */
+/* { dg-options "-fsanitize=integer-divide-by-zero -Wno-div-by-zero -fno-sanitize-recover=integer-divide-by-zero -Wno-volatile" { target c++ } } */
/* { dg-shouldfail "ubsan" } */
#include <stdio.h>
diff --git a/gcc/testsuite/c-c++-common/ubsan/inline.c b/gcc/testsuite/c-c++-common/ubsan/inline.c
new file mode 100644
index 00000000000..6cf67f97400
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/ubsan/inline.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fsanitize=vla-bound -c -O3 -fdump-tree-optimized -ffat-lto-objects" } */
+
+int x;
+
+static inline
+__attribute__((no_sanitize("undefined")))
+void do_not_sanitize(void)
+{
+ x++;
+}
+
+void
+sanitize_this(void)
+{
+ x++;
+ do_not_sanitize();
+}
+
+/* { dg-final { scan-tree-dump-times "Function do_not_sanitize" 1 "optimized" } } */
diff --git a/gcc/testsuite/c-c++-common/ubsan/overflow-add-1.c b/gcc/testsuite/c-c++-common/ubsan/overflow-add-1.c
index 960f1b0afaf..3c0a17edb85 100644
--- a/gcc/testsuite/c-c++-common/ubsan/overflow-add-1.c
+++ b/gcc/testsuite/c-c++-common/ubsan/overflow-add-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-fsanitize=signed-integer-overflow -Wno-unused-variable -fno-sanitize-recover=signed-integer-overflow" } */
+/* { dg-options "-fsanitize=signed-integer-overflow -Wno-unused-variable -fno-sanitize-recover=signed-integer-overflow -Wno-volatile" { target c++ } } */
#define SCHAR_MAX __SCHAR_MAX__
#define SHRT_MAX __SHRT_MAX__
diff --git a/gcc/testsuite/c-c++-common/ubsan/overflow-add-2.c b/gcc/testsuite/c-c++-common/ubsan/overflow-add-2.c
index b104d6158fe..8fa9074647a 100644
--- a/gcc/testsuite/c-c++-common/ubsan/overflow-add-2.c
+++ b/gcc/testsuite/c-c++-common/ubsan/overflow-add-2.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-fsanitize=signed-integer-overflow -Wno-unused-variable" } */
+/* { dg-options "-fsanitize=signed-integer-overflow -Wno-unused-variable -Wno-volatile" { target c++ } } */
#define INT_MAX __INT_MAX__
#define INT_MIN (-__INT_MAX__ - 1)
diff --git a/gcc/testsuite/c-c++-common/ubsan/overflow-int128.c b/gcc/testsuite/c-c++-common/ubsan/overflow-int128.c
index 400f25b01e1..10ccc79d0fe 100644
--- a/gcc/testsuite/c-c++-common/ubsan/overflow-int128.c
+++ b/gcc/testsuite/c-c++-common/ubsan/overflow-int128.c
@@ -1,6 +1,7 @@
/* { dg-do run } */
/* { dg-require-effective-target int128 } */
/* { dg-options "-fsanitize=signed-integer-overflow" } */
+/* { dg-options "-fsanitize=signed-integer-overflow -Wno-volatile" { target c++ } } */
/* 2^127 - 1 */
#define INT128_MAX (__int128) (((unsigned __int128) 1 << ((__SIZEOF_INT128__ * __CHAR_BIT__) - 1)) - 1)
diff --git a/gcc/testsuite/c-c++-common/ubsan/overflow-sub-1.c b/gcc/testsuite/c-c++-common/ubsan/overflow-sub-1.c
index e92aaf4ce33..7ceb4ec60a7 100644
--- a/gcc/testsuite/c-c++-common/ubsan/overflow-sub-1.c
+++ b/gcc/testsuite/c-c++-common/ubsan/overflow-sub-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-fsanitize=signed-integer-overflow -Wno-unused-variable -fno-sanitize-recover=signed-integer-overflow" } */
+/* { dg-options "-fsanitize=signed-integer-overflow -Wno-unused-variable -fno-sanitize-recover=signed-integer-overflow -Wno-volatile" { target c++ } } */
#define SCHAR_MAX __SCHAR_MAX__
#define SCHAR_MIN (-__SCHAR_MAX__ - 1)
diff --git a/gcc/testsuite/c-c++-common/ubsan/overflow-sub-2.c b/gcc/testsuite/c-c++-common/ubsan/overflow-sub-2.c
index cc94061634e..92a2ea28af2 100644
--- a/gcc/testsuite/c-c++-common/ubsan/overflow-sub-2.c
+++ b/gcc/testsuite/c-c++-common/ubsan/overflow-sub-2.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-fsanitize=signed-integer-overflow -Wno-unused-variable" } */
+/* { dg-options "-fsanitize=signed-integer-overflow -Wno-unused-variable -Wno-volatile" { target c++ } } */
#define INT_MAX __INT_MAX__
#define INT_MIN (-__INT_MAX__ - 1)
diff --git a/gcc/testsuite/c-c++-common/uninit-pr51010.c b/gcc/testsuite/c-c++-common/uninit-pr51010.c
index f28da46562c..9fd1ea3a262 100644
--- a/gcc/testsuite/c-c++-common/uninit-pr51010.c
+++ b/gcc/testsuite/c-c++-common/uninit-pr51010.c
@@ -4,10 +4,10 @@
int f (int j)
{
int a [10];
- return a [j]; /* { dg-warning "a\\\[j\\\]. is used uninitialized" } */
+ return a [j]; /* { dg-warning "a|a\\\[j\\\]. is used uninitialized" } */
}
int g (int j)
{
int a [10];
- return a [j+1]; /* { dg-warning "a\\\[<unknown>\\\]. is used uninitialized" } */
+ return a [j+1]; /* { dg-warning "a|a\\\[<unknown>\\\]. is used uninitialized" } */
}
diff --git a/gcc/testsuite/driver/a.c b/gcc/testsuite/driver/a.c
new file mode 100644
index 00000000000..c6b8c2eb61e
--- /dev/null
+++ b/gcc/testsuite/driver/a.c
@@ -0,0 +1,6 @@
+int puts (const char *);
+
+void a_func (void)
+{
+ puts ("A test");
+}
diff --git a/gcc/testsuite/driver/b.c b/gcc/testsuite/driver/b.c
new file mode 100644
index 00000000000..76a2cba0bd9
--- /dev/null
+++ b/gcc/testsuite/driver/b.c
@@ -0,0 +1,6 @@
+int puts (const char *);
+
+void a_func (void)
+{
+ puts ("Another test");
+}
diff --git a/gcc/testsuite/driver/driver.exp b/gcc/testsuite/driver/driver.exp
new file mode 100644
index 00000000000..2bbaf07778a
--- /dev/null
+++ b/gcc/testsuite/driver/driver.exp
@@ -0,0 +1,80 @@
+# Copyright (C) 2008-2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+proc check-for-errors { test input } {
+ if { [string equal "$input" ""] } then {
+ pass "$test: std out"
+ } else {
+ fail "$test: std out\n$input"
+ }
+}
+
+if ![check_effective_target_pthread] {
+ return
+}
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+
+# Test multi-input compilation
+check-for-errors "Multi-input Compilation" \
+ [gcc_target_compile "$srcdir/$subdir/a.c $srcdir/$subdir/b.c -c" "" none ""]
+
+# Compile file and generate an assembler and object file
+check-for-errors "Object Generation" \
+ [gcc_target_compile "$srcdir/$subdir/a.c -c" "a.o" none ""]
+check-for-errors "Object Generation" \
+ [gcc_target_compile "$srcdir/$subdir/b.c -c" "a.o" none ""]
+check-for-errors "Assembler Generation" \
+ [gcc_target_compile "$srcdir/$subdir/a.c -S" "a.S" none ""]
+check-for-errors "Assembler Generation" \
+ [gcc_target_compile "$srcdir/$subdir/b.c -S" "b.S" none ""]
+
+# Empty file is a valid program
+check-for-errors "Empty Program" \
+ [gcc_target_compile "$srcdir/$subdir/empty.c -c" "empty.o" none ""]
+
+# Test object file passthrough
+check-for-errors "Object file passthrough" \
+ [gcc_target_compile "$srcdir/$subdir/foo.c a.o" "a.exe" none ""]
+
+# Test compilation when assembler is provided
+check-for-errors "Assembler with Macros" \
+ [gcc_target_compile "a.S -c" "a.o" none ""]
+
+# Clean temporary generated files.
+set temp_files {"a.o" "a.S" "b.o" "b.S" "empty.o"}
+
+foreach f $temp_files {
+ if { [file exists $f] } {
+ file delete $f
+ }
+}
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/driver/empty.c b/gcc/testsuite/driver/empty.c
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/gcc/testsuite/driver/empty.c
diff --git a/gcc/testsuite/driver/foo.c b/gcc/testsuite/driver/foo.c
new file mode 100644
index 00000000000..a18fd2a3b14
--- /dev/null
+++ b/gcc/testsuite/driver/foo.c
@@ -0,0 +1,7 @@
+void a_func (void);
+
+int main()
+{
+ a_func ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/20090107-1.C b/gcc/testsuite/g++.dg/20090107-1.C
index ff586e81767..80b88f02dcc 100644
--- a/gcc/testsuite/g++.dg/20090107-1.C
+++ b/gcc/testsuite/g++.dg/20090107-1.C
@@ -6,7 +6,7 @@ template <typename T> struct Q1 { typedef int x; };
template <typename T> struct Q2 {
typename Q1<T>::x f() {
int k;
- return k; /* { dg-warning "'k' is used uninitialized in this function" } */
+ return k; /* { dg-warning "'k' is used uninitialized" } */
}
};
int foo() { return Q2<int>().f(); }
diff --git a/gcc/testsuite/g++.dg/20090121-1.C b/gcc/testsuite/g++.dg/20090121-1.C
index ddfa3ad057f..9d70fb3601b 100644
--- a/gcc/testsuite/g++.dg/20090121-1.C
+++ b/gcc/testsuite/g++.dg/20090121-1.C
@@ -7,7 +7,7 @@ private:
int y;
public:
- A () { int x; y = x + 1; } /* { dg-warning "'x' is used uninitialized in this function" } */
+ A () { int x; y = x + 1; } /* { dg-warning "'x' is used uninitialized" } */
int get_y () { return y; }
};
diff --git a/gcc/testsuite/g++.dg/DRs/dr188.C b/gcc/testsuite/g++.dg/DRs/dr188.C
new file mode 100644
index 00000000000..f29a9eba1c9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/DRs/dr188.C
@@ -0,0 +1,7 @@
+// DR 188
+// { dg-do compile { target c++11 } }
+// From [diff.expr]p5.
+
+char arr[100];
+// Yields 100 in C++ and sizeof(char*) in C.
+static_assert (sizeof (0, arr) == 100, "");
diff --git a/gcc/testsuite/g++.dg/DRs/dr2237.C b/gcc/testsuite/g++.dg/DRs/dr2237.C
new file mode 100644
index 00000000000..f3d6d11e61e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/DRs/dr2237.C
@@ -0,0 +1,18 @@
+// DR 2237 - Can a template-id name a constructor?
+
+template<class T>
+struct X {
+ X<T>(); // { dg-error "expected" "" { target c++20 } }
+ X(int); // OK, injected-class-name used
+ ~X<T>(); // { dg-error "template-id not allowed for destructor" "" { target c++20 } }
+};
+
+// ill-formed since DR1435
+template<typename T> X<T>::X<T>() {} // { dg-error "names the constructor|as no template constructors" }
+template<typename T> X<T>::~X<T>() {} // { dg-error "template-id not allowed for destructor" "" { target c++20 } }
+
+struct Q {
+ // ill-formed since DR1435
+ template<typename T> friend X<T>::X<T>(); // { dg-error "names the constructor|as no template constructors" }
+ template<typename T> friend X<T>::~X<T>(); // { dg-error "template-id not allowed for destructor" "" { target c++20 } }
+};
diff --git a/gcc/testsuite/g++.dg/Wclass-memaccess.C b/gcc/testsuite/g++.dg/Wclass-memaccess.C
index 4783438888e..57573b37dcb 100644
--- a/gcc/testsuite/g++.dg/Wclass-memaccess.C
+++ b/gcc/testsuite/g++.dg/Wclass-memaccess.C
@@ -14,6 +14,15 @@ void* memset (void*, int, size_t);
void* realloc (void*, size_t);
}
+namespace std {
+
+#if __cplusplus >= 201103L
+enum class byte: unsigned char { };
+#else
+typedef unsigned char byte;
+#endif
+}
+
/* Ordinary bzcopy and bzero aren't recognized as special. */
#define bcopy __builtin_bcopy
#define bzero __builtin_bzero
@@ -180,7 +189,8 @@ void TrivialAccess::test_member (const TrivialAccess *q, int i)
struct HasDefault { char a[4]; HasDefault (); };
void test (HasDefault *p, const HasDefault &x,
- void *q, const unsigned char *s, const int ia[])
+ void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -208,21 +218,25 @@ void test (HasDefault *p, const HasDefault &x,
T (bcopy, (q, p, n));
T (bcopy, (s, p, sizeof *p));
T (bcopy, (s, p, n));
+ T (bcopy, (b, p, n));
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, q, n));
T (memcpy, (p, s, sizeof *p));
T (memcpy, (p, s, n));
+ T (memcpy, (p, b, n));
T (memmove, (p, q, sizeof *p));
T (memmove, (p, q, n));
T (memmove, (p, s, sizeof *p));
T (memmove, (p, s, n));
+ T (memmove, (p, b, n));
T (mempcpy, (p, q, sizeof *p));
T (mempcpy, (p, q, n));
T (mempcpy, (p, s, sizeof *p));
T (mempcpy, (p, s, n));
+ T (mempcpy, (p, b, n));
// ...but partial copies are diagnosed.
T (memcpy, (p, &x, 1)); // { dg-warning "writing to an object of a non-trivial type .struct HasDefault. leaves 3 bytes unchanged" } */
@@ -259,7 +273,8 @@ struct HasTemplateDefault
};
void test (HasTemplateDefault *p, const HasTemplateDefault &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -275,21 +290,25 @@ void test (HasTemplateDefault *p, const HasTemplateDefault &x,
T (bcopy, (&x, p, sizeof *p));
T (bcopy, (q, p, sizeof *p));
T (bcopy, (s, p, sizeof *p));
+ T (bcopy, (b, p, sizeof *p));
T (bcopy, (ia, p, sizeof *p)); // { dg-warning "bcopy" }
T (memcpy, (p, &x, sizeof *p));
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
+ T (memcpy, (p, b, sizeof *p));
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p));
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
+ T (memmove, (p, b, sizeof *p));
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p));
T (mempcpy, (p, q, sizeof *p));
T (mempcpy, (p, s, sizeof *p));
+ T (mempcpy, (p, b, sizeof *p));
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
@@ -309,7 +328,8 @@ void test (HasTemplateDefault *p, const HasTemplateDefault &x,
struct HasCopy { int i; HasCopy (const HasCopy&); };
void test (HasCopy *p, const HasCopy &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -327,21 +347,25 @@ void test (HasCopy *p, const HasCopy &x,
T (bcopy, (&x, p, sizeof *p)); // { dg-warning "bcopy" }
T (bcopy, (q, p, sizeof *p)); // { dg-warning "bcopy" }
T (bcopy, (s, p, sizeof *p)); // { dg-warning "bcopy" }
+ T (bcopy, (b, p, sizeof *p)); // { dg-warning "bcopy" }
T (bcopy, (ia, p, sizeof *p)); // { dg-warning "bcopy" }
T (memcpy, (p, &x, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
@@ -385,7 +409,8 @@ private:
};
void test (HasPrivateCopy *p, const HasPrivateCopy &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -403,16 +428,19 @@ void test (HasPrivateCopy *p, const HasPrivateCopy &x,
T (memcpy, (p, &x, sizeof *p)); // { dg-warning ".void\\* memcpy(\[^\n\r\]*). writing to an object of non-trivially copyable type .struct HasPrivateCopy.; use copy-assignment instead" }
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
@@ -430,7 +458,8 @@ void test (HasPrivateCopy *p, const HasPrivateCopy &x,
struct HasDtor { int i; ~HasDtor (); };
void test (HasDtor *p, const HasDtor &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -449,16 +478,19 @@ void test (HasDtor *p, const HasDtor &x,
T (memcpy, (p, &x, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
@@ -481,7 +513,8 @@ struct HasDeletedDtor
};
void test (HasDeletedDtor *p, const HasDeletedDtor &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -494,16 +527,19 @@ void test (HasDeletedDtor *p, const HasDeletedDtor &x,
T (memcpy, (p, &x, sizeof *p));
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
+ T (memcpy, (p, b, sizeof *p));
T (memcpy, (p, ia, sizeof *p));
T (memmove, (p, &x, sizeof *p));
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
+ T (memmove, (p, b, sizeof *p));
T (memmove, (p, ia, sizeof *p));
T (mempcpy, (p, &x, sizeof *p));
T (mempcpy, (p, q, sizeof *p));
T (mempcpy, (p, s, sizeof *p));
+ T (mempcpy, (p, b, sizeof *p));
T (mempcpy, (p, ia, sizeof *p));
// Reallocating is diagnosed.
@@ -527,7 +563,8 @@ private:
};
void test (HasPrivateDtor *p, const HasPrivateDtor &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -540,16 +577,19 @@ void test (HasPrivateDtor *p, const HasPrivateDtor &x,
T (memcpy, (p, &x, sizeof *p)); // { dg-warning "writing to an object of non-trivially copyable type .struct HasPrivateDtor.; use copy-assignment or copy-initialization instead" }
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is diagnosed.
@@ -567,7 +607,8 @@ void test (HasPrivateDtor *p, const HasPrivateDtor &x,
struct HasCopyAssign { void operator= (HasCopyAssign&); };
void test (HasCopyAssign *p, const HasCopyAssign &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -584,16 +625,19 @@ void test (HasCopyAssign *p, const HasCopyAssign &x,
T (memcpy, (p, &x, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
@@ -620,7 +664,8 @@ struct HasMoveAssign
};
void test (HasMoveAssign *p, const HasMoveAssign &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -637,16 +682,19 @@ void test (HasMoveAssign *p, const HasMoveAssign &x,
T (memcpy, (p, &x, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
@@ -678,7 +726,8 @@ struct TrivialCopyHasMoveAssign
};
void test (TrivialCopyHasMoveAssign *p, const TrivialCopyHasMoveAssign &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -695,16 +744,19 @@ void test (TrivialCopyHasMoveAssign *p, const TrivialCopyHasMoveAssign &x,
T (memcpy, (p, &x, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
@@ -733,7 +785,8 @@ struct TrivialMoveNontrivialCopyAssign
void test (TrivialMoveNontrivialCopyAssign *p,
const TrivialMoveNontrivialCopyAssign &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -750,16 +803,19 @@ void test (TrivialMoveNontrivialCopyAssign *p,
T (memcpy, (p, &x, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
@@ -784,7 +840,8 @@ struct TrivialAssignRefOverload {
};
void test (TrivialAssignRefOverload *p, const TrivialAssignRefOverload &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -797,16 +854,19 @@ void test (TrivialAssignRefOverload *p, const TrivialAssignRefOverload &x,
T (memcpy, (p, &x, sizeof *p));
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
+ T (memcpy, (p, b, sizeof *p));
T (memcpy, (p, ia, sizeof *p));
T (memmove, (p, &x, sizeof *p));
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
+ T (memmove, (p, b, sizeof *p));
T (memmove, (p, ia, sizeof *p));
T (mempcpy, (p, &x, sizeof *p));
T (mempcpy, (p, q, sizeof *p));
T (mempcpy, (p, s, sizeof *p));
+ T (mempcpy, (p, b, sizeof *p));
T (mempcpy, (p, ia, sizeof *p));
T (q = realloc, (p, 1));
@@ -831,7 +891,8 @@ struct TrivialAssignCstRefOverload {
void test (TrivialAssignCstRefOverload *p,
const TrivialAssignCstRefOverload &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -844,16 +905,19 @@ void test (TrivialAssignCstRefOverload *p,
T (memcpy, (p, &x, sizeof *p));
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
+ T (memcpy, (p, b, sizeof *p));
T (memcpy, (p, ia, sizeof *p));
T (memmove, (p, &x, sizeof *p));
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
+ T (memmove, (p, b, sizeof *p));
T (memmove, (p, ia, sizeof *p));
T (mempcpy, (p, &x, sizeof *p));
T (mempcpy, (p, q, sizeof *p));
T (mempcpy, (p, s, sizeof *p));
+ T (mempcpy, (p, b, sizeof *p));
T (mempcpy, (p, ia, sizeof *p));
T (q = realloc, (p, 1));
@@ -875,7 +939,8 @@ struct TrivialRefHasVolRefAssign
void test (TrivialRefHasVolRefAssign *p,
const TrivialRefHasVolRefAssign &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -892,16 +957,19 @@ void test (TrivialRefHasVolRefAssign *p,
T (memcpy, (p, &x, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
@@ -922,7 +990,8 @@ struct HasVolRefAssign {
};
void test (HasVolRefAssign *p, const HasVolRefAssign &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -939,16 +1008,19 @@ void test (HasVolRefAssign *p, const HasVolRefAssign &x,
T (memcpy, (p, &x, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
@@ -967,7 +1039,8 @@ void test (HasVolRefAssign *p, const HasVolRefAssign &x,
struct HasVirtuals { int i; virtual void foo (); };
void test (HasVirtuals *p, const HasVirtuals &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -983,16 +1056,19 @@ void test (HasVirtuals *p, const HasVirtuals &x,
T (memcpy, (p, &x, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
@@ -1012,7 +1088,8 @@ void test (HasVirtuals *p, const HasVirtuals &x,
struct HasConstData { const char a[4]; };
void test (HasConstData *p, const HasConstData &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -1037,16 +1114,19 @@ void test (HasConstData *p, const HasConstData &x,
// { dg-warning "writing to an object of type .struct HasConstData. with no trivial copy-assignment" "c++ 98" { target { c++98_only } } .-1 }
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is not diagnosed except in C++ 98 due to a bug.
@@ -1066,7 +1146,8 @@ void test (HasConstData *p, const HasConstData &x,
struct HasReference { int &ci; };
void test (HasReference *p, const HasReference &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -1098,17 +1179,21 @@ void test (HasReference *p, const HasReference &x,
T (memcpy, (p, q, n)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, n)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, n)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, n)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is not diagnosed because a type with a reference
@@ -1132,7 +1217,8 @@ void test (HasReference *p, const HasReference &x,
struct HasMemDataPtr { int HasMemDataPtr::*p; };
void test (HasMemDataPtr *p, const HasMemDataPtr &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -1155,17 +1241,21 @@ void test (HasMemDataPtr *p, const HasMemDataPtr &x,
T (memcpy, (p, q, n));
T (memcpy, (p, s, sizeof *p));
T (memcpy, (p, s, n));
+ T (memcpy, (p, b, sizeof *p));
+ T (memcpy, (p, b, n));
T (memcpy, (p, ia, sizeof *p));
T (memcpy, (p, ia, n));
T (memmove, (p, &x, sizeof *p));
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
+ T (memmove, (p, b, sizeof *p));
T (memmove, (p, ia, sizeof *p));
T (mempcpy, (p, &x, sizeof *p));
T (mempcpy, (p, q, sizeof *p));
T (mempcpy, (p, s, sizeof *p));
+ T (mempcpy, (p, b, sizeof *p));
T (mempcpy, (p, ia, sizeof *p));
// Reallocating is the same as calling memcpy.
@@ -1185,7 +1275,8 @@ void test (HasMemDataPtr *p, const HasMemDataPtr &x,
struct HasSomePrivateData { char a[2]; private: char b[2]; };
void test (HasSomePrivateData *p, const HasSomePrivateData &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -1206,6 +1297,7 @@ void test (HasSomePrivateData *p, const HasSomePrivateData &x,
T (memcpy, (p, &x, n));
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
+ T (memcpy, (p, b, sizeof *p));
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, n)); // { dg-warning "memcpy" }
@@ -1214,6 +1306,7 @@ void test (HasSomePrivateData *p, const HasSomePrivateData &x,
T (memmove, (p, &x, n));
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
+ T (memmove, (p, b, sizeof *p));
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, n)); // { dg-warning "memmove" }
@@ -1224,6 +1317,8 @@ void test (HasSomePrivateData *p, const HasSomePrivateData &x,
T (mempcpy, (p, q, n));
T (mempcpy, (p, s, sizeof *p));
T (mempcpy, (p, s, n));
+ T (mempcpy, (p, b, sizeof *p));
+ T (mempcpy, (p, b, n));
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, n)); // { dg-warning "mempcpy" }
@@ -1246,7 +1341,8 @@ void test (HasSomePrivateData *p, const HasSomePrivateData &x,
struct HasSomeProtectedData { char a[2]; protected: char b[2]; };
void test (HasSomeProtectedData *p, const HasSomeProtectedData &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -1267,6 +1363,7 @@ void test (HasSomeProtectedData *p, const HasSomeProtectedData &x,
T (memcpy, (p, &x, n));
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
+ T (memcpy, (p, b, sizeof *p));
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, n)); // { dg-warning "memcpy" }
@@ -1275,6 +1372,7 @@ void test (HasSomeProtectedData *p, const HasSomeProtectedData &x,
T (memmove, (p, &x, n));
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
+ T (memmove, (p, b, sizeof *p));
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, n)); // { dg-warning "memmove" }
@@ -1285,6 +1383,8 @@ void test (HasSomeProtectedData *p, const HasSomeProtectedData &x,
T (mempcpy, (p, q, n));
T (mempcpy, (p, s, sizeof *p));
T (mempcpy, (p, s, n));
+ T (mempcpy, (p, b, sizeof *p));
+ T (mempcpy, (p, b, n));
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, n)); // { dg-warning "mempcpy" }
@@ -1307,7 +1407,8 @@ void test (HasSomeProtectedData *p, const HasSomeProtectedData &x,
struct HasAllPrivateData { private: char a[4]; };
void test (HasAllPrivateData *p, const HasAllPrivateData &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -1328,6 +1429,7 @@ void test (HasAllPrivateData *p, const HasAllPrivateData &x,
T (memcpy, (p, &x, n));
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
+ T (memcpy, (p, b, sizeof *p));
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, n)); // { dg-warning "memcpy" }
@@ -1336,6 +1438,7 @@ void test (HasAllPrivateData *p, const HasAllPrivateData &x,
T (memmove, (p, &x, n));
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
+ T (memmove, (p, b, sizeof *p));
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, n)); // { dg-warning "memmove" }
@@ -1346,6 +1449,8 @@ void test (HasAllPrivateData *p, const HasAllPrivateData &x,
T (mempcpy, (p, q, n));
T (mempcpy, (p, s, sizeof *p));
T (mempcpy, (p, s, n));
+ T (mempcpy, (p, b, sizeof *p));
+ T (mempcpy, (p, b, n));
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, n)); // { dg-warning "mempcpy" }
@@ -1368,7 +1473,8 @@ void test (HasAllPrivateData *p, const HasAllPrivateData &x,
struct HasAllProtectedData { protected: char a[4]; };
void test (HasAllProtectedData *p, const HasAllProtectedData &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -1389,6 +1495,7 @@ void test (HasAllProtectedData *p, const HasAllProtectedData &x,
T (memcpy, (p, &x, n));
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
+ T (memcpy, (p, b, sizeof *p));
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, n)); // { dg-warning "memcpy" }
@@ -1397,6 +1504,7 @@ void test (HasAllProtectedData *p, const HasAllProtectedData &x,
T (memmove, (p, &x, n));
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
+ T (memmove, (p, b, sizeof *p));
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, n)); // { dg-warning "memmove" }
@@ -1407,6 +1515,8 @@ void test (HasAllProtectedData *p, const HasAllProtectedData &x,
T (mempcpy, (p, q, n));
T (mempcpy, (p, s, sizeof *p));
T (mempcpy, (p, s, n));
+ T (mempcpy, (p, b, sizeof *p));
+ T (mempcpy, (p, b, n));
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, n)); // { dg-warning "mempcpy" }
@@ -1432,7 +1542,8 @@ private:
};
void test (HasDefaultPrivateAssign *p, const HasDefaultPrivateAssign &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -1462,16 +1573,22 @@ void test (HasDefaultPrivateAssign *p, const HasDefaultPrivateAssign &x,
T (memcpy, (p, q, n)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, n)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, n)); // { dg-warning "memcpy" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, n)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, n)); // { dg-warning "memmove" }
+ T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, b, n)); // { dg-warning "memmove" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, n)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, n)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, n)); // { dg-warning "mempcpy" }
// Same for partial copies are diagnosed.
T (memcpy, (p, &x, 1)); // { dg-warning "writing to an object of type .struct HasDefaultPrivateAssign. with (deleted|no trivial) copy-assignment" } */
@@ -1503,7 +1620,8 @@ private:
};
void test (HasDefaultDeletedAssign *p, const HasDefaultDeletedAssign &x,
- const void *q, const unsigned char *s, const int ia[])
+ const void *q, const unsigned char *s, const std::byte *b,
+ const int ia[])
{
const int i = *ia;
const size_t n = *ia;
@@ -1533,16 +1651,22 @@ void test (HasDefaultDeletedAssign *p, const HasDefaultDeletedAssign &x,
T (memcpy, (p, q, n)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, n)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, b, n)); // { dg-warning "memcpy" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, n)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, n)); // { dg-warning "memmove" }
+ T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, b, n)); // { dg-warning "memmove" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, n)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, n)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, b, n)); // { dg-warning "mempcpy" }
// Same for partial copies are diagnosed.
T (memcpy, (p, &x, 1)); // { dg-warning "writing to an object of type .struct HasDefaultDeletedAssign. with (deleted|no trivial) copy-assignment" } */
diff --git a/gcc/testsuite/g++.dg/abi/pure-virtual1.C b/gcc/testsuite/g++.dg/abi/pure-virtual1.C
new file mode 100644
index 00000000000..538e2cb097a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/pure-virtual1.C
@@ -0,0 +1,23 @@
+// Test that we don't need libsupc++ just for __cxa_pure_virtual.
+// { dg-do link }
+// { dg-require-weak }
+// { dg-additional-options "-fno-rtti -nodefaultlibs -lc" }
+// { dg-additional-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } }
+// { dg-xfail-if "AIX weak" { powerpc-ibm-aix* } }
+
+struct A
+{
+ int i;
+ virtual void f() = 0;
+ A(): i(0) {}
+};
+
+struct B: A
+{
+ virtual void f() {}
+};
+
+int main()
+{
+ B b;
+}
diff --git a/gcc/testsuite/g++.dg/abi/scoped1.C b/gcc/testsuite/g++.dg/abi/scoped1.C
index 7589ed44066..62ae498c970 100644
--- a/gcc/testsuite/g++.dg/abi/scoped1.C
+++ b/gcc/testsuite/g++.dg/abi/scoped1.C
@@ -6,18 +6,18 @@ void f(int i, ...)
{
__builtin_va_list ap;
__builtin_va_start (ap, i);
- if (__builtin_va_arg (ap, A) != A::a1) __builtin_abort(); // { dg-warning "passed" }
- if (__builtin_va_arg (ap, A) != A::a2) __builtin_abort(); // { dg-warning "passed" }
- if (__builtin_va_arg (ap, A) != A::a3) __builtin_abort(); // { dg-warning "passed" }
- if (__builtin_va_arg (ap, A) != A::a1) __builtin_abort(); // { dg-warning "passed" }
- if (__builtin_va_arg (ap, A) != A::a2) __builtin_abort(); // { dg-warning "passed" }
- if (__builtin_va_arg (ap, A) != A::a3) __builtin_abort(); // { dg-warning "passed" }
- if (__builtin_va_arg (ap, A) != A::a1) __builtin_abort(); // { dg-warning "passed" }
- if (__builtin_va_arg (ap, A) != A::a2) __builtin_abort(); // { dg-warning "passed" }
- if (__builtin_va_arg (ap, A) != A::a3) __builtin_abort(); // { dg-warning "passed" }
+ if (__builtin_va_arg (ap, A) != A::a1) __builtin_abort(); // { dg-warning "passed" "" { target { ! short_eq_int } } }
+ if (__builtin_va_arg (ap, A) != A::a2) __builtin_abort(); // { dg-warning "passed" "" { target { ! short_eq_int } } }
+ if (__builtin_va_arg (ap, A) != A::a3) __builtin_abort(); // { dg-warning "passed" "" { target { ! short_eq_int } } }
+ if (__builtin_va_arg (ap, A) != A::a1) __builtin_abort(); // { dg-warning "passed" "" { target { ! short_eq_int } } }
+ if (__builtin_va_arg (ap, A) != A::a2) __builtin_abort(); // { dg-warning "passed" "" { target { ! short_eq_int } } }
+ if (__builtin_va_arg (ap, A) != A::a3) __builtin_abort(); // { dg-warning "passed" "" { target { ! short_eq_int } } }
+ if (__builtin_va_arg (ap, A) != A::a1) __builtin_abort(); // { dg-warning "passed" "" { target { ! short_eq_int } } }
+ if (__builtin_va_arg (ap, A) != A::a2) __builtin_abort(); // { dg-warning "passed" "" { target { ! short_eq_int } } }
+ if (__builtin_va_arg (ap, A) != A::a3) __builtin_abort(); // { dg-warning "passed" "" { target { ! short_eq_int } } }
}
int main()
{
- f(9, A::a1, A::a2, A::a3, A::a1, A::a2, A::a3, A::a1, A::a2, A::a3); // { dg-warning "passed" }
+ f(9, A::a1, A::a2, A::a3, A::a1, A::a2, A::a3, A::a1, A::a2, A::a3); // { dg-warning "passed" "" { target { ! short_eq_int } } }
}
diff --git a/gcc/testsuite/g++.dg/analyzer/pr93212.C b/gcc/testsuite/g++.dg/analyzer/pr93212.C
index 0d76d839378..1029e8d547b 100644
--- a/gcc/testsuite/g++.dg/analyzer/pr93212.C
+++ b/gcc/testsuite/g++.dg/analyzer/pr93212.C
@@ -5,8 +5,11 @@ auto lol()
{
int aha = 3;
return [&aha] {
- return aha;
+ return aha; // { dg-warning "dereferencing pointer '.*' to within stale stack frame" }
};
+ /* TODO: may be worth special-casing the reporting of dangling
+ references from lambdas, to highlight the declaration, and maybe fix
+ the wording (it's a reference, not a pointer, for one thing). */
}
int main()
diff --git a/gcc/testsuite/g++.dg/analyzer/pr93950.C b/gcc/testsuite/g++.dg/analyzer/pr93950.C
index e2808173407..129690c82be 100644
--- a/gcc/testsuite/g++.dg/analyzer/pr93950.C
+++ b/gcc/testsuite/g++.dg/analyzer/pr93950.C
@@ -9,9 +9,7 @@ struct d
};
void h (e * i)
{
- void *j = nullptr; // { dg-bogus "NULL" "" { xfail *-*-* } }
- // TODO(xfail): we report "'i' is NULL" above, which is the wrong location
-
+ void *j = nullptr; // { dg-bogus "NULL" }
i->f = *i->g; // { dg-warning "dereference of NULL 'i'" }
}
virtual void c (int, int)
diff --git a/gcc/testsuite/g++.dg/analyzer/pr94011.C b/gcc/testsuite/g++.dg/analyzer/pr94011.C
new file mode 100644
index 00000000000..2642aa40c1b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/analyzer/pr94011.C
@@ -0,0 +1,16 @@
+// { dg-do compile { target c++11 } }
+// { dg-additional-options "-O1" }
+
+template <typename DV> DV
+vu (DV j4)
+{
+ return [j4] () { return j4 () ? j4 : throw j4 (); } ();
+}
+
+void
+foo ()
+{
+ auto n1 = [] { return nullptr; };
+
+ vu (n1);
+}
diff --git a/gcc/testsuite/g++.dg/analyzer/pr94028.C b/gcc/testsuite/g++.dg/analyzer/pr94028.C
index 0a222d1b991..0573d309ba2 100644
--- a/gcc/testsuite/g++.dg/analyzer/pr94028.C
+++ b/gcc/testsuite/g++.dg/analyzer/pr94028.C
@@ -13,12 +13,17 @@ enum e {} i;
struct j
{
void *operator new (__SIZE_TYPE__ b)
+#if __cplusplus >= 201103L
+ noexcept
+#else
+ throw()
+#endif
{
- return calloc (b, sizeof (int)); // { dg-warning "leak" }
+ return calloc (b, sizeof (int)); // { dg-bogus "leak" "" { xfail c++98_only } }
}
j (B *, int)
{
- } // { dg-warning "leak" }
+ }
};
j *
diff --git a/gcc/testsuite/g++.dg/analyzer/pr94503.C b/gcc/testsuite/g++.dg/analyzer/pr94503.C
new file mode 100644
index 00000000000..9432ac40764
--- /dev/null
+++ b/gcc/testsuite/g++.dg/analyzer/pr94503.C
@@ -0,0 +1,25 @@
+template <typename> class allocator {
+public:
+ allocator(const allocator &);
+ allocator();
+};
+
+template <typename> struct allocator_traits;
+template <typename _Tp> struct allocator_traits<allocator<_Tp> > {
+ static allocator<_Tp> select_on_container_copy_construction() {
+ return allocator<_Tp>();
+ }
+ static allocator<_Tp> _S_select_on_copy() {
+ return select_on_container_copy_construction();
+ }
+};
+
+class basic_string {
+ struct _Alloc_hider {
+ _Alloc_hider(allocator<char>);
+ } _M_dataplus;
+
+public:
+ basic_string(basic_string &)
+ : _M_dataplus(allocator_traits<allocator<char> >::_S_select_on_copy()) {}
+} xxx(xxx);
diff --git a/gcc/testsuite/g++.dg/analyzer/pr95042.C b/gcc/testsuite/g++.dg/analyzer/pr95042.C
new file mode 100644
index 00000000000..0e745529f45
--- /dev/null
+++ b/gcc/testsuite/g++.dg/analyzer/pr95042.C
@@ -0,0 +1,28 @@
+// { dg-additional-options "-O1" }
+
+class kz {
+public:
+ kz ();
+
+private:
+ int yu;
+};
+
+const kz vl;
+kz ax;
+
+void
+c1 (bool va, bool ze)
+{
+ kz ny, fb = vl;
+
+ if (va)
+ {
+ if (ze)
+ ny = vl;
+
+ fb = ny;
+ }
+
+ ax = fb;
+}
diff --git a/gcc/testsuite/g++.dg/asan/function-argument-4.C b/gcc/testsuite/g++.dg/asan/function-argument-4.C
new file mode 100644
index 00000000000..cec1f1d788f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asan/function-argument-4.C
@@ -0,0 +1,26 @@
+// { dg-do run }
+// { dg-shouldfail "asan" }
+
+#include <complex.h>
+
+static __attribute__ ((noinline)) long double
+goo (long double _Complex *a)
+{
+ return crealf(*(volatile _Complex long double *)a);
+}
+
+__attribute__ ((noinline)) float
+foo (float _Complex arg)
+{
+ return goo ((long double _Complex *)&arg);
+}
+
+int
+main ()
+{
+ return foo (3 + 2 * I);
+}
+
+// { dg-output "ERROR: AddressSanitizer: stack-buffer-overflow on address.*(\n|\r\n|\r)" }
+// { dg-output "READ of size \[0-9\]* at.*" }
+// { dg-output ".*'arg' \\(line 13\\) <== Memory access at offset \[0-9\]* partially overflows this variable.*" }
diff --git a/gcc/testsuite/g++.dg/asan/pr95025.C b/gcc/testsuite/g++.dg/asan/pr95025.C
new file mode 100644
index 00000000000..dabb7e92f82
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asan/pr95025.C
@@ -0,0 +1,28 @@
+// { dg-do compile }
+// { dg-options "-O2 -fsanitize=address" }
+
+struct a {
+ int b;
+} * c;
+struct d {
+ d *e;
+};
+struct f {
+ bool done;
+ d *g;
+};
+int h;
+int i(f *j) {
+ if (j->g) {
+ j->g = j->g->e;
+ return h;
+ }
+ j->done = true;
+ return 0;
+}
+void k(bool j) { c->b = j; }
+void l() {
+ f a;
+ for (; !(&a)->done; i(&a))
+ k(true);
+}
diff --git a/gcc/testsuite/g++.dg/concepts/abbrev7.C b/gcc/testsuite/g++.dg/concepts/abbrev7.C
new file mode 100644
index 00000000000..443c1b7871b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/concepts/abbrev7.C
@@ -0,0 +1,14 @@
+// PR c++/96106
+// { dg-do compile { target concepts } }
+
+template<typename>
+struct number {
+ friend void add(auto);
+};
+
+void add(auto) { }
+
+void foo() {
+ number<int> n;
+ add(n); // { dg-bogus "ambiguous" }
+}
diff --git a/gcc/testsuite/g++.dg/concepts/diagnostic1.C b/gcc/testsuite/g++.dg/concepts/diagnostic1.C
index c6589e2e671..29c78c4c730 100644
--- a/gcc/testsuite/g++.dg/concepts/diagnostic1.C
+++ b/gcc/testsuite/g++.dg/concepts/diagnostic1.C
@@ -1,7 +1,6 @@
// PR c++/67159
// { dg-do compile { target c++17_only } }
-// { dg-options "-fconcepts" }
-// { dg-additional-options "-fconcepts-diagnostics-depth=2" }
+// { dg-options "-fconcepts -fconcepts-diagnostics-depth=2" }
template <class T, class U>
concept bool SameAs = __is_same_as(T, U);
diff --git a/gcc/testsuite/g++.dg/concepts/diagnostic14.C b/gcc/testsuite/g++.dg/concepts/diagnostic14.C
new file mode 100644
index 00000000000..ec2b68c4a3c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/concepts/diagnostic14.C
@@ -0,0 +1,36 @@
+// PR c++/95303
+// { dg-do compile { target c++20 } }
+
+template<class>
+struct A {
+ struct B {};
+};
+
+template<class T>
+ requires __is_same(T, char)
+struct A<T> {
+ struct B {};
+};
+
+template<>
+ struct A<bool> {
+ struct B {};
+ };
+
+template<class T>
+concept C = requires (T&& t) { // { dg-message "\\\[with T = A<int>::B\\\]" }
+ t.a;
+};
+static_assert(C<A<int>::B>); // { dg-error "failed" }
+
+template<class T>
+concept D = requires (T&& t) { // { dg-message "\\\[with T = A<char>::B\\\]" }
+ t.a;
+};
+static_assert(D<A<char>::B>); // { dg-error "failed" }
+
+template<class T>
+concept E = requires (T&& t) { // { dg-message "\\\[with T = A<bool>::B\\\]" }
+ t.a;
+};
+static_assert(E<A<bool>::B>); // { dg-error "failed" }
diff --git a/gcc/testsuite/g++.dg/concepts/fn8.C b/gcc/testsuite/g++.dg/concepts/fn8.C
index ed900809908..32df5a556c0 100644
--- a/gcc/testsuite/g++.dg/concepts/fn8.C
+++ b/gcc/testsuite/g++.dg/concepts/fn8.C
@@ -24,5 +24,5 @@ template<typename T>
void g(T x) { }
int main () {
- g(&f<int>); // { dg-error "no matches" }
+ g(&f<int>); // { dg-error "no match" }
}
diff --git a/gcc/testsuite/g++.dg/concepts/pr95181-2.C b/gcc/testsuite/g++.dg/concepts/pr95181-2.C
new file mode 100644
index 00000000000..6d67350e58f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/concepts/pr95181-2.C
@@ -0,0 +1,8 @@
+// { dg-do compile { target concepts } }
+
+template<bool B> struct g {
+ g() requires B && false;
+ g() requires B;
+};
+
+g<true> b; // error
diff --git a/gcc/testsuite/g++.dg/concepts/pr95181.C b/gcc/testsuite/g++.dg/concepts/pr95181.C
new file mode 100644
index 00000000000..0185c86b438
--- /dev/null
+++ b/gcc/testsuite/g++.dg/concepts/pr95181.C
@@ -0,0 +1,9 @@
+// PR c++/95181
+// { dg-do compile { target concepts } }
+
+template <typename> struct f {
+ template <typename T=int> f();
+ template <typename T=int> requires false f();
+};
+
+f<int> a;
diff --git a/gcc/testsuite/g++.dg/concepts/pr95386.C b/gcc/testsuite/g++.dg/concepts/pr95386.C
new file mode 100644
index 00000000000..3c683e5693c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/concepts/pr95386.C
@@ -0,0 +1,11 @@
+// PR c++/95386
+// { dg-do compile { target concepts } }
+
+template <typename> struct blah {
+ typedef bool value_type;
+ constexpr operator value_type() { return false; }
+};
+
+template <class T> void fn1(T) requires (!blah<T>());
+
+void fn2() { fn1(0); }
diff --git a/gcc/testsuite/g++.dg/conversion/ref4.C b/gcc/testsuite/g++.dg/conversion/ref4.C
new file mode 100644
index 00000000000..464a4cf6c0f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/conversion/ref4.C
@@ -0,0 +1,22 @@
+// PR c++/95789
+// { dg-do compile { target c++11 } }
+
+struct B {
+ int n;
+};
+
+template <typename T>
+struct A {
+ B& get() const { return f; } // { dg-error "binding reference" }
+
+ B f;
+};
+
+int main() {
+ A<int> a;
+ a.f = {};
+
+ a.get().n = 10;
+ if (a.f.n != 0)
+ __builtin_abort();
+}
diff --git a/gcc/testsuite/g++.dg/conversion/ref5.C b/gcc/testsuite/g++.dg/conversion/ref5.C
new file mode 100644
index 00000000000..0042acd0670
--- /dev/null
+++ b/gcc/testsuite/g++.dg/conversion/ref5.C
@@ -0,0 +1,14 @@
+// PR c++/96104
+
+template <typename T> void fn(T &);
+class E {};
+struct F {
+ template <typename T> void mfn(T t) { t, fn(E()); } // { dg-error "cannot bind non-const lvalue reference" }
+};
+int
+main()
+{
+ E e;
+ F f;
+ f.mfn(e);
+}
diff --git a/gcc/testsuite/g++.dg/conversion/ref6.C b/gcc/testsuite/g++.dg/conversion/ref6.C
new file mode 100644
index 00000000000..fc87199053c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/conversion/ref6.C
@@ -0,0 +1,24 @@
+// PR c++/96179
+// { dg-do compile { target c++11 } }
+
+template<typename T> struct vector
+{
+ void push_back(T) { }
+};
+
+struct dummy{
+ int a;
+};
+
+void Modify_Dummy(dummy &d){
+ d.a=1;
+}
+
+template <bool bla=true> void Templated_Function(){
+ vector<dummy> A;
+ A.push_back(Modify_Dummy(dummy{0})); // { dg-error "cannot bind non-const lvalue reference" }
+}
+
+int main(){
+ Templated_Function();
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C b/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C
index 4bfa41cd4a9..9b537548791 100644
--- a/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C
+++ b/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C
@@ -1,4 +1,4 @@
-// { dg-additional-options "-fsyntax-only -w" }
+// { dg-additional-options "-w" }
#include "coro.h"
diff --git a/gcc/testsuite/g++.dg/coroutines/co-return-syntax-10-movable.C b/gcc/testsuite/g++.dg/coroutines/co-return-syntax-10-movable.C
new file mode 100644
index 00000000000..c6f36a7143f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/co-return-syntax-10-movable.C
@@ -0,0 +1,75 @@
+// Check that we obey the extra rules for implicitly movable co_return
+// objects [class.copy.elision]/3.
+
+#include "coro.h"
+
+#include <utility>
+
+template <typename T>
+struct coro1 {
+ struct promise_type;
+ using handle_type = coro::coroutine_handle<coro1::promise_type>;
+ handle_type handle;
+ coro1 () : handle(0) {}
+ coro1 (handle_type _handle)
+ : handle(_handle) { }
+ coro1 (const coro1 &) = delete; // no copying
+ coro1 (coro1 &&s) : handle(s.handle) { s.handle = nullptr; }
+ coro1 &operator = (coro1 &&s) {
+ handle = s.handle;
+ s.handle = nullptr;
+ return *this;
+ }
+ ~coro1() {
+ if ( handle )
+ handle.destroy();
+ }
+
+ struct promise_type {
+ T value;
+ promise_type() {}
+ ~promise_type() {}
+
+ auto get_return_object () { return handle_type::from_promise (*this);}
+ coro::suspend_always initial_suspend () const { return {}; }
+ coro::suspend_always final_suspend () const { return {}; }
+
+ void return_value(T&& v) noexcept { value = std::move(v); }
+ void return_value(const T&) noexcept = delete;
+
+ T get_value (void) { return value; }
+ void unhandled_exception() { }
+ };
+};
+
+struct MoveOnlyType
+{
+ int value_;
+
+ explicit MoveOnlyType() noexcept : value_(0) {}
+ explicit MoveOnlyType(int value) noexcept : value_(value) {}
+
+ MoveOnlyType(MoveOnlyType&& other) noexcept
+ : value_(std::exchange(other.value_, -1)) {}
+
+ MoveOnlyType& operator=(MoveOnlyType&& other) noexcept {
+ value_ = std::exchange(other.value_, -1);
+ return *this;
+ }
+
+ ~MoveOnlyType() { value_ = -2; }
+};
+
+bool b1, b2;
+
+coro1<MoveOnlyType>
+my_coro (MoveOnlyType p, MoveOnlyType &&r)
+{
+ MoveOnlyType x{10};
+ if (b1)
+ co_return p;
+ else if (b2)
+ co_return r;
+ else
+ co_return x;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C b/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C
new file mode 100644
index 00000000000..bd9dec6c75f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C
@@ -0,0 +1,65 @@
+// Test handling of the case where we have a class g-r-o and a non-void
+// and non-class-type ramp return.
+
+#include "coro.h"
+
+int g_promise = -1;
+
+struct Thing {
+ double x;
+ Thing () : x(0.0) {}
+ ~Thing () {}
+};
+
+template<typename R, typename HandleRef, typename ...T>
+struct std::coroutine_traits<R, HandleRef, T...> {
+ struct promise_type {
+ promise_type (HandleRef h, T ...args)
+ { h = std::coroutine_handle<promise_type>::from_promise (*this);
+ PRINT ("Created Promise");
+ g_promise = 1;
+ }
+ ~promise_type () { PRINT ("Destroyed Promise"); g_promise = 0;}
+ Thing get_return_object() { return {}; }
+
+ auto initial_suspend() {
+ return std::suspend_always{};
+ }
+ auto final_suspend() { return std::suspend_never{}; }
+
+ void return_void() {}
+ void unhandled_exception() {}
+ };
+};
+
+int
+my_coro (std::coroutine_handle<>& h)
+{
+ PRINT ("coro1: about to return");
+ co_return;
+} // { dg-error {'struct Thing' used where a 'int' was expected} }
+
+int main ()
+{
+ std::coroutine_handle<> h;
+ int t = my_coro (h);
+
+ if (h.done())
+ {
+ PRINT ("main: apparently was already done...");
+ abort ();
+ }
+
+ // initial suspend.
+ h.resume ();
+
+ // The coro should have self-destructed.
+ if (g_promise)
+ {
+ PRINT ("main: apparently we did not complete...");
+ abort ();
+ }
+
+ PRINT ("main: returning");
+ return t;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C b/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C
new file mode 100644
index 00000000000..c31fcb58b2e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C
@@ -0,0 +1,59 @@
+// Test handling of the case where we have a void g-r-o and a non-void
+// and non-class-type ramp return.
+
+#include "coro.h"
+
+int g_promise = -1;
+
+template<typename R, typename HandleRef, typename ...T>
+struct std::coroutine_traits<R, HandleRef, T...> {
+ struct promise_type {
+ promise_type (HandleRef h, T ...args)
+ { h = std::coroutine_handle<promise_type>::from_promise (*this);
+ PRINT ("Created Promise");
+ g_promise = 1;
+ }
+ ~promise_type () { PRINT ("Destroyed Promise"); g_promise = 0;}
+ void get_return_object() {}
+
+ auto initial_suspend() {
+ return std::suspend_always{};
+ }
+ auto final_suspend() { return std::suspend_never{}; }
+
+ void return_void() {}
+ void unhandled_exception() {}
+ };
+};
+
+int
+my_coro (std::coroutine_handle<>& h)
+{
+ PRINT ("coro1: about to return");
+ co_return;
+} // { dg-error {cannot initialize a return object of type 'int' with an rvalue of type 'void'} }
+
+int main ()
+{
+ std::coroutine_handle<> h;
+ int t = my_coro (h);
+
+ if (h.done())
+ {
+ PRINT ("main: apparently was already done...");
+ abort ();
+ }
+
+ // initial suspend.
+ h.resume ();
+
+ // The coro should have self-destructed.
+ if (g_promise)
+ {
+ PRINT ("main: apparently we did not complete...");
+ abort ();
+ }
+
+ PRINT ("main: returning");
+ return t;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-bad-grooaf-00-static.C b/gcc/testsuite/g++.dg/coroutines/coro-bad-grooaf-00-static.C
new file mode 100644
index 00000000000..e7d04346d57
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/coro-bad-grooaf-00-static.C
@@ -0,0 +1,15 @@
+/* g-r-o-o-a-f should be static. */
+
+#define BAD_GROOAF_STATIC
+#define PROVIDE_GROOAF
+#include "coro1-allocators.h"
+
+int used_grooaf = 0;
+
+struct coro1
+f () noexcept
+{
+ PRINT ("coro1: about to return");
+ co_return;
+} // { dg-error {cannot call member function 'coro1 coro1::promise_type::get_return_object_on_allocation_failure\(\)' without object} }
+
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-bad-grooaf-01-grooaf-expected.C b/gcc/testsuite/g++.dg/coroutines/coro-bad-grooaf-01-grooaf-expected.C
new file mode 100644
index 00000000000..9fa3d64a9f2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/coro-bad-grooaf-01-grooaf-expected.C
@@ -0,0 +1,14 @@
+/* g-r-o-o-a-f would be expected, since we have a noexcept op new. */
+
+#define USE_FAILING_OP_NEW
+#include "coro1-allocators.h"
+
+int used_grooaf = 0;
+
+struct coro1
+f () noexcept // { dg-warning {'operator new' is marked 'throw\(\)' or 'noexcept' but no usable 'get_return_object_on_allocation_failure' is provided by 'std::__n4861::__coroutine_traits_impl<coro1, void>::promise_type' \{aka 'coro1::promise_type'\}} }
+{
+ PRINT ("coro1: about to return");
+ co_return;
+}
+
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-final-suspend.C b/gcc/testsuite/g++.dg/coroutines/coro-missing-final-suspend.C
new file mode 100644
index 00000000000..6a0878c1269
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-final-suspend.C
@@ -0,0 +1,19 @@
+// { dg-additional-options "-fsyntax-only -w" }
+#include "coro.h"
+
+// Check diagnostic return from missing promise initial suspend entry.
+
+#define MISSING_FINAL_SUSPEND
+#include "coro1-ret-int-yield-int.h"
+
+coro1
+my_coro () // { dg-error {no member named 'final_suspend' in} }
+{
+ co_return 0;
+}
+
+// check we have not messed up continuation of the compilation.
+template <class... Args>
+struct void_t_imp {
+ using type = void;
+};
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-initial-suspend.C b/gcc/testsuite/g++.dg/coroutines/coro-missing-initial-suspend.C
new file mode 100644
index 00000000000..c5b88ff434a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-initial-suspend.C
@@ -0,0 +1,19 @@
+// { dg-additional-options "-fsyntax-only -w" }
+#include "coro.h"
+
+// Check diagnostic return from missing promise initial suspend entry.
+
+#define MISSING_INITIAL_SUSPEND
+#include "coro1-ret-int-yield-int.h"
+
+coro1
+my_coro () // { dg-error {no member named 'initial_suspend' in} }
+{
+ co_return 0;
+}
+
+// check we have not messed up continuation of the compilation.
+template <class... Args>
+struct void_t_imp {
+ using type = void;
+};
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-promise-yield.C b/gcc/testsuite/g++.dg/coroutines/coro-missing-promise-yield.C
index d489c3953ac..a85a4d54bbe 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-missing-promise-yield.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-promise-yield.C
@@ -27,6 +27,12 @@ bar ()
co_return 0;
}
+// check we have not messed up continuation of the compilation.
+template <class... Args>
+struct void_t_imp {
+ using type = void;
+};
+
int main (int ac, char *av[]) {
MissingPromiseYield x = bar ();
return 0;
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-promise.C b/gcc/testsuite/g++.dg/coroutines/coro-missing-promise.C
index e75f2002db0..834cf1209cd 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-missing-promise.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-promise.C
@@ -16,3 +16,9 @@ bar ()
co_yield 22; // { dg-error {unable to find the promise type for this coroutine} }
co_return 0;
}
+
+// check we have not messed up continuation of the compilation.
+template <class... Args>
+struct void_t_imp {
+ using type = void;
+};
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-value.C b/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-value.C
index f238c4b9a35..f745fa9c852 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-value.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-value.C
@@ -28,6 +28,12 @@ bar ()
co_return 6174; // { dg-error {no member named 'return_value' in} }
}
+// check we have not messed up continuation of the compilation.
+template <class... Args>
+struct void_t_imp {
+ using type = void;
+};
+
int main (int ac, char *av[]) {
MissingRetValue x = bar ();
return 0;
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-void.C b/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-void.C
index c9f84e59020..8639a9d4f76 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-void.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-void.C
@@ -28,6 +28,12 @@ bar ()
co_return; // { dg-error "no member named .return_void. in" }
}
+// check we have not messed up continuation of the compilation.
+template <class... Args>
+struct void_t_imp {
+ using type = void;
+};
+
int main (int ac, char *av[]) {
MissingRetVoid x = bar ();
return 0;
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-ueh-3.C b/gcc/testsuite/g++.dg/coroutines/coro-missing-ueh-3.C
index d775d8a630e..36bd7da4991 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-missing-ueh-3.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-ueh-3.C
@@ -12,6 +12,12 @@ bar ()
co_return;
}
+// check we have not messed up continuation of the compilation.
+template <class... Args>
+struct void_t_imp {
+ using type = void;
+};
+
int main (int ac, char *av[]) {
MissingUEH x = bar ();
return 0;
diff --git a/gcc/testsuite/g++.dg/coroutines/coro.h b/gcc/testsuite/g++.dg/coroutines/coro.h
index fccfe418616..02d26602727 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro.h
+++ b/gcc/testsuite/g++.dg/coroutines/coro.h
@@ -2,20 +2,12 @@
#include <coroutine>
-# if __clang__
-# include <utility>
-# endif
-
namespace coro = std;
#elif __has_include(<experimental/coroutine>)
#include <experimental/coroutine>
-# if __clang__
-# include <utility>
-# endif
-
namespace coro = std::experimental;
#else
@@ -143,6 +135,8 @@ extern "C" int printf (const char *, ...);
#include <cstdlib> /* for abort () */
+#include <utility> /* for std::forward */
+
#ifndef OUTPUT
# define PRINT(X)
# define PRINTF (void)
diff --git a/gcc/testsuite/g++.dg/coroutines/coro1-allocators.h b/gcc/testsuite/g++.dg/coroutines/coro1-allocators.h
index 3d869106006..f7a85e9e671 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro1-allocators.h
+++ b/gcc/testsuite/g++.dg/coroutines/coro1-allocators.h
@@ -172,8 +172,11 @@ struct coro1 {
}
#endif
+#ifndef BAD_GROOAF_STATIC
+# define BAD_GROOAF_STATIC static
+#endif
#ifdef PROVIDE_GROOAF
- static coro1 get_return_object_on_allocation_failure () noexcept {
+ BAD_GROOAF_STATIC coro1 get_return_object_on_allocation_failure () noexcept {
PRINT ("alloc fail return");
used_grooaf++;
return coro1 (nullptr);
diff --git a/gcc/testsuite/g++.dg/coroutines/coro1-ret-int-yield-int.h b/gcc/testsuite/g++.dg/coroutines/coro1-ret-int-yield-int.h
index 67ac197fee4..7cf50525924 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro1-ret-int-yield-int.h
+++ b/gcc/testsuite/g++.dg/coroutines/coro1-ret-int-yield-int.h
@@ -99,14 +99,20 @@ struct coro1 {
return handle_type::from_promise (*this);
}
+#ifdef MISSING_INITIAL_SUSPEND
+#else
auto initial_suspend () {
PRINT ("get initial_suspend (always)");
return suspend_always_prt{};
}
+#endif
+#ifdef MISSING_FINAL_SUSPEND
+#else
auto final_suspend () {
PRINT ("get final_suspend (always)");
return suspend_always_prt{};
}
+#endif
#ifdef USE_AWAIT_TRANSFORM
diff --git a/gcc/testsuite/g++.dg/coroutines/coroutines.exp b/gcc/testsuite/g++.dg/coroutines/coroutines.exp
index e7fd4dac461..1bef98ae54d 100644
--- a/gcc/testsuite/g++.dg/coroutines/coroutines.exp
+++ b/gcc/testsuite/g++.dg/coroutines/coroutines.exp
@@ -29,7 +29,7 @@ if ![info exists DEFAULT_CXXFLAGS] then {
}
set DEFAULT_COROFLAGS $DEFAULT_CXXFLAGS
-lappend DEFAULT_COROFLAGS "-std=c++17" "-fcoroutines"
+lappend DEFAULT_COROFLAGS "-std=c++20"
dg-init
diff --git a/gcc/testsuite/g++.dg/coroutines/pr9xxxx-mismatched-traits-and-promise-prev.C b/gcc/testsuite/g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C
index 235b5e757be..235b5e757be 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr9xxxx-mismatched-traits-and-promise-prev.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C
diff --git a/gcc/testsuite/g++.dg/coroutines/pr94817.C b/gcc/testsuite/g++.dg/coroutines/pr94817.C
new file mode 100644
index 00000000000..8f667bb942b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr94817.C
@@ -0,0 +1,10 @@
+
+void no_coroutine_traits() {
+ co_await 4; // { dg-error {coroutines require a traits template\; cannot find 'std::coroutine_traits'} }
+}
+
+// check we have not messed up continuation of the compilation.
+template <class... Args>
+struct void_t_imp {
+ using type = void;
+};
diff --git a/gcc/testsuite/g++.dg/coroutines/pr94829.C b/gcc/testsuite/g++.dg/coroutines/pr94829.C
new file mode 100644
index 00000000000..289c2802273
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr94829.C
@@ -0,0 +1,49 @@
+
+namespace std::experimental {
+template <typename R, typename... T> struct coroutine_traits {
+ using promise_type = typename R::promise_type;
+};
+
+template <class Promise = void> struct coroutine_handle;
+template <> struct coroutine_handle<void> {
+ static coroutine_handle from_address(void *) noexcept;
+ coroutine_handle() = default;
+ template <class PromiseType>
+ coroutine_handle(coroutine_handle<PromiseType>) noexcept;
+};
+template <class Promise> struct coroutine_handle : coroutine_handle<void> {
+ coroutine_handle() = default;
+ static coroutine_handle from_address(void *) noexcept;
+};
+}
+
+struct suspend_always {
+ bool await_ready() noexcept;
+ void await_suspend(std::experimental::coroutine_handle<>) noexcept;
+ void await_resume() noexcept;
+};
+
+struct Task {
+ struct promise_type {
+ Task get_return_object();
+ void return_void() {}
+ suspend_always initial_suspend() noexcept;
+ suspend_always final_suspend() noexcept;
+ void unhandled_exception() noexcept;
+ };
+};
+
+template <typename _AwrT> auto SyncAwait(_AwrT &&A) {
+ if (!A.await_ready()) {
+ auto AwaitAsync = [&]() -> Task {
+ try { (void)(co_await A); } catch (...) {} // { dg-error {coroutines require a traits template; cannot find 'std::coroutine_traits'} }
+ };
+ Task t = AwaitAsync();
+ }
+ return A.await_resume();
+}
+
+void f() {
+ suspend_always test;
+ SyncAwait(test);
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95050.C b/gcc/testsuite/g++.dg/coroutines/pr95050.C
new file mode 100644
index 00000000000..fd1516d32f0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr95050.C
@@ -0,0 +1,49 @@
+#if __has_include (<coroutine>)
+#include <coroutine>
+using namespace std;
+#elif defined (__clang__) && __has_include (<experimental/coroutine>)
+#include <experimental/coroutine>
+using namespace std::experimental;
+#endif
+#include <utility>
+
+struct ret_type
+{
+ ret_type () = default;
+ ret_type (const ret_type&) = delete;
+ //ret_type (ret_type&&) = default;
+ ~ret_type() {}
+};
+
+struct task
+{
+ struct promise_type
+ {
+ auto get_return_object () -> task { return {}; }
+ auto initial_suspend () -> suspend_always { return {}; }
+ auto final_suspend () -> suspend_always { return {}; }
+ void return_void () {}
+ void unhandled_exception () { }
+ void thing (ret_type x) {}
+ };
+};
+
+struct awaiter
+{
+ bool await_ready() const { return true; }
+ void await_suspend (coroutine_handle<>) {}
+ ret_type await_resume() { return {}; }
+};
+
+task
+my_coro ()
+{
+ ret_type r2{co_await awaiter{}};
+ //ret_type r3 (std::move(r2));
+}
+
+int main()
+{
+ auto x = my_coro ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95345.C b/gcc/testsuite/g++.dg/coroutines/pr95345.C
new file mode 100644
index 00000000000..90e946d91c2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr95345.C
@@ -0,0 +1,32 @@
+#if __has_include (<coroutine>)
+#include <coroutine>
+using namespace std;
+#elif defined (__clang__) && __has_include (<experimental/coroutine>)
+#include <experimental/coroutine>
+using namespace std::experimental;
+#endif
+
+struct dummy_coro
+{
+ using promise_type = dummy_coro;
+ bool await_ready() { return false; }
+ void await_suspend(std::coroutine_handle<>) { }
+ void await_resume() { }
+ dummy_coro get_return_object() { return {}; }
+ dummy_coro initial_suspend() { return {}; }
+ dummy_coro final_suspend() { return {}; }
+ void return_void() { }
+ void unhandled_exception() { }
+};
+
+template <int ...I>
+dummy_coro
+foo()
+{
+ ((co_await [](int){ return std::suspend_never{}; }(I)), ...);
+ co_return;
+}
+
+void bar() {
+ foo<1>();
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95346.C b/gcc/testsuite/g++.dg/coroutines/pr95346.C
new file mode 100644
index 00000000000..8505a7322e1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr95346.C
@@ -0,0 +1,26 @@
+#if __has_include(<coroutine>)
+#include <coroutine>
+#elif defined (__clang__) && __has_include (<experimental/coroutine>)
+#include <experimental/coroutine>
+namespace std { using namespace experimental; }
+#endif
+#include <utility>
+
+struct task {
+ struct promise_type {
+ task get_return_object();
+ void return_void();
+ void unhandled_exception();
+ std::suspend_always initial_suspend() noexcept;
+ std::suspend_always final_suspend() noexcept;
+ };
+};
+
+struct wrapper {
+ using promise_type = task::promise_type;
+ wrapper(task&&);
+};
+
+wrapper f() {
+ co_return;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95350.C b/gcc/testsuite/g++.dg/coroutines/pr95350.C
new file mode 100644
index 00000000000..1915032c471
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr95350.C
@@ -0,0 +1,28 @@
+#if __has_include(<coroutine>)
+#include <coroutine>
+#else
+#include <experimental/coroutine>
+namespace std { using namespace experimental; }
+#endif
+#include <utility>
+
+struct task {
+ struct promise_type {
+ task get_return_object();
+ void return_void();
+ void unhandled_exception();
+ std::suspend_always initial_suspend() noexcept;
+ std::suspend_always final_suspend() noexcept;
+ };
+};
+
+struct move_only {
+ move_only();
+ move_only(const move_only&) = delete;
+ move_only(move_only&) = delete;
+ move_only(move_only&&) = default;
+};
+
+task f(move_only x) {
+ co_return;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95440.C b/gcc/testsuite/g++.dg/coroutines/pr95440.C
new file mode 100644
index 00000000000..8542880d1ab
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr95440.C
@@ -0,0 +1,39 @@
+#if __has_include(<coroutine>)
+#include <coroutine>
+#else
+#include <experimental/coroutine>
+namespace std { using namespace experimental; }
+#endif
+#if 0
+struct suspend_n {
+ const int x;
+ constexpr suspend_n (int x) : x (x) {}
+ constexpr static bool await_ready() { return false; }
+ constexpr static void await_suspend(std::coroutine_handle<>) {}
+ constexpr static void await_resume() {}
+};
+#endif
+struct task
+{
+ struct promise_type
+ {
+ auto get_return_object() const { return task{}; }
+#if 0
+// static constexpr suspend_n initial_suspend() { return {2}; }
+#endif
+ static constexpr std::suspend_always initial_suspend() { return {}; }
+ static constexpr std::suspend_never final_suspend() { return {}; }
+ static constexpr void return_void() {}
+ static constexpr void unhandled_exception() {}
+ };
+};
+
+task
+test_task ()
+{
+ co_await std::suspend_always{};
+}
+
+auto t = test_task();
+
+int main() {}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95477.C b/gcc/testsuite/g++.dg/coroutines/pr95477.C
new file mode 100644
index 00000000000..7050aee0078
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr95477.C
@@ -0,0 +1,37 @@
+// { dg-do run }
+
+#include "coro.h"
+
+struct simple {
+ static inline int alive = 0;
+ simple() { ++alive; }
+ simple(simple&&) { ++alive; }
+ ~simple() { --alive; }
+
+ struct promise_type {
+ simple get_return_object() { return simple{}; }
+ void return_void() {}
+ void unhandled_exception() {}
+ auto initial_suspend() noexcept { return coro::suspend_never{}; }
+ auto final_suspend() noexcept { return coro::suspend_never{}; }
+ };
+};
+
+simple
+f()
+{
+ co_return;
+}
+
+int main() {
+ {
+ f();
+ }
+
+ if (simple::alive != 0)
+ {
+ PRINTF ("something wrong with dtors: %d\n", simple::alive);
+ abort ();
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95505.C b/gcc/testsuite/g++.dg/coroutines/pr95505.C
new file mode 100644
index 00000000000..a76b827cae4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr95505.C
@@ -0,0 +1,26 @@
+#if __has_include (<coroutine>)
+#include <coroutine>
+using namespace std;
+#elif defined (__clang__) && __has_include (<experimental/coroutine>)
+#include <experimental/coroutine>
+namespace std { using namespace experimental; }
+#endif
+
+struct dummy
+{
+ struct promise_type
+ {
+ dummy get_return_object() const noexcept { return {}; }
+ static dummy get_return_object_on_allocation_failure() noexcept { return {}; }
+ std::suspend_always initial_suspend() const noexcept { return {}; }
+ std::suspend_never final_suspend() const noexcept { return {}; }
+ void return_void() const noexcept {}
+ void unhandled_exception() const noexcept {}
+ };
+};
+
+dummy foo() // { dg-error {dummy::promise_type::get_return_object_on_allocation_failure.*but 'std::nothrow' cannot be found} }
+{
+ co_return;
+}
+
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95518.C b/gcc/testsuite/g++.dg/coroutines/pr95518.C
new file mode 100644
index 00000000000..b1717677810
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr95518.C
@@ -0,0 +1,28 @@
+// { dg-additional-options "-O -Wunused-function" }
+
+#if __has_include (<coroutine>)
+#include <coroutine>
+using namespace std;
+#elif defined (__clang__) && __has_include (<experimental/coroutine>)
+#include <experimental/coroutine>
+namespace std { using namespace experimental; }
+#endif
+
+struct dummy
+{
+ struct promise_type
+ {
+ dummy get_return_object() const noexcept { return {}; }
+ std::suspend_never initial_suspend() const noexcept { return {}; }
+ std::suspend_never final_suspend() const noexcept { return {}; }
+ void return_void() const noexcept {}
+ void unhandled_exception() const noexcept {}
+ };
+};
+
+// This checks that the attribute is passed on to the outlined coroutine
+// functions (so that there should be no diagnostic).
+[[maybe_unused]] static dummy foo()
+{
+ co_return;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95591.C b/gcc/testsuite/g++.dg/coroutines/pr95591.C
new file mode 100644
index 00000000000..664b1d39619
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr95591.C
@@ -0,0 +1,26 @@
+#if __has_include (<coroutine>)
+#include <coroutine>
+using namespace std;
+#elif defined (__clang__) && __has_include (<experimental/coroutine>)
+#include <experimental/coroutine>
+namespace std { using namespace experimental; }
+#endif
+
+struct generator {
+ struct promise_type {
+ generator get_return_object();
+ void return_void();
+ void unhandled_exception();
+ suspend_always initial_suspend();
+ suspend_always final_suspend();
+
+ template<typename Arg>
+ suspend_always yield_value(Arg&&) {
+ return {};
+ }
+ };
+};
+
+generator x() {
+ co_yield "foo";
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95599.C b/gcc/testsuite/g++.dg/coroutines/pr95599.C
new file mode 100644
index 00000000000..9376359d378
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr95599.C
@@ -0,0 +1,69 @@
+// { dg-do run }
+
+// The simplest co_await we can do.
+
+#include "coro.h"
+
+// boiler-plate for tests of codegen
+#include "coro1-ret-int-yield-int.h"
+
+int counter = 0;
+int a, b, c, d;
+int e, f, g;
+
+struct suspend_always_order {
+ suspend_always_order (int *v) {
+ PRINT ("susp-always-order-ctor-value"); *v = counter++;
+ }
+ suspend_always_order () { PRINT ("susp-always-order-ctor"); }
+ constexpr bool await_ready() const noexcept { return false; }
+ void await_suspend(coro1::handle_type) const noexcept { PRINT ("susp-always-order-susp");}
+ void await_resume() const noexcept { PRINT ("susp-always-order-resume");}
+ ~suspend_always_order() { PRINT ("susp-always-order-dtor"); }
+};
+
+coro1
+my_coro ()
+{
+ (a = counter++, b = counter++, co_await suspend_always_order(&c), d = counter++);
+ co_await (e = counter++, suspend_always_order (&f));
+ co_return (g = counter++, 10);
+}
+
+int main ()
+{
+ auto f_coro = my_coro ();
+
+ if (f_coro.handle.done())
+ {
+ PRINT ("main: we should not be 'done' [1]");
+ abort ();
+ }
+ PRINT ("main: resuming [1] initial suspend");
+ f_coro.handle.resume();
+ PRINT ("main: resuming [2] co_await");
+ f_coro.handle.resume();
+ PRINT ("main: resuming [3] co_await");
+ f_coro.handle.resume();
+
+ /* we should now have returned with the co_return */
+ if (!f_coro.handle.done())
+ {
+ PRINT ("main: we should be 'done' ");
+ abort ();
+ }
+ int y = f_coro.handle.promise().get_value();
+ if (y != 10)
+ {
+ PRINTF ("main: y is wrong : %d, should be 10\n", y);
+ abort ();
+ }
+ if (a != 0 || b != 1 || c != 2 || d != 3
+ || e != 4 || f != 5 || g != 6 )
+ {
+ PRINTF ("something happened in the wrong order %d, %d, %d, %d, %d, %d, %d\n", a, b, c, d, e, f, g);
+ abort ();
+ }
+ puts ("main: done");
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95711.C b/gcc/testsuite/g++.dg/coroutines/pr95711.C
new file mode 100644
index 00000000000..f6aedb16ebd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr95711.C
@@ -0,0 +1,79 @@
+// { dg-do run }
+
+#if __has_include(<coroutine>)
+#include <coroutine>
+#else
+#include <experimental/coroutine>
+namespace std {
+ using namespace std::experimental;
+}
+#endif
+#include <cstdlib>
+
+template <typename T>
+struct generator{
+ struct promise_type;
+ using coro_handle = std::coroutine_handle<promise_type>;
+
+ struct promise_type{
+ std::suspend_always yield_value (T value){
+ value_ = value;
+ return {};
+ }
+ std::suspend_always initial_suspend (){
+ return {};
+ }
+ std::suspend_always final_suspend (){
+ return {};
+ }
+
+ std::suspend_never return_void()
+ {
+ return {};
+ }
+ generator get_return_object () {
+ return {coro_handle::from_promise(*this)};
+ }
+ void unhandled_exception () {
+ return;
+ }
+ T value_;
+ };
+ coro_handle handle;
+ generator(coro_handle h)
+ :handle(h)
+ {}
+ ~generator(){
+ if(handle)
+ handle.destroy();
+ }
+
+ bool resume(){
+ if(not handle.done())
+ handle.resume();
+ return not handle.done();
+ };
+
+ T get () {
+ return handle.promise().value_;
+ }
+};
+namespace A
+{
+}
+
+generator<int>
+parse()
+{
+ namespace B = A;
+ co_yield 1;
+}
+
+int main()
+{
+ auto gen = parse();
+ gen.handle.resume (); /* init suspend. */
+ if (gen.get() != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95736.C b/gcc/testsuite/g++.dg/coroutines/pr95736.C
new file mode 100644
index 00000000000..0be5168a8d2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr95736.C
@@ -0,0 +1,84 @@
+#include <iostream>
+#include <exception>
+#include <cassert>
+
+#if __has_include("coroutine")
+#include <coroutine>
+namespace stdcoro = std;
+#else
+#include <experimental/coroutine>
+namespace stdcoro = std::experimental;
+#endif
+
+struct footable : stdcoro::suspend_always {
+ footable() noexcept = default;
+ ~footable() { assert(released); }
+ footable(const footable&) = delete;
+
+ using coro_handle = stdcoro::coroutine_handle<>;
+
+ void await_suspend(coro_handle awaiter) noexcept {
+ std::cout << "suspending to footable " << this << std::endl;
+ assert(!handle);
+ handle = awaiter;
+ }
+ void await_resume() noexcept {
+ std::cout << "resuming from footable " << this << std::endl;
+ assert(handle);
+ handle = {};
+ }
+
+ void operator()() noexcept {
+ std::cout << "operator() on " << this << std::endl;
+ assert(handle);
+ handle.resume();
+ handle = {};
+ }
+
+ void release() noexcept { released = true; }
+private:
+ coro_handle handle;
+ bool released = false;
+};
+
+struct footask {
+ struct promise_type {
+ using coro_handle = stdcoro::coroutine_handle<promise_type>;
+
+ stdcoro::suspend_never initial_suspend() noexcept { return {}; }
+ stdcoro::suspend_never final_suspend() noexcept { std::cout << "final suspend" << std::endl; return {}; }
+ void unhandled_exception() {}
+ void return_void() noexcept { std::cout << "coro returns" << std::endl; }
+
+ footask get_return_object() { return footask{ coro_handle::from_promise(*this) }; }
+ };
+
+ footask(promise_type::coro_handle handle) : handle(handle) {}
+ ~footask() { assert(handle.done()); }
+
+ promise_type::coro_handle handle;
+};
+
+struct bar {
+ bar() = default;
+ bar(const bar&) = delete;
+
+ footable foo{};
+ footask task = taskfun();
+
+ footask taskfun() noexcept {
+ std::cout << "coro begin" << std::endl;
+ co_await foo;
+ std::cout << "coro end" << std::endl;
+ }
+};
+
+int main() {
+ bar foobar;
+ foobar.foo();
+ assert(foobar.task.handle.done());
+ std::cout << "releasing" << std::endl;
+ foobar.foo.release();
+ std::cout << "done" << std::endl;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95813.C b/gcc/testsuite/g++.dg/coroutines/pr95813.C
new file mode 100644
index 00000000000..445cdf1f7ef
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr95813.C
@@ -0,0 +1,46 @@
+// { dg-additional-options "-Wall -O" }
+
+// This should complete without any diagnostic.
+
+#include <coroutine>
+#include <exception>
+
+template <typename T>
+class lazy {
+ T _v = 0;
+public:
+ lazy() {}
+ bool await_ready() {return true;}
+ void await_suspend(auto x) noexcept {}
+ T await_resume() { return _v; }
+};
+
+namespace std {
+
+template <typename T, typename... Args>
+struct coroutine_traits<lazy<T>, Args...> {
+ struct promise_type {
+ suspend_always initial_suspend() const { return {}; }
+ suspend_always final_suspend() const { return {}; }
+ void return_value(T val) {}
+ lazy<T> get_return_object() {
+ return lazy<T>();
+ }
+ void unhandled_exception() {
+ std::terminate();
+ }
+ };
+};
+}
+
+struct xxx {
+ static lazy<int> func() {
+ co_return 1;
+ }
+};
+
+#if 0
+lazy<int> foo() {
+ co_return co_await xxx::func();
+}
+#endif
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95823.C b/gcc/testsuite/g++.dg/coroutines/pr95823.C
new file mode 100644
index 00000000000..14d4680206d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr95823.C
@@ -0,0 +1,30 @@
+#include <coroutine>
+#include <memory>
+
+struct task {
+ struct promise_type {
+ auto initial_suspend() noexcept { return std::suspend_always{}; }
+ auto final_suspend() noexcept { return std::suspend_always{}; }
+ void return_void() {}
+ task get_return_object() { return task{}; }
+ void unhandled_exception() noexcept {}
+ };
+
+ ~task() noexcept {}
+
+ bool await_ready() const noexcept { return false; }
+ void await_suspend(std::coroutine_handle<>) noexcept {}
+ void await_resume() noexcept {}
+};
+
+struct Id
+{
+ std::unique_ptr<int> value;
+};
+
+task g(int);
+
+task f() {
+ std::unique_ptr<Id> id;
+ co_await g(*id->value);
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95824.C b/gcc/testsuite/g++.dg/coroutines/pr95824.C
new file mode 100644
index 00000000000..d44d7015090
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr95824.C
@@ -0,0 +1,37 @@
+#include <coroutine>
+
+struct task {
+ struct promise_type {
+ auto initial_suspend() noexcept { return std::suspend_always{}; }
+ auto final_suspend() noexcept { return std::suspend_always{}; }
+ void return_void() {}
+ task get_return_object() { return task{}; }
+ void unhandled_exception() noexcept {}
+ };
+
+ ~task() noexcept {}
+
+ bool await_ready() const noexcept { return false; }
+ void await_suspend(std::coroutine_handle<>) noexcept {}
+ void await_resume() noexcept {}
+};
+
+struct base
+{
+ virtual ~base() = default;
+};
+
+class exception : public virtual base
+{};
+
+struct factory
+{
+ virtual ~factory() = default;
+ virtual int makeId() const;
+};
+
+task g(int);
+
+task f(factory& factory) {
+ co_await g(factory.makeId());
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C
index 3168ea272c1..01a75c1905d 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C
@@ -5,14 +5,17 @@
#include "../coro.h"
+int g_promise = -1;
+
template<typename R, typename HandleRef, typename ...T>
struct std::coroutine_traits<R, HandleRef, T...> {
struct promise_type {
promise_type (HandleRef h, T ...args)
{ h = std::coroutine_handle<promise_type>::from_promise (*this);
PRINT ("Created Promise");
+ g_promise = 1;
}
-
+ ~promise_type () { PRINT ("Destroyed Promise"); g_promise = 0;}
void get_return_object() {}
auto initial_suspend() {
@@ -45,10 +48,11 @@ int main ()
// initial suspend.
h.resume ();
-
- if (!h.done())
+
+ // The coro should have self-destructed.
+ if (g_promise)
{
- PRINT ("main: apparently wasn't done...");
+ PRINT ("main: apparently we did not complete...");
abort ();
}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/func-params-08.C b/gcc/testsuite/g++.dg/coroutines/torture/func-params-08.C
index c166745e052..cce1521b226 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/func-params-08.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/func-params-08.C
@@ -69,8 +69,9 @@ my_coro (Foo t_lv, Foo& t_ref, Foo&& t_rv_ref)
PRINT ("my_coro 1");
sum += co_await t_ref;
PRINT ("my_coro 2");
- sum += co_await t_rv_ref;
- PRINT ("my_coro 3");
+ // This can't work for the rvalue ref, it's always dangling.
+ //sum += co_await t_rv_ref;
+ //PRINT ("my_coro 3");
co_return sum;
}
@@ -90,17 +91,17 @@ int main ()
// now do the three co_awaits.
while(!x.handle.done())
x.handle.resume();
- PRINT ("main: after resuming 3 co_awaits");
+ PRINT ("main: after resuming 2 co_awaits");
/* Now we should have the co_returned value. */
int y = x.handle.promise().get_value();
- if (y != 14)
+ if (y != 10)
{
PRINTF ("main: wrong result (%d).", y);
abort ();
}
- if (regular != 3 || copy != 1 || move != 1)
+ if (regular != 3 || copy != 0 || move != 1)
{
PRINTF ("main: unexpected ctor use (R:%d, C:%d, M:%d)\n",
regular, copy, move);
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/func-params-09-awaitable-parms.C b/gcc/testsuite/g++.dg/coroutines/torture/func-params-09-awaitable-parms.C
index 7d376b91f13..81430bf4d54 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/func-params-09-awaitable-parms.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/func-params-09-awaitable-parms.C
@@ -62,8 +62,9 @@ my_coro (FooAwaitable t_lv, FooAwaitable& t_ref, FooAwaitable&& t_rv_ref)
PRINT ("my_coro 1");
sum += co_await t_ref;
PRINT ("my_coro 2");
- sum += co_await t_rv_ref;
- PRINT ("my_coro 3");
+ // This can't work for the rvalue ref, it's always dangling.
+ //sum += co_await t_rv_ref;
+ //PRINT ("my_coro 3");
co_return sum;
}
@@ -83,17 +84,17 @@ int main ()
// now do the three co_awaits.
while(!x.handle.done())
x.handle.resume();
- PRINT ("main: after resuming 3 co_awaits");
+ PRINT ("main: after resuming 2 co_awaits");
/* Now we should have the co_returned value. */
int y = x.handle.promise().get_value();
- if (y != 14)
+ if (y != 10)
{
PRINTF ("main: wrong result (%d).", y);
abort ();
}
- if (regular != 3 || copy != 1 || move != 1)
+ if (regular != 3 || copy != 0 || move != 1)
{
PRINTF ("main: unexpected ctor use (R:%d, C:%d, M:%d)\n",
regular, copy, move);
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95003.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95003.C
new file mode 100644
index 00000000000..eda785827ec
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95003.C
@@ -0,0 +1,50 @@
+// { dg-do run }
+
+#include "../coro.h"
+#include "../coro1-ret-int-yield-int.h"
+
+// This tests that, when we insert bind scopes to contain variables that
+// have been promoted from compiler temporaries to extend their lifetimes
+// to a containing full expression, the inserted bind scopes have their
+// tree-side-effects set.
+
+struct Awaitable {
+ int v;
+ Awaitable (int _v) : v(_v) {}
+ bool await_ready() { return false; }
+ void await_suspend(std::coroutine_handle<coro1::promise_type>) {}
+ int await_resume() { return v; }
+ auto operator co_await() { return *this; }
+};
+
+coro1
+my_coro
+(int x)
+{
+ int sum = 0;
+ for (unsigned i = 0; i < 100; ++i) {
+ sum += co_await Awaitable{x+1};
+ }
+ co_return sum;
+}
+
+int main ()
+{
+ PRINT ("main: create coro1");
+ struct coro1 f_coro = my_coro (0);
+
+ PRINT ("main: OK -- looping");
+
+ do {
+ f_coro.handle.resume();
+ } while (!f_coro.handle.done());
+
+ int y = f_coro.handle.promise().get_value();
+ if (y != 100)
+ {
+ PRINTF ("main: y is wrong : %d, should be 100\n", y);
+ abort ();
+ }
+ puts ("main: done");
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95519-00-return_void.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-00-return_void.C
new file mode 100644
index 00000000000..2952d011674
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-00-return_void.C
@@ -0,0 +1,63 @@
+// { dg-do run }
+
+#include "../coro.h"
+
+struct pt_b
+{
+ std::suspend_never initial_suspend() const noexcept { return {}; }
+ std::suspend_never final_suspend() const noexcept { return {}; }
+ void unhandled_exception() const noexcept {}
+};
+
+int called_rv_op = 0;
+struct rv
+{
+ void operator ()(){
+ PRINT("call to operator ");
+ called_rv_op++;
+ }
+};
+
+struct pt_c : pt_b
+{
+ using handle_t = std::coroutine_handle<pt_c>;
+ auto get_return_object() noexcept { return handle_t::from_promise(*this); }
+ rv return_void;
+};
+
+int called_lambda = 0;
+
+struct pt_d : pt_b
+{
+ using handle_t = std::coroutine_handle<pt_d>;
+ auto get_return_object() noexcept { return handle_t::from_promise(*this); }
+ static constexpr auto return_void
+ = []{ PRINT("call to lambda "); called_lambda++; };
+};
+
+template <> struct std::coroutine_traits<pt_c::handle_t>
+ { using promise_type = pt_c; };
+
+static pt_c::handle_t foo ()
+{
+ co_return;
+}
+
+template <> struct std::coroutine_traits<pt_d::handle_t>
+ { using promise_type = pt_d; };
+
+static pt_d::handle_t bar ()
+{
+ co_return;
+}
+
+int main ()
+{
+ foo ();
+ bar ();
+ if (called_rv_op != 1 || called_lambda != 1)
+ {
+ PRINT ("Failed to call one of the return_void cases");
+ abort ();
+ }
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95519-01-initial-suspend.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-01-initial-suspend.C
new file mode 100644
index 00000000000..346c20dbd8f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-01-initial-suspend.C
@@ -0,0 +1,69 @@
+// { dg-do run }
+
+#include "../coro.h"
+
+struct pt_b
+{
+ std::suspend_never final_suspend() const noexcept { return {}; }
+ constexpr void return_void () noexcept {};
+ void unhandled_exception() const noexcept {}
+};
+
+int called_is_op = 0;
+struct is
+{
+ std::suspend_never operator ()() noexcept {
+ PRINT("call to operator IS");
+ called_is_op++;
+ return {};
+ }
+};
+
+struct pt_c : pt_b
+{
+ using handle_t = std::coroutine_handle<pt_c>;
+ auto get_return_object() noexcept { return handle_t::from_promise(*this); }
+ is initial_suspend;
+};
+
+int called_lambda = 0;
+struct pt_d : pt_b
+{
+ using handle_t = std::coroutine_handle<pt_d>;
+ auto get_return_object() noexcept { return handle_t::from_promise(*this); }
+ static constexpr auto initial_suspend
+ = []() noexcept {
+ PRINT("call to lambda IS");
+ called_lambda++;
+ return std::suspend_never{};
+ };
+};
+
+template <>
+struct std::coroutine_traits<pt_c::handle_t>
+{ using promise_type = pt_c; };
+
+static pt_c::handle_t foo ()
+{
+ co_return;
+}
+
+template <>
+struct std::coroutine_traits<pt_d::handle_t>
+{ using promise_type = pt_d; };
+
+static pt_d::handle_t bar ()
+{
+ co_return;
+}
+
+int main ()
+{
+ foo ();
+ bar ();
+ if (called_is_op != 1 || called_lambda != 1)
+ {
+ PRINT ("Failed to call one of the initial_suspend cases");
+ abort ();
+ }
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95519-02-final_suspend.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-02-final_suspend.C
new file mode 100644
index 00000000000..4200c333ee3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-02-final_suspend.C
@@ -0,0 +1,69 @@
+// { dg-do run }
+
+#include "../coro.h"
+
+struct pt_b
+{
+ std::suspend_never initial_suspend() const noexcept { return {}; }
+ constexpr void return_void () noexcept {};
+ void unhandled_exception() const noexcept {}
+};
+
+int called_fs_op = 0;
+struct fs
+{
+ auto operator ()() noexcept {
+ PRINT("call to operator FS");
+ called_fs_op++;
+ return std::suspend_never{};
+ }
+};
+
+struct pt_c : pt_b
+{
+ using handle_t = std::coroutine_handle<pt_c>;
+ auto get_return_object() noexcept { return handle_t::from_promise(*this); }
+ fs final_suspend;
+};
+
+int called_lambda = 0;
+struct pt_d : pt_b
+{
+ using handle_t = std::coroutine_handle<pt_d>;
+ auto get_return_object() noexcept { return handle_t::from_promise(*this); }
+ constexpr static auto final_suspend
+ = []() noexcept {
+ PRINT("call to lambda FS");
+ called_lambda++;
+ return std::suspend_never{};
+ };
+};
+
+template <>
+struct std::coroutine_traits<pt_c::handle_t>
+{ using promise_type = pt_c; };
+
+static pt_c::handle_t foo ()
+{
+ co_return;
+}
+
+template <>
+struct std::coroutine_traits<pt_d::handle_t>
+{ using promise_type = pt_d; };
+
+static pt_d::handle_t bar ()
+{
+ co_return;
+}
+
+int main ()
+{
+ foo ();
+ bar ();
+ if (called_fs_op != 1 || called_lambda != 1)
+ {
+ PRINT ("Failed to call one of the final_suspend cases");
+ abort ();
+ }
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95519-03-return-value.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-03-return-value.C
new file mode 100644
index 00000000000..cf4c43d1a90
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-03-return-value.C
@@ -0,0 +1,80 @@
+// { dg-do run }
+
+#include "../coro.h"
+
+struct pt_b
+{
+ std::suspend_never initial_suspend() const noexcept { return {}; }
+ std::suspend_never final_suspend() const noexcept { return {}; }
+ void unhandled_exception() const noexcept {}
+};
+
+int called_rv_op = 0;
+int v;
+
+struct pt_c : pt_b
+{
+ struct rv
+ {
+ void operator ()(int x){
+ PRINTF("call to operator ret val with %d\n", x);
+ called_rv_op++;
+ v = x;
+// int val () { return x; }
+ }
+ };
+ using handle_t = std::coroutine_handle<pt_c>;
+ auto get_return_object() noexcept { return handle_t::from_promise(*this); }
+ rv return_value;
+};
+
+int called_lambda = 0;
+
+struct pt_d : pt_b
+{
+ using handle_t = std::coroutine_handle<pt_d>;
+ auto get_return_object() noexcept { return handle_t::from_promise(*this); }
+ static constexpr auto return_value
+ = [] (int x) { PRINTF("call to lambda ret val %d\n", x); called_lambda++; v = x;};
+};
+
+template <> struct std::coroutine_traits<pt_c::handle_t>
+ { using promise_type = pt_c; };
+
+static pt_c::handle_t foo ()
+{
+ co_return 5;
+}
+
+template <> struct std::coroutine_traits<pt_d::handle_t>
+ { using promise_type = pt_d; };
+
+static pt_d::handle_t bar ()
+{
+ co_return 3;
+}
+
+int main ()
+{
+ /* These 'coroutines' run to completion imediately, like a regular fn. */
+ foo ();
+ if (v != 5)
+ {
+ PRINT ("foo failed to set v");
+ abort ();
+ }
+
+ bar ();
+ if (v != 3)
+ {
+ PRINT ("bar failed to set v");
+ abort ();
+ }
+
+
+ if (called_rv_op != 1 || called_lambda != 1)
+ {
+ PRINT ("Failed to call one of the return_value cases");
+ abort ();
+ }
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95519-04-yield-value.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-04-yield-value.C
new file mode 100644
index 00000000000..5f1be4e00f4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-04-yield-value.C
@@ -0,0 +1,84 @@
+// { dg-do run }
+
+#include "../coro.h"
+
+struct pt_b
+{
+ std::suspend_never initial_suspend() const noexcept { return {}; }
+ std::suspend_never final_suspend() const noexcept { return {}; }
+ void unhandled_exception() const noexcept {}
+ constexpr static void return_void () noexcept {}
+};
+
+int called_yv_op = 0;
+int v;
+
+struct pt_c : pt_b
+{
+ struct yv
+ {
+ auto operator ()(int x){
+ PRINTF("call to operator yield val with %d\n", x);
+ called_yv_op++;
+ v = x;
+ return std::suspend_never{};
+ }
+ };
+ using handle_t = std::coroutine_handle<pt_c>;
+ auto get_return_object() noexcept { return handle_t::from_promise(*this); }
+ yv yield_value;
+};
+
+int called_lambda = 0;
+struct pt_d : pt_b
+{
+ using handle_t = std::coroutine_handle<pt_d>;
+ auto get_return_object() noexcept { return handle_t::from_promise(*this); }
+ static constexpr auto yield_value = [] (int x) -> std::suspend_never
+ {
+ PRINTF("call to lambda yield val %d\n", x);
+ called_lambda++;
+ v = x;
+ return {};
+ };
+};
+
+template <> struct std::coroutine_traits<pt_c::handle_t>
+ { using promise_type = pt_c; };
+
+static pt_c::handle_t foo ()
+{
+ co_yield 5;
+}
+
+template <> struct std::coroutine_traits<pt_d::handle_t>
+ { using promise_type = pt_d; };
+
+static pt_d::handle_t bar ()
+{
+ co_yield 3;
+}
+
+int main ()
+{
+ /* These 'coroutines' run to completion imediately, like a regular fn. */
+ foo ();
+ if (v != 5)
+ {
+ PRINT ("foo failed to yield v");
+ abort ();
+ }
+
+ bar ();
+ if (v != 3)
+ {
+ PRINT ("bar failed to yield v");
+ abort ();
+ }
+
+ if (called_yv_op != 1 || called_lambda != 1)
+ {
+ PRINT ("Failed to call one of the yield_value cases");
+ abort ();
+ }
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95519-05-gro.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-05-gro.C
new file mode 100644
index 00000000000..fbbce97ed17
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-05-gro.C
@@ -0,0 +1,64 @@
+// { dg-do run }
+
+#include "../coro.h"
+
+struct pt_b
+{
+ std::suspend_always initial_suspend() const noexcept { return {}; }
+ std::suspend_never final_suspend() const noexcept { return {}; }
+ constexpr void return_void () noexcept {};
+ constexpr void unhandled_exception() const noexcept {}
+};
+
+int called_gro_op = 0;
+
+template<typename R, typename HandleRef, typename ...T>
+struct std::coroutine_traits<R, HandleRef, T...> {
+ struct pt_c;
+ using promise_type = pt_c;
+ struct pt_c : pt_b {
+ //using handle_t = std::coroutine_handle<pt_c>;
+ pt_c (HandleRef h, T ...args)
+ { h = std::coroutine_handle<pt_c>::from_promise (*this);
+ PRINT ("Created Promise");
+ //g_promise = 1;
+ }
+ struct gro
+ {
+ auto operator ()() {
+ PRINT("call to operator ");
+ called_gro_op++;
+ }
+ };
+ gro get_return_object;
+ };
+};
+
+static void
+foo (std::coroutine_handle<>& h)
+{
+ co_return;
+}
+
+int main ()
+{
+ std::coroutine_handle<> f;
+ foo (f);
+ if (f.done())
+ {
+ PRINT ("unexpected finished foo coro");
+ abort ();
+ }
+ f.resume();
+ if (!f.done())
+ {
+ PRINT ("expected foo to be finished");
+ abort ();
+ }
+
+ if (called_gro_op != 1)
+ {
+ PRINT ("Failed to call gro op");
+ abort ();
+ }
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95519-06-grooaf.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-06-grooaf.C
new file mode 100644
index 00000000000..b6b6bd73c9a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-06-grooaf.C
@@ -0,0 +1,49 @@
+// { dg-do run }
+
+#include "../coro.h"
+
+struct pt_b
+{
+ constexpr std::suspend_never initial_suspend() noexcept { return {}; }
+ constexpr std::suspend_never final_suspend() noexcept { return {}; }
+ constexpr void return_void () noexcept {}
+ constexpr void unhandled_exception() noexcept {}
+};
+
+int called_grooaf = 0;
+
+struct pt_c : pt_b
+{
+ using handle_t = std::coroutine_handle<pt_c>;
+ auto get_return_object() noexcept { return handle_t::from_promise(*this); }
+
+ static constexpr auto get_return_object_on_allocation_failure
+ = []{ PRINT("call to lambda grooaf");
+ called_grooaf++; return std::coroutine_handle<pt_c>{};
+ };
+
+ /* Provide an operator new, that always fails. */
+ void *operator new (std::size_t sz) noexcept {
+ PRINT ("promise_type: used failing op new");
+ return nullptr;
+ }
+};
+
+template <> struct std::coroutine_traits<pt_c::handle_t>
+ { using promise_type = pt_c; };
+
+static pt_c::handle_t
+foo ()
+{
+ co_return;
+}
+
+int main ()
+{
+ foo ();
+ if (called_grooaf != 1)
+ {
+ PRINT ("Failed to call grooaf");
+ abort ();
+ }
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95519-07-unhandled-exception.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-07-unhandled-exception.C
new file mode 100644
index 00000000000..be2a928ea00
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-07-unhandled-exception.C
@@ -0,0 +1,69 @@
+// { dg-do run }
+
+#include "../coro.h"
+
+struct pt_b
+{
+ constexpr std::suspend_never initial_suspend() const noexcept { return {}; }
+ constexpr std::suspend_never final_suspend() const noexcept { return {}; }
+ constexpr void return_void () {};
+};
+
+int called_ueh_op = 0;
+struct ueh
+{
+ void operator ()() noexcept {
+ PRINT("call to operator UEH");
+ called_ueh_op++;
+ }
+};
+
+struct pt_c : pt_b
+{
+ using handle_t = std::coroutine_handle<pt_c>;
+ auto get_return_object() noexcept { return handle_t::from_promise(*this); }
+ ueh unhandled_exception;
+};
+
+int lambda_ueh = 0;
+
+struct pt_d : pt_b
+{
+ using handle_t = std::coroutine_handle<pt_d>;
+ auto get_return_object() noexcept { return handle_t::from_promise(*this); }
+ static constexpr auto unhandled_exception
+ = [] () noexcept { PRINT("call to lambda UEH"); lambda_ueh++; };
+};
+
+template <>
+struct std::coroutine_traits<pt_c::handle_t>
+ { using promise_type = pt_c; };
+
+static pt_c::handle_t
+foo ()
+{
+ throw ("foo");
+ co_return;
+}
+
+template <>
+struct std::coroutine_traits<pt_d::handle_t>
+ { using promise_type = pt_d; };
+
+static pt_d::handle_t
+bar ()
+{
+ throw ("bar");
+ co_return;
+}
+
+int main ()
+{
+ foo ();
+ bar ();
+ if (called_ueh_op != 1 || lambda_ueh != 1)
+ {
+ PRINT ("Failed to call one of the UEH cases");
+ abort ();
+ }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/Wnarrowing18.C b/gcc/testsuite/g++.dg/cpp0x/Wnarrowing18.C
new file mode 100644
index 00000000000..0dc7075cd62
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/Wnarrowing18.C
@@ -0,0 +1,15 @@
+// PR c++/94590 - Detect long double -> double narrowing.
+// { dg-do compile { target c++11 } }
+// { dg-additional-options "-mlong-double-64" { target x86_64-*-* i?86-*-* } }
+
+int
+main ()
+{
+ using T = long double;
+ extern long double ld;
+ extern T ld2;
+ extern const T ld3;
+ double d{ld}; // { dg-error "narrowing conversion" }
+ double d2{ld2}; // { dg-error "narrowing conversion" }
+ double d3{ld3}; // { dg-error "narrowing conversion" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/Wredundant-move1.C b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move1.C
index e70f3cde625..ce4087b476f 100644
--- a/gcc/testsuite/g++.dg/cpp0x/Wredundant-move1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move1.C
@@ -60,7 +60,7 @@ fn4 (const T t)
{
// t is const: will decay into copy despite std::move, so it's redundant.
// We used to warn about this, but no longer since c++/87378.
- return std::move (t);
+ return std::move (t); // { dg-warning "redundant move" "" { target c++20 } }
}
int
diff --git a/gcc/testsuite/g++.dg/cpp0x/Wredundant-move7.C b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move7.C
index 015d7c4f7a4..3fec525879d 100644
--- a/gcc/testsuite/g++.dg/cpp0x/Wredundant-move7.C
+++ b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move7.C
@@ -28,7 +28,7 @@ struct S2 : S1 {};
S1
f (S2 s)
{
- return std::move(s); // { dg-bogus "redundant move in return statement" }
+ return std::move(s); // { dg-warning "redundant move in return statement" "" { target c++20 } }
}
struct R1 {
@@ -40,7 +40,7 @@ struct R2 : R1 {};
R1
f2 (const R2 s)
{
- return std::move(s); // { dg-bogus "redundant move in return statement" }
+ return std::move(s); // { dg-warning "redundant move in return statement" "" { target c++20 } }
}
struct T1 {
@@ -55,5 +55,5 @@ f3 (const T2 s)
{
// Without std::move: const T1 &
// With std::move: const T1 &&
- return std::move(s); // { dg-bogus "redundant move in return statement" }
+ return std::move(s); // { dg-warning "redundant move in return statement" "" { target c++20 } }
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/Wredundant-move9.C b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move9.C
index fdd3ce16092..ca1e23b7a4b 100644
--- a/gcc/testsuite/g++.dg/cpp0x/Wredundant-move9.C
+++ b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move9.C
@@ -61,7 +61,7 @@ fn4 (const T<int> t)
{
// t is const: will decay into copy despite std::move, so it's redundant.
// We used to warn about this, but no longer since c++/87378.
- return std::move (t);
+ return std::move (t); // { dg-warning "redundant move" "" { target c++20 } }
}
int
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-70.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-70.C
new file mode 100644
index 00000000000..28d9279e8a4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-70.C
@@ -0,0 +1,23 @@
+// PR c++/70642
+// { dg-do compile { target c++11 } }
+
+template<bool, class> struct enable_if {};
+template<class T> struct enable_if<true, T> { using type = T; };
+
+template <typename X>
+struct foo
+{
+ template <typename R>
+ using meow = typename enable_if<sizeof(X) == 0, R>::type; // { dg-error "no type named .type." }
+
+ template <typename R = int> // 1
+ meow<R> bar () = delete;
+
+ int bar ()
+ {
+ meow<int> i; // 2
+ return 0; // 3
+ }
+};
+
+int j = foo<long>().bar();
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-70001-1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-70001-1.C
index e68ff0e58a0..7b28177b82f 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-70001-1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-70001-1.C
@@ -1,5 +1,6 @@
// PR c++/70001
// { dg-do compile { target c++11 } }
+// { dg-require-effective-target size24plus }
struct B
{
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-95307.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-95307.C
new file mode 100644
index 00000000000..bd3c6a8f91f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-95307.C
@@ -0,0 +1,5 @@
+// PR c++/95307
+// { dg-do compile { target c++11 } }
+
+int v;
+constexpr auto p{reinterpret_cast<__UINTPTR_TYPE__>(&v) - 1u}; // { dg-error "conversion from pointer type" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr10.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr10.C
index b1d47cf2cbd..5224bb14234 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr10.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr10.C
@@ -19,18 +19,18 @@ constexpr int *p0 = &i;
constexpr bool b0 = p0; // { dg-warning "address of .A::i." }
constexpr bool b1 = p0 == 0; // { dg-warning "address of .A::i." }
constexpr bool b2 = p0 != 0; // { dg-warning "address of .A::i." }
-constexpr bool b3 = p0 < 0; // { dg-warning "25:ordered comparison" }
-constexpr bool b4 = p0 <= 0; // { dg-warning "25:ordered comparison" }
-constexpr bool b5 = p0 > 0; // { dg-warning "25:ordered comparison" }
-constexpr bool b6 = p0 >= 0; // { dg-warning "25:ordered comparison" }
+constexpr bool b3 = p0 < 0; // { dg-error "25:ordered comparison" }
+constexpr bool b4 = p0 <= 0; // { dg-error "25:ordered comparison" }
+constexpr bool b5 = p0 > 0; // { dg-error "25:ordered comparison" }
+constexpr bool b6 = p0 >= 0; // { dg-error "25:ordered comparison" }
constexpr bool b7 = !p0; // { dg-warning "address of .A::i." }
constexpr bool b8 = 0 == p0; // { dg-warning "address of .A::i." }
constexpr bool b9 = 0 != p0; // { dg-warning "address of .A::i." }
-constexpr bool b10 = 0 < p0; // { dg-warning "24:ordered comparison" }
-constexpr bool b11 = 0 <= p0; // { dg-warning "24:ordered comparison" }
-constexpr bool b12 = 0 > p0; // { dg-warning "24:ordered comparison" }
-constexpr bool b13 = 0 >= p0; // { dg-warning "24:ordered comparison" }
+constexpr bool b10 = 0 < p0; // { dg-error "24:ordered comparison" }
+constexpr bool b11 = 0 <= p0; // { dg-error "24:ordered comparison" }
+constexpr bool b12 = 0 > p0; // { dg-error "24:ordered comparison" }
+constexpr bool b13 = 0 >= p0; // { dg-error "24:ordered comparison" }
}
@@ -60,20 +60,19 @@ constexpr int *p0 = &i;
constexpr bool b0 = p0; // { dg-error "not a constant expression" }
constexpr bool b1 = p0 == 0; // { dg-error "not a constant expression" }
constexpr bool b2 = p0 != 0; // { dg-error "not a constant expression" }
-constexpr bool b4 = p0 <= 0; // { dg-error "not a constant expression" }
-constexpr bool b5 = p0 > 0; // { dg-error "not a constant expression" }
+constexpr bool b4 = p0 <= 0; // { dg-error "ordered comparison" }
+constexpr bool b5 = p0 > 0; // { dg-error "ordered comparison" }
constexpr bool b7 = !p0; // { dg-error "not a constant expression" }
constexpr bool b8 = 0 == p0; // { dg-error "not a constant expression" }
constexpr bool b9 = 0 != p0; // { dg-error "not a constant expression" }
-constexpr bool b10 = 0 < p0; // { dg-error "not a constant expression" }
-constexpr bool b13 = 0 >= p0; // { dg-error "not a constant expression" }
+constexpr bool b10 = 0 < p0; // { dg-error "ordered comparison" }
+constexpr bool b13 = 0 >= p0; // { dg-error "ordered comparison" }
-// The following are accepted as constant expressions due to bug c++/70196.
-constexpr bool b3 = p0 < 0;
-constexpr bool b6 = p0 >= 0;
-constexpr bool b11 = 0 <= p0;
-constexpr bool b12 = 0 > p0;
+constexpr bool b3 = p0 < 0; // { dg-error "ordered comparison" }
+constexpr bool b6 = p0 >= 0; // { dg-error "ordered comparison" }
+constexpr bool b11 = 0 <= p0; // { dg-error "ordered comparison" }
+constexpr bool b12 = 0 > p0; // { dg-error "ordered comparison" }
#pragma GCC diagnostic pop
@@ -92,14 +91,14 @@ constexpr int *p1 = &i + 1;
constexpr bool b0 = p1; // { dg-error "not a constant expression" }
constexpr bool b1 = p1 == 0; // { dg-error "not a constant expression" }
constexpr bool b2 = p1 != 0; // { dg-error "not a constant expression" }
-constexpr bool b4 = p1 <= 0; // { dg-error "not a constant expression" }
-constexpr bool b5 = p1 > 0; // { dg-error "not a constant expression" }
+constexpr bool b4 = p1 <= 0; // { dg-error "ordered comparison" }
+constexpr bool b5 = p1 > 0; // { dg-error "ordered comparison" }
constexpr bool b7 = !p1; // { dg-error "not a constant expression" }
constexpr bool b8 = 0 == p1; // { dg-error "not a constant expression" }
constexpr bool b9 = 0 != p1; // { dg-error "not a constant expression" }
-constexpr bool b10 = 0 < p1; // { dg-error "not a constant expression" }
-constexpr bool b13 = 0 >= p1; // { dg-error "not a constant expression" }
+constexpr bool b10 = 0 < p1; // { dg-error "ordered comparison" }
+constexpr bool b13 = 0 >= p1; // { dg-error "ordered comparison" }
// The following are accepted as constant expressions due to bug c++/70196.
// constexpr bool b3 = p1 < 0;
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-array25.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-array25.C
new file mode 100644
index 00000000000..9162943249f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-array25.C
@@ -0,0 +1,21 @@
+// PR c++/95241
+// { dg-do compile { target c++11 } }
+
+struct Fragment
+{
+ int off;
+ constexpr Fragment(int _off) : off(_off) { }
+ constexpr Fragment() : Fragment(1) { }
+};
+
+struct Field
+{
+ Fragment fragments[3];
+ constexpr Field(int off) : fragments{{off}} { }
+};
+
+constexpr Field field{0};
+
+static_assert(field.fragments[0].off == 0
+ && field.fragments[1].off == 1
+ && field.fragments[2].off == 1, "");
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-array26.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-array26.C
new file mode 100644
index 00000000000..274f55a88bf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-array26.C
@@ -0,0 +1,13 @@
+// PR c++/96282
+// { dg-do compile { target c++11 } }
+
+struct e { bool v = true; };
+
+template<int N>
+struct b { e m[N]; };
+
+template<int N>
+struct t : b<N> { constexpr t() : b<N>() {} };
+
+constexpr t<1> h1;
+constexpr t<42> h2;
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-array27.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-array27.C
new file mode 100644
index 00000000000..1234caef31d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-array27.C
@@ -0,0 +1,13 @@
+// PR c++/96282
+// { dg-do compile { target c++11 } }
+
+struct e { bool v = true; e *p = this; };
+
+template<int N>
+struct b { e m[N][N]; };
+
+template<int N>
+struct t : b<N> { constexpr t() : b<N>() {} };
+
+constexpr t<1> h1;
+constexpr t<42> h2;
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-bitfield3.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-bitfield3.C
index c393db4e6e9..a17d45cf6a2 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-bitfield3.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-bitfield3.C
@@ -1,5 +1,6 @@
// PR c++/49136
// { dg-do compile { target c++11 } }
+// { dg-require-effective-target int32plus }
struct S
{
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-is_literal.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-is_literal.C
index f255b8d1507..02d2ca35298 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-is_literal.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-is_literal.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++11 } }
+// { dg-do compile { target c++14_only } }
#include <type_traits>
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ptrsub2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ptrsub2.C
new file mode 100644
index 00000000000..fd644ad7854
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ptrsub2.C
@@ -0,0 +1,4 @@
+// { dg-do compile { target c++11 } }
+
+char c;
+constexpr char p2 = *(&c - 1); // { dg-error "-1" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-shift2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-shift2.C
new file mode 100644
index 00000000000..9b3490a66a7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-shift2.C
@@ -0,0 +1,12 @@
+// PR c++/94955
+// { dg-do compile { target c++11 } }
+
+struct S {
+ static constexpr char foo() { return 10; }
+};
+
+short int
+fn (short int e)
+{
+ return e >> S::foo();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype63.C b/gcc/testsuite/g++.dg/cpp0x/decltype63.C
index 60dfec47a41..b588bc3e5ef 100644
--- a/gcc/testsuite/g++.dg/cpp0x/decltype63.C
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype63.C
@@ -4,4 +4,5 @@
template<typename T>
class C{
T t;
- decltype(t)::a:: // { dg-error "expected" }
+ decltype(t)::a:: // { dg-error "expected" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype76.C b/gcc/testsuite/g++.dg/cpp0x/decltype76.C
new file mode 100644
index 00000000000..239fe6d2a8f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype76.C
@@ -0,0 +1,7 @@
+// PR c+/57943
+// { dg-do compile { target c++11 } }
+
+struct a { };
+
+template <typename T = decltype (a(0))> // { dg-error "" }
+void f() { }
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype77.C b/gcc/testsuite/g++.dg/cpp0x/decltype77.C
new file mode 100644
index 00000000000..ffd59d4188c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype77.C
@@ -0,0 +1,10 @@
+// PR c++/96103
+// { dg-do compile { target c++11_only } }
+
+decltype(auto) foo () { return 4; } // { dg-error ".decltype\\(auto\\). type specifier only available" }
+
+void
+bar ()
+{
+ decltype(auto) i = 0; // { dg-error ".decltype\\(auto\\). type specifier only available" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype78.C b/gcc/testsuite/g++.dg/cpp0x/decltype78.C
new file mode 100644
index 00000000000..6f4e5b4ad3b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype78.C
@@ -0,0 +1,24 @@
+// PR c++/81339
+// { dg-do compile { target c++11 } }
+
+struct true_type { static const bool value = true; };
+struct false_type { static const bool value = false; };
+
+template <typename T>
+struct IsDefaultConstructibleT
+{
+ // using T here (instead of U) should be an error
+ template <typename U, typename = decltype(T())> // { dg-error "deleted" }
+ static true_type test(void*);
+
+ template <typename U>
+ static false_type test(...);
+
+ static constexpr bool value = decltype(test<T>(nullptr))::value;
+};
+
+struct S {
+ S() = delete;
+};
+
+static_assert( IsDefaultConstructibleT<S>::value, "" ); // { dg-error "assertion failed" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype79.C b/gcc/testsuite/g++.dg/cpp0x/decltype79.C
new file mode 100644
index 00000000000..50c292a1958
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype79.C
@@ -0,0 +1,19 @@
+// PR c++/79504
+// { dg-do compile { target c++11 } }
+
+struct A
+{
+ void f () & {}
+
+ template <typename ...Args>
+ auto f (Args &&... args) && -> decltype (this->f (args...))
+ {
+ return this->f (args...);
+ }
+};
+
+int main (){
+ A p;
+ p.f ();
+ A{}.f();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/elision_neg.C b/gcc/testsuite/g++.dg/cpp0x/elision_neg.C
index 4995acd50a5..6a181b27d37 100644
--- a/gcc/testsuite/g++.dg/cpp0x/elision_neg.C
+++ b/gcc/testsuite/g++.dg/cpp0x/elision_neg.C
@@ -30,7 +30,7 @@ test1()
move_only
test2(move_only&& x)
{
- return x; // { dg-error "within this context" }
+ return x; // { dg-error "within this context" "" { target c++17_down } }
}
int main()
diff --git a/gcc/testsuite/g++.dg/cpp0x/enum13.C b/gcc/testsuite/g++.dg/cpp0x/enum13.C
index 8335fadd78e..9902a4dc6b1 100644
--- a/gcc/testsuite/g++.dg/cpp0x/enum13.C
+++ b/gcc/testsuite/g++.dg/cpp0x/enum13.C
@@ -15,5 +15,5 @@ void foo(int x, ...) {
}
int main() {
- foo(0, A::X); // { dg-warning "scoped" }
+ foo(0, A::X); // { dg-warning "scoped" "" { target { ! short_eq_int } } }
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C
index 4b335eb2818..822b64ea460 100644
--- a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C
+++ b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C
@@ -1,4 +1,5 @@
// PR c++/85140
// { dg-do compile { target c++11 } }
-namespace alignas() N {} // { dg-error "expected" }
+namespace alignas() N {} // { dg-error "expected" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist-array12.C b/gcc/testsuite/g++.dg/cpp0x/initlist-array12.C
new file mode 100644
index 00000000000..168c5dd6492
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist-array12.C
@@ -0,0 +1,26 @@
+// PR c++/95319
+// { dg-do compile { target c++11 } }
+
+typedef decltype(sizeof(char)) size_t;
+
+namespace std {
+template <class> class initializer_list {
+ int *_M_array;
+ size_t _M_len;
+};
+template <int _Nm> struct A { typedef int _Type[_Nm]; };
+template <int _Nm> struct B { typename A<_Nm>::_Type _M_elems; };
+class C {
+public:
+ void insert(int, B<3>);
+ void insert(int, initializer_list<B<3>>);
+};
+} // namespace std
+int a;
+int
+main() {
+ using ArrayVector = std::C;
+ auto b = ArrayVector();
+ b.insert(a, {{2}});
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist5.C b/gcc/testsuite/g++.dg/cpp0x/initlist5.C
index 5f253ca4827..5f128582014 100644
--- a/gcc/testsuite/g++.dg/cpp0x/initlist5.C
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist5.C
@@ -32,4 +32,4 @@ char c = char{ u }; // { dg-error "narrowing" }
// PR c++/50011
short unsigned su;
-int i { su };
+int i { su }; // { dg-error "narrowing" "" { target short_eq_int } }
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist7.C b/gcc/testsuite/g++.dg/cpp0x/initlist7.C
index 7dbbf2d2200..0cb89e627ac 100644
--- a/gcc/testsuite/g++.dg/cpp0x/initlist7.C
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist7.C
@@ -3,7 +3,7 @@
typedef enum { AA=1, BB=2 } my_enum;
-typedef struct { my_enum a:4 ; unsigned b:28; } stru;
+typedef struct { my_enum a:4 ; unsigned b:28; } stru; // { dg-warning "width.*exceeds its type" "" { target { ! int32plus } } }
void foo (char c, my_enum x, int i)
{
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist92.C b/gcc/testsuite/g++.dg/cpp0x/initlist92.C
index 319264ae274..213b192d441 100644
--- a/gcc/testsuite/g++.dg/cpp0x/initlist92.C
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist92.C
@@ -23,7 +23,7 @@ bool Test4(std::initializer_list<std::string>);
int main ()
{
- ( Test1({"false"}) ); // { dg-error "narrowing" "" { target c++2a } }
+ ( Test1({"false"}) ); // { dg-error "narrowing" }
( Test2({123}) );
( Test3({456}) );
( Test4({"false"}) );
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-constexpr2.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-constexpr2.C
new file mode 100644
index 00000000000..b1982ab0506
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-constexpr2.C
@@ -0,0 +1,13 @@
+// PR c++/90212
+// { dg-do compile { target c++11 } }
+
+template<typename T> struct tuple {
+ constexpr tuple(T&& t) : t(t) { }
+ int t;
+};
+
+void foo() {
+ constexpr tuple<int> v1{1};
+ constexpr auto v2 = v1;
+ [&]{ constexpr auto v2 = v1; };
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice30.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice30.C
index 46350bd1d52..7b0a155a31a 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice30.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice30.C
@@ -3,11 +3,11 @@
template<int> void foo()
{
- int x[=]; // { dg-error "expected" }
+ int x[=]; // { dg-error "" }
[&x]{};
}
void bar()
{
- foo<0>();
+ foo<0>(); // { dg-prune-output "not declared" }
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice31.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice31.C
index 54ded7bb282..f0ecf8cc26f 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice31.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice31.C
@@ -4,5 +4,5 @@
template<typename T> void foo()
{
T x[=]; // { dg-error "expected" }
- [&x]{};
+ [&x]{}; // { dg-prune-output "not declared" }
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/move-return2.C b/gcc/testsuite/g++.dg/cpp0x/move-return2.C
index 681e9ecaca1..999f2c95c49 100644
--- a/gcc/testsuite/g++.dg/cpp0x/move-return2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/move-return2.C
@@ -7,5 +7,5 @@ struct S2 : S1 {};
S1
f (S2 s)
{
- return s; // { dg-error "use of deleted function" }
+ return s; // { dg-error "use of deleted function" "" { target c++17_down } }
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/move-return3.C b/gcc/testsuite/g++.dg/cpp0x/move-return3.C
new file mode 100644
index 00000000000..c79f0591936
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/move-return3.C
@@ -0,0 +1,23 @@
+// PR c++/91212
+// Test that C++11 implicit move semantics don't call the const copy.
+// { dg-do link }
+
+struct T { int i; };
+
+struct X {
+ X(T&) { } // #1
+ X(const T&); // #2
+};
+
+X
+fn ()
+{
+ T buf;
+ return buf;
+}
+
+int
+main()
+{
+ X c = fn ();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept30.C b/gcc/testsuite/g++.dg/cpp0x/noexcept30.C
index 6a9f7821092..1075c69a491 100644
--- a/gcc/testsuite/g++.dg/cpp0x/noexcept30.C
+++ b/gcc/testsuite/g++.dg/cpp0x/noexcept30.C
@@ -5,7 +5,7 @@
template<typename A>
struct F {
template<typename B>
- void f() noexcept(&F::template f<B>) {} // { dg-error "exception specification|convert" }
+ void f() noexcept(&F::template f<B>) {} // { dg-error "exception specification|convert|resolve" }
};
int main () {
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept58.C b/gcc/testsuite/g++.dg/cpp0x/noexcept58.C
new file mode 100644
index 00000000000..0a145e030a5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/noexcept58.C
@@ -0,0 +1,9 @@
+// PR c++/90748
+// { dg-do compile { target c++11 } }
+
+template <class ...> class A
+{
+ void e ();
+ bool f (int() noexcept(e)); // { dg-error "::e" }
+};
+A<> b;
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept59.C b/gcc/testsuite/g++.dg/cpp0x/noexcept59.C
new file mode 100644
index 00000000000..c752601ba09
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/noexcept59.C
@@ -0,0 +1,10 @@
+// PR c++/90748
+// { dg-do compile { target c++11 } }
+
+template <class ...Ts> class A
+{
+ void e ();
+ bool f (int() noexcept(this->e())); // { dg-error "this" }
+ bool g (int() noexcept(e())); // { dg-error "without object" }
+};
+A<> b;
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept60.C b/gcc/testsuite/g++.dg/cpp0x/noexcept60.C
new file mode 100644
index 00000000000..d8efe1a24cb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/noexcept60.C
@@ -0,0 +1,13 @@
+// PR c++/95562
+// { dg-do compile { target c++11 } }
+
+template <bool Nothrow>
+struct Functions
+{
+ void (*func)(void*) noexcept(Nothrow);
+};
+
+void test()
+{
+ Functions<true> f{};
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi16.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi16.C
new file mode 100644
index 00000000000..07bc198e691
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi16.C
@@ -0,0 +1,11 @@
+// PR c++/94926
+// { dg-do compile { target c++11 } }
+
+template<typename>
+struct A {
+ static auto self_reference = A{}; // { dg-error "incomplete" }
+};
+
+int main() {
+ A<void>{};
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr04.C b/gcc/testsuite/g++.dg/cpp0x/nullptr04.C
index 15af84c1c86..7cb3559b3a3 100644
--- a/gcc/testsuite/g++.dg/cpp0x/nullptr04.C
+++ b/gcc/testsuite/g++.dg/cpp0x/nullptr04.C
@@ -5,12 +5,12 @@
__extension__ typedef __INTPTR_TYPE__ intptr_t;
const int n4 = static_cast<const int>(nullptr); // { dg-error "16:invalid 'static_cast' " }
-const short int n5 = reinterpret_cast<short int>(nullptr); // { dg-error "22:cast from .std::nullptr_t. to .short int. loses precision" }
+const short int n5 = reinterpret_cast<short int>(nullptr); // { dg-error "22:cast from .std::nullptr_t. to .short int. loses precision" "" { target { ! ptr_eq_short } } }
const intptr_t n6 = reinterpret_cast<intptr_t>(nullptr);
const intptr_t n7 = (intptr_t)nullptr;
decltype(nullptr) mynull = 0;
const int n8 = static_cast<const int>(mynull); // { dg-error "16:invalid 'static_cast' " }
-const short int n9 = reinterpret_cast<short int>(mynull); // { dg-error "22:cast from .std::nullptr_t. to .short int. loses precision" }
+const short int n9 = reinterpret_cast<short int>(mynull); // { dg-error "22:cast from .std::nullptr_t. to .short int. loses precision" "" { target { ! ptr_eq_short } } }
const intptr_t n10 = reinterpret_cast<intptr_t>(mynull);
const intptr_t n11 = (intptr_t)mynull;
diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr22.C b/gcc/testsuite/g++.dg/cpp0x/nullptr22.C
index 5fbd124b32c..0b326fbb715 100644
--- a/gcc/testsuite/g++.dg/cpp0x/nullptr22.C
+++ b/gcc/testsuite/g++.dg/cpp0x/nullptr22.C
@@ -10,11 +10,11 @@ void f3(const char*, ...) __attribute__((sentinel));
void f()
{
f1("%p", nullptr);
- f2(nullptr); // { dg-warning "null argument where non-null required " }
+ f2(nullptr); // { dg-warning "argument 1 null where non-null expected " }
f3("x", "y", __null); // { dg-warning "missing sentinel in function call" }
f3("x", "y", nullptr);
decltype(nullptr) mynull = 0;
f1("%p", mynull);
- f2(mynull); // { dg-warning "null argument where non-null required " }
+ f2(mynull); // { dg-warning "argument 1 null where non-null expected " }
f3("x", "y", mynull);
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr62101.C b/gcc/testsuite/g++.dg/cpp0x/pr62101.C
index 5fc579c7661..07ab1b76fbc 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr62101.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr62101.C
@@ -17,7 +17,7 @@ void g(Y, double);
struct Y
{
// { dg-prune-output "note" }
- friend void g(Y, int) = delete;
+ friend void g(Y, int) = delete; // { dg-error "not first declaration" }
friend void g(Y, double) {}
};
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr68726.C b/gcc/testsuite/g++.dg/cpp0x/pr68726.C
index 64572e5ee46..636a20c83be 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr68726.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr68726.C
@@ -4,4 +4,5 @@ template <typename> struct A {
template <typename, > struct __construct_helper; // { dg-error "expected" }
template <typename... _Args>
using __has_construct typename __construct_helper<_Args...>::type; // { dg-error "expected" }
-} struct : A<int> { // { dg-error "expected" }
+} struct : A<int> { // { dg-error "expected" }
+ // { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr78341.C b/gcc/testsuite/g++.dg/cpp0x/pr78341.C
index af906384098..8573f9f0824 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr78341.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr78341.C
@@ -1,4 +1,5 @@
// PR c++/78341
// { dg-do compile { target c++11 } }
-alignas (alignas double // { dg-error "" }
+alignas (alignas double // { dg-error "expected" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr80259.C b/gcc/testsuite/g++.dg/cpp0x/pr80259.C
index 9d2a109bcf3..adb354b4ee8 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr80259.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr80259.C
@@ -7,7 +7,7 @@ void bar ();
struct A
{
friend void foo () = delete; // { dg-error "redefinition of" }
- friend void bar () = delete; // { dg-message "previously defined here" }
+ friend void bar () = delete; // { dg-error "not first declaration" }
};
void bar () {} // { dg-error "redefinition of" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr81246.C b/gcc/testsuite/g++.dg/cpp0x/pr81246.C
index e51e0b9a6e1..01260e18534 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr81246.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr81246.C
@@ -4,7 +4,7 @@ namespace N
{
template < typename T > class A
{
- template < T > friend class B; // { dg-error "not a valid type" }
+ template < T > friend class B; // { dg-error "not a valid type" "" { target c++17_down } }
};
A < float > a;
diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual20.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual20.C
index c8bd43643af..cfbef300226 100644
--- a/gcc/testsuite/g++.dg/cpp0x/ref-qual20.C
+++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual20.C
@@ -52,14 +52,15 @@ f5 ()
int
main ()
{
+ int return_lval = __cplusplus > 201703L ? -1 : 2;
Y y1 = f (A());
- if (y1.y != 2)
+ if (y1.y != return_lval)
__builtin_abort ();
Y y2 = f2 (A());
if (y2.y != -1)
__builtin_abort ();
Y y3 = f3 ();
- if (y3.y != 2)
+ if (y3.y != return_lval)
__builtin_abort ();
Y y4 = f4 ();
if (y4.y != -1)
diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae66.C b/gcc/testsuite/g++.dg/cpp0x/sfinae66.C
new file mode 100644
index 00000000000..49067cd35d0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/sfinae66.C
@@ -0,0 +1,32 @@
+// PR c++/95143
+// { dg-do compile { target c++11 } }
+
+struct false_type {
+ static constexpr bool value = false;
+};
+
+struct true_type{
+ static constexpr bool value = true;
+};
+
+template<class T>
+T&& declval() noexcept;
+
+template<typename T, typename U, typename = U>
+struct is_static_castable : false_type
+{};
+template<typename T, typename U>
+struct is_static_castable<T, U, decltype(static_cast<U>(declval<T>()))> : true_type
+{};
+
+class Base { };
+struct A { };
+class B: public Base { };
+
+int main()
+{
+ constexpr auto canCast = is_static_castable<A, B>::value;
+ static_assert(!canCast, "");
+ constexpr auto canCast2 = is_static_castable<A, A>::value;
+ static_assert(canCast2, "");
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-value1.C b/gcc/testsuite/g++.dg/cpp0x/variadic-value1.C
index 179919a5bc7..b27ac34692f 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic-value1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic-value1.C
@@ -1,18 +1,20 @@
// PR c++/52796
// { dg-do run { target c++11 } }
+typedef int int32_t __attribute__((mode (__SI__)));
+
inline void *operator new(__SIZE_TYPE__ s, void *p) { return p; }
struct A
{
- int i;
+ int32_t i;
template<class... Ts>
A(Ts&&... ts): i(ts...) { }
};
static union {
unsigned char c[sizeof(A)];
- int i;
+ int32_t i;
};
int main()
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic74.C b/gcc/testsuite/g++.dg/cpp0x/variadic74.C
index b86380b4e27..656aacdebe4 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic74.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic74.C
@@ -2,7 +2,7 @@
template <class... Types> class A
{
public:
- template <Types... Values> class X { /* ... */ }; // { dg-error "not a valid type for a template non-type parameter" }
+ template <Types... Values> class X { /* ... */ }; // { dg-error "not a valid type for a template non-type parameter" "" { target c++17_down } }
};
template<class... Types> class B
diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-59978.C b/gcc/testsuite/g++.dg/cpp0x/vt-59978.C
new file mode 100644
index 00000000000..b7cdb19353a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/vt-59978.C
@@ -0,0 +1,16 @@
+// PR c++/59978
+// { dg-do compile { target c++11 } }
+
+static void testFunc(int i1, int i2) {
+ (void)i1;
+ (void)i2;
+}
+
+template <int... Ints> void wrapper() {
+ testFunc(Ints...);
+}
+
+int main()
+{
+ wrapper<1, 2>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn58.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn58.C
new file mode 100644
index 00000000000..8c4f24ccc74
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn58.C
@@ -0,0 +1,13 @@
+// PR c++/95820
+// { dg-do compile { target c++14 } }
+
+auto (*a)() -> bool = nullptr;
+int (*b)() -> bool = nullptr; // { dg-error "function with trailing return type" }
+int (**c)() -> bool = nullptr; // { dg-error "function with trailing return type" }
+int (&d)() -> bool = nullptr; // { dg-error "function with trailing return type" }
+int (*&e)() -> bool = nullptr; // { dg-error "function with trailing return type" }
+int (f[])() -> bool = nullptr; // { dg-error "function with trailing return type" }
+auto* (*g)() -> bool = nullptr; // { dg-error "function with trailing return type" }
+decltype(auto) (*h)() -> bool = nullptr; // { dg-error "invalid use" }
+decltype(auto)* (*i)() -> bool = nullptr; // { dg-error "function with trailing return type" }
+decltype(auto)& (*j)() -> bool = nullptr; // { dg-error "function with trailing return type" }
diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn59.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn59.C
new file mode 100644
index 00000000000..8f6ec9b79ab
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn59.C
@@ -0,0 +1,8 @@
+// PR c++/79815
+// { dg-do compile { target c++14 } }
+
+decltype(auto) const x = 1; // { dg-error "cannot be cv-qualified" }
+volatile decltype(auto) x2 = 1; // { dg-error "cannot be cv-qualified" }
+const volatile decltype(auto) x3 = 1; // { dg-error "cannot be cv-qualified" }
+const decltype(auto) fn() { return 42; } // { dg-error "cannot be cv-qualified" }
+const decltype(auto) fn2(); // { dg-error "cannot be cv-qualified" }
diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn60.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn60.C
new file mode 100644
index 00000000000..575abafbae5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn60.C
@@ -0,0 +1,11 @@
+// PR c++/64194
+// { dg-do compile { target c++14 } }
+
+template <typename T> void g(void (*)(T)) { }
+
+template <typename> auto id(int) { }
+template <typename> auto id(char) { return 0; }
+
+int main() {
+ g(id<int>);
+}
diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn61.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn61.C
new file mode 100644
index 00000000000..c24c3b85d78
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn61.C
@@ -0,0 +1,13 @@
+// PR c++/88003
+// { dg-do compile { target c++14 } }
+// { dg-ice "poplevel_class" }
+
+auto test() {
+ struct O {
+ struct N;
+ };
+ return O();
+}
+
+typedef decltype(test()) TN;
+struct TN::N {};
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-82304.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-82304.C
new file mode 100644
index 00000000000..3b05243df25
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-82304.C
@@ -0,0 +1,14 @@
+// PR c++/82304
+// { dg-do compile { target c++14 } }
+
+typedef __UINTPTR_TYPE__ uintptr_t;
+
+constexpr const char *
+foo (const char *p)
+{
+ auto l = reinterpret_cast<uintptr_t>(p); // { dg-error "conversion from pointer" }
+ ++l;
+ return reinterpret_cast<const char *>(l);
+}
+
+constexpr auto s = foo ("Hello");
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-96182.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-96182.C
new file mode 100644
index 00000000000..9c07d7186ec
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-96182.C
@@ -0,0 +1,6 @@
+// PR c++/96182
+// { dg-do compile { target c++11 } }
+
+constexpr int foo () {} // { dg-error "no return statement in 'constexpr' function returning non-void" "" { target c++14 } }
+// { dg-error "body of 'constexpr' function 'constexpr int foo\\\(\\\)' not a return-statement" "" { target c++11_only } .-1 }
+// { dg-warning "no return statement in function returning non-void" "" { target c++11_only } .-2 }
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-arith-overflow.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-arith-overflow.C
index 7ca0033d217..d6a6509d591 100644
--- a/gcc/testsuite/g++.dg/cpp1y/constexpr-arith-overflow.C
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-arith-overflow.C
@@ -90,6 +90,10 @@ template <> struct ResType<unsigned short> { typedef unsigned type; };
StaticAssert (vflow ? CAT (op, __LINE__)(x, y).v \
: CAT (op, __LINE__)(x, y) == Res<T>(op (x, y), vflow))
+/* If short and int are the same size we will overflow in some additional cases
+ when testing short. */
+#define INT_EQ_SHORT __SIZEOF_INT__ == __SIZEOF_SHORT__
+
/* Signed int addition. */
TEST (sadd, signed char, 0, 0, 0);
TEST (sadd, signed char, 0, SCHAR_MAX, 0);
@@ -100,11 +104,11 @@ TEST (sadd, signed char, -1, SCHAR_MIN, 0);
TEST (sadd, short, 0, 0, 0);
TEST (sadd, short, 0, SHRT_MAX, 0);
-TEST (sadd, short, 1, SHRT_MAX, 0);
-TEST (sadd, short, SHRT_MAX, SHRT_MAX, 0);
+TEST (sadd, short, 1, SHRT_MAX, INT_EQ_SHORT);
+TEST (sadd, short, SHRT_MAX, SHRT_MAX, INT_EQ_SHORT);
TEST (sadd, short, 0, SHRT_MIN, 0);
-TEST (sadd, short, -1, SHRT_MIN, 0);
-TEST (sadd, short, SHRT_MIN, SHRT_MIN, 0);
+TEST (sadd, short, -1, SHRT_MIN, INT_EQ_SHORT);
+TEST (sadd, short, SHRT_MIN, SHRT_MIN, INT_EQ_SHORT);
TEST (sadd, int, 0, 0, 0);
TEST (sadd, int, 0, INT_MAX, 0);
@@ -139,8 +143,8 @@ TEST (uadd, unsigned char, UCHAR_MAX, UCHAR_MAX, 0);
TEST (uadd, unsigned short, 0U, 0U, 0);
TEST (uadd, unsigned short, 0U, USHRT_MAX, 0);
-TEST (uadd, unsigned short, 1U, USHRT_MAX, 0);
-TEST (uadd, unsigned short, USHRT_MAX, USHRT_MAX, 0);
+TEST (uadd, unsigned short, 1U, USHRT_MAX, INT_EQ_SHORT);
+TEST (uadd, unsigned short, USHRT_MAX, USHRT_MAX, INT_EQ_SHORT);
TEST (uadd, unsigned, 0U, 0U, 0);
TEST (uadd, unsigned, 0U, UINT_MAX, 0);
@@ -170,7 +174,7 @@ TEST (ssub, short, 0, 0, 0);
TEST (ssub, short, 0, SHRT_MAX, 0);
TEST (ssub, short, 1, SHRT_MAX, 0);
TEST (ssub, short, SHRT_MAX, SHRT_MAX, 0);
-TEST (ssub, short, 0, SHRT_MIN, 0);
+TEST (ssub, short, 0, SHRT_MIN, INT_EQ_SHORT);
TEST (ssub, short, -1, SHRT_MIN, 0);
TEST (ssub, short, SHRT_MIN, SHRT_MIN, 0);
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-array8.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-array8.C
new file mode 100644
index 00000000000..339abb69019
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-array8.C
@@ -0,0 +1,18 @@
+// PR c++/96197
+// { dg-do compile { target c++14 } }
+
+struct S {
+ S* p = this;
+};
+
+constexpr S ary[5000] = {};
+
+constexpr int foo() {
+ int count = 0;
+ for (int i = 0; i < 5000; i++)
+ if (ary[i].p != nullptr)
+ count++;
+ return count;
+}
+
+constexpr int bar = foo();
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C
index cb0185414af..3357fe3cf23 100644
--- a/gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C
@@ -3,6 +3,7 @@
constexpr int f (int i)
{
+ if (i == -1) return 0;
}
constexpr int i = f(42); // { dg-error "flows off the end|in .constexpr. expansion of " }
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-shift1.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-shift1.C
index d63c954f42f..e0e56e262f0 100644
--- a/gcc/testsuite/g++.dg/cpp1y/constexpr-shift1.C
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-shift1.C
@@ -3,7 +3,7 @@
constexpr int p = 1;
constexpr __PTRDIFF_TYPE__ bar (int a)
{
- return ((__PTRDIFF_TYPE__) &p) << a; // { dg-error "is not a constant expression" }
+ return ((__PTRDIFF_TYPE__) &p) << a; // { dg-error "conversion from pointer" }
}
constexpr __PTRDIFF_TYPE__ r = bar (2); // { dg-message "in .constexpr. expansion of" }
-constexpr __PTRDIFF_TYPE__ s = bar (0); // { dg-error "conversion from pointer" }
+constexpr __PTRDIFF_TYPE__ s = bar (0);
diff --git a/gcc/testsuite/g++.dg/cpp1y/digit-sep-neg.C b/gcc/testsuite/g++.dg/cpp1y/digit-sep-neg.C
index 727e74e2e10..5343e52c5a5 100644
--- a/gcc/testsuite/g++.dg/cpp1y/digit-sep-neg.C
+++ b/gcc/testsuite/g++.dg/cpp1y/digit-sep-neg.C
@@ -1,9 +1,11 @@
// { dg-do compile { target c++14 } }
+typedef int int32_t __attribute__((mode (__SI__)));
+
int
main()
{
- int i = 0;
+ int32_t i = 0;
i = 1048''576; // { dg-error "adjacent digit separators" }
i = 0X'100000; // { dg-error "digit separator after base indicator" }
i = 0x'100000; // { dg-error "digit separator after base indicator" }
@@ -25,6 +27,6 @@ main()
float f = 1.602'176'565e-19'F; // { dg-error "digit separator outside digit sequence" }
}
-// { dg-error "exponent has no digits" "exponent has no digits" { target *-*-* } 21 }
-// { dg-error "expected ';' before" "expected ';' before" { target *-*-* } 13 }
-// { dg-error "expected ';' before" "expected ';' before" { target *-*-* } 24 }
+// { dg-error "exponent has no digits" "exponent has no digits" { target *-*-* } 23 }
+// { dg-error "expected ';' before" "expected ';' before" { target *-*-* } 15 }
+// { dg-error "expected ';' before" "expected ';' before" { target *-*-* } 26 }
diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic21.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic21.C
new file mode 100644
index 00000000000..affb1ffd474
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic21.C
@@ -0,0 +1,26 @@
+// PR c++/91104
+// { dg-do run { target c++14 } }
+
+void
+test (void (*f)(int, int, int))
+{
+ f(1, 2, 3);
+}
+
+void
+check (int a, int b, int c)
+{
+ if (a != 1 || b != 2 || c != 3)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+ test ([](auto... args) {
+ check (args...);
+ });
+ test ([](int a, int b, int c) {
+ check (a, b, c);
+ });
+}
diff --git a/gcc/testsuite/g++.dg/cpp1y/new1.C b/gcc/testsuite/g++.dg/cpp1y/new1.C
index 7016951b46f..aa5f647d535 100644
--- a/gcc/testsuite/g++.dg/cpp1y/new1.C
+++ b/gcc/testsuite/g++.dg/cpp1y/new1.C
@@ -1,6 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-cddce-details" } */
-// { dg-additional-options "-fdelete-null-pointer-checks" }
+/* { dg-options "-O2 -fdump-tree-cddce-details -fdelete-null-pointer-checks" } */
#include <stdlib.h>
diff --git a/gcc/testsuite/g++.dg/cpp1y/new2.C b/gcc/testsuite/g++.dg/cpp1y/new2.C
index 97f4001d5d7..cdcbd7daf2b 100644
--- a/gcc/testsuite/g++.dg/cpp1y/new2.C
+++ b/gcc/testsuite/g++.dg/cpp1y/new2.C
@@ -1,6 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -std=c++17 -fdump-tree-cddce-details" } */
-/* { dg-additional-options "-fdelete-null-pointer-checks" } */
+/* { dg-options "-O2 -std=c++17 -fdump-tree-cddce-details -fdelete-null-pointer-checks" } */
#include <cstdio>
#include <cstdlib>
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr57644.C b/gcc/testsuite/g++.dg/cpp1y/pr57644.C
index ec595a21b7d..dd67a3bd2d1 100644
--- a/gcc/testsuite/g++.dg/cpp1y/pr57644.C
+++ b/gcc/testsuite/g++.dg/cpp1y/pr57644.C
@@ -1,8 +1,10 @@
// { dg-do compile { target c++14 } }
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
+
struct Foo
{
- unsigned i: 32;
+ uint32_t i: 32;
};
int
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr63996.C b/gcc/testsuite/g++.dg/cpp1y/pr63996.C
index fe47544a3c8..8eee2e0af30 100644
--- a/gcc/testsuite/g++.dg/cpp1y/pr63996.C
+++ b/gcc/testsuite/g++.dg/cpp1y/pr63996.C
@@ -5,6 +5,7 @@ constexpr int
foo (int i)
{
int a[i] = { }; // { dg-error "7:ISO C\\+\\+ forbids variable length array .a" }
+ if (i == 23) return 0;
}
constexpr int j = foo (1); // { dg-error "flows off the end|in .constexpr. expansion of" }
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr65202.C b/gcc/testsuite/g++.dg/cpp1y/pr65202.C
index 43eb01f1fcb..a76f8da689c 100644
--- a/gcc/testsuite/g++.dg/cpp1y/pr65202.C
+++ b/gcc/testsuite/g++.dg/cpp1y/pr65202.C
@@ -24,4 +24,5 @@ int main()
{
foo<ns::bar> f;
adl::swap(f, f) // { dg-error "expected ';'" }
-} // { dg-error "expected '.'" "expected end of namespace" }
+}
+// { dg-error "-:expected '.'" "expected end of namespace" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr65340.C b/gcc/testsuite/g++.dg/cpp1y/pr65340.C
index 848eff965e5..d3e03f75df3 100644
--- a/gcc/testsuite/g++.dg/cpp1y/pr65340.C
+++ b/gcc/testsuite/g++.dg/cpp1y/pr65340.C
@@ -16,4 +16,5 @@ struct traverse {
};
}
auto &traverse = constant < functors :: traverse > ;
-operator()()->decltype(traverse(0, 0)) // { dg-error "no match|expected" }
+operator()()->decltype(traverse(0, 0))// { dg-error "no match" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr68578.C b/gcc/testsuite/g++.dg/cpp1y/pr68578.C
index 3fe07230117..9b3898176f1 100644
--- a/gcc/testsuite/g++.dg/cpp1y/pr68578.C
+++ b/gcc/testsuite/g++.dg/cpp1y/pr68578.C
@@ -1,3 +1,4 @@
// { dg-do compile { target c++14 } }
-template <typename> struct bar foo; template <> struct foo<>: // { dg-error "class template|expected" }
+template <typename> struct bar foo; template <> struct foo<>: // { dg-error "class template|redeclared" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr77321.C b/gcc/testsuite/g++.dg/cpp1y/pr77321.C
index b25f492dc4f..51c5bd9b394 100644
--- a/gcc/testsuite/g++.dg/cpp1y/pr77321.C
+++ b/gcc/testsuite/g++.dg/cpp1y/pr77321.C
@@ -1,6 +1,7 @@
// PR c++/77321
// { dg-do compile { target c++14 } }
// { dg-options "-Wall" }
+// { dg-require-effective-target size24plus }
extern "C" void *memset (void *, int, __SIZE_TYPE__);
extern "C" void *malloc(__SIZE_TYPE__);
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr90996.C b/gcc/testsuite/g++.dg/cpp1y/pr90996.C
index 780cbb4e3ac..eff5b62db28 100644
--- a/gcc/testsuite/g++.dg/cpp1y/pr90996.C
+++ b/gcc/testsuite/g++.dg/cpp1y/pr90996.C
@@ -1,5 +1,5 @@
// PR c++/90996
-// { dg-do compile { target c++14 } }
+// { dg-do run { target c++14 } }
struct S
{
@@ -15,3 +15,20 @@ struct T
};
T d {};
+
+int
+main()
+{
+ if (++c[0][0].b[0] != 6
+ || ++c[0][1].b[0] != 3
+ || ++c[1][0].b[0] != 3
+ || ++c[1][1].b[0] != 3)
+ __builtin_abort();
+
+ auto& e = d.c;
+ if (++e[0][0].b[0] != 8
+ || ++e[0][1].b[0] != 3
+ || ++e[1][0].b[0] != 3
+ || ++e[1][1].b[0] != 3)
+ __builtin_abort();
+}
diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ4.C b/gcc/testsuite/g++.dg/cpp1y/var-templ4.C
index 3cd84a892c3..4e762aa929e 100644
--- a/gcc/testsuite/g++.dg/cpp1y/var-templ4.C
+++ b/gcc/testsuite/g++.dg/cpp1y/var-templ4.C
@@ -1,12 +1,14 @@
// { dg-do compile { target c++14 } }
+typedef int int32_t __attribute__((mode (__SI__)));
+
template<typename T>
- constexpr int var = sizeof (T);
+ constexpr int32_t var = sizeof (T);
template<>
- constexpr int var<int> = 100000;
+ constexpr int32_t var<int32_t> = 100000;
int main ()
{
- static_assert(var<int> == 100000 && var<char> == sizeof(char), "");
+ static_assert(var<int32_t> == 100000 && var<char> == sizeof(char), "");
}
diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ44.C b/gcc/testsuite/g++.dg/cpp1y/var-templ44.C
index 2ef01cf7480..74954ed102c 100644
--- a/gcc/testsuite/g++.dg/cpp1y/var-templ44.C
+++ b/gcc/testsuite/g++.dg/cpp1y/var-templ44.C
@@ -26,5 +26,6 @@ constexpr auto make_array()
-> array<conditional_t<is_void_v<_Dest>, common_type_t<>, _Dest>,
sizeof...(_Types)> {
static_assert(__or_<__not_<is_void<_Dest>>, __and_<>>::value, ""); // { dg-error "static assert" }
+ throw 1;
}
auto d = make_array();
diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ66.C b/gcc/testsuite/g++.dg/cpp1y/var-templ66.C
new file mode 100644
index 00000000000..65cd3d9d31b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/var-templ66.C
@@ -0,0 +1,7 @@
+// PR c++/94553
+// { dg-do compile { target c++14 } }
+
+struct C { };
+template<typename> int C; // { dg-error "different kind of entity" }
+template<typename> int D;
+struct D { }; // { dg-error "different kind of entity" }
diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ67.C b/gcc/testsuite/g++.dg/cpp1y/var-templ67.C
new file mode 100644
index 00000000000..f36af39bc19
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/var-templ67.C
@@ -0,0 +1,16 @@
+// DR 2032 - Default template-arguments of variable templates
+// PR c++/96218
+// { dg-do compile { target c++14 } }
+
+// [temp.param]/14: If a template-parameter of a class template, variable
+// template, or alias template has a default template-argument, each subsequent
+// template-parameter shall either have a default template-argument supplied or
+// be a template parameter pack.
+template<typename T = int, typename U>
+T vt; // { dg-error "no default argument" }
+
+// [temp.param]/14: If a template-parameter of a primary class template,
+// primary variable template, or alias template is a template parameter pack,
+// it shall be the last template-parameter.
+template<typename... Ts, typename U> // { dg-error "must be at the end" }
+int vt2;
diff --git a/gcc/testsuite/g++.dg/cpp1z/aggr-base10.C b/gcc/testsuite/g++.dg/cpp1z/aggr-base10.C
new file mode 100644
index 00000000000..10370daa6e6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/aggr-base10.C
@@ -0,0 +1,16 @@
+// PR c++/90254
+// { dg-do compile { target c++17 } }
+
+struct A {
+ A();
+ A(const A &);
+};
+struct B : A { };
+
+A foo ();
+
+int
+main ()
+{
+ B b{foo()};
+}
diff --git a/gcc/testsuite/g++.dg/cpp1z/attributes-enum-1a.C b/gcc/testsuite/g++.dg/cpp1z/attributes-enum-1a.C
index aacfac875b1..20f0b1d8876 100644
--- a/gcc/testsuite/g++.dg/cpp1z/attributes-enum-1a.C
+++ b/gcc/testsuite/g++.dg/cpp1z/attributes-enum-1a.C
@@ -1,4 +1,5 @@
-// This macro should not be defined without -std=c++17.
+// { dg-do compile { target c++14_down } }
+// This macro should not be defined without c++17.
#ifdef __cpp_enumerator_attributes
#error __cpp_enumerator_attributes defined
diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction44.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction44.C
index 225652cd2e4..95caa992a21 100644
--- a/gcc/testsuite/g++.dg/cpp1z/class-deduction44.C
+++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction44.C
@@ -2,4 +2,5 @@
// { dg-do compile { target c++17 } }
template <typename> struct A;
-template <typename> struct B : A < B { , // { dg-error "" }
+template <typename> struct B : A < B { , // { dg-error "" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/cpp1z/constexpr-if-lambda3.C b/gcc/testsuite/g++.dg/cpp1z/constexpr-if-lambda3.C
index 34615f71ee2..fa9a4b6d8c0 100644
--- a/gcc/testsuite/g++.dg/cpp1z/constexpr-if-lambda3.C
+++ b/gcc/testsuite/g++.dg/cpp1z/constexpr-if-lambda3.C
@@ -18,6 +18,7 @@ template <auto l, typename j> void m(j f) {
template <int, int c> void o() {
auto p = [](auto i) {
if constexpr (a<i>{}) ;
+ if constexpr (typename a<i>::t{}); // { dg-error "" }
};
m<c>(p);
}
diff --git a/gcc/testsuite/g++.dg/cpp1z/constexpr-if34.C b/gcc/testsuite/g++.dg/cpp1z/constexpr-if34.C
new file mode 100644
index 00000000000..6e0b2597a53
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/constexpr-if34.C
@@ -0,0 +1,15 @@
+// PR c++/94937 - ICE with -Wall and constexpr if.
+// { dg-do compile { target c++17 } }
+// { dg-options "-Wall" }
+
+struct B {
+ static constexpr bool foo() { return false; }
+};
+
+template<typename T>
+struct C {
+ static void bar ()
+ {
+ if constexpr (B::foo()) ;
+ }
+};
diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp52.C b/gcc/testsuite/g++.dg/cpp1z/decomp52.C
new file mode 100644
index 00000000000..43b76181b5e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/decomp52.C
@@ -0,0 +1,14 @@
+// DR 2289
+// PR c++/94553
+// { dg-do compile { target c++17 } }
+// A structured binding must be unique in its declarative region.
+
+void
+f ()
+{
+ int arr[1] = { 1 };
+ struct A { };
+ auto [A] = arr; // { dg-error "redeclared as different kind of entity" }
+ auto [B] = arr;
+ struct B { }; // { dg-error "redeclared as different kind of entity" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp53.C b/gcc/testsuite/g++.dg/cpp1z/decomp53.C
new file mode 100644
index 00000000000..b34e6ac7250
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/decomp53.C
@@ -0,0 +1,22 @@
+// PR c++/95328
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
+
+template <typename T>
+struct S
+{
+ int a, b;
+};
+
+template <typename T>
+void
+foo ()
+{
+ auto [a, b] = S<int>(); // { dg-warning "structured bindings only available with" "" { target c++14_down } }
+}
+
+int
+main ()
+{
+ foo<int> ();
+}
diff --git a/gcc/testsuite/g++.dg/cpp1z/direct-enum-init1.C b/gcc/testsuite/g++.dg/cpp1z/direct-enum-init1.C
index f1d1aa5dfdc..027bd5e2083 100644
--- a/gcc/testsuite/g++.dg/cpp1z/direct-enum-init1.C
+++ b/gcc/testsuite/g++.dg/cpp1z/direct-enum-init1.C
@@ -54,7 +54,7 @@ foo ()
C c3 { 8L }; // { dg-error "cannot convert 'long int' to 'C' in initialization" "" { target c++14_down } }
B b4 {short (c + 5)}; // { dg-error "invalid conversion from 'short int' to 'B'" "" { target c++14_down } }
B b5 {c + 5}; // { dg-error "invalid conversion from 'int' to 'B'" "" { target c++14_down } }
- // { dg-error "narrowing conversion of \[^\n\r]* from 'int' to 'short int'" "" { target c++17 } .-1 }
+ // { dg-error "narrowing conversion of \[^\n\r]* from 'int' to 'short int'" "" { target { c++17 && { ! short_eq_int } } } .-1 }
C c4 { ll }; // { dg-error "cannot convert 'long long int' to 'C' in initialization" "" { target c++14_down } }
// { dg-error "narrowing conversion of 'll' from 'long long int' to 'int'" "" { target c++17 } .-1 }
C c5 {short (c + 5)}; // { dg-error "cannot convert 'short int' to 'C' in initialization" "" { target c++14_down } }
@@ -120,7 +120,7 @@ foo2 ()
C c3 { 8L }; // { dg-error "cannot convert 'long int' to 'C' in initialization" "" { target c++14_down } }
B b4 {short (c + 5)}; // { dg-error "invalid conversion from 'short int' to 'B'" "" { target c++14_down } }
B b5 {c + 5}; // { dg-error "invalid conversion from 'int' to 'B'" "" { target c++14_down } }
- // { dg-error "narrowing conversion of \[^\n\r]* from 'int' to 'short int'" "" { target c++17 } .-1 }
+ // { dg-error "narrowing conversion of \[^\n\r]* from 'int' to 'short int'" "" { target { c++17 && { ! short_eq_int } } } .-1 }
C c4 { ll }; // { dg-error "cannot convert 'long long int' to 'C' in initialization" "" { target c++14_down } }
// { dg-error "narrowing conversion of 'll' from 'long long int' to 'int'" "" { target c++17 } .-1 }
C c5 {short (c + 5)}; // { dg-error "cannot convert 'short int' to 'C' in initialization" "" { target c++14_down } }
@@ -188,7 +188,7 @@ foo3 ()
J c3 { 8L }; // { dg-error "cannot convert 'long int' to 'C' in initialization" "" { target c++14_down } }
I b4 {short (c + 5)}; // { dg-error "invalid conversion from 'short int' to 'B'" "" { target c++14_down } }
I b5 {c + 5}; // { dg-error "invalid conversion from 'int' to 'B'" "" { target c++14_down } }
- // { dg-error "narrowing conversion of \[^\n\r]* from 'int' to 'short int'" "" { target c++17 } .-1 }
+ // { dg-error "narrowing conversion of \[^\n\r]* from 'int' to 'short int'" "" { target { c++17 && { ! short_eq_int } } } .-1 }
J c4 { ll }; // { dg-error "cannot convert 'long long int' to 'C' in initialization" "" { target c++14_down } }
// { dg-error "narrowing conversion of 'll' from 'long long int' to 'int'" "" { target c++17 } .-1 }
J c5 {short (c + 5)}; // { dg-error "cannot convert 'short int' to 'C' in initialization" "" { target c++14_down } }
diff --git a/gcc/testsuite/g++.dg/cpp1z/eval-order9.C b/gcc/testsuite/g++.dg/cpp1z/eval-order9.C
new file mode 100644
index 00000000000..7001f5a7b52
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/eval-order9.C
@@ -0,0 +1,18 @@
+// { dg-do run }
+// { dg-additional-options -fstrong-eval-order=all }
+
+struct A
+{
+ virtual A& operator=(const A&) { return *this; }
+};
+
+int i;
+
+A& f() { if (i != 1) __builtin_abort (); i = 2; static A a; return a; }
+A& g() { if (i != 0) __builtin_abort (); i = 1; static A a; return a; }
+
+int main()
+{
+ f() = g();
+ if (i != 2) __builtin_abort ();
+}
diff --git a/gcc/testsuite/g++.dg/cpp1z/fold7a.C b/gcc/testsuite/g++.dg/cpp1z/fold7a.C
index 5c782ff0969..8cca8792709 100644
--- a/gcc/testsuite/g++.dg/cpp1z/fold7a.C
+++ b/gcc/testsuite/g++.dg/cpp1z/fold7a.C
@@ -1,4 +1,5 @@
-// This macro should not be defined without -std=c++17.
+// { dg-do compile { target c++14_down } }
+// This macro should not be defined without c++17.
#ifdef __cpp_fold_expressions
#error __cpp_fold_expressions defined
diff --git a/gcc/testsuite/g++.dg/cpp1z/lambda-this7.C b/gcc/testsuite/g++.dg/cpp1z/lambda-this7.C
new file mode 100644
index 00000000000..8137061e161
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/lambda-this7.C
@@ -0,0 +1,11 @@
+// PR c++/95193
+// { dg-do compile { target c++17 } }
+
+struct X {
+ void foo() const {
+ auto GL1 = [*this](auto a) {
+ };
+
+ GL1("abc");
+ }
+};
diff --git a/gcc/testsuite/g++.dg/cpp1z/launder9.C b/gcc/testsuite/g++.dg/cpp1z/launder9.C
new file mode 100644
index 00000000000..89d7ecfddb6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/launder9.C
@@ -0,0 +1,11 @@
+// PR c++/95963
+// { dg-do compile }
+// { dg-options "-Wnonnull" }
+
+struct A { virtual void foo (); };
+
+void
+bar (A *p)
+{
+ __builtin_launder (p)->foo ();
+}
diff --git a/gcc/testsuite/g++.dg/cpp1z/nontype-auto3.C b/gcc/testsuite/g++.dg/cpp1z/nontype-auto3.C
index b1aed4392a7..3ffdbcf0e7e 100644
--- a/gcc/testsuite/g++.dg/cpp1z/nontype-auto3.C
+++ b/gcc/testsuite/g++.dg/cpp1z/nontype-auto3.C
@@ -4,7 +4,7 @@
template<auto n> struct B { decltype(n) f = n; };
B<5> b1; // OK: template parameter type is int
B<'a'> b2; // OK: template parameter type is char
-B<2.5> b3; // { dg-error "" } template parameter type cannot be double
+B<2.5> b3; // { dg-error "" "" { target c++17_down } } template parameter type cannot be double
template <auto n> void f(B<n>) { }
diff --git a/gcc/testsuite/g++.dg/cpp1z/nontype2.C b/gcc/testsuite/g++.dg/cpp1z/nontype2.C
index 75dc7600379..cf73166dc3a 100644
--- a/gcc/testsuite/g++.dg/cpp1z/nontype2.C
+++ b/gcc/testsuite/g++.dg/cpp1z/nontype2.C
@@ -8,7 +8,7 @@ template<int* p> class X { };
template<const char *s> class Y {};
template<const std::type_info &> class Z {};
-X<&s.m> x7; // { dg-error "3:.& s.S::m. is not a valid template argument" }
+X<&s.m> x7; // { dg-error "3:.& s.S::m. is not a valid template argument" "" { target c++17_down } }
Y<"foo"> y1; // { dg-error "string literal" }
Z<typeid(p)> z1; // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/cpp1z/nontype3.C b/gcc/testsuite/g++.dg/cpp1z/nontype3.C
index 80f1e98ab76..1e02f1e1f5b 100644
--- a/gcc/testsuite/g++.dg/cpp1z/nontype3.C
+++ b/gcc/testsuite/g++.dg/cpp1z/nontype3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++17 } }
+// { dg-do compile { target c++17_only } }
#ifndef __cpp_nontype_template_args
#error __cpp_nontype_template_args not defined
diff --git a/gcc/testsuite/g++.dg/cpp1z/nontype3a.C b/gcc/testsuite/g++.dg/cpp1z/nontype3a.C
index a704e5045b6..b3ffe037904 100644
--- a/gcc/testsuite/g++.dg/cpp1z/nontype3a.C
+++ b/gcc/testsuite/g++.dg/cpp1z/nontype3a.C
@@ -1,4 +1,5 @@
-// This macro should not be defined without -std=c++17.
+// { dg-do compile { target c++14_down } }
+// This macro should not be defined without c++17.
#ifdef __cpp_nontype_template_args
#error __cpp_nontype_template_args defined
diff --git a/gcc/testsuite/g++.dg/cpp1z/pr86648.C b/gcc/testsuite/g++.dg/cpp1z/pr86648.C
index 20ee4c8c0d4..58c611c985f 100644
--- a/gcc/testsuite/g++.dg/cpp1z/pr86648.C
+++ b/gcc/testsuite/g++.dg/cpp1z/pr86648.C
@@ -1,5 +1,7 @@
// { dg-do compile { target c++17 } }
template <typename> class A;
-template <class T> struct B { static A a{T::a}; };
+template <class T> struct B {
+ static A a{T::a}; // { dg-error "int" }
+};
void foo () { B<int> a; }
diff --git a/gcc/testsuite/g++.dg/cpp1z/static2.C b/gcc/testsuite/g++.dg/cpp1z/static2.C
index 9462e0355c8..5d93a0e7242 100644
--- a/gcc/testsuite/g++.dg/cpp1z/static2.C
+++ b/gcc/testsuite/g++.dg/cpp1z/static2.C
@@ -3,7 +3,7 @@
template <class T>
struct A
{
- static constexpr auto x = T::x;
+ static constexpr auto x = T::x; // { dg-error "incomplete" }
};
struct B;
diff --git a/gcc/testsuite/g++.dg/cpp1z/utf8-2a.C b/gcc/testsuite/g++.dg/cpp1z/utf8-2a.C
index 0e243d68a75..b2a99a99023 100644
--- a/gcc/testsuite/g++.dg/cpp1z/utf8-2a.C
+++ b/gcc/testsuite/g++.dg/cpp1z/utf8-2a.C
@@ -1,4 +1,5 @@
-// This macro should not be 201411 without -std=c++17.
+// { dg-do compile { target c++14_down } }
+// This macro should not be 201411 without c++17.
#if __cpp_unicode_characters == 201411
#error Wrong value for __cpp_unicode_characters
diff --git a/gcc/testsuite/g++.dg/cpp2a/aggr1.C b/gcc/testsuite/g++.dg/cpp2a/aggr1.C
index 73a257cead9..ea599237ab1 100644
--- a/gcc/testsuite/g++.dg/cpp2a/aggr1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/aggr1.C
@@ -1,15 +1,15 @@
// { dg-do compile { target c++11 } }
struct A {
- A () = delete; // { dg-message "declared here" "" { target c++2a } }
+ A () = delete; // { dg-message "declared here" "" { target c++20 } }
};
struct B {
B () = default;
int b = 0;
};
struct C {
- C (C&&) = default; // { dg-message "candidate" "" { target c++2a } }
+ C (C&&) = default; // { dg-message "candidate" "" { target c++20 } }
int c, d;
};
-A a {}; // { dg-error "use of deleted function" "" { target c++2a } }
-B b = {1}; // { dg-error "could not convert" "" { target { c++11_only || c++2a } } }
-C *c = new C {2, 3}; // { dg-error "no matching function for call to" "" { target c++2a } }
+A a {}; // { dg-error "use of deleted function" "" { target c++20 } }
+B b = {1}; // { dg-error "could not convert" "" { target { c++11_only || c++20 } } }
+C *c = new C {2, 3}; // { dg-error "no matching function for call to" "" { target c++20 } }
diff --git a/gcc/testsuite/g++.dg/cpp2a/array-conv11.C b/gcc/testsuite/g++.dg/cpp2a/array-conv11.C
index a072b29191d..04a531c356e 100644
--- a/gcc/testsuite/g++.dg/cpp2a/array-conv11.C
+++ b/gcc/testsuite/g++.dg/cpp2a/array-conv11.C
@@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-options "-Wpedantic" }
// Test flexible array member. Here we're binding int[] to int[]. This worked
diff --git a/gcc/testsuite/g++.dg/cpp2a/array-conv12.C b/gcc/testsuite/g++.dg/cpp2a/array-conv12.C
index 1156ea32df5..b0dd81984bb 100644
--- a/gcc/testsuite/g++.dg/cpp2a/array-conv12.C
+++ b/gcc/testsuite/g++.dg/cpp2a/array-conv12.C
@@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-options "-Wpedantic" }
int arr[1] = { 42 };
diff --git a/gcc/testsuite/g++.dg/cpp2a/array-conv13.C b/gcc/testsuite/g++.dg/cpp2a/array-conv13.C
index 9908b7e9118..96b65a59795 100644
--- a/gcc/testsuite/g++.dg/cpp2a/array-conv13.C
+++ b/gcc/testsuite/g++.dg/cpp2a/array-conv13.C
@@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename T> void foo(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/array-conv14.C b/gcc/testsuite/g++.dg/cpp2a/array-conv14.C
index 793e85d7b1c..8406b999dd5 100644
--- a/gcc/testsuite/g++.dg/cpp2a/array-conv14.C
+++ b/gcc/testsuite/g++.dg/cpp2a/array-conv14.C
@@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
void f(const int(*)[]);
void fb(const int(*)[3]);
diff --git a/gcc/testsuite/g++.dg/cpp2a/array-conv15.C b/gcc/testsuite/g++.dg/cpp2a/array-conv15.C
index 033a74683a7..17f917af737 100644
--- a/gcc/testsuite/g++.dg/cpp2a/array-conv15.C
+++ b/gcc/testsuite/g++.dg/cpp2a/array-conv15.C
@@ -1,5 +1,5 @@
// PR c++/69531 - DR 1307, Overload resolution based on size of array init-list.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
int f(int, int const(&)[2]) { return 1; }
int f(double, int const(&)[2]) { return 2; }
diff --git a/gcc/testsuite/g++.dg/cpp2a/array-conv16.C b/gcc/testsuite/g++.dg/cpp2a/array-conv16.C
index bfb39d1c12c..1413971aaa2 100644
--- a/gcc/testsuite/g++.dg/cpp2a/array-conv16.C
+++ b/gcc/testsuite/g++.dg/cpp2a/array-conv16.C
@@ -1,5 +1,5 @@
// PR c++/91364 - P0388R4: Permit conversions to arrays of unknown bound.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
using P = int *(*)[3];
using S = const int *const (*)[];
diff --git a/gcc/testsuite/g++.dg/cpp2a/array-conv17.C b/gcc/testsuite/g++.dg/cpp2a/array-conv17.C
index 3313ed466fb..a879099d542 100644
--- a/gcc/testsuite/g++.dg/cpp2a/array-conv17.C
+++ b/gcc/testsuite/g++.dg/cpp2a/array-conv17.C
@@ -1,5 +1,5 @@
// PR c++/91364 - P0388R4: Permit conversions to arrays of unknown bound.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// As conversion/qual1.C, but with [].
diff --git a/gcc/testsuite/g++.dg/cpp2a/array-conv2.C b/gcc/testsuite/g++.dg/cpp2a/array-conv2.C
index 5245d830f1f..37e9e0546f6 100644
--- a/gcc/testsuite/g++.dg/cpp2a/array-conv2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/array-conv2.C
@@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
A();
diff --git a/gcc/testsuite/g++.dg/cpp2a/array-conv3.C b/gcc/testsuite/g++.dg/cpp2a/array-conv3.C
index 3d92b401247..1ce041e8f2a 100644
--- a/gcc/testsuite/g++.dg/cpp2a/array-conv3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/array-conv3.C
@@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
// Ranking of reference initialization conversions
diff --git a/gcc/testsuite/g++.dg/cpp2a/array-conv4.C b/gcc/testsuite/g++.dg/cpp2a/array-conv4.C
index 979c69b0555..3f6f92c1fed 100644
--- a/gcc/testsuite/g++.dg/cpp2a/array-conv4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/array-conv4.C
@@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Ranking of reference initialization conversions
diff --git a/gcc/testsuite/g++.dg/cpp2a/array-conv5.C b/gcc/testsuite/g++.dg/cpp2a/array-conv5.C
index 34678f5cead..e1058cd83d5 100644
--- a/gcc/testsuite/g++.dg/cpp2a/array-conv5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/array-conv5.C
@@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
// Ranking of list-initialization sequences
int b(int (&&)[] ) { return 1; } // #1
diff --git a/gcc/testsuite/g++.dg/cpp2a/array-conv6.C b/gcc/testsuite/g++.dg/cpp2a/array-conv6.C
index c2389c82273..dc1064005fc 100644
--- a/gcc/testsuite/g++.dg/cpp2a/array-conv6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/array-conv6.C
@@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
// Ranking of reference initialization conversions
diff --git a/gcc/testsuite/g++.dg/cpp2a/array-conv7.C b/gcc/testsuite/g++.dg/cpp2a/array-conv7.C
index 07c709ff10f..1ea1a69c2ff 100644
--- a/gcc/testsuite/g++.dg/cpp2a/array-conv7.C
+++ b/gcc/testsuite/g++.dg/cpp2a/array-conv7.C
@@ -1,5 +1,5 @@
// PR c++/69531 - DR 1307, Overload resolution based on size of array init-list.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
int f(int const(&)[]) { return 1; }
int f(int const(&)[2]) { return 2; }
diff --git a/gcc/testsuite/g++.dg/cpp2a/array-conv8.C b/gcc/testsuite/g++.dg/cpp2a/array-conv8.C
index 635c7679a21..77a07ea038d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/array-conv8.C
+++ b/gcc/testsuite/g++.dg/cpp2a/array-conv8.C
@@ -1,5 +1,5 @@
// PR c++/69531 - DR 1307, Overload resolution based on size of array init-list.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
// Example from [over.ics.rank].
int f(int (&&)[] ) { return 1; } // #1
diff --git a/gcc/testsuite/g++.dg/cpp2a/array-conv9.C b/gcc/testsuite/g++.dg/cpp2a/array-conv9.C
index 63318c53e09..4081cce57ba 100644
--- a/gcc/testsuite/g++.dg/cpp2a/array-conv9.C
+++ b/gcc/testsuite/g++.dg/cpp2a/array-conv9.C
@@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
int arr[1];
extern int arr2[];
diff --git a/gcc/testsuite/g++.dg/cpp2a/attr-likely1.C b/gcc/testsuite/g++.dg/cpp2a/attr-likely1.C
index 43de249bd5a..03b210d5f2d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/attr-likely1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/attr-likely1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options -fdump-tree-gimple }
// { dg-final { scan-tree-dump-times "hot label" 5 "gimple" } }
// { dg-final { scan-tree-dump-times "cold label" 3 "gimple" } }
diff --git a/gcc/testsuite/g++.dg/cpp2a/attr-likely2.C b/gcc/testsuite/g++.dg/cpp2a/attr-likely2.C
index 6c59610528e..ee178dec9c5 100644
--- a/gcc/testsuite/g++.dg/cpp2a/attr-likely2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/attr-likely2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
bool b;
int main()
diff --git a/gcc/testsuite/g++.dg/cpp2a/attr-likely3.C b/gcc/testsuite/g++.dg/cpp2a/attr-likely3.C
index bb1265ddb6e..6e37dbdc980 100644
--- a/gcc/testsuite/g++.dg/cpp2a/attr-likely3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/attr-likely3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
[[likely]] void f() { } // { dg-warning "function" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/attr-likely4.C b/gcc/testsuite/g++.dg/cpp2a/attr-likely4.C
index bf0dc4c5d4e..0a96edc3183 100644
--- a/gcc/testsuite/g++.dg/cpp2a/attr-likely4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/attr-likely4.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
int a, b, c;
diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr1.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr1.C
index 61ba65a1333..f7bd72b7f45 100644
--- a/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr1.C
@@ -1,5 +1,5 @@
// Testcase from P1816R0
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename T>
struct S {
diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr2.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr2.C
index 896554f610a..2fdf4e8f89f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr2.C
@@ -1,5 +1,5 @@
// Test that non-aggregates don't get the aggregate deduction.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-prune-output "no matching function" }
struct A { A(); };
diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr3.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr3.C
new file mode 100644
index 00000000000..13d7ec9b57d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr3.C
@@ -0,0 +1,24 @@
+// Pack expansion testcases from P2082R1
+// { dg-do compile { target c++20 } }
+
+template<typename U, typename... T>
+struct C2 : T... {
+ U a;
+ static constexpr int len = sizeof...(T);
+};
+C2 c2 = {
+ []{ return 1; },
+};
+static_assert (c2.len == 0);
+
+template <typename... T>
+struct Types {};
+template <typename... T>
+struct F : Types<T...>, T... {};
+struct X {};
+struct Y {};
+struct Z {};
+struct W { operator Y(); };
+F f1 = {Types<X, Y, Z>{}, {}, {}}; // OK, F<X, Y, Z> deduced
+F f2 = {Types<X, Y, Z>{}, X{}, Y{}}; // OK, F<X, Y, Z> deduced
+F f3 = {Types<X, Y, Z>{}, X{}, W{}}; // { dg-error "" } conflicting types deduced; operator Y not considered
diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr4.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr4.C
new file mode 100644
index 00000000000..0debbb2443f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr4.C
@@ -0,0 +1,29 @@
+// Other testcases from P2082R1
+// { dg-do compile { target c++20 } }
+
+template <typename T>
+struct X {};
+int main() {
+ X<int> x1;
+ X x2 {x1};
+}
+
+template <typename T, int N>
+struct A {
+ T array[N];
+};
+A a1 = {{1, 2, 3}}; // should deduce A<int, 3>
+A a2 = {"meow"}; // should deduce A<const char, 5>
+
+template <typename T>
+struct B {
+ T array[2];
+};
+B b = {0, 1};
+
+template<typename... T>
+struct C : T... {};
+C c = {
+ []{ return 1; },
+ []{ return 2; }
+};
diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr5.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr5.C
new file mode 100644
index 00000000000..01253f42006
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr5.C
@@ -0,0 +1,20 @@
+// PR c++/95568
+// { dg-do compile { target c++20 } }
+
+template<typename T> struct X { T x; };
+template<typename T, typename U> struct X2 { T x; U y; };
+template<typename T> concept Y = requires { X{0}; };
+
+template<typename T>
+void g()
+{
+ X{0};
+ X2{1, 2.2};
+ Y auto y = X{1};
+}
+
+void
+fn ()
+{
+ g<int>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr6.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr6.C
new file mode 100644
index 00000000000..95d7c5eec18
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr6.C
@@ -0,0 +1,35 @@
+// PR c++/95568
+// { dg-do compile { target c++20 } }
+// CTAD with aggregates containing bit-fields.
+
+template<class, class> struct same_type;
+template<class T> struct same_type<T, T> {};
+
+enum E { e };
+enum class F { f };
+
+template<typename T>
+struct X {
+ T a : 5;
+};
+
+template<typename>
+void g()
+{
+ auto x = X{ 0 };
+ same_type<decltype(x.a), int>();
+ auto x2 = X{ E::e };
+ same_type<decltype(x2.a), E>();
+ auto x3 = X{ false };
+ same_type<decltype(x3.a), bool>();
+ auto x4 = X{ 0u };
+ same_type<decltype(x4.a), unsigned int>();
+ auto x5 = X{ F::f };
+ same_type<decltype(x5.a), F>();
+}
+
+void
+fn ()
+{
+ g<int>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr7.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr7.C
new file mode 100644
index 00000000000..3505a8c97db
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr7.C
@@ -0,0 +1,14 @@
+// { dg-do compile { target c++20 } }
+
+template <class T, int N>
+struct A
+{
+ T ar[N];
+};
+
+A a = { "foo" };
+
+template<class, class> struct same;
+template<class T> struct same<T,T> {};
+same<decltype (a.ar), char[4]> s;
+
diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias1.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias1.C
index ed47eb38f1b..6890d0a1f89 100644
--- a/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias1.C
@@ -1,5 +1,5 @@
// Testcase from P1814R0
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T> struct identity { using type = T; };
template <class T> using identity_t = typename identity<T>::type;
diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias2.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias2.C
index d855f7d11ce..07876a4a496 100644
--- a/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias2.C
@@ -1,6 +1,6 @@
// Test that a non-template deduction guide that doesn't match the alias is
// ignored.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T> struct identity { using type = T; };
template <class T> using identity_t = typename identity<T>::type;
diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias3.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias3.C
new file mode 100644
index 00000000000..318d4c942ce
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias3.C
@@ -0,0 +1,11 @@
+// PR c++/95486
+// { dg-do compile { target c++20 } }
+
+template<class T, class U>
+struct X { X(U) requires __is_same(U, int) {} };
+
+template<class U>
+using Y = X<void, U>;
+
+Y y{1};
+Y z{'a'}; // { dg-error "failed|no match" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/comma1.C b/gcc/testsuite/g++.dg/cpp2a/comma1.C
index 8ffe5d74e61..d9c140db23a 100644
--- a/gcc/testsuite/g++.dg/cpp2a/comma1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/comma1.C
@@ -8,19 +8,19 @@ struct S {
void
fn (int *a, int b, int c)
{
- a[b,c]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++2a } }
+ a[b,c]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20 } }
a[(b,c)];
- a[(void) b, c]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++2a } }
+ a[(void) b, c]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20 } }
a[((void) b, c)];
- a[(void) b, (void) c, (void) b, b]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++2a } }
+ a[(void) b, (void) c, (void) b, b]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20 } }
a[((void) b, (void) c, (void) b, b)];
- a[S(), 10]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++2a } }
+ a[S(), 10]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20 } }
a[(S(), 10)];
a[int{(1,2)}];
- a[int{(1,2)}, int{}]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++2a } }
+ a[int{(1,2)}, int{}]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20 } }
a[(int{(1,2)}, int{})];
}
diff --git a/gcc/testsuite/g++.dg/cpp2a/comma2.C b/gcc/testsuite/g++.dg/cpp2a/comma2.C
index 15fd26ab400..995944f500e 100644
--- a/gcc/testsuite/g++.dg/cpp2a/comma2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/comma2.C
@@ -1,5 +1,5 @@
// PR c++/91338 - P1161R3: Deprecate a[b,c].
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-options "-Wno-comma-subscript" }
struct S {
diff --git a/gcc/testsuite/g++.dg/cpp2a/comma4.C b/gcc/testsuite/g++.dg/cpp2a/comma4.C
index 23183ad7bc2..0d149c7a9af 100644
--- a/gcc/testsuite/g++.dg/cpp2a/comma4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/comma4.C
@@ -1,5 +1,5 @@
// PR c++/91338 - P1161R3: Deprecate a[b,c].
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-options "-Wno-deprecated" }
struct S {
diff --git a/gcc/testsuite/g++.dg/cpp2a/comma5.C b/gcc/testsuite/g++.dg/cpp2a/comma5.C
index 68d19c09ccf..acf5d43ad5d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/comma5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/comma5.C
@@ -1,5 +1,5 @@
// PR c++/91391 - bogus -Wcomma-subscript warning.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T, typename U>
int foo(T t, U u) { return t + u; }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-alias.C b/gcc/testsuite/g++.dg/cpp2a/concepts-alias.C
index 862879169fb..b8089679772 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-alias.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-alias.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept Class = __is_class(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-alias3.C b/gcc/testsuite/g++.dg/cpp2a/concepts-alias3.C
index 02e960ad40a..2ac9ae2ff72 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-alias3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-alias3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename T> struct A { };
template <typename T> concept int_type = __is_same_as (T, int);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-alias4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-alias4.C
index d37ce6a51e8..26b3d4a2cbb 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-alias4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-alias4.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename T> struct A { };
template <typename T> concept int_type = __is_same_as (T, int);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-alias5.C b/gcc/testsuite/g++.dg/cpp2a/concepts-alias5.C
index 907b0c2e357..a565de66412 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-alias5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-alias5.C
@@ -1,5 +1,5 @@
// PR c++/93377
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct empty
{};
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-ca107.C b/gcc/testsuite/g++.dg/cpp2a/concepts-ca107.C
new file mode 100644
index 00000000000..e18280a04bc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-ca107.C
@@ -0,0 +1,33 @@
+// NB comments CA107/US117
+// { dg-do compile { target concepts } }
+
+template <unsigned N> constexpr bool Atomic = true;
+template <unsigned N> concept C = Atomic<N>;
+template <unsigned N> concept Add1 = C<N + 1>;
+template <unsigned N> concept AddOne = C<N + 1>;
+template <unsigned M> void f()
+ requires Add1<2 * M>;
+template <unsigned M> int f()
+ requires AddOne<2 * M> && true;
+
+int x = f<0>(); // OK, the atomic constraints from concept C in both fs are Atomic<N>
+ // with mapping similar to N -> 2 * M + 1
+
+template <unsigned N> struct WrapN;
+template <unsigned N> using Add1Ty = WrapN<N + 1>;
+template <unsigned N> using AddOneTy = WrapN<N + 1>;
+template <unsigned M> void g(Add1Ty<2 * M> *);
+template <unsigned M> void g(AddOneTy<2 * M> *);
+
+void h() {
+ g<0>(nullptr); // OK, there is only one g
+}
+template <unsigned N> void f2()
+ requires Add1<2 * N>;
+template <unsigned N> int f2()
+ requires Add1<N * 2> && true;
+void h2() {
+ f2<0>(); // { dg-error "ambiguous" } ill-formed, no diagnostic required:
+ // required determination of subsumption between atomic constraints that are
+ // functionally equivalent but not equivalent
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-class.C b/gcc/testsuite/g++.dg/cpp2a/concepts-class.C
index aca5c44c48f..b50cb421b3b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-class.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-class.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept Class = __is_class(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-cmath.C b/gcc/testsuite/g++.dg/cpp2a/concepts-cmath.C
index b090c3a3719..d13100b96f9 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-cmath.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-cmath.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <cmath>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-complete1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-complete1.C
index 25c4ca064ce..63f36965f00 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-complete1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-complete1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T> concept has_mem_type = requires { typename T::type; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-constrained-parm.C b/gcc/testsuite/g++.dg/cpp2a/concepts-constrained-parm.C
index bb7e31d8b6c..18564c8da13 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-constrained-parm.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-constrained-parm.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-conv2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-conv2.C
index 821042f44ee..f61f2602b78 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-conv2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-conv2.C
@@ -1,5 +1,5 @@
// PR c++/94597
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename b, typename c> concept d = requires(b e) { e.operator c(); };
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-decltype.C b/gcc/testsuite/g++.dg/cpp2a/concepts-decltype.C
index db3cfdf3cb2..13733c645f3 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-decltype.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-decltype.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Tests constrained decltype(auto).
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-dr1430.C b/gcc/testsuite/g++.dg/cpp2a/concepts-dr1430.C
index 91eefee602a..80047691004 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-dr1430.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-dr1430.C
@@ -1,5 +1,5 @@
// PR c++/66092
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename T, typename U, typename... Args>
concept Similar = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-err2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-err2.C
new file mode 100644
index 00000000000..c0372a6096b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-err2.C
@@ -0,0 +1,11 @@
+// PR c++/95735
+// { dg-do compile { target concepts } }
+
+template <auto F>
+ requires requires { F(); }
+bool v{};
+
+void f() {
+ int x;
+ static_assert(v<[&] { x++; }>); // { dg-error "not a constant expression" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst1.C
index 14d994c9b04..5cbf64a8cd3 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-final { scan-assembler "_Z1gI1XEvT_" } }
// { dg-final { scan-assembler "_Z1gI1YEvT_" } }
// { dg-final { scan-assembler "_Z1gIiEvT_" } }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst2.C
index 6074bc78682..5756b0d73a6 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst3.C b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst3.C
index 03ec9e9a698..105f39e45fc 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst4.C
index 81bc081abbb..562fc138cfd 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst4.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst5.C b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst5.C
new file mode 100644
index 00000000000..05959a8972c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst5.C
@@ -0,0 +1,14 @@
+// PR c++/96164
+// { dg-do compile { target concepts } }
+
+template <int N>
+struct A {
+ void f() requires (N == 3) { static_assert(N == 3); }
+};
+template struct A<2>;
+
+template <int N>
+struct B {
+ void f() requires (N == 2) { static_assert(N == 3); } // { dg-error "assert" }
+};
+template struct B<2>;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec1.C
index d54bcdb3211..2fe479934a8 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec1.C
@@ -1,4 +1,4 @@
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec2.C
index 4103714b004..99f83cba6cf 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec3.C b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec3.C
index 76c6fb9bd34..3f2d62c94fd 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec4.C
index 0634eafb248..471eaba773f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec4.C
@@ -1,4 +1,4 @@
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec5.C b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec5.C
index b682b0d8846..a15749a88be 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec5.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec6.C b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec6.C
index 13f04d77594..e726e1cc91e 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec6.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
struct A {
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-feature-macro.C b/gcc/testsuite/g++.dg/cpp2a/concepts-feature-macro.C
index 56fbb683868..50a08328755 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-feature-macro.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-feature-macro.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#ifndef __cpp_concepts
#error __cpp_concepts not defined
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-fn1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-fn1.C
index 9287ab8e5d7..b31675d255c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-fn1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-fn1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept Type = true;
@@ -170,7 +170,7 @@ template<typename T> void g(T x) { }
void driver_3 ()
{
g(&ok<int>);
- g(&err<int>); // { dg-error "no matches" }
+ g(&err<int>); // { dg-error "no match" }
}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-fn2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-fn2.C
index ddf99aa9933..c8590b4074b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-fn2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-fn2.C
@@ -1,4 +1,4 @@
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
#define assert(E) if (!(E)) __builtin_abort();
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-fn3.C b/gcc/testsuite/g++.dg/cpp2a/concepts-fn3.C
index b25adcc17c0..f33251987f7 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-fn3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-fn3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept type = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-fn4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-fn4.C
index 8a29ca9360c..4fca936db2b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-fn4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-fn4.C
@@ -1,5 +1,5 @@
// Testcase from [expr.prim.id]/5
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T> struct A {
static void f(int) requires false;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-fn5.C b/gcc/testsuite/g++.dg/cpp2a/concepts-fn5.C
new file mode 100644
index 00000000000..8f00a760d7e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-fn5.C
@@ -0,0 +1,17 @@
+// Verify we check associated constraints when resolving the address of a
+// template-id.
+// { dg-do compile { target c++20 } }
+
+void id(auto) { }
+
+template <typename>
+int f() { return 0; }
+
+template <typename T> requires requires { T::fail(); }
+auto f() { T::fail(); }
+
+int main() {
+ using U = decltype(&f<int>);
+ (void)&f<int>;
+ id(&f<int>);
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-friend1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-friend1.C
index e3740d5170e..fe80460c9c5 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-friend1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-friend1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept Eq = requires(T t) { t == t; }; // { dg-message "in requirements" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-friend2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-friend2.C
index 6aa9d961779..d5f700c7d39 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-friend2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-friend2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept Eq = requires(T t) { t == t; }; // { dg-message "in requirements" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-friend4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-friend4.C
index 88f9fe825f8..90ab8f0305d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-friend4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-friend4.C
@@ -1,5 +1,5 @@
// C++20 NB comment US115
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T> concept Any = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-friend6.C b/gcc/testsuite/g++.dg/cpp2a/concepts-friend6.C
new file mode 100644
index 00000000000..11e8313f0ac
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-friend6.C
@@ -0,0 +1,19 @@
+// PR c++/93467
+// { dg-do compile { target c++20 } }
+
+template<bool B> requires B
+ class C;
+
+template<typename>
+class S1
+{
+ template<bool B> requires B
+ friend class ::C;
+};
+
+template<typename>
+class S2
+{
+ template<bool B> requires (!B)
+ friend class ::C; // { dg-error "does not match original declaration" }
+};
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-friend7.C b/gcc/testsuite/g++.dg/cpp2a/concepts-friend7.C
new file mode 100644
index 00000000000..4481b5c4af4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-friend7.C
@@ -0,0 +1,18 @@
+// PR c++/93467
+// { dg-do compile { target c++20 } }
+
+template<typename T> concept True = true;
+
+template<typename U>
+struct S1 {
+ template<True T> friend struct S2; // friend declaration for S2
+};
+
+S1<int> s; // instantiate S1
+
+template<True T> struct S2; // another declaration for S2
+
+template<typename U>
+struct S3 {
+ template<True T> friend struct ::S2; // a third declaration for S2
+};
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-friend8.C b/gcc/testsuite/g++.dg/cpp2a/concepts-friend8.C
new file mode 100644
index 00000000000..e4930bbf80c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-friend8.C
@@ -0,0 +1,12 @@
+// { dg-do compile { target c++20 } }
+
+template <class T>
+struct A
+{
+ friend bool operator==(const A&, const A&) requires true = default;
+};
+
+int main()
+{
+ A<int>() == A<int>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-iconv1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-iconv1.C
index 4e2d13f8eb3..4ddf516b1a9 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-iconv1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-iconv1.C
@@ -1,5 +1,5 @@
// PR c++/67240
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-diagnostics-depth=2" }
template <class T, class U> concept Same = __is_same_as(T,U);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor2.C
index aa244bc04c1..b858e2770d1 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor4.C
index 34eaf22c26c..7fe930cd865 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor4.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor6.C b/gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor6.C
index c92d6ac774c..ad29068e49f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor6.C
@@ -1,5 +1,5 @@
// PR c++/91930
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename T> struct basic_mixin {
basic_mixin() requires true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda1.C
index ef1968899f6..61595749f71 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda1.C
@@ -1,5 +1,5 @@
// PR c++/82565
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct string
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda10.C b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda10.C
new file mode 100644
index 00000000000..392da312b28
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda10.C
@@ -0,0 +1,7 @@
+// PR c++/94128
+// { dg-do compile { target c++20 } }
+
+void test(auto param)
+requires requires{ { [](auto p){return p;}(param) }; };
+
+void test2() { test(1); }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda11.C b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda11.C
new file mode 100644
index 00000000000..dd9cd4e2344
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda11.C
@@ -0,0 +1,17 @@
+// PR c++/92838
+// { dg-do compile { target c++20 } }
+
+template<int N>
+auto foo()
+{
+ [] () requires (N != 0) { }(); // { dg-error "no match" }
+ [] () requires (N == 0) { }();
+
+ [] <int M=1> () requires (N == M) { }(); // { dg-error "no match" }
+ [] <int M=1> () requires (N != M) { }();
+}
+
+void bar()
+{
+ foo<0>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda12.C b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda12.C
new file mode 100644
index 00000000000..2bc9fd0bb25
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda12.C
@@ -0,0 +1,15 @@
+// PR c++/92633
+// { dg-do compile { target c++20 } }
+
+template<class A, class B>
+concept different_than = !__is_same_as(A, B);
+
+template<class B>
+auto diff(B) {
+ return [](different_than<B> auto a) {};
+}
+
+int main() {
+ diff(42)("");
+ diff(42)(42); // { dg-error "no match" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda2.C
index a7419d69a46..44b509dd380 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept False = false;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda3.C b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda3.C
index 96da7852a70..291e451ca1a 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda3.C
@@ -1,4 +1,4 @@
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
template<typename T>
concept C1 = __is_same_as(T, int)
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda4.C
index dfb5f3bcc5e..daaaf31cf6c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda4.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct a {};
template <bool> using b = a;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda5.C b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda5.C
index fe471899c14..ee9180e2866 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda5.C
@@ -1,5 +1,5 @@
// PR c++/92556
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Having this as a hard error is consistent with template argument deduction;
// it's an open core issue (jason 2020-02-14).
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda7.C b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda7.C
new file mode 100644
index 00000000000..50746b777a3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda7.C
@@ -0,0 +1,14 @@
+// PR c++/95020
+// { dg-do compile { target c++2a } }
+
+template<typename>
+void foo() {
+ auto t = [](auto v) {
+ static_assert(requires { *v; }); // { dg-error "static assertion failed" }
+ };
+ t(0);
+}
+
+void bar() {
+ foo<void>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda8.C b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda8.C
new file mode 100644
index 00000000000..c1c9be682d0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda8.C
@@ -0,0 +1,11 @@
+// PR c++/92652
+// { dg-do compile { target concepts } }
+
+template < typename T >
+ requires ([]{return true ;}())
+void h() { }
+
+int main()
+{
+ h<int>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda9.C b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda9.C
new file mode 100644
index 00000000000..6b81ba0adac
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda9.C
@@ -0,0 +1,11 @@
+// PR c++/93698
+// { dg-do compile { target concepts } }
+
+#include <utility>
+
+template <int N>
+concept foo = []<std::size_t... Is>(std::index_sequence<Is...>) constexpr {
+ return (Is + ...) > 10;
+}(std::make_index_sequence<N>());
+
+bool a = foo<7>;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-locations1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-locations1.C
index 6c81c1476ab..c841daec7f2 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-locations1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-locations1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-member-concept.C b/gcc/testsuite/g++.dg/cpp2a/concepts-member-concept.C
index f3a2d064dbd..cec45b46aa0 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-member-concept.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-member-concept.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// FIXME: Diagnostics should be better.
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-memfun-err.C b/gcc/testsuite/g++.dg/cpp2a/concepts-memfun-err.C
index acfa188af21..8867b7bf3a1 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-memfun-err.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-memfun-err.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-memfun.C b/gcc/testsuite/g++.dg/cpp2a/concepts-memfun.C
index f6ad5196352..77e10c6b5c7 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-memfun.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-memfun.C
@@ -1,4 +1,4 @@
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-memtmpl1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-memtmpl1.C
index ee28d5b7754..7ddfe62590c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-memtmpl1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-memtmpl1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T>
struct A {
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-noexcept1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-noexcept1.C
index 418040aa56e..987bf27f784 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-noexcept1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-noexcept1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
void f1(int);
void f2(int) noexcept;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-p2113a.C b/gcc/testsuite/g++.dg/cpp2a/concepts-p2113a.C
new file mode 100644
index 00000000000..e2652dd12f3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-p2113a.C
@@ -0,0 +1,12 @@
+// Test that the second foo is not considered more specialized because we don't
+// compare constraints unless the template parameters and function parameters
+// are equivalent (P2113)
+
+// { dg-do compile { target c++20 } }
+
+template <typename T> concept P = true;
+
+template <typename T> void foo(int, T);
+template <P U> void foo(U, int);
+
+void bar() { foo(1,2); } // { dg-error "ambiguous" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-p2113b.C b/gcc/testsuite/g++.dg/cpp2a/concepts-p2113b.C
new file mode 100644
index 00000000000..18c4098d473
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-p2113b.C
@@ -0,0 +1,25 @@
+// testcase from P2113
+// { dg-do compile { target c++20 } }
+
+template <typename> constexpr bool True = true;
+template <typename T> concept C = True<T>;
+
+void f(C auto &, auto &) = delete;
+template <C Q> void f(Q &, C auto &);
+
+void g(struct A *ap, struct B *bp) {
+ f(*ap, *bp); // OK: Can use different methods to produce template parameters
+}
+
+template <typename T, typename U> struct X {};
+
+template <typename T1, C U1, typename V1>
+bool operator==(X<T1, U1>, V1) = delete;
+
+// In P2113 this candidate is reversed.
+template <C T2, C U2, C V2>
+bool operator==(X<T2, U2>, V2);
+
+void h() {
+ X<void *, int>{} == 0; // OK
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec4.C
index 5ba3ab19c23..fb3272632c7 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec4.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T> concept is_int = __is_same_as(T,int);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec5.C b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec5.C
index f33f74969b7..8774d4f6fd7 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec5.C
@@ -1,5 +1,5 @@
// PR c++/67138
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T>
concept Auto = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec6.C b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec6.C
index 2bb4bacb2ef..9e455d5d3a2 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec6.C
@@ -1,5 +1,5 @@
// PR c++/67152
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T>
concept HasType = requires { typename T::type; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec7.C b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec7.C
new file mode 100644
index 00000000000..5b3afce3bc7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec7.C
@@ -0,0 +1,22 @@
+// PR c++/92103
+// { dg-do compile { target c++20 } }
+
+template<int M>
+struct traits
+{
+ template<int N>
+ struct equal_to
+ { static constexpr bool value = false; };
+
+ template<int N> requires (M == N)
+ struct equal_to<N>
+ { static constexpr bool value = true; };
+
+ template<int N> requires (M < 0) || (N < 0)
+ struct equal_to<N>
+ { };
+};
+
+static_assert(traits<0>::equal_to<0>::value);
+static_assert(!traits<0>::equal_to<1>::value);
+static_assert(traits<-1>::equal_to<0>::value); // { dg-error "not a member" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec8.C b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec8.C
new file mode 100644
index 00000000000..873cf44e407
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec8.C
@@ -0,0 +1,14 @@
+// { dg-do compile { target c++20 } }
+
+template<int M, int N>
+concept equal = M == N;
+
+template<int M>
+struct traits
+{
+ template<int N> requires equal<M, N>
+ struct foo {};
+
+ template<int N> requires equal<M, N> && (M >= 0) // { dg-bogus "not more constrained" }
+ struct foo<N> {};
+};
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder1.C
index cbea81d6b21..887fe4df3a9 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<class T, class U>
concept Same = __is_same_as(T, U);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder2.C
index b04354cf8d0..9e6fd16c368 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder2.C
@@ -1,5 +1,5 @@
// PR c++/94481
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept C = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr65552.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr65552.C
index 5af2a40e9a3..7176efbc608 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr65552.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr65552.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept Concept =
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr65634.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr65634.C
index 52f24ec90be..54405f2ca6e 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr65634.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr65634.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept C1 =
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr65636.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr65636.C
index b99a3433f6c..1bcc051243f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr65636.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr65636.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
using TD = int;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr65848.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr65848.C
index b246d254bc3..2868f9cfadc 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr65848.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr65848.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Performance test... This should be fast.
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr65854.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr65854.C
index 53bb9a355f1..93dc32de922 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr65854.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr65854.C
@@ -1,5 +1,5 @@
// PR c++/65854
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Handle alias templates in type requirements.
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr66844.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr66844.C
index c32f4d1184b..afeee5927e5 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr66844.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr66844.C
@@ -1,5 +1,5 @@
// PR c++/66844
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T, class U>
concept Same = __is_same_as(T, U);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr66962.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr66962.C
index ca57a0915f1..c6dfe5d1c79 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr66962.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr66962.C
@@ -1,5 +1,5 @@
// PR c++/66962
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename> struct remove_cv;
template <typename> struct is_reference;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67070.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67070.C
index 88017dc723f..fbaac1c34a3 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67070.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67070.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T>
concept C1 =
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67147.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67147.C
index db8c37e2191..1e83fbae3bf 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67147.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67147.C
@@ -1,5 +1,5 @@
// PR c++/67147
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class F, class I1, class I2 = I1>
concept IndirectCallableRelation = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67148.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67148.C
index c5939960a14..97f80cfcfa8 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67148.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67148.C
@@ -1,5 +1,5 @@
// PR c++/67148
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
namespace std
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67178.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67178.C
index 7154fc2b7fe..c74f6f00a5c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67178.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67178.C
@@ -1,5 +1,5 @@
// PR c++/67178
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept c = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67210.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67210.C
index 044e677363c..a31750eb495 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67210.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67210.C
@@ -1,5 +1,5 @@
// PR c++/67210
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T, class U>
concept C = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67217.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67217.C
index 35618aed5d3..b1a7a8c333a 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67217.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67217.C
@@ -1,5 +1,5 @@
// PR c++/67217
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T>
requires __is_same_as(T, double)
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-1.C
index 500e6314119..d59d4f95bfb 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-1.C
@@ -1,5 +1,5 @@
// PR c++/67225
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template <class T, class U>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-2.C
index 62181768dcc..f8d99ffe006 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-2.C
@@ -1,5 +1,5 @@
// PR c++/67225
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template<typename Target>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-3.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-3.C
index d08efb661f0..937098d394f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-3.C
@@ -1,5 +1,5 @@
// PR c++/67225
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template <class>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-4.C
index 0ef5ed87264..e37ad28c1bc 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-4.C
@@ -1,5 +1,5 @@
// PR c++/67225
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template <class, class>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-5.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-5.C
index 9a25831f4a2..92f42982a38 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-5.C
@@ -1,5 +1,5 @@
// PR c++/67225
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template<typename A, typename T>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67319.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67319.C
index 6eb1c440ed4..5399780cfbf 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67319.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67319.C
@@ -1,5 +1,5 @@
// PR c++/67319
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template <typename T>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67427.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67427.C
index fcad30183d6..fad43be6c5b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67427.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67427.C
@@ -1,5 +1,5 @@
// PR c++/67427
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template <class S, class I>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67654.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67654.C
index 27ee205a7fc..5087344d2c9 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67654.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67654.C
@@ -1,5 +1,5 @@
// PR c++/67427
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template <bool... Values> struct and_c_impl {
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67658.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67658.C
index 087f4fc83ae..530cb333f38 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67658.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67658.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template<class T> concept bool C1() { return false; }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67684.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67684.C
index 35e92954414..392492214e2 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67684.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67684.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template<class T>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67692.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67692.C
index 139ecd6d798..c712d727235 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67692.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67692.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<class T>
bool f(T x) {
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67697.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67697.C
index 44c077b16a1..27083371ae1 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67697.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67697.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template<class X>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67719.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67719.C
index d28b44559bd..c3c5c235455 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67719.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67719.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template<class X> concept bool C() {
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67774.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67774.C
index d363c59f6d5..5ee5c2dac8f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67774.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67774.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
#include <type_traits>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67825.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67825.C
index fff414b8eb2..64cd9d2d336 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67825.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67825.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
struct A {
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67860.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67860.C
index 8bad0319a05..693237fa783 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67860.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67860.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
#include <type_traits>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67862.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67862.C
index 222e5280913..b42ce8b7c30 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67862.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67862.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
typedef int size_t;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67969.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67969.C
index 4f2ab510389..b809553c07a 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr67969.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr67969.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template <class, class>
class NumericArray {};
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr68093-1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr68093-1.C
index bf952103841..bc679a71f9c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr68093-1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr68093-1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename t>
struct S
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr68093-2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr68093-2.C
index 91e3c80653d..2dd46dae6d7 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr68093-2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr68093-2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template <class T>
concept bool True = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr68372.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr68372.C
index d1416ebc99c..9fc90ff39a6 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr68372.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr68372.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template<typename F>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr68434.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr68434.C
index 23ecf4de2bc..1fbda9f9ca0 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr68434.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr68434.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class>
concept C1 = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr68683.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr68683.C
index f11d69f75fd..0a8715d91cc 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr68683.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr68683.C
@@ -1,5 +1,5 @@
// PR c++/68683
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename, typename>
struct is_same {
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr68812.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr68812.C
index 2d809e85914..324b3ad8b37 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr68812.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr68812.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
namespace zero
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr69235.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr69235.C
index 5e96d0e7b7d..1df563b341c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr69235.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr69235.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template<typename T>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr71368.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr71368.C
index c67e632d443..d83440d49c6 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr71368.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr71368.C
@@ -1,5 +1,5 @@
// PR c++/71368
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T, class U> concept Same = __is_same_as(T,U);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr71385.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr71385.C
index f31997c920d..aee27bc0c98 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr71385.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr71385.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<class From, class To>
concept convertible_to = requires(From (&f)(), void (&g)(To)) { g(f()); };
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr71965.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr71965.C
index 4619cf993af..cdad62ca440 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr71965.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr71965.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T>
concept Destructible = false;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr78752-2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr78752-2.C
new file mode 100644
index 00000000000..6777054285d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr78752-2.C
@@ -0,0 +1,21 @@
+// { dg-do compile { target c++2a } }
+// { dg-additional-options "-fconcepts-ts" }
+
+template <class T, class U>
+concept bool Same = __is_same(T, U);
+
+struct test {
+ void func(Same<int>... ints) {}
+};
+
+void func(Same<int>... ints) {}
+
+int main()
+{
+ test t;
+ t.func(1, 2, 3);
+ func(1, 2, 3);
+
+ t.func(1, 2, ""); // { dg-error "no match" }
+ func(1, 2, ""); // { dg-error "unsatisfied constraints" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr78752.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr78752.C
index 40eeaa7d57b..447b149b80c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr78752.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr78752.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
#include <type_traits>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr79759.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr79759.C
index a99103c97dd..5fdd64eb26f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr79759.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr79759.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template<typename T, T N>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr80746.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr80746.C
index 69e2fbec4d8..1a0008e7a98 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr80746.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr80746.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template<typename T, typename T::type>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr80773.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr80773.C
index 34b96c59582..92e89da5451 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr80773.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr80773.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template<typename F>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr82507.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr82507.C
index f7438552ca9..81a671c7b1a 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr82507.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr82507.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template<class I>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr82740.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr82740.C
index 6e0f062c14b..01a42a4e73f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr82740.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr82740.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template<class T>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr84140.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr84140.C
index 83a9083cf17..b604f7e00bf 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr84140.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr84140.C
@@ -1,4 +1,4 @@
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
template<class, class> constexpr bool is_same_v = false;
template<class T> constexpr bool is_same_v<T, T> = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr84551.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr84551.C
index e40796f4975..ef1d278e99b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr84551.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr84551.C
@@ -1,5 +1,5 @@
// PR c++/84551
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-g -O" }
template<typename> concept C = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr84810.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr84810.C
index b330e4be051..8d7cb89f3f5 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr84810.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr84810.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<class> constexpr bool is_int = false;
template<> constexpr bool is_int<int> = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr85808.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr85808.C
index bcba830bc0d..f32ca63d5ee 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr85808.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr85808.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
namespace X
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr86269.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr86269.C
index 4428ee1796c..6fb430d90a3 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr86269.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr86269.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
#include <type_traits>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr87441.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr87441.C
index bcd4ba54071..28be9e9e0ea 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr87441.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr87441.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template<typename X, typename Y = X>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr88395.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr88395.C
index ad24da9cb47..1c25252d47b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr88395.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr88395.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T, class U>
concept Concept2 = requires (T t, U u)
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr92078.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr92078.C
index 9bfb896cc78..6df9b852fb1 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr92078.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr92078.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename I>
struct iterator_traits
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr95497.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr95497.C
new file mode 100644
index 00000000000..4d7718ad5e8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr95497.C
@@ -0,0 +1,12 @@
+// PR c++/95497
+// { dg-do compile { target c++20 } }
+
+template <typename T>
+struct A{};
+
+template <typename T>
+concept c =
+ requires(T t, A<int> b) // note that A<int> is independent of T
+ {
+ { t += b };
+ };
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat1.C
index ee83d560cf6..22696c30d81 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<int N, typename T>
concept Foo = requires(T t) { foo<N + 1>(t); }; // { dg-error "template instantiation depth" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat2.C
index d76f12eb209..992fcbbfccb 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept Fooable = requires(T t) { foo(t); }; // { dg-error "template instantiation depth" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat3.C b/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat3.C
index b8ca9164792..679f5cfbf69 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept Fooable = requires(T t) { foo(t); };
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-redecl1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-redecl1.C
new file mode 100644
index 00000000000..33cd778a318
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-redecl1.C
@@ -0,0 +1,7 @@
+// PR c++/94553
+// { dg-do compile { target c++20 } }
+
+struct E { };
+template<typename> concept E = false; // { dg-error "different kind of entity" }
+template<typename> concept F = false;
+struct F { }; // { dg-error "different kind of entity" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires1.C
index 7afd34d11fd..03668d34384 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept Class = __is_class(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires10.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires10.C
index bb0e3b0667f..0364d2e3138 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires10.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires10.C
@@ -1,5 +1,5 @@
// PR c++/66988
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<bool B>
struct bool_constant {
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires11.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires11.C
index be6409ebad8..816a37c10b7 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires11.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires11.C
@@ -1,5 +1,5 @@
// PR c++/67018
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename T>
constexpr bool Val = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires12.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires12.C
index c8e3cfd5c63..2d8c2911a9c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires12.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires12.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class> struct all_same {
static constexpr bool value = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires13.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires13.C
index 8ba38625834..062d22c5aee 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires13.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires13.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T> concept C = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires14.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires14.C
index e2893c061de..06908a419e0 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires14.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires14.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept A = sizeof(T) >= 4;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires15.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires15.C
index 9b82061af11..27af524f7ba 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires15.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires15.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct string;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires16.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires16.C
index b9532a36eb5..cb2ac5d9311 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires16.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires16.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// A poor mans Integral concept.
template<typename T>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires17.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires17.C
index 1ec1d59fc84..6b665ac52ea 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires17.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires17.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept Type = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires18.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires18.C
index c97704565a1..9d8ec94f696 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires18.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires18.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept integer = __is_same_as(T, int);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires19.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires19.C
index 071a838f754..b020250da50 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires19.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires19.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept check_c = false;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires2.C
index 282dba63e29..a9b422b5bac 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Test the types of atomic constraints
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires20.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires20.C
index 089db2ba013..5f7aec5b281 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires20.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires20.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename ...>
constexpr bool r () { return true; }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires21.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires21.C
index 1d21cce7eee..bc38b893c68 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires21.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires21.C
@@ -1,5 +1,5 @@
// PR c++/94480
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T, typename U>
constexpr bool is_same_v = __is_same (T, U);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires3.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires3.C
index bbcba0d5806..292ce20ee73 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Test basic expression requirements
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires4.C
index 61aa72d0452..3153afa4c4d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires4.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Test associated type requirements
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires5.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires5.C
index 2f912b13d6a..976efe67c46 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires5.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts -fconcepts-diagnostics-depth=2" }
// Test conversion requirements (not in C++20)
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires6.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires6.C
index d9899250342..a4e4402a6cf 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires6.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Test deduction requirements.
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires7.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires7.C
index 89057c42441..8101d03100b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires7.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires7.C
@@ -1,5 +1,5 @@
// PR c++/66758
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T, class U>
concept C = requires (T t, U u) { t + u; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires8.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires8.C
index 0d61a0ab313..0170042b2ad 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires8.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires8.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T, class U>
concept C = requires (T t, U u) { t + u; }; // { dg-message "in requirements" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires9.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires9.C
index 3594176627f..c9ff9cace6e 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-requires9.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires9.C
@@ -1,5 +1,5 @@
// PR c++/66832
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T, class U, unsigned N>
requires requires (T& t, U &u) { t.foo(); u.foo(); }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-return-req1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-return-req1.C
index 1d005f059d0..d21a49be14e 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-return-req1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-return-req1.C
@@ -1,5 +1,5 @@
// PR c++/92268
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T> concept Two = true;
template <class T> concept One = Two<typename T::type>;
@@ -15,5 +15,5 @@ int f(...);
int main()
{
- f<int>();
+ f<int>(); // { dg-error "ambiguous" }
}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-spec1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-spec1.C
new file mode 100644
index 00000000000..5001813d7b7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-spec1.C
@@ -0,0 +1,10 @@
+// Example from CA 104 proposal.
+// { dg-do compile { target concepts } }
+
+template <class T> concept C = sizeof(T) == 8;
+template <class T> struct A {
+ template <class U> U f(U) requires C<typename T::type>; // #1
+ template <class U> U f(U) requires C<T>; // #2
+};
+
+template <> template <class U> U A<int>::f(U) requires C<int> { } // OK, specializes #2
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm1.C
index 4ff401a98e9..39e0d7d8ac7 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept Int = __is_same_as(T, int);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm10.C b/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm10.C
index 239b485f717..047c19e95ac 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm10.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm10.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class>
concept Dummy = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm2.C
index 7c1d69b38d1..3bb2f576a87 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept Int = __is_same_as(T, int);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm5.C b/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm5.C
index 78b6f1c799b..46c50a6ef5c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm5.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept Int = __is_same_as(T, int);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm6.C b/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm6.C
index 47c8ef72c90..c7d9964f738 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm6.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename... Ts> struct are_same;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm8.C b/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm8.C
index adcffed060c..265d8947957 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm8.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm8.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm9.C b/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm9.C
index d578b354084..00cc21067ce 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm9.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-template-parm9.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-traits2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-traits2.C
index 2bdd3d370c2..18baac48e4d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-traits2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-traits2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept Nothrow_assignable = __has_nothrow_assign(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-ts1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-ts1.C
index b3acec15986..1cefe3b243f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-ts1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-ts1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
// This tests the terse notation.
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-ts2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-ts2.C
index f731bac8c2a..5942ff19327 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-ts2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-ts2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
// Basic tests using function concepts.
@@ -173,7 +173,7 @@ template<typename T> void g(T x) { }
void driver_3 ()
{
g(&ok<int>);
- g(&err<int>); // { dg-error "no matches" }
+ g(&err<int>); // { dg-error "no match" }
}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-ts3.C b/gcc/testsuite/g++.dg/cpp2a/concepts-ts3.C
index 434a5e2651b..6f7ed1ffee4 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-ts3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-ts3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
// Basic tests using variable concepts.
@@ -173,7 +173,7 @@ template<typename T> void g(T x) { }
void driver_3 ()
{
g(&ok<int>);
- g(&err<int>); // { dg-error "no matches" }
+ g(&err<int>); // { dg-error "no match" }
}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-ts4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-ts4.C
index aa96621d9cf..cc49ff4fb27 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-ts4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-ts4.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
// Basic tests for introduction syntax.
@@ -31,4 +31,6 @@ void driver()
fn<0>(); // OK
fn<-1>(); // { dg-error "" }
fn<int>(); // { dg-error "no matching function" }
+ // { dg-error "type/value mismatch at argument 1" "" { target *-*-* } .-1 }
+ // { dg-message "expected a constant of type .int., got .int." "" { target *-*-* } .-2 }
}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-ts5.C b/gcc/testsuite/g++.dg/cpp2a/concepts-ts5.C
index cdc40df4387..06244882167 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-ts5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-ts5.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
struct Base {
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-ts6.C b/gcc/testsuite/g++.dg/cpp2a/concepts-ts6.C
index bf665aa6308..8aede575f75 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-ts6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-ts6.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-ts" }
template<typename T, int N, typename... Xs> concept bool C1 = true;
@@ -25,6 +25,8 @@ void driver1() {
f<X>();
f<int>(); // { dg-error "no matching function for call" }
+ // { dg-error "type/value mismatch at argument 1" "" { target *-*-* } .-1 }
+ // { dg-message "expected a class template, got .int." "" { target *-*-* } .-2 }
S2<int> s2a;
S2<char, signed char, unsigned char> s2b;
@@ -69,4 +71,4 @@ void driver2()
S6<void, void> s6a;
S6<void, int> s6c; // { dg-error "template constraint failure" }
S6<void, void, void> s6b; // { dg-error "wrong number of template arguments" }
-} \ No newline at end of file
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-ttp1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-ttp1.C
new file mode 100644
index 00000000000..3f6eb35cf61
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-ttp1.C
@@ -0,0 +1,16 @@
+// PR c++/95371
+// { dg-do compile { target c++20 } }
+
+template <typename...>
+struct configuration {
+ template <template <typename...> typename query_t>
+ static constexpr bool exists() { return true; }
+
+ template <template <typename...> typename query_t>
+ void remove() requires(exists<query_t>());
+};
+
+int main() {
+ configuration<> cfg{};
+ cfg.remove<configuration>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-using1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-using1.C
index 733382db0f5..adfecf85c13 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-using1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-using1.C
@@ -1,5 +1,5 @@
// PR c++/79591
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class> concept True = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-using2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-using2.C
index 206b54a2883..b9a67f5d8da 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-using2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-using2.C
@@ -10,7 +10,7 @@ template <typename b> using g = typename f<b>::e;
struct b;
template <typename b> struct f { using e = b; };
template <typename ai> struct m { typedef g<ai> aj; };
-template <typename b> class n { typedef typename m<b>::aj e; };
+template <typename b> struct n { typedef typename m<b>::aj e; };
template <typename b> using an = typename n<b>::e;
template <typename> constexpr bool ao = c<true>::d;
template <typename> constexpr bool i = c<1>::d;
@@ -38,7 +38,7 @@ template <typename da> concept de = dd<da>;
struct {
template <de da, typename b> void operator()(da, b);
} di;
-class p {
+struct p {
void begin();
};
template <typename> using df = p;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts.C b/gcc/testsuite/g++.dg/cpp2a/concepts.C
index 5839207177c..ebeeebf60bb 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Change in grammar for the expression trailing `requires`.
template<typename T>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts1.C b/gcc/testsuite/g++.dg/cpp2a/concepts1.C
index a99343fc04d..87adf8c7a69 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept Class = __is_class(T);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts2.C b/gcc/testsuite/g++.dg/cpp2a/concepts2.C
index d3b45f7ddaa..04e7ee6f892 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
concept True = true;
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts3.C b/gcc/testsuite/g++.dg/cpp2a/concepts3.C
index 34dacade330..4ccfd0805b7 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T, class U> concept same_as = __is_same_as(T,U);
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts4.C b/gcc/testsuite/g++.dg/cpp2a/concepts4.C
index 388fad7514b..5f08ae383ed 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts4.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T> struct A { static const int x = 42; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts5.C b/gcc/testsuite/g++.dg/cpp2a/concepts5.C
index 24ac2aa4095..ed8028f8540 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts5.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename T, typename U>
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts6.C b/gcc/testsuite/g++.dg/cpp2a/concepts6.C
index d69628b0318..0524bb90a80 100644
--- a/gcc/testsuite/g++.dg/cpp2a/concepts6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts6.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace a
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/cond-triv2.C b/gcc/testsuite/g++.dg/cpp2a/cond-triv2.C
index 554f8a3328a..531ec1c4c72 100644
--- a/gcc/testsuite/g++.dg/cpp2a/cond-triv2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/cond-triv2.C
@@ -1,5 +1,5 @@
// PR c++/67348
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <type_traits>
#include <vector>
diff --git a/gcc/testsuite/g++.dg/cpp2a/consteval-virtual1.C b/gcc/testsuite/g++.dg/cpp2a/consteval-virtual1.C
new file mode 100644
index 00000000000..5cdb75ab89a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/consteval-virtual1.C
@@ -0,0 +1,12 @@
+// { dg-do compile { target c++20 } }
+
+struct S {
+ virtual int foo () { return 42; } // { dg-message "overridden function is 'virtual int S::foo\\\(\\\)'" }
+ consteval virtual int bar () { return 43; } // { dg-message "overridden function is 'virtual consteval int S::bar\\\(\\\)'" }
+};
+struct T : public S {
+ int bar () { return 44; } // { dg-error "non-'consteval' function 'virtual int T::bar\\\(\\\)' overriding 'consteval' function" }
+};
+struct U : public S {
+ consteval virtual int foo () { return 45; } // { dg-error "'consteval' function 'virtual consteval int U::foo\\\(\\\)' overriding non-'consteval' function" }
+};
diff --git a/gcc/testsuite/g++.dg/cpp2a/consteval-virtual2.C b/gcc/testsuite/g++.dg/cpp2a/consteval-virtual2.C
new file mode 100644
index 00000000000..d5d8f798cab
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/consteval-virtual2.C
@@ -0,0 +1,22 @@
+// { dg-do compile { target c++20 } }
+
+struct A
+{
+ virtual consteval int f() const { return 1; };
+};
+
+struct B: A
+{
+ virtual consteval int f() const { return 2; };
+ virtual void g() { }
+};
+
+consteval int f()
+{
+ const A& ar = B();
+ return ar.f();
+}
+
+static_assert (f() == 2);
+
+B b;
diff --git a/gcc/testsuite/g++.dg/cpp2a/consteval-virtual3.C b/gcc/testsuite/g++.dg/cpp2a/consteval-virtual3.C
new file mode 100644
index 00000000000..376e3ba50d3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/consteval-virtual3.C
@@ -0,0 +1,53 @@
+// { dg-do compile { target c++20 } }
+
+struct S {
+ constexpr S () : s (0) {}
+ virtual int foo () const { return 42; }
+ consteval virtual int bar () const { return 43; }
+ consteval virtual int baz () const { return 44; }
+ consteval virtual int qux () const { return 47; }
+ int s;
+};
+struct T : public S {
+ constexpr T () : t (0) {}
+ consteval int bar () const { return 45; }
+ consteval virtual int baz () const { return 46; }
+ consteval virtual int grault () const { return 48; }
+ int t;
+};
+
+consteval int
+foo ()
+{
+ S s;
+ T t;
+ S *u = (S *) &t;
+ T *v = &t;
+ if (s.bar () != 43) throw 1;
+ if (s.baz () != 44) throw 2;
+ if (t.bar () != 45) throw 3;
+ if (t.baz () != 46) throw 4;
+ if (u->bar () != 45) throw 5;
+ if (u->baz () != 46) throw 6;
+ if (s.qux () != 47) throw 7;
+ if (t.qux () != 47) throw 8;
+ if (u->qux () != 47) throw 9;
+ if (v->qux () != 47) throw 10;
+ if (v->grault () != 48) throw 11;
+ return 0;
+}
+
+constexpr S s;
+constexpr T t;
+
+constexpr const S *
+bar (bool x)
+{
+ return x ? &s : (const S *) &t;
+}
+
+int a = foo ();
+int b = bar (false)->bar ();
+int c = bar (true)->baz ();
+static_assert (bar (false)->bar () == 45);
+static_assert (bar (true)->baz () == 44);
diff --git a/gcc/testsuite/g++.dg/cpp2a/consteval-virtual4.C b/gcc/testsuite/g++.dg/cpp2a/consteval-virtual4.C
new file mode 100644
index 00000000000..83405fe7aee
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/consteval-virtual4.C
@@ -0,0 +1,48 @@
+// { dg-do compile { target c++20 } }
+
+struct S {
+ constexpr S () : s (0) {}
+ virtual int foo () const { return 42; }
+ consteval virtual int bar () const { return 43; }
+ consteval virtual int baz () const { return 44; }
+ int s;
+};
+struct T : public S {
+ constexpr T () : t (0) {}
+ consteval int bar () const { return 45; }
+ consteval virtual int baz () const { return 46; }
+ int t;
+};
+
+consteval int
+foo ()
+{
+ S s;
+ T t;
+ S *u = (S *) &t;
+ T *v = &t;
+ auto pmf1 = &S::bar;
+ auto pmf2 = &S::baz;
+ if ((s.*pmf1) () != 43) throw 1;
+ if ((s.*pmf2) () != 44) throw 2;
+ if ((t.*pmf1) () != 45) throw 3;
+ if ((t.*pmf2) () != 46) throw 4;
+ if ((u->*pmf1) () != 45) throw 5;
+ if ((u->*pmf2) () != 46) throw 6;
+ return 0;
+}
+
+constexpr S s;
+constexpr T t;
+
+constexpr const S *
+bar (bool x)
+{
+ return x ? &s : (const S *) &t;
+}
+
+int a = foo ();
+int b = bar (false)->bar ();
+int c = bar (true)->baz ();
+static_assert (bar (false)->bar () == 45);
+static_assert (bar (true)->baz () == 44);
diff --git a/gcc/testsuite/g++.dg/cpp2a/consteval-virtual5.C b/gcc/testsuite/g++.dg/cpp2a/consteval-virtual5.C
new file mode 100644
index 00000000000..85ad1182fb0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/consteval-virtual5.C
@@ -0,0 +1,61 @@
+// { dg-do compile { target c++20 } }
+
+struct B1;
+struct B2;
+struct D;
+
+struct B1
+{
+ virtual consteval const B1 *foo1 () const {return this;}
+ virtual consteval const B2 *foo2 (const D *) const;
+};
+struct B2
+{
+ virtual consteval const B2 *baz1 () const {return this;}
+ virtual consteval const B1 *baz2 (const D *) const;
+};
+
+struct D : public B1, B2
+{
+ virtual consteval const D *foo1 () const {return this;}
+ virtual consteval const D *foo2 (const D *d) const {return d;}
+ virtual consteval const D *baz1 () const {return this;}
+ virtual consteval const D *baz2 (const D *d) const {return d;}
+};
+
+consteval const B2 *B1::foo2 (const D *d) const {return d;}
+consteval const B1 *B2::baz2 (const D *d) const {return d;}
+
+consteval int
+test (const B1 *b1, const B2 *b2, const D *d)
+{
+ if (b1->foo1 () != b1)
+ return 1;
+ if (b2->baz1 () != b2)
+ return 2;
+ if (b1->foo2 (d) != b2)
+ return 3;
+ if (b2->baz2 (d) != b1)
+ return 4;
+ return 0;
+}
+
+consteval int
+test (const D *d)
+{
+ if (d->foo2 (d) != d)
+ return 11;
+ if (d->baz2 (d) != d)
+ return 12;
+ if (d->foo1 () != d)
+ return 13;
+ if (d->baz1 () != d)
+ return 14;
+ return 0;
+}
+
+constexpr D d;
+constexpr auto e = test (&d, &d, &d);
+constexpr auto f = test (&d);
+static_assert (e == 0);
+static_assert (f == 0);
diff --git a/gcc/testsuite/g++.dg/cpp2a/consteval-void1.C b/gcc/testsuite/g++.dg/cpp2a/consteval-void1.C
index 783cf4c7ef7..b572650626a 100644
--- a/gcc/testsuite/g++.dg/cpp2a/consteval-void1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/consteval-void1.C
@@ -1,5 +1,5 @@
// PR c++/93257
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <bool, typename>
consteval void test() {}
diff --git a/gcc/testsuite/g++.dg/cpp2a/consteval17.C b/gcc/testsuite/g++.dg/cpp2a/consteval17.C
new file mode 100644
index 00000000000..6af39aad8da
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/consteval17.C
@@ -0,0 +1,11 @@
+// { dg-do compile { target c++20 } }
+
+struct A
+{
+ consteval int operator+() { return 42; }
+};
+
+int main()
+{
+ +A();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor2.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor2.C
index 397cfb0f1a1..7b3903c24eb 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor2.C
@@ -1,5 +1,5 @@
// P0784R7
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor3.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor3.C
index d9461836970..193ae93933d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor3.C
@@ -1,5 +1,5 @@
// P0784R7
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor4.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor4.C
index 68ad69c186d..ad03987f890 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor4.C
@@ -1,5 +1,5 @@
// PR c++/92414
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A { virtual void foo (); };
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic1.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic1.C
index e8ba63d9609..c37753b05c5 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic1.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Downcast.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic10.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic10.C
index c226292a07d..f9f82236d15 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic10.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic10.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Virtual base.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic11.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic11.C
index 8dfa03a9cd5..9ee93c334e9 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic11.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic11.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
// dynamic_cast in a constructor.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic12.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic12.C
index 0ce9beb8d72..4aedf9893ad 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic12.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic12.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// dynamic_cast in a destructor.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic13.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic13.C
index 203067a2581..1df0772b499 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic13.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic13.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Adopted from g++.old-deja/g++.other/dyncast1.C.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic14.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic14.C
index f739c6df94b..cc1cadae3bc 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic14.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic14.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Adopted from g++.old-deja/g++.other/dyncast1.C.
// But use reference dynamic_cast.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic15.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic15.C
index fcf507289c4..aed95c29585 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic15.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic15.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Test HINT = -3 (SRC is a multiple public non-virtual base of DST).
struct A { virtual void a() {} };
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic16.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic16.C
index f0394d130a3..1d2b8cbebbf 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic16.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic16.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Here the hint turns out to be wrong: A is a public base of B2, but the
// dynamic_cast operand is not that subobject, but rather a sibling base of
// B2.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic17.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic17.C
index c574e755103..a26678e6ed7 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic17.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic17.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
// dynamic_cast in a constructor.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic18.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic18.C
index 346f9f56470..25d98c2b661 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic18.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic18.C
@@ -1,5 +1,5 @@
// PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Here 'b' doesn't point/refer to a public base of Derived.
struct Base {
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic2.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic2.C
index aae03f691ca..2e5ea0e7eb4 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic2.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Downcast, with hint > 0.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic3.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic3.C
index c3e09808e32..9caeb241df6 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic3.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Sidecast.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic4.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic4.C
index 6f42d20ec41..da647bfca5e 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic4.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
// From clang's constant-expression-cxx2a.cpp.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic5.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic5.C
index 743b3018d2f..77c7043a6fd 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic5.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Multiple levels.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic6.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic6.C
index 23434734e26..d67c3072b54 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic6.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Private base.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic7.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic7.C
index d71497aae6d..bc3efd05bcc 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic7.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic7.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Protected base.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic8.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic8.C
index 8056f30bb99..1958cae441d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic8.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic8.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Unrelated type.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic9.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic9.C
index d8cbb2f2f0d..7d42ffa5a78 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic9.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic9.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Ambiguous base.
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init1.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init1.C
index ab7b89da9e8..75984a2fdcb 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init1.C
@@ -1,5 +1,5 @@
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Test basic use.
struct S {
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init10.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init10.C
index 74bf8e6677b..3834457a276 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init10.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init10.C
@@ -1,5 +1,5 @@
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// In c++2a we don't emit a call to _ZN3FooI3ArgEC1Ev.
struct Arg;
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init11.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init11.C
index 1c7836a674a..79ad61895b0 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init11.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init11.C
@@ -1,5 +1,5 @@
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S {
int i;
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init12.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init12.C
index 7d3d3729b31..4eb8753906a 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init12.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init12.C
@@ -1,5 +1,5 @@
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S {
int uninit;
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init13.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init13.C
index 3d4460a0eb8..96140e6c212 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init13.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init13.C
@@ -1,5 +1,5 @@
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct E { };
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init14.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init14.C
index 6ab6abf1505..1335e51c853 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init14.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init14.C
@@ -1,5 +1,5 @@
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct E {
constexpr E() = default;
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init15.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init15.C
index f80d3f2c27c..3cfc23a210e 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init15.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init15.C
@@ -1,5 +1,5 @@
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct E {
constexpr E() = default;
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init16.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init16.C
index 16db2974f2a..87de38a678d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init16.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init16.C
@@ -1,5 +1,5 @@
// PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct empty { };
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init17.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init17.C
index 34d9fe58ecb..ec362ad9160 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init17.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init17.C
@@ -1,5 +1,5 @@
// PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct empty { };
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init18.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init18.C
new file mode 100644
index 00000000000..47ad11f2290
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init18.C
@@ -0,0 +1,16 @@
+// PR c++/96282
+// { dg-do compile { target c++20 } }
+
+struct e { bool v = true; bool w; };
+
+template<int N>
+struct b { e m[N][N]; };
+
+template<int N>
+struct t : b<N> { constexpr t() : b<N>() {} };
+
+constexpr t<1> h1;
+static_assert(h1.m[0][0].w == false);
+
+constexpr t<42> h2;
+static_assert(h2.m[17][17].w == false);
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init2.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init2.C
index 541da1c023f..d0d0411f99d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init2.C
@@ -1,5 +1,5 @@
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init3.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init3.C
index dd2735289cb..1c0c0183cd0 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init3.C
@@ -1,5 +1,5 @@
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init4.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init4.C
index dd614ede2c6..78f3ebd74f6 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init4.C
@@ -1,5 +1,5 @@
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// This bullet in [dcl.constexpr] is now gone:
// - every non-static data member and base class sub-object shall be initialized
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init5.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init5.C
index 0d21f26da0e..a9e717d91f9 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init5.C
@@ -1,5 +1,5 @@
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S { int i; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init6.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init6.C
index a2994f5272c..a1634aab031 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init6.C
@@ -1,5 +1,5 @@
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
/* We used to get the "constexpr constructor for union S::<unnamed union>
must initialize exactly one non-static data member" error, but not anymore
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init7.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init7.C
index dd2741efa8c..2e62b5377b1 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init7.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init7.C
@@ -1,5 +1,5 @@
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S {
int a = 1;
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init8.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init8.C
index 0d5a4a79c90..8bb9a9c8dbc 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init8.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init8.C
@@ -1,5 +1,5 @@
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S {
constexpr S(int) {}
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init9.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init9.C
index b44098cc89b..1ac14c22319 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init9.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init9.C
@@ -1,5 +1,5 @@
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S {
constexpr S(int) {}
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new1.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new1.C
index 5d1b7ef1019..a936c1e1294 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new1.C
@@ -1,5 +1,5 @@
// P0784R7
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
struct S { constexpr S () : s (5) {} constexpr S (int x) : s (x) {} int s; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new10.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new10.C
index bc5e6e5c78a..6f6b11c2481 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new10.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new10.C
@@ -1,5 +1,5 @@
// PR c++/91369
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
struct S {
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new11.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new11.C
index 2bf359a350f..5adf13e6a04 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new11.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new11.C
@@ -1,5 +1,5 @@
// PR c++/93633
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
struct A {
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new12.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new12.C
index 04f75975c97..5a3d06a5fab 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new12.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new12.C
@@ -1,5 +1,5 @@
// PR c++/93633
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
struct A {
@@ -24,4 +24,4 @@ foo ()
return r;
}
-constexpr auto a = foo (); // { dg-error "is not a constant expression" }
+constexpr auto a = foo (); // { dg-error "constant expression" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new13.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new13.C
index 21219039152..6762c24a342 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new13.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new13.C
@@ -1,5 +1,5 @@
// PR c++/93633
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
constexpr A () : a (0) {}
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new2.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new2.C
index d3733e831b6..0c513bd9f12 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new2.C
@@ -1,5 +1,5 @@
// P0784R7
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
template <int N>
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C
index 6e7880adcb2..70b841208f8 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C
@@ -1,5 +1,5 @@
// P0784R7
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
constexpr int *
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new4.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new4.C
index b9bd5ea19c1..4be1bf041fa 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new4.C
@@ -1,5 +1,5 @@
// P0784R7
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
struct S
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new5.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new5.C
index b2b65f2ba82..2bb407a4b51 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new5.C
@@ -1,5 +1,5 @@
// P0784R7
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new6.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new6.C
index 5c0c2b6f967..d51bdbb8269 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new6.C
@@ -1,5 +1,5 @@
// P0784R7
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new7.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new7.C
index 5fc130e4432..bb60a8ee91b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new7.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new7.C
@@ -1,5 +1,5 @@
// P0784R7
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new8.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new8.C
index f13da104439..e61323adaed 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new8.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new8.C
@@ -1,5 +1,5 @@
// PR c++/91369
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
struct A {
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new9.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new9.C
index f99f0808f7c..db45cdf72dc 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new9.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new9.C
@@ -1,5 +1,5 @@
// PR c++/91369
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
struct S {
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid1.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid1.C
index a81f649b44b..32f63a51e42 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid1.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Test non-polymorphic type.
#include <typeinfo>
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid2.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid2.C
index 51c8fb451b8..495914f1cca 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid2.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Test polymorphic type.
#include <typeinfo>
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid3.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid3.C
index 38b9e609a9f..e58026ac620 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid3.C
@@ -1,5 +1,5 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Test typeid in a template.
#include <typeinfo>
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-union1.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-union1.C
index c38167ad798..ac8aa5f669c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-union1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-union1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
union U
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual14.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual14.C
index b29d3f6aefb..db00a3f6f28 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual14.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual14.C
@@ -1,5 +1,5 @@
// PR c++/92695
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
virtual int get () = 0;
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual15.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual15.C
index cb55aa3bb56..88229cfd848 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual15.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual15.C
@@ -1,5 +1,5 @@
// PR c++/92695
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A { virtual int get() = 0; };
struct B : A { constexpr int get() override { return 10; } };
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual16.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual16.C
new file mode 100644
index 00000000000..8cca8a61723
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual16.C
@@ -0,0 +1,22 @@
+// Test constexpr virtual in non-primary vtable.
+// { dg-do compile { target c++20 } }
+
+struct A
+{
+ virtual constexpr int f() const { return 1; };
+};
+
+struct B
+{
+ virtual constexpr int g() const { return 2; };
+};
+
+struct C: A, B
+{
+};
+
+constexpr C c;
+
+constexpr int g(const B& b) { return b.g(); }
+static_assert (g(c) == 2);
+
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual17.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual17.C
new file mode 100644
index 00000000000..a8a89952626
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual17.C
@@ -0,0 +1,28 @@
+// PR c++/93310
+// { dg-do compile { target c++20 } }
+
+struct A
+{
+ virtual constexpr char f () const
+ { return 'A'; }
+};
+
+struct B : A
+{
+ char x;
+
+ constexpr B () : x (0)
+ { x = ((A *)this)->f(); }
+
+ virtual constexpr char f () const
+ { return 'B'; }
+};
+
+struct C : B
+{
+ virtual constexpr char f () const
+ { return 'C'; }
+};
+
+constexpr C c;
+static_assert (c.x == 'B');
diff --git a/gcc/testsuite/g++.dg/cpp2a/constinit1.C b/gcc/testsuite/g++.dg/cpp2a/constinit1.C
index 9d1c0289a62..1dc00eaff6f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constinit1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constinit1.C
@@ -1,5 +1,5 @@
// PR c++/91360 - Implement C++20 P1143R2: constinit
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Test basic usage of 'constinit'.
const char *g() { return "dynamic init"; }
diff --git a/gcc/testsuite/g++.dg/cpp2a/constinit10.C b/gcc/testsuite/g++.dg/cpp2a/constinit10.C
index a50f285ecb1..b678788541e 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constinit10.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constinit10.C
@@ -1,5 +1,5 @@
// PR c++/91360 - Implement C++20 P1143R2: constinit
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// From PR83428.
struct S1
diff --git a/gcc/testsuite/g++.dg/cpp2a/constinit11.C b/gcc/testsuite/g++.dg/cpp2a/constinit11.C
index ab3715b2064..e8b3bcb570b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constinit11.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constinit11.C
@@ -1,5 +1,5 @@
// PR c++/91360 - Implement C++20 P1143R2: constinit
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
int foo ();
constexpr int constfoo () { return 42; }
diff --git a/gcc/testsuite/g++.dg/cpp2a/constinit12.C b/gcc/testsuite/g++.dg/cpp2a/constinit12.C
index b5b736f87c2..cc6569b2277 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constinit12.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constinit12.C
@@ -1,5 +1,5 @@
// PR c++/91360 - Implement C++20 P1143R2: constinit
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S {
S(int) { }
diff --git a/gcc/testsuite/g++.dg/cpp2a/constinit14.C b/gcc/testsuite/g++.dg/cpp2a/constinit14.C
index 72bfab667b8..86a058b632c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constinit14.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constinit14.C
@@ -1,5 +1,5 @@
// PR c++/92134 - constinit malfunction in static data member.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct Value {
Value() : v{new int{42}} {}
diff --git a/gcc/testsuite/g++.dg/cpp2a/constinit15.C b/gcc/testsuite/g++.dg/cpp2a/constinit15.C
index 32594334330..29e8b51326d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constinit15.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constinit15.C
@@ -1,5 +1,5 @@
// PR c++/92058 - constinit malfunction in static data member.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct B {
B() {}
diff --git a/gcc/testsuite/g++.dg/cpp2a/constinit3.C b/gcc/testsuite/g++.dg/cpp2a/constinit3.C
index 1db16feafcb..a29c594657a 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constinit3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constinit3.C
@@ -1,5 +1,5 @@
// PR c++/91360 - Implement C++20 P1143R2: constinit
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
constinit constinit int v1; // { dg-error "duplicate .constinit." }
constexpr constinit int v2 = 1; // { dg-error "can use at most one of the .constinit. and .constexpr. specifiers" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/constinit4.C b/gcc/testsuite/g++.dg/cpp2a/constinit4.C
index 748a7ffa3a9..0630e18ee0c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constinit4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constinit4.C
@@ -1,5 +1,5 @@
// PR c++/91360 - Implement C++20 P1143R2: constinit
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S { };
constinit extern S s;
diff --git a/gcc/testsuite/g++.dg/cpp2a/constinit5.C b/gcc/testsuite/g++.dg/cpp2a/constinit5.C
index 3d21f48dbee..951c6fe1852 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constinit5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constinit5.C
@@ -1,5 +1,5 @@
// PR c++/91360 - Implement C++20 P1143R2: constinit
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Check that we preserve DECL_DECLARED_CONSTINIT_P in duplicate_decls.
int gl = 42;
diff --git a/gcc/testsuite/g++.dg/cpp2a/constinit8.C b/gcc/testsuite/g++.dg/cpp2a/constinit8.C
index c6b2975350c..50bc13f2ce9 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constinit8.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constinit8.C
@@ -1,5 +1,5 @@
// PR c++/91360 - Implement C++20 P1143R2: constinit
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Variable templates.
int nonconst;
diff --git a/gcc/testsuite/g++.dg/cpp2a/constinit9.C b/gcc/testsuite/g++.dg/cpp2a/constinit9.C
index 4c7f8925169..9c5c848f7fc 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constinit9.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constinit9.C
@@ -1,5 +1,5 @@
// PR c++/91360 - Implement C++20 P1143R2: constinit
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
// A run-time test.
constexpr int foo (int x) { return x; }
diff --git a/gcc/testsuite/g++.dg/cpp2a/desig11.C b/gcc/testsuite/g++.dg/cpp2a/desig11.C
index d6895a7be56..a189fff2059 100644
--- a/gcc/testsuite/g++.dg/cpp2a/desig11.C
+++ b/gcc/testsuite/g++.dg/cpp2a/desig11.C
@@ -11,4 +11,4 @@ int bar (_Complex int); // { dg-message "initializing argument 1 of" }
int y = bar ({.real = 0, .imag = 1}); // { dg-error "cannot convert" }
int baz (std::initializer_list<int>);
-int z = baz ({.one = 1, .two = 2, .three = 3}); // { dg-error "could not convert" }
+int z = baz ({.one = 1, .two = 2, .three = 3}); // { dg-error "designated initializers" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/desig13.C b/gcc/testsuite/g++.dg/cpp2a/desig13.C
index 442e8b74aa4..a931e348604 100644
--- a/gcc/testsuite/g++.dg/cpp2a/desig13.C
+++ b/gcc/testsuite/g++.dg/cpp2a/desig13.C
@@ -11,6 +11,6 @@ void
baz ()
{
foo ({.d = 5, 6, .b = 2, 3}); // { dg-error "designator order for field 'S::b' does not match declaration order in 'S'" }
- // { dg-error "either all initializer clauses should be designated or none of them should be" "" { target c++2a } .-1 }
+ // { dg-error "either all initializer clauses should be designated or none of them should be" "" { target c++20 } .-1 }
bar ({.b = 1, .a = 2}); // { dg-error "designator order for field 'T::a' does not match declaration order in 'T'" }
}
diff --git a/gcc/testsuite/g++.dg/cpp2a/desig16.C b/gcc/testsuite/g++.dg/cpp2a/desig16.C
new file mode 100644
index 00000000000..3edb68d24a4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/desig16.C
@@ -0,0 +1,28 @@
+// PR c++/95369
+// { dg-do compile { target c++20 } }
+
+struct S {
+ unsigned a;
+ unsigned b;
+ constexpr S(unsigned _a, unsigned _b) noexcept: a{_a}, b{_b} { }
+};
+
+template<S s> struct X { };
+void g(S);
+
+struct Z {
+ S s;
+ Z() : s{.a = 1, .b = 2} { } // { dg-error "designated initializers|no matching function" }
+};
+
+S
+f()
+{
+ X<{.a = 1, .b = 2}> x; // { dg-error "designated initializers" }
+ S s{ .a = 1, .b = 2 }; // { dg-error "designated initializers|no matching function" }
+ S s2 = { .a = 1, .b = 2 }; // { dg-error "designated initializers" }
+ S s3 = S{ .a = 1, .b = 2 }; // { dg-error "designated initializers|no matching function" }
+ g({.a = 1, .b = 2}); // { dg-error "designated initializers" }
+ g(S{.a = 1, .b = 2}); // { dg-error "designated initializers|no matching function" }
+ return {.a = 1, .b = 2}; // { dg-error "designated initializers" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/desig2.C b/gcc/testsuite/g++.dg/cpp2a/desig2.C
index 7a036182062..c993134fea0 100644
--- a/gcc/testsuite/g++.dg/cpp2a/desig2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/desig2.C
@@ -5,8 +5,8 @@ struct S { int a, b, c; };
S a = { 1, 2, 3 };
S b = { .a = 1, .b = 2, .c = 3 };
-S c = { 1, .b = 2, .c = 3 }; // { dg-error "either all initializer clauses should be designated or none of them should be" "" { target c++2a } }
-S d = { .a = 1, 2, 3 }; // { dg-error "either all initializer clauses should be designated or none of them should be" "" { target c++2a } }
+S c = { 1, .b = 2, .c = 3 }; // { dg-error "either all initializer clauses should be designated or none of them should be" "" { target c++20 } }
+S d = { .a = 1, 2, 3 }; // { dg-error "either all initializer clauses should be designated or none of them should be" "" { target c++20 } }
S e = { .b = 1, .b = 2 }; // { dg-error "designator used multiple times in the same initializer list" }
#if __cplusplus > 201103L
@@ -14,6 +14,6 @@ template <int... N>
void
foo ()
{
- S f = { .a = N... }; // { dg-error "'...' not allowed in designated initializer list" "" { target c++2a } }
+ S f = { .a = N... }; // { dg-error "'...' not allowed in designated initializer list" "" { target c++20 } }
}
#endif
diff --git a/gcc/testsuite/g++.dg/cpp2a/destroying-delete1.C b/gcc/testsuite/g++.dg/cpp2a/destroying-delete1.C
index 329588be7ab..210a5a54c34 100644
--- a/gcc/testsuite/g++.dg/cpp2a/destroying-delete1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/destroying-delete1.C
@@ -1,4 +1,4 @@
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
#include <new>
diff --git a/gcc/testsuite/g++.dg/cpp2a/destroying-delete2.C b/gcc/testsuite/g++.dg/cpp2a/destroying-delete2.C
index 2592c0757a3..10cb80acfd1 100644
--- a/gcc/testsuite/g++.dg/cpp2a/destroying-delete2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/destroying-delete2.C
@@ -1,5 +1,5 @@
// PR c++/88969
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <new>
diff --git a/gcc/testsuite/g++.dg/cpp2a/destroying-delete3.C b/gcc/testsuite/g++.dg/cpp2a/destroying-delete3.C
index 112fb0ad67e..9cc495e6d72 100644
--- a/gcc/testsuite/g++.dg/cpp2a/destroying-delete3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/destroying-delete3.C
@@ -1,5 +1,5 @@
// PR c++/88969
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <new>
diff --git a/gcc/testsuite/g++.dg/cpp2a/destroying-delete4.C b/gcc/testsuite/g++.dg/cpp2a/destroying-delete4.C
index c122cee4942..2bf0c09cefc 100644
--- a/gcc/testsuite/g++.dg/cpp2a/destroying-delete4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/destroying-delete4.C
@@ -1,5 +1,5 @@
// PR c++/90171
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <new>
diff --git a/gcc/testsuite/g++.dg/cpp2a/explicit14.C b/gcc/testsuite/g++.dg/cpp2a/explicit14.C
index 9c3acc32ac4..3e510feee23 100644
--- a/gcc/testsuite/g++.dg/cpp2a/explicit14.C
+++ b/gcc/testsuite/g++.dg/cpp2a/explicit14.C
@@ -1,5 +1,5 @@
// PR c++/89420
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename>
struct S {
diff --git a/gcc/testsuite/g++.dg/cpp2a/explicit15.C b/gcc/testsuite/g++.dg/cpp2a/explicit15.C
index e0058f6dc87..939456c93f0 100644
--- a/gcc/testsuite/g++.dg/cpp2a/explicit15.C
+++ b/gcc/testsuite/g++.dg/cpp2a/explicit15.C
@@ -1,5 +1,5 @@
// PR c++/89836
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct W {
constexpr explicit operator bool() { return true; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/explicit16.C b/gcc/testsuite/g++.dg/cpp2a/explicit16.C
new file mode 100644
index 00000000000..9d95b0d669e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/explicit16.C
@@ -0,0 +1,21 @@
+// PR c++/95066 - explicit malfunction with dependent expression.
+// { dg-do compile { target c++2a } }
+
+template <typename T>
+struct Foo {
+ template <typename U>
+ explicit(static_cast<U>(true)) operator Foo<U>();
+};
+
+template <typename T>
+template <typename U>
+Foo<T>::operator Foo<U>() {
+ return {};
+}
+
+int
+main ()
+{
+ Foo<float> a;
+ Foo<int> b = a; // { dg-error "conversion" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C b/gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C
index 82fd602f9f1..7f1fe34ad7f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C
+++ b/gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C
@@ -334,8 +334,8 @@
#ifndef __cpp_nontype_template_args
# error "__cpp_nontype_template_args"
-#elif __cpp_nontype_template_args != 201411
-# error "__cpp_nontype_template_args != 201411"
+#elif __cpp_nontype_template_args != 201911
+# error "__cpp_nontype_template_args != 201911"
#endif
#ifndef __cpp_hex_float
diff --git a/gcc/testsuite/g++.dg/cpp2a/implicit-move1.C b/gcc/testsuite/g++.dg/cpp2a/implicit-move1.C
new file mode 100644
index 00000000000..4c284a13cae
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/implicit-move1.C
@@ -0,0 +1,17 @@
+// testcase from P1825R0
+// { dg-do compile { target c++20 } }
+
+struct base {
+ base();
+ base(base const &);
+private:
+ base(base &&);
+};
+
+struct derived : base {};
+
+base f(base b) {
+ throw b; // { dg-error "" } base(base &&) is private
+ derived d;
+ return d; // { dg-error "" } base(base &&) is private
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/implicit-move2.C b/gcc/testsuite/g++.dg/cpp2a/implicit-move2.C
new file mode 100644
index 00000000000..cb1379648c9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/implicit-move2.C
@@ -0,0 +1,49 @@
+// Testcase from P1825R0
+// { dg-do compile { target c++17 } }
+
+extern "C" void abort();
+
+int m;
+
+struct T
+{
+ int i;
+ T(): i (42) { }
+ T(const T& t) = delete;
+ T(T&& t): i(t.i) { t.i = 0; ++m; }
+};
+
+struct U
+{
+ int i;
+ U(): i (42) { }
+ U(const U& t): i(t.i) { }
+ U(U&& t) = delete;
+};
+
+template <class V> void g(const V&);
+void h();
+
+bool b;
+
+void f()
+{
+ U x;
+ try {
+ T y;
+ try { h(); }
+ catch(...) {
+ if (b)
+ throw x; // does not move
+ throw y; // moves
+ }
+ g(y);
+ } catch(...) {
+ g(x);
+ }
+}
+
+int main()
+{
+ f();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/implicit-move3.C b/gcc/testsuite/g++.dg/cpp2a/implicit-move3.C
new file mode 100644
index 00000000000..a1f0b3d0740
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/implicit-move3.C
@@ -0,0 +1,49 @@
+// Testcase from P1825R0, modified for rvalue refs.
+// { dg-do compile { target c++20 } }
+
+extern "C" void abort();
+
+int m;
+
+struct T
+{
+ int i;
+ T(): i (42) { }
+ T(const T& t) = delete;
+ T(T&& t): i(t.i) { t.i = 0; ++m; }
+};
+
+struct U
+{
+ int i;
+ U(): i (42) { }
+ U(const U& t): i(t.i) { }
+ U(U&& t) = delete;
+};
+
+template <class V> void g(const V&);
+void h();
+
+bool b;
+
+void f()
+{
+ U&& x = U();
+ try {
+ T&& y = T();
+ try { h(); }
+ catch(...) {
+ if (b)
+ throw x; // does not move
+ throw y; // moves
+ }
+ g(y);
+ } catch(...) {
+ g(x);
+ }
+}
+
+int main()
+{
+ f();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/inline-asm2.C b/gcc/testsuite/g++.dg/cpp2a/inline-asm2.C
index 6038c111eb0..874e4cd3e29 100644
--- a/gcc/testsuite/g++.dg/cpp2a/inline-asm2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/inline-asm2.C
@@ -1,6 +1,6 @@
// P1668R1: Permit unevaluated inline asm in constexpr functions
// PR c++/91346
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
constexpr int
foo (bool b)
diff --git a/gcc/testsuite/g++.dg/cpp2a/inline-asm3.C b/gcc/testsuite/g++.dg/cpp2a/inline-asm3.C
index b636e3b2d87..a7476b1d9d1 100644
--- a/gcc/testsuite/g++.dg/cpp2a/inline-asm3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/inline-asm3.C
@@ -1,5 +1,5 @@
// P1668R1: Permit unevaluated inline asm in constexpr functions
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-Wno-pedantic" }
constexpr int
diff --git a/gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated10.C b/gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated10.C
new file mode 100644
index 00000000000..7b2e345f448
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated10.C
@@ -0,0 +1,30 @@
+// { dg-do compile { target c++2a } }
+// { dg-options "-Wtautological-compare" }
+
+namespace std {
+ constexpr inline bool
+ is_constant_evaluated () noexcept
+ {
+ return __builtin_is_constant_evaluated ();
+ }
+}
+
+template<typename>
+constexpr int
+foo(int i)
+{
+ if constexpr (std::is_constant_evaluated ()) // { dg-warning ".std::is_constant_evaluated. always evaluates to true in .if constexpr." }
+ return 42;
+ else
+ return i;
+}
+
+template<typename>
+constexpr int
+foo2(int i)
+{
+ if constexpr (__builtin_is_constant_evaluated ()) // { dg-warning ".std::is_constant_evaluated. always evaluates to true in .if constexpr." }
+ return 42;
+ else
+ return i;
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated9.C b/gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated9.C
index 37833698992..0e96a1a3729 100644
--- a/gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated9.C
+++ b/gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated9.C
@@ -1,5 +1,5 @@
// PR c++/91428 - warn about std::is_constant_evaluated in if constexpr.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-options "-Wtautological-compare" }
namespace std {
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-generic-variadic20.C b/gcc/testsuite/g++.dg/cpp2a/lambda-generic-variadic20.C
index 3d69dbb8e98..ab1a4e42bd9 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-generic-variadic20.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-generic-variadic20.C
@@ -1,5 +1,5 @@
// PR c++/94546
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T> T&& forward(T&& t) { return static_cast<T&&>(t); }
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-generic5.C b/gcc/testsuite/g++.dg/cpp2a/lambda-generic5.C
index e608e9520bf..44306113760 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-generic5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-generic5.C
@@ -3,4 +3,4 @@
// { dg-options "-std=c++2a" }
int j = []<class T>(T t, int i) { return i; }(3, 4);
-// { dg-bogus "lambda templates are only available with" "" { target c++2a } .-1 }
+// { dg-bogus "lambda templates are only available with" "" { target c++20 } .-1 }
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-generic7.C b/gcc/testsuite/g++.dg/cpp2a/lambda-generic7.C
index bedba683671..de457420530 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-generic7.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-generic7.C
@@ -1,5 +1,5 @@
// PR c++/94507 - ICE-on-invalid with lambda template.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S { };
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-mangle.C b/gcc/testsuite/g++.dg/cpp2a/lambda-mangle.C
index 8ee9b0327a5..35abc9179e7 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-mangle.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-mangle.C
@@ -1,5 +1,5 @@
// Test lambda mangling
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-require-weak "" }
// { dg-options "-fno-inline" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init1.C b/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init1.C
index 89c63532831..e5942ac0550 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
void bar();
void bar(int);
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init2.C b/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init2.C
index 55d689dbc67..e950d657574 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init2.C
@@ -1,5 +1,5 @@
// PR c++/89686
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename... Ts>
void foo(Ts... xs)
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init4.C b/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init4.C
index e7c815b92d4..b49e26dc7a3 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init4.C
@@ -1,5 +1,5 @@
// P2095R0
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-options "" }
template <class... T>
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init5.C b/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init5.C
index 492fc479e94..5fcf41b1a1f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init5.C
@@ -1,5 +1,5 @@
// PR c++/94483
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<int... a> constexpr auto x1
= [...z = -a] (auto F) { return F(z...); };
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C b/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C
index b2d30d64e5a..3e00e68e906 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C
@@ -6,8 +6,8 @@ struct X {
int x;
void foo (int n) {
auto a1 = [=] { x = n; }; // { dg-bogus "implicit capture" "" { target c++17_down } }
- // { dg-warning "implicit capture of 'this' via '\\\[=\\\]' is deprecated" "" { target c++2a } .-1 }
- // { dg-message "add explicit 'this' or '\\\*this' capture" "" { target c++2a } .-2 }
+ // { dg-warning "implicit capture of 'this' via '\\\[=\\\]' is deprecated" "" { target c++20 } .-1 }
+ // { dg-message "add explicit 'this' or '\\\*this' capture" "" { target c++20 } .-2 }
auto a2 = [=, this] { x = n; };
// { dg-warning "explicit by-copy capture" "" { target c++17_down } .-1 }
auto a3 = [=, *this]() mutable { x = n; };
@@ -16,14 +16,14 @@ struct X {
auto a6 = [&, *this]() mutable { x = n; };
auto a7 = [=] { // { dg-bogus "implicit capture" "" { target c++17_down } }
- // { dg-warning "implicit capture of 'this' via '\\\[=\\\]' is deprecated" "" { target c++2a } .-1 }
- // { dg-message "add explicit 'this' or '\\\*this' capture" "" { target c++2a } .-2 }
+ // { dg-warning "implicit capture of 'this' via '\\\[=\\\]' is deprecated" "" { target c++20 } .-1 }
+ // { dg-message "add explicit 'this' or '\\\*this' capture" "" { target c++20 } .-2 }
auto a = [=] { // { dg-bogus "implicit capture" "" { target c++17_down } }
- // { dg-warning "implicit capture of 'this' via '\\\[=\\\]' is deprecated" "" { target c++2a } .-1 }
- // { dg-message "add explicit 'this' or '\\\*this' capture" "" { target c++2a } .-2 }
+ // { dg-warning "implicit capture of 'this' via '\\\[=\\\]' is deprecated" "" { target c++20 } .-1 }
+ // { dg-message "add explicit 'this' or '\\\*this' capture" "" { target c++20 } .-2 }
auto a2 = [=] { x = n; }; // { dg-bogus "implicit capture" "" { target c++17_down } }
- // { dg-warning "implicit capture of 'this' via '\\\[=\\\]' is deprecated" "" { target c++2a } .-1 }
- // { dg-message "add explicit 'this' or '\\\*this' capture" "" { target c++2a } .-2 }
+ // { dg-warning "implicit capture of 'this' via '\\\[=\\\]' is deprecated" "" { target c++20 } .-1 }
+ // { dg-message "add explicit 'this' or '\\\*this' capture" "" { target c++20 } .-2 }
};
};
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval1.C b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval1.C
index 8a1703304ab..816b6e994de 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
typedef decltype([]{}) C; // the closure type has no name for linkage purposes
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval11.C b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval11.C
index a04262494c7..01ad27f1151 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval11.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval11.C
@@ -1,5 +1,5 @@
// PR c++/92010
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T> void spam(decltype([]{}) (*s)[sizeof(T)] = nullptr)
{ }
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval12.C b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval12.C
index 24d2e701e44..c66c6f8353f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval12.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval12.C
@@ -1,5 +1,5 @@
// PR c++/94521
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename T>
void spam(decltype([]{}) *s)
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval2.C b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval2.C
index f29a59e26fd..d8b20bdc2a4 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// ill-formed, no diagnostic required: the two expressions are
// functionally equivalent but not equivalent
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval3.C b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval3.C
index 3c9b1e1cd45..994d184b643 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <int N> void foo(const char (*s)[([]{}, N)]) {}
template <class T> void spam(decltype([]{}) (*s)[sizeof(T)]) {}
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval4.C b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval4.C
index e75a1270c72..f12273910d3 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval4.C
@@ -1,4 +1,4 @@
-// { dg-do link { target c++2a } }
+// { dg-do link { target c++20 } }
template <class T> T f(T t) { return t; }
using L = decltype([]{ return f(42); });
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval5.C b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval5.C
index 7fb05c3ce9c..dc19004d3a1 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval5.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
using L = decltype([]{ });
void f(L) { }
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval6.C b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval6.C
index 0396f9ff10d..7d5aa316e93 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval6.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
static decltype([] { }) f();
static decltype([] { }) f(); // { dg-error "ambiguating" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval7.C b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval7.C
index 41028824ce8..efe3691d8c9 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval7.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval7.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <int N>
struct A { };
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval8.C b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval8.C
index 3692154f9be..966da0cc3fa 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval8.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval8.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <auto N>
struct A {
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval9.C b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval9.C
index e32d447819e..f512ae7a0f7 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval9.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval9.C
@@ -1,4 +1,4 @@
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
// { dg-additional-sources "lambda-uneval9.cc" }
#include "lambda-uneval9.h"
diff --git a/gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-1.C b/gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-1.C
index 01e41424bc7..e7024babe54 100644
--- a/gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <new>
@@ -8,5 +8,5 @@ namespace delete_selection_d {
void operator delete(B *, std::destroying_delete_t) = delete;
};
void delete_B(B *b) { delete b; } // { dg-bogus "deleted .* deleted" }
- // { dg-error "deleted" "" { target c++2a } .-1 }
+ // { dg-error "deleted" "" { target c++20 } .-1 }
}
diff --git a/gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C b/gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C
index 314e2e9b697..5db55c41987 100644
--- a/gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <new>
@@ -8,5 +8,5 @@ namespace delete_selection_r {
void operator delete(void*) = delete;
};
void delete_B(B *b) { delete b; } // { dg-bogus "deleted .* deleted" }
- // { dg-error "deleted" "" { target c++2a } .-1 }
+ // { dg-error "deleted" "" { target c++20 } .-1 }
}
diff --git a/gcc/testsuite/g++.dg/cpp2a/nested-inline-ns2.C b/gcc/testsuite/g++.dg/cpp2a/nested-inline-ns2.C
index 9b5f2cab47b..a1cbe52124b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nested-inline-ns2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nested-inline-ns2.C
@@ -1,5 +1,5 @@
// P1094R2
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
inline namespace A::B { // { dg-error "a nested namespace definition cannot be inline" }
int i;
diff --git a/gcc/testsuite/g++.dg/cpp2a/no_unique_address1.C b/gcc/testsuite/g++.dg/cpp2a/no_unique_address1.C
index dd019393f28..9cc8b94abb4 100644
--- a/gcc/testsuite/g++.dg/cpp2a/no_unique_address1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/no_unique_address1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
[[no_unique_address]] struct B { }; // { dg-warning "attribute" }
[[no_unique_address]] int i; // { dg-warning "attribute" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/no_unique_address4.C b/gcc/testsuite/g++.dg/cpp2a/no_unique_address4.C
new file mode 100644
index 00000000000..2fe44e37163
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/no_unique_address4.C
@@ -0,0 +1,22 @@
+// PR c++/96105
+// { dg-do compile { target c++20 } }
+
+struct Empty {};
+
+struct A {
+ Empty emp [[no_unique_address]][3];
+};
+
+struct B : A {
+ float f;
+};
+
+struct C {
+ Empty emp [[no_unique_address]][3];
+ float f;
+};
+
+extern char szc[sizeof(C)];
+extern char szc[sizeof(float) * 2]; // GCC likes this
+extern char szb[sizeof(B)];
+extern char szb[sizeof(float) * 2]; // GCC does not like this
diff --git a/gcc/testsuite/g++.dg/cpp2a/no_unique_address5.C b/gcc/testsuite/g++.dg/cpp2a/no_unique_address5.C
new file mode 100644
index 00000000000..5fca35dbd81
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/no_unique_address5.C
@@ -0,0 +1,25 @@
+// PR c++/96052
+// { dg-do compile { target c++20 } }
+
+struct Q {
+ struct {
+ } emp alignas(8) [[no_unique_address]];
+ char x;
+};
+struct QQ {
+ char x;
+ Q q;
+};
+
+struct Z {
+ char x alignas(8) [[no_unique_address]];
+};
+struct ZZ {
+ char x;
+ Z z;
+};
+
+extern char qx[sizeof(QQ)];
+extern char qx[16];
+extern char qz[sizeof(ZZ)];
+extern char qz[16];
diff --git a/gcc/testsuite/g++.dg/cpp2a/no_unique_address6.C b/gcc/testsuite/g++.dg/cpp2a/no_unique_address6.C
new file mode 100644
index 00000000000..427db4439dd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/no_unique_address6.C
@@ -0,0 +1,25 @@
+// PR c++/95976
+// { dg-do compile { target c++20 } }
+
+struct empty {};
+
+union no_attribute_t
+{
+ empty _0;
+ empty _1;
+};
+
+union with_attribute_t
+{
+ [[no_unique_address]] empty _0;
+ [[no_unique_address]] empty _1;
+};
+
+constexpr no_attribute_t no_attribute{};
+constexpr with_attribute_t with_attribute{};
+
+// This succeeds
+static_assert( &no_attribute._0 == &no_attribute._1 );
+
+// This fails
+static_assert( &with_attribute._0 == &with_attribute._1 );
diff --git a/gcc/testsuite/g++.dg/cpp2a/no_unique_address7.C b/gcc/testsuite/g++.dg/cpp2a/no_unique_address7.C
new file mode 100644
index 00000000000..edd82d1eccc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/no_unique_address7.C
@@ -0,0 +1,13 @@
+// PR c++/93711
+// { dg-do compile { target c++11 } }
+
+struct A { A(const A&) = delete; };
+
+A f();
+
+struct C
+{
+ [[no_unique_address]] A a;
+};
+
+C c{f()}; // { dg-error "deleted" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/no_unique_address7a.C b/gcc/testsuite/g++.dg/cpp2a/no_unique_address7a.C
new file mode 100644
index 00000000000..453baceb905
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/no_unique_address7a.C
@@ -0,0 +1,14 @@
+// PR c++/93711
+// { dg-do compile { target c++11 } }
+
+struct B { };
+struct A: B { A(const A&) = delete; };
+
+A f();
+
+struct C
+{
+ [[no_unique_address]] A a;
+};
+
+C c{f()}; // { dg-error "deleted" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/nodiscard-constructor.c b/gcc/testsuite/g++.dg/cpp2a/nodiscard-constructor.c
index a5c2c6514cf..9af4e59c3dc 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nodiscard-constructor.c
+++ b/gcc/testsuite/g++.dg/cpp2a/nodiscard-constructor.c
@@ -1,5 +1,5 @@
/* nodiscard attribute tests */
-/* { dg-do compile { target c++2a } } */
+/* { dg-do compile { target c++20 } } */
/* { dg-options "-O -ftrack-macro-expansion=0" } */
struct A { [[nodiscard("bad constructor")]] A() {} };
diff --git a/gcc/testsuite/g++.dg/cpp2a/nodiscard-once.C b/gcc/testsuite/g++.dg/cpp2a/nodiscard-once.C
index 78349715aae..c810fd0daad 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nodiscard-once.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nodiscard-once.C
@@ -1,5 +1,5 @@
/* nodiscard attribute tests */
-/* { dg-do compile { target c++2a } } */
+/* { dg-do compile { target c++20 } } */
/* { dg-options "-O -ftrack-macro-expansion=0" } */
[[nodiscard, nodiscard]] int check1 (void); /* { dg-error "nodiscard\[^\n\r]*can appear at most once" } */
diff --git a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C
index 76692e732c4..d81baf0ebcd 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C
@@ -1,5 +1,5 @@
/* nodiscard attribute tests */
-/* { dg-do compile { target c++2a } } */
+/* { dg-do compile { target c++20 } } */
/* { dg-options "-O -ftrack-macro-expansion=0" } */
[[nodiscard(123)]] int check1 (void); /* { dg-error "nodiscard\[^\n\r]*must be a string constant" } */
diff --git a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-only-one.C b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-only-one.C
index d42f4dc7bbe..6104a5ffa08 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-only-one.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-only-one.C
@@ -1,5 +1,5 @@
/* nodiscard attribute tests */
-/* { dg-do compile { target c++2a } } */
+/* { dg-do compile { target c++20 } } */
/* { dg-options "-O -ftrack-macro-expansion=0" } */
[[nodiscard("not", "allowed")]] int check1 (void); /* { dg-error "wrong number of arguments.\[^\n\r]*nodiscard" } */
diff --git a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason.C b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason.C
index 5fda058c9ee..2db2303c72d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason.C
@@ -1,5 +1,5 @@
/* nodiscard attribute tests, adapted from gcc.dg/attr-warn-unused-result.c. */
-/* { dg-do compile { target c++2a } } */
+/* { dg-do compile { target c++20 } } */
/* { dg-options "-O -ftrack-macro-expansion=0" } */
#define NODIS [[nodiscard("exact_message")]]
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class-equiv1.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class-equiv1.C
new file mode 100644
index 00000000000..038d46fdac8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class-equiv1.C
@@ -0,0 +1,25 @@
+// { dg-do compile { target c++20 } }
+
+template <auto N> struct A {};
+template <class,class> struct assert_same;
+template <class T> struct assert_same<T,T> {};
+
+#define TEQ(X,Y) static_assert(__is_same(A<(X)>,A<(Y)>))
+#define TNEQ(X,Y) static_assert(!__is_same(A<(X)>,A<(Y)>))
+
+union U {
+ int i; int j;
+ constexpr U(int i): i(i) {}
+ constexpr U(unsigned u): j(u) {}
+};
+
+TEQ(U(0),U(0));
+
+// Calling the other constructor initializes a different member with the same
+// value. We need to distinguish these.
+TNEQ(U(0),U(0u));
+
+// { dg-final { scan-assembler "_Z1f1AIXtl1Udi1iLi0EEEE" } }
+void f(A<U(0)>) { }
+// { dg-final { scan-assembler "_Z1g1AIXtl1Udi1jLi0EEEE" } }
+void g(A<U(0u)>) { }
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class-union1.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class-union1.C
new file mode 100644
index 00000000000..038d46fdac8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class-union1.C
@@ -0,0 +1,25 @@
+// { dg-do compile { target c++20 } }
+
+template <auto N> struct A {};
+template <class,class> struct assert_same;
+template <class T> struct assert_same<T,T> {};
+
+#define TEQ(X,Y) static_assert(__is_same(A<(X)>,A<(Y)>))
+#define TNEQ(X,Y) static_assert(!__is_same(A<(X)>,A<(Y)>))
+
+union U {
+ int i; int j;
+ constexpr U(int i): i(i) {}
+ constexpr U(unsigned u): j(u) {}
+};
+
+TEQ(U(0),U(0));
+
+// Calling the other constructor initializes a different member with the same
+// value. We need to distinguish these.
+TNEQ(U(0),U(0u));
+
+// { dg-final { scan-assembler "_Z1f1AIXtl1Udi1iLi0EEEE" } }
+void f(A<U(0)>) { }
+// { dg-final { scan-assembler "_Z1g1AIXtl1Udi1jLi0EEEE" } }
+void g(A<U(0u)>) { }
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class1.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class1.C
index a3334fc7d48..8f3b32948d0 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
struct A
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class10.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class10.C
index 5cc179300ca..31520c8de1b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class10.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class10.C
@@ -1,5 +1,5 @@
// PR c++/88196
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct C { C *c; };
template <C> struct D;
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class11.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class11.C
index 8a06d23904b..502a835bc96 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class11.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class11.C
@@ -1,5 +1,5 @@
// PR c++/88538
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S {
unsigned a;
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class12.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class12.C
index 11f8c12f3ff..824f0b40141 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class12.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class12.C
@@ -1,5 +1,5 @@
// PR c++/88744
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#define SA(X) static_assert((X),#X)
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class13.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class13.C
index 14c601ba040..035dbb161e9 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class13.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class13.C
@@ -1,5 +1,5 @@
// PR c++/77304
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S {};
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class14.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class14.C
index 9cc14460734..3d451a90b11 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class14.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class14.C
@@ -1,5 +1,5 @@
// PR c++/89532
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct tuple;
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class15.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class15.C
index d684785a77f..1142974495d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class15.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class15.C
@@ -1,7 +1,7 @@
// PR c++/89833
// Test to verify that the same specializations on non-type template
// parameters of class types are in fact treated as the same.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A1 { char c[5]; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class16.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class16.C
index 3afb5d24261..8ed742ff625 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class16.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class16.C
@@ -2,7 +2,7 @@
// Test to verify that arrays of null pointer to members used as
// non-type template arguments are interprested as null regardless
// of the form of their initialization.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-options "-O2 -Wall -fdump-tree-optimized" }
struct A { int i; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class17.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class17.C
index ca5f68e1611..2e1433939dc 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class17.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class17.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<auto>
struct S { };
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class18.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class18.C
index 22f47884d08..5319ca1e583 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class18.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class18.C
@@ -1,5 +1,5 @@
// PR c++/90101
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename List>
struct A;
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class19.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class19.C
index 91267aca383..fe87ffc5404 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class19.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class19.C
@@ -1,5 +1,5 @@
// PR c++/90099
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct Unit {
int value;
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class2.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class2.C
index 2785f947544..6811c2741bb 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
int i;
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class20.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class20.C
index 5d3479c345e..4b4d32989ca 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class20.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class20.C
@@ -1,5 +1,5 @@
// PR c++/90098
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
int value;
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class21.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class21.C
index c58fe05b9dd..7f3d3620fef 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class21.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class21.C
@@ -1,5 +1,5 @@
// PR c++/90101
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<int N>
struct A{};
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class22.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class22.C
index 026855f0bc6..193095b237d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class22.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class22.C
@@ -1,5 +1,5 @@
// PR c++/90100
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
inline constexpr bool is_nontype_list = false;
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class23.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class23.C
index ab9e80fd335..134d1bf4d98 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class23.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class23.C
@@ -3,7 +3,7 @@
// parameters of class types are in fact treated as the same. Unlike
// nontype-class15.C which involves only one-dimensional arrays this
// test involves arrays of arrays and arrays of structs.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct AA3
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class24.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class24.C
index aa96de36a80..6c703b7f8ed 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class24.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class24.C
@@ -1,5 +1,5 @@
// PR c++/92150
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct X {
int value;
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class25.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class25.C
index 67d6f094968..279d4d00e36 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class25.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class25.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct base { int i{}; };
struct derived : private base {};
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class26.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class26.C
index 315e0ac2309..7707f439aad 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class26.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class26.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct p { unsigned p_ {}; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class27.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class27.C
index 23eae64c64b..ae64fac81c2 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class27.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class27.C
@@ -1,5 +1,5 @@
// PR c++/92965
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<int>
class TS {
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class28.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class28.C
index 80b9b499355..a8b05fe8380 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class28.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class28.C
@@ -1,5 +1,5 @@
// PR c++/92948 - Fix class NTTP with template arguments.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
constexpr A(int) { }
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class29.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class29.C
index 2d2e9690a06..a3c1446af5d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class29.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class29.C
@@ -1,5 +1,5 @@
// PR c++/92948 - Fix class NTTP with template arguments.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
struct A {
int i;
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class3.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class3.C
index 0c0fcf6be33..750accdd525 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
int i;
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class30.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class30.C
index b2e174c7fd3..44b8338b0ae 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class30.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class30.C
@@ -1,5 +1,5 @@
// PR c++/91754 - Fix template arguments comparison with class NTTP.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S {};
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class31.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class31.C
index 329b3129e1b..dbecf91c46d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class31.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class31.C
@@ -1,5 +1,5 @@
// PR c++/88092
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
struct S {
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class32.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class32.C
index 6a4dac5c90e..9c6d6f93bda 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class32.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class32.C
@@ -1,5 +1,5 @@
// PR c++/88819
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T, template<T> class TT, class R = TT <0>> struct A
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class33.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class33.C
index 1b9dfb88918..7a1b9e66f0c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class33.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class33.C
@@ -1,5 +1,5 @@
// PR c++/90938 - Initializing array with {1} works, but not {0}
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-options "-Wall" }
struct A { int i; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class34.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class34.C
index 2d3ba018618..acbc62151f8 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class34.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class34.C
@@ -1,5 +1,5 @@
// PR c++/94592 - ICE with { } as template argument.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
constexpr A() {}
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class35.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class35.C
index 78cf0a39c81..7d0126c64fb 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class35.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class35.C
@@ -1,5 +1,5 @@
// PR c++/94592 - ICE with { } as template argument.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
int i;
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class36.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class36.C
index 1c1e23c10a8..8371eb96621 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class36.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class36.C
@@ -1,5 +1,5 @@
/* PR c++/94510 - nullptr_t implicitly cast to zero twice in std::array
- { dg-do compile { target c++2a } }
+ { dg-do compile { target c++20 } }
{ dg-options "-Wall" } */
struct A { int i; int f (); };
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class37.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class37.C
index 5649fa2e6dc..f5e9826d243 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class37.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class37.C
@@ -1,5 +1,5 @@
/* PR c++/94510 - nullptr_t implicitly cast to zero twice in std::array
- { dg-do compile { target c++2a } }
+ { dg-do compile { target c++20 } }
{ dg-options "-Wall" } */
struct A { char a[4]; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class38.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class38.C
new file mode 100644
index 00000000000..5b440fd1c9e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class38.C
@@ -0,0 +1,30 @@
+// PR c++/95369
+// { dg-do compile { target c++20 } }
+
+struct S {
+ int a;
+ int b;
+};
+
+struct W {
+ int i;
+ S s;
+};
+
+template <S p>
+void fnc()
+{
+}
+
+template<S s> struct X { };
+template<W w> struct Y { };
+
+void f()
+{
+ fnc<{ .a = 10, .b = 20 }>();
+ fnc<{ 10, 20 }>();
+ X<{ .a = 1, .b = 2 }> x;
+ X<{ 1, 2 }> x2;
+ // Brace elision is likely to be allowed.
+ Y<{ 1, 2, 3 }> x3;
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class4.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class4.C
index fc0e7c9655d..6235fc8f3f5 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class4.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T>
struct A {
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class5.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class5.C
index 8c39cd72715..67c57099f74 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class5.C
@@ -1,5 +1,5 @@
// Example from P0732
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<class T, T p> class X {
/* ... */
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class6.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class6.C
index 246fab6c178..377a151d343 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class6.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
char ar[10];
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class7.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class7.C
index 15389e18537..436f4fdfe11 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class7.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class7.C
@@ -1,5 +1,5 @@
// Example from P0732.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
using size_t = decltype(sizeof(1));
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class8.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class8.C
index 47fc9c7f5c0..af22a9389be 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class8.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class8.C
@@ -1,7 +1,7 @@
// If the entity is a template parameter object for a template parameter of
// type T, the type of the expression is const T.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T, class U> struct same;
template <class T> struct same<T,T> {};
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class9.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class9.C
index 737f712be47..d62be58d57d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nontype-class9.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class9.C
@@ -1,5 +1,5 @@
// PR c++/88216
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <class T, class U> struct same;
template <class T> struct same<T,T> {};
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-subob1.C b/gcc/testsuite/g++.dg/cpp2a/nontype-subob1.C
new file mode 100644
index 00000000000..9e5e888114e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-subob1.C
@@ -0,0 +1,25 @@
+// { dg-do compile { target c++20 } }
+
+template <auto N> struct A {};
+template <class,class> struct assert_same;
+template <class T> struct assert_same<T,T> {};
+
+#define TEQ(X,Y) static_assert(__is_same(A<(X)>,A<(Y)>))
+#define TNEQ(X,Y) static_assert(!__is_same(A<(X)>,A<(Y)>))
+
+struct C { int i; };
+
+struct B: C
+{
+ int j[3];
+} b;
+
+// { dg-final { scan-assembler _Z1f1AIXaddtL_Z1bE1iEE } }
+void f(A<&b.i>) {}
+TEQ(&b.i,&((C*)&b)->i);
+
+// { dg-final { scan-assembler "_Z1g1AIXadixdtL_Z1bE1jL\[silx]1EEE" } }
+void g(A<&b.j[0]+1>) {}
+TEQ(&b.j[1],&b.j[1]);
+TEQ(&b.j[1],&b.j[0]+1);
+TNEQ(&b.j[1],&b.j[0]);
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-subob2.C b/gcc/testsuite/g++.dg/cpp2a/nontype-subob2.C
new file mode 100644
index 00000000000..a5768f64360
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-subob2.C
@@ -0,0 +1,13 @@
+// { dg-do compile { target c++20 } }
+// { dg-additional-options -Wno-inaccessible-base }
+
+struct Base { int i; };
+template <int N> struct Derived : Derived<N-1>, Base {};
+template <> struct Derived<0> : Base {};
+
+template <int* P> struct A { };
+
+Derived<4> d;
+void f(A<&((Derived<0>&)d).i>) {}
+
+// { dg-final { scan-assembler _Z1f1AIXaddtcvR7DerivedILi0EEL_Z1dE1iEE } }
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init1.C b/gcc/testsuite/g++.dg/cpp2a/paren-init1.C
index a54b2ccaf6d..316c162dd52 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init1.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
struct A {
int i;
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init10.C b/gcc/testsuite/g++.dg/cpp2a/paren-init10.C
index 5c70d9d59ee..8e635de4514 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init10.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init10.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Test from [dcl.init].
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init11.C b/gcc/testsuite/g++.dg/cpp2a/paren-init11.C
index 82ca2669545..638e9c2ecca 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init11.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init11.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Test ill-formed code.
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init12.C b/gcc/testsuite/g++.dg/cpp2a/paren-init12.C
index d7be6f2b55d..c53b4b53542 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init12.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init12.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A;
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init13.C b/gcc/testsuite/g++.dg/cpp2a/paren-init13.C
index 4b9107c70ff..31c7d4e1669 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init13.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init13.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct X { int a, b; };
struct Y { X x; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init15.C b/gcc/testsuite/g++.dg/cpp2a/paren-init15.C
index 4311dd4df59..ddaea8fd90d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init15.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init15.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
int i;
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init16.C b/gcc/testsuite/g++.dg/cpp2a/paren-init16.C
index c8ed924877e..dd991aec8c8 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init16.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init16.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S { int a[2]; };
struct A { S s[1]; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init18.C b/gcc/testsuite/g++.dg/cpp2a/paren-init18.C
index 0aea493f214..40a65a573cf 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init18.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init18.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A { int a, b, c; };
struct S { A a; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init19.C b/gcc/testsuite/g++.dg/cpp2a/paren-init19.C
index 73643fa3aa2..065e16a21be 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init19.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init19.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
int i[2];
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init2.C b/gcc/testsuite/g++.dg/cpp2a/paren-init2.C
index e9e90d7acb6..f1221b286e8 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init2.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
struct A {
int i = 0;
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init20.C b/gcc/testsuite/g++.dg/cpp2a/paren-init20.C
index 05da7604686..4dcc94d5630 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init20.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init20.C
@@ -1,5 +1,5 @@
// PR c++/92878 - Parenthesized init of aggregates in new-expression.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Test new TYPE(...).
int f ();
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init21.C b/gcc/testsuite/g++.dg/cpp2a/paren-init21.C
index cfd37193f66..f8e6c4bee1c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init21.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init21.C
@@ -1,5 +1,5 @@
// PR c++/92947 - Paren init of aggregates in unevaluated context.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
int a;
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init22.C b/gcc/testsuite/g++.dg/cpp2a/paren-init22.C
index 1b2959e7731..ac7ab9c5808 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init22.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init22.C
@@ -1,5 +1,5 @@
// PR c++/94155 - crash in gimplifier with paren init of aggregates.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S { int i, j; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init23.C b/gcc/testsuite/g++.dg/cpp2a/paren-init23.C
index 6038f63be5a..b6761ddb85d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init23.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init23.C
@@ -1,5 +1,5 @@
// PR c++/93790 - wrong paren-init of aggregates interference.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S {
int i;
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init24.C b/gcc/testsuite/g++.dg/cpp2a/paren-init24.C
index 4e97bbc5b56..261bcbffb45 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init24.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init24.C
@@ -1,5 +1,5 @@
// PR c++/94149 - make __is_constructible work with paren-init of aggrs.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <type_traits>
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init25.C b/gcc/testsuite/g++.dg/cpp2a/paren-init25.C
index 53855a9ef9e..011ff318536 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init25.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init25.C
@@ -1,5 +1,5 @@
// PR c++/94149 - make __is_constructible work with paren-init of aggrs.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct nonaggr {
nonaggr() {}
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init26.C b/gcc/testsuite/g++.dg/cpp2a/paren-init26.C
index 0b98ebf43bb..cf1edb6bdf9 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init26.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init26.C
@@ -1,5 +1,5 @@
// PR c++/94885 - paren-init of aggregates accepts invalid code.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename T, typename = decltype(T(0))> // { dg-error "could not convert" }
void foo();
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init27.C b/gcc/testsuite/g++.dg/cpp2a/paren-init27.C
new file mode 100644
index 00000000000..0b8cbe33b69
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init27.C
@@ -0,0 +1,24 @@
+// PR c++/92812
+// P1975R0
+// { dg-do run { target c++20 } }
+// { dg-options "-Wall -Wextra" }
+
+struct Aggr { int x; int y; };
+struct Base { int i; Base(int i_) : i{i_} { } };
+struct BaseAggr : Base { };
+struct X { };
+struct AggrSDM { static X x; int i; int j; };
+
+int
+main ()
+{
+ Aggr a = static_cast<Aggr>(42); // { dg-warning "missing initializer" }
+ if (a.x != 42 || a.y != 0)
+ __builtin_abort ();
+ BaseAggr b = static_cast<BaseAggr>(42);
+ if (b.i != 42)
+ __builtin_abort ();
+ AggrSDM s = static_cast<AggrSDM>(42); // { dg-warning "missing initializer" }
+ if (s.i != 42 || s.j != 0)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init28.C b/gcc/testsuite/g++.dg/cpp2a/paren-init28.C
new file mode 100644
index 00000000000..8c57dc8e155
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init28.C
@@ -0,0 +1,15 @@
+// PR c++/92812
+// P1975R0
+// { dg-do compile { target c++20 } }
+
+// In both cases the reference declarations lifetime-extend the array
+// temporary.
+int (&&r)[3] = static_cast<int[3]>(42);
+int (&&r2)[1] = static_cast<int[]>(42);
+
+// Make sure we've lifetime-extended.
+// { dg-final { scan-assembler "_ZGR1r_" } }
+// { dg-final { scan-assembler "_ZGR2r2_" } }
+
+// Narrowing is probably OK here.
+int (&&r3)[1] = static_cast<int[1]>(1.3);
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init29.C b/gcc/testsuite/g++.dg/cpp2a/paren-init29.C
new file mode 100644
index 00000000000..c39cd8cc0d0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init29.C
@@ -0,0 +1,15 @@
+// PR c++/92812
+// P1975R0
+// { dg-do run { target c++20 } }
+
+int (&&r)[3] = static_cast<int[3]>(42);
+int (&&r2)[1] = static_cast<int[]>(42);
+
+int
+main ()
+{
+ if (r[0] != 42 || r[1] != 0 || r[2] != 0)
+ __builtin_abort ();
+ if (r2[0] != 42 || sizeof (r2) != sizeof (int))
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init3.C b/gcc/testsuite/g++.dg/cpp2a/paren-init3.C
index f444005a09f..ebfa8db033a 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init3.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
class a {
int b{};
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init30.C b/gcc/testsuite/g++.dg/cpp2a/paren-init30.C
new file mode 100644
index 00000000000..6b2e86f00f4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init30.C
@@ -0,0 +1,23 @@
+// PR c++/92812
+// P1975R0
+// { dg-do compile { target c++20 } }
+
+struct S1 {
+ int i;
+ int j;
+};
+
+struct S2 {
+ S1 s[4];
+};
+
+struct S3 {
+ S2 s2;
+};
+
+void
+f ()
+{
+ // Brace elision not allowed.
+ auto s3 = static_cast<S3>(1); // { dg-error "could not convert" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init31.C b/gcc/testsuite/g++.dg/cpp2a/paren-init31.C
new file mode 100644
index 00000000000..3600c4993a5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init31.C
@@ -0,0 +1,10 @@
+// PR c++/92812
+// P1975R0
+// { dg-do compile { target c++20 } }
+// Test we don't lifetime-extend the int temporary.
+
+struct A { const int &r; };
+A a(42);
+auto a2 = static_cast<A>(42);
+
+// { dg-final { scan-assembler-not "_ZGR" } }
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init32.C b/gcc/testsuite/g++.dg/cpp2a/paren-init32.C
new file mode 100644
index 00000000000..bf7833ebd5b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init32.C
@@ -0,0 +1,21 @@
+// PR c++/92812
+// P1975R0
+// { dg-do compile { target c++20 } }
+
+struct A { int i; };
+struct A2 { int i; A2(int); };
+struct A3 { int i; explicit A3(int); };
+
+struct X { A a; };
+auto x = static_cast<X>(42); // { dg-error "could not convert" }
+
+struct X2 { A2 a; };
+auto x2 = static_cast<X2>(42);
+
+struct X3 { A3 a; };
+// Aggregate-initialization copy-initializes, so the explicit ctor
+// isn't considered.
+auto x3 = static_cast<X3>(42); // { dg-error "could not convert" }
+
+struct NonAggr { int i; virtual void foo (); };
+auto x4 = static_cast<NonAggr>(42); // { dg-error "no matching" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init4.C b/gcc/testsuite/g++.dg/cpp2a/paren-init4.C
index f8c7bd10b63..0bfddf0bbb8 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init4.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
// Test T[]().
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init5.C b/gcc/testsuite/g++.dg/cpp2a/paren-init5.C
index a64cb00ebbc..6d2efd70731 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init5.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
union U {
int a;
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init6.C b/gcc/testsuite/g++.dg/cpp2a/paren-init6.C
index b5d97dcb3d8..96a32844528 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init6.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Test that we don't perform lifetime extension for () init.
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init7.C b/gcc/testsuite/g++.dg/cpp2a/paren-init7.C
index 32af1a7265c..81f909e943b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init7.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init7.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
int h;
struct i {
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init8.C b/gcc/testsuite/g++.dg/cpp2a/paren-init8.C
index 30e71650bc9..6433c17f55d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init8.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init8.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Test that we don't accept designated inits in ( ).
diff --git a/gcc/testsuite/g++.dg/cpp2a/paren-init9.C b/gcc/testsuite/g++.dg/cpp2a/paren-init9.C
index c44b206feb8..7058d274c1d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/paren-init9.C
+++ b/gcc/testsuite/g++.dg/cpp2a/paren-init9.C
@@ -1,5 +1,5 @@
// PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct B { };
struct A : B {
diff --git a/gcc/testsuite/g++.dg/cpp2a/pr88534.C b/gcc/testsuite/g++.dg/cpp2a/pr88534.C
index 54faf385f11..2da38142bf0 100644
--- a/gcc/testsuite/g++.dg/cpp2a/pr88534.C
+++ b/gcc/testsuite/g++.dg/cpp2a/pr88534.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-options "-g" }
typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/g++.dg/cpp2a/pr88537.C b/gcc/testsuite/g++.dg/cpp2a/pr88537.C
index d558d45f578..8d59643037b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/pr88537.C
+++ b/gcc/testsuite/g++.dg/cpp2a/pr88537.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-options "-g" }
struct pair {
diff --git a/gcc/testsuite/g++.dg/cpp2a/pr89913.C b/gcc/testsuite/g++.dg/cpp2a/pr89913.C
index c06847e67c3..8ef9b1e2830 100644
--- a/gcc/testsuite/g++.dg/cpp2a/pr89913.C
+++ b/gcc/testsuite/g++.dg/cpp2a/pr89913.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename...> using A = auto; // { dg-error "not allowed" }
// In pre-20, the error is "invalid use of auto"
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr1.C
index 9d008f19fea..6ccc7e8507b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr2.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr2.C
index 02f92b10aef..2610864f29c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr2.C
@@ -1,5 +1,5 @@
// PR c++/93650
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
using type = enum _Ord { less };
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr3.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr3.C
new file mode 100644
index 00000000000..95f03e6e231
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr3.C
@@ -0,0 +1,7 @@
+// PR c++/96497
+// { dg-do compile { target c++20 } }
+
+#include <compare>
+
+static_assert(std::partial_ordering(std::strong_ordering::less) < 0);
+static_assert(std::partial_ordering(1 <=> 2) < 0);
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-decltype1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-decltype1.C
index bc673b2e020..217e34fe79f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-decltype1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-decltype1.C
@@ -1,5 +1,5 @@
// PR c++/92560
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq1.C
index 19a03fb04df..88e2d36988e 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq1.C
@@ -1,4 +1,4 @@
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
struct D
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq1a.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq1a.C
index 7e98c472cd1..1e26e57f065 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq1a.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq1a.C
@@ -1,4 +1,4 @@
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
template <class T>
struct D
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq2.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq2.C
index 06b988f6e57..8de75bd2f3b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct D
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq3.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq3.C
index 490726de56f..d31faef095d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
bool operator==(const A&) const;
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq4.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq4.C
index d89fc885e50..66b228d07af 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq4.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
int operator==(const A&) const = default; // { dg-error "return .bool" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq5.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq5.C
index ac24f366c94..429d31a2212 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq5.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A {
int &r; // { dg-message "reference" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq6.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq6.C
index f804e133714..265d075ab18 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq6.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct A
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq7.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq7.C
index 8112eaa4f80..b1351886176 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq7.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq7.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
union A
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq8.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq8.C
index aabbd324d86..61bcde55d1c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq8.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq8.C
@@ -1,5 +1,5 @@
// PR c++/92966
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct S {
int operator==(const S&) const = default; // { dg-error "must return 'bool'" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq9.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq9.C
index 4f5df226410..5533481a61b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-eq9.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-eq9.C
@@ -1,5 +1,5 @@
// PR c++/94462
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
struct strong_ordering { };
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-err1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-err1.C
index ce7b56ce574..905b60086d9 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-err1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-err1.C
@@ -1,5 +1,5 @@
// Test that we suggest adding #include <compare>.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
auto x = 1<=>2; // { dg-error "" }
// { dg-message "<compare>" "" { target *-*-* } .-1 }
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-err2.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-err2.C
index 6461c6ab60a..56ab343c9a7 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-err2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-err2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <compare>
template <class T, T x = (T() <=> T())> // { dg-error "31:0 <=> 0" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-err3.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-err3.C
index e756ebca945..825bd7032a7 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-err3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-err3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-err4.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-err4.C
index 00f90ced255..a39e5069957 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-err4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-err4.C
@@ -1,7 +1,7 @@
// PR c++/94478 - ICE with defaulted comparison operator.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct B {};
-bool operator!=(const B&, const B&) = default; // { dg-error "equality comparison operator can only be defaulted in a class definition" }
-bool operator==(const B&, const B&) = default; // { dg-error "equality comparison operator can only be defaulted in a class definition" }
-bool operator<=>(const B&, const B&) = default; // { dg-error "three-way comparison operator can only be defaulted in a class definition" }
+bool operator!=(const B&, const B&) = default; // { dg-error "not a friend" }
+bool operator==(const B&, const B&) = default; // { dg-error "not a friend" }
+bool operator<=>(const B&, const B&) = default; // { dg-error "not a friend" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-friend1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-friend1.C
new file mode 100644
index 00000000000..24bbc74a2d1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-friend1.C
@@ -0,0 +1,26 @@
+// P2085, separate definition of defaulted comparisons
+// { dg-do compile { target c++20 } }
+
+namespace X {
+
+ struct A {
+ int i;
+ friend constexpr bool operator==(const A&,const A&);
+ };
+
+ inline constexpr bool operator==(const A&,const A&)=default;
+
+ static_assert (A() == A());
+
+}
+
+namespace Y {
+
+ struct A {
+ int i;
+ // friend bool operator==(const A&,const A&);
+ };
+
+ inline bool operator==(const A&,const A&)=default; // { dg-error "not a friend" }
+
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-ref1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-ref1.C
new file mode 100644
index 00000000000..5f888dfc3b4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-ref1.C
@@ -0,0 +1,12 @@
+// Reject &&.
+// { dg-do compile { target c++20 } }
+
+struct A
+{
+ bool operator==(const A&) const && = default; // { dg-error "ref-qualifier" }
+};
+
+struct B
+{
+ friend bool operator==(const B&&, const B&&) = default; // { dg-error "" }
+};
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite1.C
index bb60302622f..c4030cd2f4d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite1.C
@@ -1,5 +1,5 @@
// This should continue to work.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<class T>
struct A {
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite3.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite3.C
index ef29cffbd0b..d0e4a892225 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite3.C
@@ -1,10 +1,10 @@
// Test that very different operators still cause ambiguity with reversed.
struct X { operator int(); };
-bool operator==(X, int); // #1 { dg-message "reversed" "" { target c++2a } }
+bool operator==(X, int); // #1 { dg-message "reversed" "" { target c++20 } }
struct Y { operator int(); };
-bool operator==(Y, int); // #2 { dg-message "reversed" "" { target c++2a } }
+bool operator==(Y, int); // #2 { dg-message "reversed" "" { target c++20 } }
X x; Y y;
-bool b1 = x == y; // { dg-error "ambiguous" "" { target c++2a } }
-bool b2 = y == x; // { dg-error "ambiguous" "" { target c++2a } }
+bool b1 = x == y; // { dg-error "ambiguous" "" { target c++20 } }
+bool b2 = y == x; // { dg-error "ambiguous" "" { target c++20 } }
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite4.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite4.C
index c068b5ab294..f3488ea0754 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite4.C
@@ -8,5 +8,5 @@ struct const_iterator {
struct iterator {
bool operator==(const const_iterator &ci) const {
return ci == *this; // { dg-error "deleted" "" { target c++17_down } }
- } // { dg-warning "reversed" "" { target c++2a } .-1 }
+ } // { dg-warning "reversed" "" { target c++20 } .-1 }
};
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar1-neg.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar1-neg.C
index 182bf2b9092..6e08acf2b20 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar1-neg.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar1-neg.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar1.C
index 0d1dd63d368..c4971aafc03 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar1.C
@@ -1,4 +1,4 @@
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar1a.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar1a.C
index 552c92aa5bd..3607c816664 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar1a.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar1a.C
@@ -1,4 +1,4 @@
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar2.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar2.C
index d3cb0a6b0f0..9d96944399a 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar3.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar3.C
index 7dacaf4b81d..e6baaa262c7 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-scalar3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-options "-fext-numeric-literals" }
int main()
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-sfinae1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-sfinae1.C
index 6a03f54b91a..eb199186153 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-sfinae1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-sfinae1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// missing #include <compare>
template <class T, T x = (T() <=> T()) == 0>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg1.C
index f9b2dc449e2..6c35f70ea6c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg2.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg2.C
index ecc249a67b7..486db6cbbf9 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg2.C
@@ -1,5 +1,5 @@
// PR c++/92774
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg3.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg3.C
index 45ce4ee047a..a4d8b32922f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg3.C
@@ -1,5 +1,5 @@
// PR c++/92496
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<auto V>
struct A {};
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg4.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg4.C
new file mode 100644
index 00000000000..e99aa0a2041
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg4.C
@@ -0,0 +1,20 @@
+// P2002: deleted if a subobject <=> has non-category type.
+// { dg-do compile { target c++20 } }
+
+#include <compare>
+
+struct A
+{
+ bool operator<=>(const A&) const;
+};
+
+struct B
+{
+ A a; // { dg-message "bool" }
+ auto operator<=>(const B&) const = default;
+};
+
+int main()
+{
+ auto x = B() <=> B(); // { dg-error "deleted" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth1.C
index 2a35de99e09..1872fb5382c 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth1.C
@@ -1,5 +1,5 @@
// Test with all operators explicitly defaulted.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth1a.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth1a.C
index 32314579dcb..899a83c80b3 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth1a.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth1a.C
@@ -1,5 +1,5 @@
// Test with all operators explicitly defaulted.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth2.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth2.C
index cf23c9771e0..9b6cfa081d1 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth2.C
@@ -1,5 +1,8 @@
// Test with only spaceship defaulted.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
+
+// Add this warning to test PR c++/95242
+// { dg-additional-options -Wzero-as-null-pointer-constant }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth2a.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth2a.C
index 11fe32f86dc..959e376b446 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth2a.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth2a.C
@@ -1,5 +1,5 @@
// Test with only spaceship defaulted.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth2b.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth2b.C
index 2632f525aad..65915ce6c0a 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth2b.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth2b.C
@@ -1,5 +1,5 @@
// Test with only spaceship defaulted.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth3.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth3.C
index 0fc5aa2c9b8..aac0013725d 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth3.C
@@ -1,5 +1,5 @@
// Test for reversed candidates.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth3a.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth3a.C
index 89f84899fcc..20da546d82a 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth3a.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth3a.C
@@ -1,5 +1,5 @@
// Test for reversed candidates.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth4.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth4.C
index 033578122ae..291f6e839cf 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth4.C
@@ -1,5 +1,5 @@
// Test with all operators explicitly defaulted.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth5.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth5.C
index 8e4aa864b27..49f88f6f694 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth5.C
@@ -1,5 +1,5 @@
// Test with all operators explicitly defaulted.
-// { dg-do run { target c++2a } }
+// { dg-do run { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth6.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth6.C
index e8296bbb60a..4765601f239 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth6.C
@@ -1,5 +1,5 @@
// PR c++/94583
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std { struct strong_ordering { }; }
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth7.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth7.C
index 86b661ca6e0..7cb201416f9 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth7.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth7.C
@@ -1,5 +1,5 @@
// PR c++/94583
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std { struct strong_ordering { }; }
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth8.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth8.C
new file mode 100644
index 00000000000..bd1c4d2af2f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth8.C
@@ -0,0 +1,12 @@
+// PR c++/94907
+// { dg-do compile { target c++20 } }
+
+namespace std { struct strong_ordering { }; }
+
+struct E;
+struct D {
+ virtual std::strong_ordering operator<=>(const struct E&) const = 0;
+};
+struct E : D {
+ std::strong_ordering operator<=>(const E&) const override = default;
+};
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth9.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth9.C
new file mode 100644
index 00000000000..33b547d2b50
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth9.C
@@ -0,0 +1,27 @@
+// Test that most properties of <=> are copied to ==.
+// { dg-do compile { target c++20 } }
+
+#include <compare>
+
+template<typename T> struct X {
+ T t;
+ friend consteval std::partial_ordering operator<=>(X, X) requires (sizeof(T) != 1) = default;
+ // implicitly declares: friend constexpr bool operator==(X, X) requires (sizeof(T) != 1) = default;
+};
+
+template<typename T> struct Y {
+ [[nodiscard]] virtual std::strong_ordering operator<=>(const Y&) const = default;
+ // implicitly declares: [[nodiscard]] virtual bool operator==(const Y&) const = default;
+};
+
+struct Z: Y<int>
+{
+ bool operator==(const Y&) const noexcept override;
+};
+
+int main()
+{
+ X<char>() == X<char>(); // { dg-error "no match" }
+ X<int> x; x == x; // { dg-error "x' is not usable in a constant expression" }
+ Y<int>() == Y<int>(); // { dg-warning "nodiscard" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-union1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-union1.C
new file mode 100644
index 00000000000..a08ba0de69c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-union1.C
@@ -0,0 +1,12 @@
+// P2002: Allow default comparison of unions with no members.
+// { dg-do compile { target c++20 } }
+
+union A
+{
+ bool operator==(const A&) const = default;
+};
+
+int main()
+{
+ A() == A();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-vec1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-vec1.C
index 83547691118..bc1ec63113a 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-vec1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-vec1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <compare>
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-weak1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-weak1.C
index 1ff39549973..400d9931b66 100644
--- a/gcc/testsuite/g++.dg/cpp2a/spaceship-weak1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-weak1.C
@@ -1,5 +1,5 @@
// Test explicit weak_ordering.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
#include <compare>
struct A
diff --git a/gcc/testsuite/g++.dg/cpp2a/srcloc1.C b/gcc/testsuite/g++.dg/cpp2a/srcloc1.C
index c88bc146a5d..6e19ff77756 100644
--- a/gcc/testsuite/g++.dg/cpp2a/srcloc1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/srcloc1.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
struct source_location {
diff --git a/gcc/testsuite/g++.dg/cpp2a/srcloc10.C b/gcc/testsuite/g++.dg/cpp2a/srcloc10.C
index a27016d1e36..1be78d9f7bd 100644
--- a/gcc/testsuite/g++.dg/cpp2a/srcloc10.C
+++ b/gcc/testsuite/g++.dg/cpp2a/srcloc10.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
struct source_location {
diff --git a/gcc/testsuite/g++.dg/cpp2a/srcloc11.C b/gcc/testsuite/g++.dg/cpp2a/srcloc11.C
index 742a8925e54..abc850fcd43 100644
--- a/gcc/testsuite/g++.dg/cpp2a/srcloc11.C
+++ b/gcc/testsuite/g++.dg/cpp2a/srcloc11.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
struct source_location {
diff --git a/gcc/testsuite/g++.dg/cpp2a/srcloc12.C b/gcc/testsuite/g++.dg/cpp2a/srcloc12.C
index 900e5a8cab8..49a7e569b7f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/srcloc12.C
+++ b/gcc/testsuite/g++.dg/cpp2a/srcloc12.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
struct source_location {
diff --git a/gcc/testsuite/g++.dg/cpp2a/srcloc13.C b/gcc/testsuite/g++.dg/cpp2a/srcloc13.C
index 890931236b8..ee7b1248354 100644
--- a/gcc/testsuite/g++.dg/cpp2a/srcloc13.C
+++ b/gcc/testsuite/g++.dg/cpp2a/srcloc13.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
struct source_location {
diff --git a/gcc/testsuite/g++.dg/cpp2a/srcloc14.C b/gcc/testsuite/g++.dg/cpp2a/srcloc14.C
index 21ab8311d36..2730143c6ee 100644
--- a/gcc/testsuite/g++.dg/cpp2a/srcloc14.C
+++ b/gcc/testsuite/g++.dg/cpp2a/srcloc14.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
struct source_location {
diff --git a/gcc/testsuite/g++.dg/cpp2a/srcloc2.C b/gcc/testsuite/g++.dg/cpp2a/srcloc2.C
index 380d83428cf..5ef09bbb1b1 100644
--- a/gcc/testsuite/g++.dg/cpp2a/srcloc2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/srcloc2.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
inline namespace _8 { }
diff --git a/gcc/testsuite/g++.dg/cpp2a/srcloc3.C b/gcc/testsuite/g++.dg/cpp2a/srcloc3.C
index b841ff6ceaa..29587e4ebb5 100644
--- a/gcc/testsuite/g++.dg/cpp2a/srcloc3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/srcloc3.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
auto x = __builtin_source_location (); // { dg-error "'source_location' is not a member of 'std'" }
// { dg-message "std::source_location' is defined in header '<source_location>'; did you forget to '#include <source_location>'" "" { target *-*-* } .-1 }
diff --git a/gcc/testsuite/g++.dg/cpp2a/srcloc4.C b/gcc/testsuite/g++.dg/cpp2a/srcloc4.C
index c8c5f513931..c10f64b95d2 100644
--- a/gcc/testsuite/g++.dg/cpp2a/srcloc4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/srcloc4.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
void source_location ();
diff --git a/gcc/testsuite/g++.dg/cpp2a/srcloc5.C b/gcc/testsuite/g++.dg/cpp2a/srcloc5.C
index 0e89a00a13c..ce7170b6dce 100644
--- a/gcc/testsuite/g++.dg/cpp2a/srcloc5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/srcloc5.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
typedef int source_location;
diff --git a/gcc/testsuite/g++.dg/cpp2a/srcloc6.C b/gcc/testsuite/g++.dg/cpp2a/srcloc6.C
index a389add2e7c..89c6887cb46 100644
--- a/gcc/testsuite/g++.dg/cpp2a/srcloc6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/srcloc6.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
struct source_location {
diff --git a/gcc/testsuite/g++.dg/cpp2a/srcloc7.C b/gcc/testsuite/g++.dg/cpp2a/srcloc7.C
index 2a8b569a1af..ef56edf9426 100644
--- a/gcc/testsuite/g++.dg/cpp2a/srcloc7.C
+++ b/gcc/testsuite/g++.dg/cpp2a/srcloc7.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
struct source_location {
diff --git a/gcc/testsuite/g++.dg/cpp2a/srcloc8.C b/gcc/testsuite/g++.dg/cpp2a/srcloc8.C
index db56bb5ff90..caef812b464 100644
--- a/gcc/testsuite/g++.dg/cpp2a/srcloc8.C
+++ b/gcc/testsuite/g++.dg/cpp2a/srcloc8.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
struct source_location {
diff --git a/gcc/testsuite/g++.dg/cpp2a/srcloc9.C b/gcc/testsuite/g++.dg/cpp2a/srcloc9.C
index 01ba00aaf41..47fce003913 100644
--- a/gcc/testsuite/g++.dg/cpp2a/srcloc9.C
+++ b/gcc/testsuite/g++.dg/cpp2a/srcloc9.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
struct source_location {
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename1.C b/gcc/testsuite/g++.dg/cpp2a/typename1.C
index 0c1f6309c5b..726c9df5c88 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename1.C
@@ -1,5 +1,5 @@
// P0634R3
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// OK, return type of a function declaration at global scope.
template<class T> T::R f();
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename10.C b/gcc/testsuite/g++.dg/cpp2a/typename10.C
index 1413268ba16..cdd1465d010 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename10.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename10.C
@@ -1,5 +1,5 @@
// P0634R3
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace N {
// template<typename T> extern T::type v; // #1a
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename11.C b/gcc/testsuite/g++.dg/cpp2a/typename11.C
index ed7ad958f62..5dd81f105ca 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename11.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename11.C
@@ -1,5 +1,5 @@
// P0634R3
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
struct A
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename12.C b/gcc/testsuite/g++.dg/cpp2a/typename12.C
index 97962e53d65..99a235961a3 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename12.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename12.C
@@ -1,5 +1,5 @@
// P0634R3
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct W {
template<typename T>
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename13.C b/gcc/testsuite/g++.dg/cpp2a/typename13.C
index c439f726c5d..5aa5a516cd4 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename13.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename13.C
@@ -1,5 +1,5 @@
// P0634R3, PR c++/88358
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template <typename T>
int pi(T::your_pi);
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename14.C b/gcc/testsuite/g++.dg/cpp2a/typename14.C
index 4750db35cd8..8d82b6b8d34 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename14.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename14.C
@@ -1,5 +1,5 @@
// PR c++/88325
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename> struct A
{
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename15.C b/gcc/testsuite/g++.dg/cpp2a/typename15.C
index 9094190cec9..72476712562 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename15.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename15.C
@@ -1,5 +1,5 @@
// PR c++/88979
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
struct B {
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename16.C b/gcc/testsuite/g++.dg/cpp2a/typename16.C
index 7f4242a1dba..bb6d528201f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename16.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename16.C
@@ -1,5 +1,5 @@
// PR c++/90572
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct X { X(int); };
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename17.C b/gcc/testsuite/g++.dg/cpp2a/typename17.C
index bf534f1717f..5f8be8f9e01 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename17.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename17.C
@@ -1,5 +1,5 @@
// DR 2413 - typename in conversion-function-ids.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<class T> struct S {
operator T::X();
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename2.C b/gcc/testsuite/g++.dg/cpp2a/typename2.C
index 7c926177004..4a2a1cde53e 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename2.C
@@ -1,5 +1,5 @@
// P0634R3
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<class T> typename T::R f();
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename3.C b/gcc/testsuite/g++.dg/cpp2a/typename3.C
index e64aa0316ef..55ad378c1b1 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename3.C
@@ -1,5 +1,5 @@
// P0634R3
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<class T>
void f(int i)
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename4.C b/gcc/testsuite/g++.dg/cpp2a/typename4.C
index 69154e7daaf..fc65eee85cf 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename4.C
@@ -1,5 +1,5 @@
// P0634R3
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<class T>
struct A {
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename5.C b/gcc/testsuite/g++.dg/cpp2a/typename5.C
index 97c27adafcc..6913d088dce 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename5.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename5.C
@@ -1,5 +1,5 @@
// P0634R3
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct X {
template<typename T>
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename6.C b/gcc/testsuite/g++.dg/cpp2a/typename6.C
index e96e2ab802c..8b5a4533f8b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename6.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename6.C
@@ -1,5 +1,5 @@
// P0634R3
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// (5.2.1) simple-declaration or a function-definition in namespace scope
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename7.C b/gcc/testsuite/g++.dg/cpp2a/typename7.C
index 713db51d972..2354fafcfa0 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename7.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename7.C
@@ -1,5 +1,5 @@
// P0634R3
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// Not in namespace scope.
template<typename T>
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename8.C b/gcc/testsuite/g++.dg/cpp2a/typename8.C
index 3ebfde45ec5..afba0f83b31 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename8.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename8.C
@@ -1,5 +1,5 @@
// P0634R3
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
template<typename T>
struct S {
diff --git a/gcc/testsuite/g++.dg/cpp2a/typename9.C b/gcc/testsuite/g++.dg/cpp2a/typename9.C
index 7b1865222b3..70f9e3996f8 100644
--- a/gcc/testsuite/g++.dg/cpp2a/typename9.C
+++ b/gcc/testsuite/g++.dg/cpp2a/typename9.C
@@ -1,5 +1,5 @@
// P0634R3
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-options "-fconcepts" }
template <typename, typename> class A { class B; };
diff --git a/gcc/testsuite/g++.dg/cpp2a/ucn2.C b/gcc/testsuite/g++.dg/cpp2a/ucn2.C
index 2e6ce11d2e7..ee7011b4a3b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/ucn2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/ucn2.C
@@ -6,11 +6,11 @@ const char16_t *a = u"\U0001F914\u2753";
const char32_t *b = U"\U0001F914\u2753";
const char16_t *c = u"\uD802"; // { dg-error "is not a valid universal character" }
const char16_t *d = u"\U0000DFF0"; // { dg-error "is not a valid universal character" }
-const char16_t *e = u"\U00110000"; // { dg-error "is outside the UCS codespace" "" { target c++2a } }
+const char16_t *e = u"\U00110000"; // { dg-error "is outside the UCS codespace" "" { target c++20 } }
// { dg-error "converting UCN to execution character set" "" { target *-*-* } .-1 }
const char32_t *f = U"\uD802"; // { dg-error "is not a valid universal character" }
const char32_t *g = U"\U0000DFF0"; // { dg-error "is not a valid universal character" }
-const char32_t *h = U"\U00110001"; // { dg-error "is outside the UCS codespace" "" { target c++2a } }
+const char32_t *h = U"\U00110001"; // { dg-error "is outside the UCS codespace" "" { target c++20 } }
#if __cpp_unicode_characters >= 201411
const char8_t i = u8'\u00C0'; // { dg-error "character constant too long for its type" "" { target c++17 } }
#endif
@@ -22,9 +22,9 @@ const char8_t l = u8'ab'; // { dg-error "character constant too long for its ty
const char16_t m = u'ab'; // { dg-error "character constant too long for its type" }
const char32_t n = U'ab'; // { dg-error "character constant too long for its type" }
#if __cpp_unicode_characters >= 201411
-const char8_t o = u8'\U00110002'; // { dg-error "is outside the UCS codespace" "" { target c++2a } }
+const char8_t o = u8'\U00110002'; // { dg-error "is outside the UCS codespace" "" { target c++20 } }
// { dg-error "character constant too long for its type" "" { target c++17 } .-1 }
#endif
-const char16_t p = u'\U00110003'; // { dg-error "is outside the UCS codespace" "" { target c++2a } }
+const char16_t p = u'\U00110003'; // { dg-error "is outside the UCS codespace" "" { target c++20 } }
// { dg-error "converting UCN to execution character set" "" { target *-*-* } .-1 }
-const char32_t q = U'\U00110004'; // { dg-error "is outside the UCS codespace" "" { target c++2a } }
+const char32_t q = U'\U00110004'; // { dg-error "is outside the UCS codespace" "" { target c++20 } }
diff --git a/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad-neg.C b/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad-neg.C
index 437fa9b5ab8..b91e01ce0b3 100644
--- a/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad-neg.C
+++ b/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad-neg.C
@@ -1,7 +1,7 @@
// PR c++/88095
// Test class non-type template parameters for literal operator templates.
// Validate handling of failed class template argument deduction.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
using size_t = decltype(sizeof(int));
diff --git a/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad-neg2.C b/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad-neg2.C
index 89bb5d39d7d..067fdbac81e 100644
--- a/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad-neg2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad-neg2.C
@@ -1,7 +1,7 @@
// PR c++/88095
// Test class non-type template parameters for literal operator templates.
// Validate rejection of class template parameter packs.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
using size_t = decltype(sizeof(int));
diff --git a/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad.C b/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad.C
index f6877a960c9..e9421bc4072 100644
--- a/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad.C
+++ b/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-ctad.C
@@ -1,7 +1,7 @@
// PR c++/88095
// Test class non-type template parameters for literal operator templates.
// Validate support for class template argument deduction.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
namespace std {
using size_t = decltype(sizeof(int));
diff --git a/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-neg.C b/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-neg.C
index 8f7e3f29511..85b3fe7fc61 100644
--- a/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-neg.C
+++ b/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-neg.C
@@ -1,7 +1,7 @@
// PR c++/88095
// Test class non-type template parameters for literal operator templates.
// Validate that parameter packs are rejected.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct literal_class {
constexpr literal_class(...) { }
diff --git a/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-neg2.C b/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-neg2.C
index 71ba8f981a0..62cb86ae695 100644
--- a/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-neg2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-neg2.C
@@ -1,7 +1,7 @@
// PR c++/88095
// Test class non-type template parameters for literal operator templates.
// Validate that non-literal class types are rejected.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct non_literal_class {
constexpr non_literal_class(...) { }
diff --git a/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp.C b/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp.C
index dcaca3e4070..b7ef79d68a0 100644
--- a/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp.C
+++ b/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp.C
@@ -1,7 +1,7 @@
// PR c++/88095
// Test class non-type template parameters for literal operator templates.
// Validate basic support.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
struct literal_class {
constexpr literal_class(...) { }
diff --git a/gcc/testsuite/g++.dg/cpp2a/volatile1.C b/gcc/testsuite/g++.dg/cpp2a/volatile1.C
index e47591b13bc..7ea6b477ca2 100644
--- a/gcc/testsuite/g++.dg/cpp2a/volatile1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/volatile1.C
@@ -24,21 +24,21 @@ struct W {
W& operator=(volatile W&) volatile;
};
-volatile int // { dg-warning ".volatile.-qualified return type is deprecated" "" { target c++2a } }
-fn (volatile int i) // { dg-warning ".volatile.-qualified parameter is deprecated" "" { target c++2a } }
+volatile int // { dg-warning ".volatile.-qualified return type is deprecated" "" { target c++20 } }
+fn (volatile int i) // { dg-warning ".volatile.-qualified parameter is deprecated" "" { target c++20 } }
{
volatile int v = 10;
int *volatile p = nullptr;
// Pre/post ++/--.
- v++; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++2a } }
- ++v; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++2a } }
- v--; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++2a } }
- --v; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++2a } }
- p++; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++2a } }
- ++p; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++2a } }
- p--; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++2a } }
- --p; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++2a } }
+ v++; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++20 } }
+ ++v; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++20 } }
+ v--; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++20 } }
+ --v; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++20 } }
+ p++; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++20 } }
+ ++p; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++20 } }
+ p--; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++20 } }
+ --p; // { dg-warning "expression of .volatile.-qualified type is deprecated" "" { target c++20 } }
return v + i + *p;
}
@@ -55,45 +55,45 @@ fn2 ()
vi = 42;
vi = i;
vi = i = 42;
- i = vi = 42; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
- &(vi = i); // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
+ i = vi = 42; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
+ &(vi = i); // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
(vi = 42, 45);
- (i = vi = 42, 10); // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
+ (i = vi = 42, 10); // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
i = vi; // LHS not volatile.
i = (vi = i, 42);
static_cast<void>(vi = i);
- static_cast<void>(i = vi = 42); // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
+ static_cast<void>(i = vi = 42); // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
(void)(vi = i);
- (void)(i = vi = 42); // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
+ (void)(i = vi = 42); // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
// Unevaluated operand.
decltype(vi = 42) x = vi;
decltype(i = vi = 42) x3 = i;
// Compound assignments.
- vi += i; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
- vi -= i; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
- vi %= i; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
- vi ^= i; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
- vi |= i; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
- vi /= i; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
- vi = vi += 42; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
- vi += vi = 42; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
+ vi += i; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
+ vi -= i; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
+ vi %= i; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
+ vi ^= i; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
+ vi |= i; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
+ vi /= i; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
+ vi = vi += 42; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
+ vi += vi = 42; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
i *= vi;
- decltype(vi -= 42) x2 = vi; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
+ decltype(vi -= 42) x2 = vi; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
// Structured bindings.
int a[] = { 10, 5 };
const auto & [cxr, cyr] = a;
- const volatile auto & [cvxr, cvyr] = a; // { dg-warning ".volatile.-qualified structured binding is deprecated" "" { target c++2a } }
- volatile auto & [vxr, vyr] = a; // { dg-warning ".volatile.-qualified structured binding is deprecated" "" { target c++2a } }
+ const volatile auto & [cvxr, cvyr] = a; // { dg-warning ".volatile.-qualified structured binding is deprecated" "" { target c++20 } }
+ volatile auto & [vxr, vyr] = a; // { dg-warning ".volatile.-qualified structured binding is deprecated" "" { target c++20 } }
}
void
fn3 ()
{
volatile int i, j, k = 0;
- i = j = k; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
+ i = j = k; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
ACCESS_ONCE(j);
@@ -102,13 +102,13 @@ fn3 ()
volatile U u;
u.c = 42;
- i = u.c = 42; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
- u.c += 42; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
+ i = u.c = 42; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
+ u.c += 42; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
volatile T t;
t.a = 3;
- j = t.a = 3; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
- t.a += 3; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
+ j = t.a = 3; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
+ t.a += 3; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
volatile int *src = &i;
*src; // No assignment, don't warn.
@@ -130,8 +130,8 @@ void raccoon ()
{
volatile T t, u;
t = 42;
- u = t = 42; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
- t &= 42; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++2a } }
+ u = t = 42; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
+ t &= 42; // { dg-warning "assignment with .volatile.-qualified left operand is deprecated" "" { target c++20 } }
}
void
diff --git a/gcc/testsuite/g++.dg/cpp2a/volatile2.C b/gcc/testsuite/g++.dg/cpp2a/volatile2.C
index 1a7889a6a8c..92526b5058b 100644
--- a/gcc/testsuite/g++.dg/cpp2a/volatile2.C
+++ b/gcc/testsuite/g++.dg/cpp2a/volatile2.C
@@ -1,5 +1,5 @@
// PR c++/91361 - P1152R4: Deprecating some uses of volatile.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-options "-Wno-volatile" }
#define ACCESS_ONCE(x) (*(volatile __typeof(x) *)&(x))
diff --git a/gcc/testsuite/g++.dg/cpp2a/volatile4.C b/gcc/testsuite/g++.dg/cpp2a/volatile4.C
index 2148cdeb3d1..e22ee6c9568 100644
--- a/gcc/testsuite/g++.dg/cpp2a/volatile4.C
+++ b/gcc/testsuite/g++.dg/cpp2a/volatile4.C
@@ -1,5 +1,5 @@
// PR c++/91361 - P1152R4: Deprecating some uses of volatile.
-// { dg-do compile { target c++2a } }
+// { dg-do compile { target c++20 } }
// { dg-options "-Wno-deprecated" }
#define ACCESS_ONCE(x) (*(volatile __typeof(x) *)&(x))
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C b/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C
index 12181d0fdb0..8b25475d25b 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C
@@ -1,7 +1,6 @@
// PR c++/61433
// { dg-do compile { target c++11 } }
-// { dg-options "-O -fcompare-debug -fno-inline -fno-ipa-pure-const -fipa-sra" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-O -fcompare-debug -fno-inline -fno-ipa-pure-const -fipa-sra -Wno-return-type" }
template <class T>
struct A
diff --git a/gcc/testsuite/g++.dg/delayedfold/fwrapv1.C b/gcc/testsuite/g++.dg/delayedfold/fwrapv1.C
index 412535ce1ee..6d374802f00 100644
--- a/gcc/testsuite/g++.dg/delayedfold/fwrapv1.C
+++ b/gcc/testsuite/g++.dg/delayedfold/fwrapv1.C
@@ -1,5 +1,6 @@
// PR c++/69631
// { dg-options -fwrapv }
+// { dg-skip-if "" int16 }
struct C {
static const unsigned short max = static_cast<unsigned short>((32767 * 2 + 1));
diff --git a/gcc/testsuite/g++.dg/diagnostic/bad-binary-ops.C b/gcc/testsuite/g++.dg/diagnostic/bad-binary-ops.C
index fab5849dfc7..ebbf3001055 100644
--- a/gcc/testsuite/g++.dg/diagnostic/bad-binary-ops.C
+++ b/gcc/testsuite/g++.dg/diagnostic/bad-binary-ops.C
@@ -33,10 +33,10 @@ int test_2 (void)
~~~~~~~~~~~~~~~~
|
s
- + some_other_function ());
- ^ ~~~~~~~~~~~~~~~~~~~~~~
- |
- t
+ + some_other_function ());
+ ^ ~~~~~~~~~~~~~~~~~~~~~~
+ |
+ t
{ dg-end-multiline-output "" } */
}
diff --git a/gcc/testsuite/g++.dg/diagnostic/enum2.C b/gcc/testsuite/g++.dg/diagnostic/enum2.C
new file mode 100644
index 00000000000..e6e8320e3b6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/diagnostic/enum2.C
@@ -0,0 +1,10 @@
+// PR c++/95288
+
+void f()
+{
+ enum X
+ { // { dg-message "to match this" }
+ a. // { dg-error "expected" }
+ b
+ }; // { dg-error "extra" "" { target c++98_only } }
+} // { dg-error "expected" }
diff --git a/gcc/testsuite/g++.dg/diagnostic/mem-init1.C b/gcc/testsuite/g++.dg/diagnostic/mem-init1.C
new file mode 100644
index 00000000000..b749c72cd8b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/diagnostic/mem-init1.C
@@ -0,0 +1,29 @@
+// PR c++/94024
+// { dg-do compile }
+
+struct A {
+ A()
+ : a() // { dg-error "reference type" }
+ , b(1) // { dg-error "incompatible" }
+ , c(0) // { dg-bogus "" }
+ {}
+
+ int &a;
+ int b[1];
+ char c;
+};
+
+template<typename T, typename U>
+struct B {
+ B()
+ : a() // { dg-error "reference type" }
+ , b(1) // { dg-error "incompatible" }
+ , c(0) // { dg-bogus "" }
+ {}
+
+ T a;
+ U b;
+ char c;
+};
+
+B<int&, int[1]> b;
diff --git a/gcc/testsuite/g++.dg/diagnostic/pr96328.C b/gcc/testsuite/g++.dg/diagnostic/pr96328.C
new file mode 100644
index 00000000000..de5f9adb262
--- /dev/null
+++ b/gcc/testsuite/g++.dg/diagnostic/pr96328.C
@@ -0,0 +1,4 @@
+// PR c++/96328
+// { dg-do compile }
+friend // { dg-error "'friend' used outside of class" }
+// { dg-prune-output "expected unqualified-id at end of input" }
diff --git a/gcc/testsuite/g++.dg/diagnostic/unclosed-extern-c.C b/gcc/testsuite/g++.dg/diagnostic/unclosed-extern-c.C
index 44f538e33ec..f905e4f3cc9 100644
--- a/gcc/testsuite/g++.dg/diagnostic/unclosed-extern-c.C
+++ b/gcc/testsuite/g++.dg/diagnostic/unclosed-extern-c.C
@@ -8,5 +8,6 @@ template <typename T> // { dg-error "template with C linkage" }
void bar (void);
// { dg-message "1: 'extern .C.' linkage started here" "" { target *-*-* } open_extern_c }
-void test (void); /* { dg-error "17: expected '.' at end of input" } */
+void test (void);
// { message "12: to match this '.'" "" { target *-*-* } open_extern_c }
+/* { dg-error "-:expected '.' at end of input" "" { target *-*-* } .+1 } */
diff --git a/gcc/testsuite/g++.dg/diagnostic/unclosed-function.C b/gcc/testsuite/g++.dg/diagnostic/unclosed-function.C
index e1e15504172..4d841d5c6f4 100644
--- a/gcc/testsuite/g++.dg/diagnostic/unclosed-function.C
+++ b/gcc/testsuite/g++.dg/diagnostic/unclosed-function.C
@@ -1,3 +1,4 @@
void test (void)
{ /* { dg-message "1: to match this '.'" } */
- int filler; /* { dg-error "13: expected '.' at end of input" } */
+ int filler;
+ /* { dg-error "-:expected '.' at end of input" "" { target *-*-* } .+1 } */
diff --git a/gcc/testsuite/g++.dg/diagnostic/unclosed-namespace.C b/gcc/testsuite/g++.dg/diagnostic/unclosed-namespace.C
index ff113226cc7..0887bc1e813 100644
--- a/gcc/testsuite/g++.dg/diagnostic/unclosed-namespace.C
+++ b/gcc/testsuite/g++.dg/diagnostic/unclosed-namespace.C
@@ -1,2 +1,3 @@
namespace unclosed { /* { dg-message "20: to match this '.'" } */
-int filler; /* { dg-error "11: expected '.' at end of input" } */
+int filler;
+/* { dg-error "-:expected '.' at end of input" "" { target *-*-* } .+1 } */
diff --git a/gcc/testsuite/g++.dg/diagnostic/unclosed-struct.C b/gcc/testsuite/g++.dg/diagnostic/unclosed-struct.C
index 8c206bbecc4..e68e5996204 100644
--- a/gcc/testsuite/g++.dg/diagnostic/unclosed-struct.C
+++ b/gcc/testsuite/g++.dg/diagnostic/unclosed-struct.C
@@ -1,3 +1,3 @@
struct unclosed { /* { dg-message "17: to match this '.'" } */
- int dummy; /* { dg-error "12: expected '.' at end of input" } */
- // { dg-error "expected unqualified-id at end of input" "" { target *-*-* } .-1 }
+ int dummy;
+ // { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/eh/builtin10.C b/gcc/testsuite/g++.dg/eh/builtin10.C
index 8c48e3de6d3..6c34f1f6d5c 100644
--- a/gcc/testsuite/g++.dg/eh/builtin10.C
+++ b/gcc/testsuite/g++.dg/eh/builtin10.C
@@ -2,12 +2,12 @@
// { dg-do compile }
extern "C" void __cxa_throw (void *, void *, void (*) (void *));
-extern "C" float __cxa_get_exception_ptr (void *); // { dg-error "declared incorrectly" }
-extern "C" void *__cxa_begin_catch (void *);
+extern "C" float __cxa_get_exception_ptr (void *) throw (); // { dg-message "previous declaration" }
+extern "C" void *__cxa_begin_catch (void *) throw ();
extern "C" void __cxa_end_catch ();
extern "C" void __cxa_rethrow ();
-extern "C" void *__cxa_allocate_exception (__SIZE_TYPE__);
-extern "C" int __cxa_free_exception (void *); // { dg-error "declared incorrectly" }
+extern "C" void *__cxa_allocate_exception (__SIZE_TYPE__) throw ();
+extern "C" int __cxa_free_exception (void *) throw (); // { dg-message "previous declaration" }
struct S { S (); S (const S &); ~S (); };
@@ -15,13 +15,13 @@ int
foo (int x)
{
if (x > 27)
- throw 19;
+ throw 19; // { dg-error "conflicting" }
try
{
if (x > 15)
throw S ();
}
- catch (S s)
+ catch (S s) // { dg-error "conflicting" }
{
throw;
}
diff --git a/gcc/testsuite/g++.dg/eh/builtin11.C b/gcc/testsuite/g++.dg/eh/builtin11.C
index fb1d4f38ab3..abc8c1af535 100644
--- a/gcc/testsuite/g++.dg/eh/builtin11.C
+++ b/gcc/testsuite/g++.dg/eh/builtin11.C
@@ -1,13 +1,13 @@
// PR c++/88482
// { dg-do compile }
-extern "C" void __cxa_throw (float, void *, void (*) (void *)); // { dg-error "declared incorrectly" }
-extern "C" void *__cxa_get_exception_ptr (void *);
-extern "C" void *__cxa_begin_catch (int); // { dg-error "declared incorrectly" }
-extern "C" void __cxa_end_catch (long long); // { dg-error "declared incorrectly" }
-extern "C" void __cxa_rethrow (int); // { dg-error "declared incorrectly" }
-extern "C" void *__cxa_allocate_exception (void *); // { dg-error "declared incorrectly" }
-extern "C" void __cxa_free_exception (void *);
+extern "C" void __cxa_throw (float, void *, void (*) (void *)); // { dg-message "previous declaration" }
+extern "C" void *__cxa_get_exception_ptr (void *) throw ();
+extern "C" void *__cxa_begin_catch (int) throw (); // { dg-message "previous declaration" }
+extern "C" void __cxa_end_catch (long long) throw (); // { dg-message "previous declaration" }
+extern "C" void __cxa_rethrow (int); // { dg-message "previous declaration" }
+extern "C" void *__cxa_allocate_exception (void *) throw (); // { dg-message "previous declaration" }
+extern "C" void __cxa_free_exception (void *) throw ();
struct S { S (); S (const S &); ~S (); };
@@ -15,15 +15,15 @@ int
foo (int x)
{
if (x > 27)
- throw 19;
+ throw 19; // { dg-error "conflicting" }
try
{
if (x > 15)
throw S ();
}
- catch (S s)
+ catch (S s) // { dg-error "conflicting" }
{
- throw;
+ throw; // { dg-error "conflicting" }
}
return x + 3;
}
diff --git a/gcc/testsuite/g++.dg/eh/builtin5.C b/gcc/testsuite/g++.dg/eh/builtin5.C
index eec6f2509a5..1ab9c749867 100644
--- a/gcc/testsuite/g++.dg/eh/builtin5.C
+++ b/gcc/testsuite/g++.dg/eh/builtin5.C
@@ -2,12 +2,12 @@
// { dg-do compile }
extern "C" void __cxa_throw (void *, void *, void (*) (void *));
-extern "C" void *__cxa_get_exception_ptr (void *);
-extern "C" void *__cxa_begin_catch (void *);
+extern "C" void *__cxa_get_exception_ptr (void *) throw ();
+extern "C" void *__cxa_begin_catch (void *) throw ();
extern "C" void __cxa_end_catch ();
extern "C" void __cxa_rethrow ();
-extern "C" void *__cxa_allocate_exception (__SIZE_TYPE__);
-extern "C" void __cxa_free_exception (void *);
+extern "C" void *__cxa_allocate_exception (__SIZE_TYPE__) throw ();
+extern "C" void __cxa_free_exception (void *) throw ();
struct S { S (); S (const S &); ~S (); };
diff --git a/gcc/testsuite/g++.dg/eh/builtin6.C b/gcc/testsuite/g++.dg/eh/builtin6.C
index a70b406cf84..c05abdc8f51 100644
--- a/gcc/testsuite/g++.dg/eh/builtin6.C
+++ b/gcc/testsuite/g++.dg/eh/builtin6.C
@@ -1,12 +1,12 @@
// PR c++/88482
// { dg-do compile }
-float __cxa_throw; // { dg-error "declared incorrectly" }
+float __cxa_throw; // { dg-message "previous declaration" }
extern "C" void *__cxa_get_exception_ptr (void *);
-float __cxa_begin_catch; // { dg-error "declared incorrectly" }
-float __cxa_end_catch; // { dg-error "declared incorrectly" }
-float __cxa_rethrow; // { dg-error "declared incorrectly" }
-float __cxa_allocate_exception; // { dg-error "declared incorrectly" }
+float __cxa_begin_catch; // { dg-message "previous declaration" }
+float __cxa_end_catch; // { dg-message "previous declaration" }
+float __cxa_rethrow; // { dg-message "previous declaration" }
+float __cxa_allocate_exception; // { dg-message "previous declaration" }
extern "C" void __cxa_free_exception (void *);
struct S { S (); S (const S &); ~S (); };
@@ -15,15 +15,15 @@ int
foo (int x)
{
if (x > 27)
- throw 19;
+ throw 19; // { dg-error "redeclared" }
try
{
if (x > 15)
throw S ();
}
- catch (S s)
+ catch (S s) // { dg-error "redeclared" }
{
- throw;
+ throw; // { dg-error "redeclared" }
}
return x + 3;
}
diff --git a/gcc/testsuite/g++.dg/eh/builtin7.C b/gcc/testsuite/g++.dg/eh/builtin7.C
index ad9c7f6802d..0ef279d09c1 100644
--- a/gcc/testsuite/g++.dg/eh/builtin7.C
+++ b/gcc/testsuite/g++.dg/eh/builtin7.C
@@ -2,12 +2,12 @@
// { dg-do compile }
extern "C" void __cxa_throw (void *, void *, void (*) (void *));
-int __cxa_get_exception_ptr; // { dg-error "declared incorrectly" }
-extern "C" void *__cxa_begin_catch (void *);
+int __cxa_get_exception_ptr; // { dg-message "previous declaration" }
+extern "C" void *__cxa_begin_catch (void *) throw ();
extern "C" void __cxa_end_catch ();
extern "C" void __cxa_rethrow ();
-extern "C" void *__cxa_allocate_exception (__SIZE_TYPE__);
-int __cxa_free_exception; // { dg-error "declared incorrectly" }
+extern "C" void *__cxa_allocate_exception (__SIZE_TYPE__) throw ();
+int __cxa_free_exception; // { dg-message "previous declaration" }
struct S { S (); S (const S &); ~S (); };
@@ -15,13 +15,13 @@ int
foo (int x)
{
if (x > 27)
- throw 19;
+ throw 19; // { dg-error "redeclared" }
try
{
if (x > 15)
throw S ();
}
- catch (S s)
+ catch (S s) // { dg-error "redeclared" }
{
throw;
}
diff --git a/gcc/testsuite/g++.dg/eh/builtin9.C b/gcc/testsuite/g++.dg/eh/builtin9.C
index acd1a5e7dd6..591a622630c 100644
--- a/gcc/testsuite/g++.dg/eh/builtin9.C
+++ b/gcc/testsuite/g++.dg/eh/builtin9.C
@@ -1,13 +1,13 @@
// PR c++/88482
// { dg-do compile }
-extern "C" int __cxa_throw (void *, void *, void (*) (void *)); // { dg-error "declared incorrectly" }
-extern "C" void *__cxa_get_exception_ptr (void *);
-extern "C" double __cxa_begin_catch (void *); // { dg-error "declared incorrectly" }
-extern "C" long *__cxa_end_catch (); // { dg-error "declared incorrectly" }
-extern "C" char __cxa_rethrow (); // { dg-error "declared incorrectly" }
-extern "C" void __cxa_allocate_exception (__SIZE_TYPE__); // { dg-error "declared incorrectly" }
-extern "C" void __cxa_free_exception (void *);
+extern "C" int __cxa_throw (void *, void *, void (*) (void *)); // { dg-message "previous declaration" }
+extern "C" void *__cxa_get_exception_ptr (void *) throw ();
+extern "C" double __cxa_begin_catch (void *) throw (); // { dg-message "previous declaration" }
+extern "C" long *__cxa_end_catch () throw (); // { dg-message "previous declaration" }
+extern "C" char __cxa_rethrow (); // { dg-message "previous declaration" }
+extern "C" void __cxa_allocate_exception (__SIZE_TYPE__) throw ();// { dg-message "previous declaration" }
+extern "C" void __cxa_free_exception (void *) throw ();
struct S { S (); S (const S &); ~S (); };
@@ -15,15 +15,15 @@ int
foo (int x)
{
if (x > 27)
- throw 19;
+ throw 19; // { dg-error "conflicting" }
try
{
if (x > 15)
throw S ();
}
- catch (S s)
+ catch (S s) // { dg-error "conflicting" }
{
- throw;
+ throw; // { dg-error "conflicting" }
}
return x + 3;
}
diff --git a/gcc/testsuite/g++.dg/expr/bitfield9.C b/gcc/testsuite/g++.dg/expr/bitfield9.C
index 177f65b8800..2e309c34167 100644
--- a/gcc/testsuite/g++.dg/expr/bitfield9.C
+++ b/gcc/testsuite/g++.dg/expr/bitfield9.C
@@ -4,11 +4,13 @@
extern "C" void abort();
+typedef int int32_t __attribute__((mode (__SI__)));
+
struct S {
long long i : 32;
};
-void f(int i, int j) {
+void f(int32_t i, int32_t j) {
if (i != 0xabcdef01)
abort();
if (j != 0)
diff --git a/gcc/testsuite/g++.dg/expr/composite-ptr-type.C b/gcc/testsuite/g++.dg/expr/composite-ptr-type.C
new file mode 100644
index 00000000000..a7c301d7cb0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/composite-ptr-type.C
@@ -0,0 +1,72 @@
+// DR 1512
+// Test the composite pointer type of two operands.
+// { dg-do compile { target c++11 } }
+
+using nullptr_t = decltype(nullptr);
+
+template <class T, class U> struct same;
+template <class T> struct same<T,T> { };
+
+template<typename T>
+T fn ()
+{
+}
+
+// Check that the composite pointer type of T and U is RES.
+template<typename T, typename U, typename RES>
+void test ()
+{
+ same<decltype(true ? fn<T>() : fn<U>()), RES> s;
+}
+
+struct A { };
+struct B : A { };
+
+// Test [expr.type]/3.
+void
+foo ()
+{
+ // if both p1 and p2 are null pointer constants -> std::nullptr_­t.
+ test<nullptr_t, nullptr_t, nullptr_t>();
+
+ // if either p1 or p2 is a null pointer constant -> T2 or T1.
+ test<nullptr_t, const char **, const char **>();
+ test<const char **, nullptr_t, const char **>();
+
+ // if T1 or T2 is 'pointer to cv1 void' and the other type is 'pointer
+ // to cv2 T', where T is an object type or void -> 'pointer to cv12 void',
+ // where cv12 is the union of cv1 and cv2.
+ test<const int *, volatile void *, const volatile void *>();
+ test<const void *, volatile int *, const volatile void *>();
+
+ test<int *, const int *, const int *>();
+ // Make sure that we propagate 'const' here as per [conv.qual]/3.3.
+ test<int **, const int **, const int *const *>();
+ test<int *volatile *, const int **, const int *const volatile *>();
+ test<int **, volatile int **, volatile int *const *>();
+
+ // if T1 is 'pointer to cv1 C1' and T2 is 'pointer to cv2 C2', where C1 is
+ // reference-related to C2 or C2 is reference-related to C1 -> the cv-combined
+ // type of T1 and T2 or the cv-combined type of T2 and T1, respectively.
+ test<const A*, volatile B*, const volatile A *>();
+ test<const B*, volatile A*, const volatile A *>();
+
+ test<const int *A::*, volatile int *A::*, const volatile int *const A::*>();
+ // FIXME: This doesn't work if they're reference-related but not same.
+ //test<const int *A::*, volatile int *B::*, const volatile int *const B::*>();
+ //test<const int *B::*, volatile int *A::*, const volatile int *const B::*>();
+
+ // if T1 or T2 is 'pointer to noexcept function' and the other type is
+ // 'pointer to function', where the function types are otherwise the same
+ // -> 'pointer to function'.
+ test<int (*)() noexcept, int (*)(), int (*)()>();
+ test<int (*)(), int (*)() noexcept, int (*)()>();
+
+ // if T1 or T2 is 'pointer to member of C1 of type function', the other type
+ // is 'pointer to member of C2 of type noexcept function', and C1 is
+ // reference-related to C2 or C2 is reference-related to C1, where the
+ // function types are otherwise the same -> 'pointer to member of C2 of type
+ // function' or 'pointer to member of C1 of type function', respectively.
+ test<int (A::*)() noexcept, int (A::*)(), int (A::*)()>();
+ test<int (A::*)(), int (A::*)() noexcept, int (A::*)()>();
+}
diff --git a/gcc/testsuite/g++.dg/expr/ptr-comp1.C b/gcc/testsuite/g++.dg/expr/ptr-comp1.C
new file mode 100644
index 00000000000..f2434cbc87e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/ptr-comp1.C
@@ -0,0 +1,32 @@
+// DR 1512
+// PR c++/87699
+// { dg-do compile { target c++11 } }
+
+/* Relational comparisons between null pointer constants and pointers are now
+ ill-formed. */
+
+void
+f (char *p)
+{
+ if (p > 0) { } // { dg-error "ordered comparison of pointer with integer zero" }
+ if (p >= 0) { } // { dg-error "ordered comparison of pointer with integer zero" }
+ if (p < 0) { } // { dg-error "ordered comparison of pointer with integer zero" }
+ if (p <= 0) { } // { dg-error "ordered comparison of pointer with integer zero" }
+ if (p > nullptr) { } // { dg-error "ordered comparison of pointer with integer zero" }
+ if (p >= nullptr) { } // { dg-error "ordered comparison of pointer with integer zero" }
+ if (p < nullptr) { } // { dg-error "ordered comparison of pointer with integer zero" }
+ if (p <= nullptr) { } // { dg-error "ordered comparison of pointer with integer zero" }
+}
+
+void
+f2 (char *p)
+{
+ if (0 > p) { } // { dg-error "ordered comparison of pointer with integer zero" }
+ if (0 >= p) { } // { dg-error "ordered comparison of pointer with integer zero" }
+ if (0 < p) { } // { dg-error "ordered comparison of pointer with integer zero" }
+ if (0 <= p) { } // { dg-error "ordered comparison of pointer with integer zero" }
+ if (nullptr > p) { } // { dg-error "ordered comparison of pointer with integer zero" }
+ if (nullptr >= p) { } // { dg-error "ordered comparison of pointer with integer zero" }
+ if (nullptr < p) { } // { dg-error "ordered comparison of pointer with integer zero" }
+ if (nullptr <= p) { } // { dg-error "ordered comparison of pointer with integer zero" }
+}
diff --git a/gcc/testsuite/g++.dg/expr/ptr-comp2.C b/gcc/testsuite/g++.dg/expr/ptr-comp2.C
new file mode 100644
index 00000000000..da5b09af8ad
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/ptr-comp2.C
@@ -0,0 +1,14 @@
+// DR 1512
+// PR c++/87699
+// { dg-do compile { target c++11 } }
+
+template<class T, decltype((((T*) 0) < nullptr), true) = false> // { dg-error "ordered comparison" }
+bool test(T*)
+{
+ return true;
+}
+
+int main()
+{
+ test((int*)(nullptr)); // { dg-error "no matching function" }
+}
diff --git a/gcc/testsuite/g++.dg/expr/ptr-comp3.C b/gcc/testsuite/g++.dg/expr/ptr-comp3.C
new file mode 100644
index 00000000000..e1bc3c56d4d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/ptr-comp3.C
@@ -0,0 +1,15 @@
+// DR 1512
+// PR c++/87699
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wall -Wextra -pedantic-errors" }
+
+/* Comparisons between pointer types with different cv-quals are now OK. */
+
+void
+f (int **p1, const int **p2)
+{
+ if (p1 == p2) { }
+ if (p1 != p2) { }
+ if (p2 == p1) { }
+ if (p2 != p1) { }
+}
diff --git a/gcc/testsuite/g++.dg/ext/attr-access.C b/gcc/testsuite/g++.dg/ext/attr-access.C
index fcb54cd8861..3b9c1a36e30 100644
--- a/gcc/testsuite/g++.dg/ext/attr-access.C
+++ b/gcc/testsuite/g++.dg/ext/attr-access.C
@@ -39,7 +39,7 @@ void call_rop1_ror2_O0 (void)
void call_rdwrp1_rdwrr2_O0 (void)
{
- int32_t x[1];
+ int32_t x[1] = { };
rdwrp1_rdwrr2 (x, x[0]);
rdwrp1_rdwrr2 (x, x[1]); // { dg-warning "writing 4 bytes into a region of size 0" }
@@ -78,7 +78,7 @@ void call_rop1_ror2_O1 (void)
void call_rdwrp1_rdwrr2_O1 (void)
{
- int32_t x[1];
+ int32_t x[1] = { };
int32_t *p0 = x, &r0 = x[0];
int32_t *p1 = (int32_t*)((char*)p0 + 1);
int32_t &r2 = *(int32_t*)((char*)p1 + 1);
diff --git a/gcc/testsuite/g++.dg/ext/attr-nonnull.C b/gcc/testsuite/g++.dg/ext/attr-nonnull.C
index 5ef754ee377..c448bb07971 100644
--- a/gcc/testsuite/g++.dg/ext/attr-nonnull.C
+++ b/gcc/testsuite/g++.dg/ext/attr-nonnull.C
@@ -21,11 +21,11 @@ f<float>(float*, float*, float*);
void test_nonnull (void)
{
- f<void>(0, 0, 0); // { dg-warning "null argument where non-null required \\\(argument 1\\\)" }
+ f<void>(0, 0, 0); // { dg-warning "argument 1 null where non-null expected" }
- f<int>(0, 0, 0); // { dg-bogus "null argument" }
+ f<int>(0, 0, 0); // { dg-bogus "null" }
f<float>(0, 0, 0);
- // { dg-bogus "null argument where non-null required \\\(argument 1\\\)" "" { target *-*-* } .-1 }
- // { dg-warning "null argument where non-null required \\\(argument 3\\\)" "" { target *-*-* } .-2 }
+ // { dg-bogus "argument 1 null where non-null expected" "" { target *-*-* } .-1 }
+ // { dg-warning "argument 3 null where non-null expected" "" { target *-*-* } .-2 }
}
diff --git a/gcc/testsuite/g++.dg/ext/attr-parm-1.C b/gcc/testsuite/g++.dg/ext/attr-parm-1.C
new file mode 100644
index 00000000000..681a652de1f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/attr-parm-1.C
@@ -0,0 +1,11 @@
+// { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ia32 || lp64 } } } }
+// PR 94946
+class a {
+#ifdef __LP64__
+ template <typename b> a(b(__attribute__((sysv_abi)) *c)());
+ template <typename b> a(b(__attribute__((ms_abi)) *c)());
+#else
+ template <typename b> a(b (*)());
+ template <typename b> a(b(__attribute__((fastcall)) *c)());
+#endif
+};
diff --git a/gcc/testsuite/g++.dg/ext/attrib49.C b/gcc/testsuite/g++.dg/ext/attrib49.C
index 99c6154f1a5..d0ba738494a 100644
--- a/gcc/testsuite/g++.dg/ext/attrib49.C
+++ b/gcc/testsuite/g++.dg/ext/attrib49.C
@@ -10,11 +10,11 @@ void (foo::*g) (int *) __attribute__ ((nonnull (2)));
void
fun1 (void (foo::*f) (int *) __attribute__ ((nonnull (2))))
{
- (x.*f) ((int *) 0); // { dg-warning "null argument" }
+ (x.*f) ((int *) 0); // { dg-warning "argument 1 null" }
}
void
fun2 (void (foo::*f) () __attribute__ ((nonnull, unused))) // { dg-bogus "unused" }
{
- (x.*g) ((int *) 0); // { dg-warning "null argument" }
+ (x.*g) ((int *) 0); // { dg-warning "argument 1 null" }
}
diff --git a/gcc/testsuite/g++.dg/ext/attribute-test-1.C b/gcc/testsuite/g++.dg/ext/attribute-test-1.C
index 93e08d7ef89..97579035355 100644
--- a/gcc/testsuite/g++.dg/ext/attribute-test-1.C
+++ b/gcc/testsuite/g++.dg/ext/attribute-test-1.C
@@ -4,22 +4,24 @@
extern "C" void abort();
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
+
#define vector __attribute__((vector_size(16)))
struct Constants {
- inline vector unsigned int deadbeef(void) const {
- return (vector unsigned int){0xdeadbeef, 0xabababab, 0x55555555, 0x12345678};
+ inline vector uint32_t deadbeef(void) const {
+ return (vector uint32_t){0xdeadbeef, 0xabababab, 0x55555555, 0x12345678};
};
};
-inline vector unsigned int const_deadbeef(Constants &C)
+inline vector uint32_t const_deadbeef(Constants &C)
{
return C.deadbeef();
}
union u {
- unsigned int f[4];
- vector unsigned int v;
+ uint32_t f[4];
+ vector uint32_t v;
} data;
int main()
diff --git a/gcc/testsuite/g++.dg/ext/bitfield1.C b/gcc/testsuite/g++.dg/ext/bitfield1.C
index 25c90df4191..91019dba52a 100644
--- a/gcc/testsuite/g++.dg/ext/bitfield1.C
+++ b/gcc/testsuite/g++.dg/ext/bitfield1.C
@@ -2,9 +2,11 @@
// { dg-do link }
// { dg-options "" }
+typedef int int32_t __attribute__((mode (__SI__)));
+
struct S
{
- signed int a:17;
+ int32_t a:17;
} x;
typedef typeof (x.a) foo;
@@ -15,7 +17,7 @@ T* inc(T* p) { return p+1; }
int main ()
{
foo x[2] = { 1,2 };
- int y[2] = { 1,2 };
+ int32_t y[2] = { 1,2 };
*inc(x);
*inc(y);
return 0;
diff --git a/gcc/testsuite/g++.dg/ext/builtin-has-attribute.C b/gcc/testsuite/g++.dg/ext/builtin-has-attribute.C
new file mode 100644
index 00000000000..3438dd59ba3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/builtin-has-attribute.C
@@ -0,0 +1,8 @@
+// PR c++/90915
+// { dg-do compile { target c++11 } }
+
+template<typename T>
+void foo ()
+{
+ static_assert(!__builtin_has_attribute(T::a, aligned), ""); // { dg-message "sorry, unimplemented: .__builtin_has_attribute. with dependent argument not supported yet" }
+}
diff --git a/gcc/testsuite/g++.dg/ext/fixed1.C b/gcc/testsuite/g++.dg/ext/fixed1.C
index 5a479d6891a..92e3184ea59 100644
--- a/gcc/testsuite/g++.dg/ext/fixed1.C
+++ b/gcc/testsuite/g++.dg/ext/fixed1.C
@@ -6,3 +6,5 @@ template<int> struct A {};
template<typename> struct B : A<sizeof(0=0r)> {}; // { dg-error "not supported" }
template<typename> struct C : A<sizeof(0=0r)> {}; // { dg-error "not supported" }
+
+// { dg-prune-output "template argument" }
diff --git a/gcc/testsuite/g++.dg/ext/flexary13.C b/gcc/testsuite/g++.dg/ext/flexary13.C
index 7c67d09ee5a..f0603f9a261 100644
--- a/gcc/testsuite/g++.dg/ext/flexary13.C
+++ b/gcc/testsuite/g++.dg/ext/flexary13.C
@@ -7,10 +7,12 @@
__FILE__, __LINE__, STR(exp)), \
__builtin_abort ()))
-struct Ax { int n, a[]; };
-struct AAx { int i; Ax ax; };
+typedef int int32_t __attribute__((mode (__SI__)));
-int i = 12345678;
+struct Ax { int32_t n, a[]; };
+struct AAx { int32_t i; Ax ax; };
+
+int32_t i = 12345678;
int main ()
{
@@ -44,7 +46,7 @@ int main ()
ASSERT (s.n == 456 && s.a [0] == i);
}
{
- int j = i + 1, k = j + 1;
+ int32_t j = i + 1, k = j + 1;
static Ax s =
{ 3, { i, j, k } }; // dg-warning "initialization of a flexible array member" }
ASSERT (s.n == 3 && s.a [0] == i && s.a [1] == j && s.a [2] == k);
diff --git a/gcc/testsuite/g++.dg/ext/flexary37.C b/gcc/testsuite/g++.dg/ext/flexary37.C
new file mode 100644
index 00000000000..ceb5053de2e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/flexary37.C
@@ -0,0 +1,15 @@
+// PR c++/92427
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
+
+class C {
+private:
+ int a; int b;
+public:
+ C(int A, int B) : a(A), b(B) { }
+ ~C() { }
+};
+
+struct y { // { dg-error "unknown array size in delete" }
+ int a; C b[];
+} y = { 1, { { 2, 3 } } }; // { dg-error "unknown array size in delete" }
diff --git a/gcc/testsuite/g++.dg/ext/pr84598.C b/gcc/testsuite/g++.dg/ext/pr84598.C
index 05016b82b8c..8b78e0fddea 100644
--- a/gcc/testsuite/g++.dg/ext/pr84598.C
+++ b/gcc/testsuite/g++.dg/ext/pr84598.C
@@ -1,3 +1,4 @@
// { dg-options "-fpermissive -w" }
-template<int b> __attribute__ a([] { class c, __attribute__(vector_size(operator+()))) d; // { dg-error "expected" }
+template<int b> __attribute__ a([] { class c, __attribute__(vector_size(operator+()))) d; // { dg-error "" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/ext/pr85503.C b/gcc/testsuite/g++.dg/ext/pr85503.C
index 7e17943e353..832952a8774 100644
--- a/gcc/testsuite/g++.dg/ext/pr85503.C
+++ b/gcc/testsuite/g++.dg/ext/pr85503.C
@@ -138,6 +138,7 @@ struct ad< ai< cr, ag, ah, cu, ct, cw > > {
};
template < typename, int ag, int ah, int, int, int >
class ai : public af< ai< double, ag, ah > > {
+public:
typedef ai cv;
};
template < typename bk, typename ce, typename cf >
diff --git a/gcc/testsuite/g++.dg/ext/tmplattr10.C b/gcc/testsuite/g++.dg/ext/tmplattr10.C
new file mode 100644
index 00000000000..46caa070098
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/tmplattr10.C
@@ -0,0 +1,52 @@
+// PR c++/95222
+// { dg-do compile { target { { { i?86-*-* x86_64-*-* } && ia32 } && c++11 } } }
+
+#if defined(_MSC_VER)
+#define CC_FASTCALL __fastcall
+#define CC_STDCALL __stdcall
+#else
+#define CC_FASTCALL __attribute__((fastcall))
+#define CC_STDCALL __attribute__((stdcall))
+#endif
+
+template <typename FuncT>
+struct FuncResult;
+
+template <typename R, typename... Args>
+struct FuncResult<R(*)(Args...)>
+{
+ using type = R;
+};
+
+template <typename R, typename... Args>
+struct FuncResult<R(CC_FASTCALL*)(Args...)>
+{
+ using type = R;
+};
+
+template <typename R, typename... Args>
+struct FuncResult<R(CC_STDCALL*)(Args...)>
+{
+ using type = R;
+};
+
+template <typename FuncT>
+auto wrap(FuncT f) -> typename FuncResult<FuncT>::type
+{
+ return f(1, 2, 3);
+}
+
+int CC_FASTCALL func1(int x, int y, int z)
+{
+ return x + y + z;
+}
+
+int CC_STDCALL func2(int x, int y, int z)
+{
+ return x + y + z;
+}
+
+int main()
+{
+ return wrap(&func1) + wrap(&func2);
+}
diff --git a/gcc/testsuite/g++.dg/ext/utf-cvt.C b/gcc/testsuite/g++.dg/ext/utf-cvt.C
index 929b7c71303..a792a737c52 100644
--- a/gcc/testsuite/g++.dg/ext/utf-cvt.C
+++ b/gcc/testsuite/g++.dg/ext/utf-cvt.C
@@ -27,8 +27,8 @@ void m(char16_t c0, char32_t c1)
f_s (c0); /* { dg-warning "change the sign" } */
fss (c0); /* { dg-warning "change the sign" } */
fus (c0);
- f_i (c0);
- fsi (c0);
+ f_i (c0); /* { dg-warning "change the sign" "" { target int16 } } */
+ fsi (c0); /* { dg-warning "change the sign" "" { target int16 } } */
fui (c0);
f_l (c0);
fsl (c0);
@@ -43,11 +43,13 @@ void m(char16_t c0, char32_t c1)
f_s (c1); /* { dg-warning "change value" } */
fss (c1); /* { dg-warning "change value" } */
fus (c1); /* { dg-warning "change value" } */
- f_i (c1); /* { dg-warning "change the sign" } */
- fsi (c1); /* { dg-warning "change the sign" } */
- fui (c1);
- f_l (c1); /* { dg-warning "change the sign" "" { target { llp64 || ilp32 } } } */
- fsl (c1); /* { dg-warning "change the sign" "" { target { llp64 || ilp32 } } } */
+ f_i (c1); /* { dg-warning "change the sign" "" { target { ! int16 } } } */
+ /* { dg-warning "change value" "" { target int16 } .-1 } */
+ fsi (c1); /* { dg-warning "change the sign" "" { target { ! int16 } } } */
+ /* { dg-warning "change value" "" { target int16 } .-1 } */
+ fui (c1); /* { dg-warning "change value" "" { target int16 } } */
+ f_l (c1); /* { dg-warning "change the sign" "" { target { llp64 || { ilp32 || int16 } } } } */
+ fsl (c1); /* { dg-warning "change the sign" "" { target { llp64 || { ilp32 || int16 } } } } */
ful (c1);
f_ll (c1);
fsll (c1);
diff --git a/gcc/testsuite/g++.dg/ext/vector28.C b/gcc/testsuite/g++.dg/ext/vector28.C
index ea48c961244..b0a003c967a 100644
--- a/gcc/testsuite/g++.dg/ext/vector28.C
+++ b/gcc/testsuite/g++.dg/ext/vector28.C
@@ -1,6 +1,8 @@
/* { dg-do compile } */
-typedef int veci __attribute__ ((vector_size (4 * sizeof (int))));
+typedef int int32_t __attribute__((mode (__SI__)));
+
+typedef int veci __attribute__ ((vector_size (4 * sizeof (int32_t))));
typedef float vecf __attribute__ ((vector_size (4 * sizeof (float))));
void f (veci *a, vecf *b, int c)
diff --git a/gcc/testsuite/g++.dg/ext/vla1.C b/gcc/testsuite/g++.dg/ext/vla1.C
index c017b6e90ed..cae3f82135a 100644
--- a/gcc/testsuite/g++.dg/ext/vla1.C
+++ b/gcc/testsuite/g++.dg/ext/vla1.C
@@ -19,8 +19,7 @@ class B { B (int); };
B::B (int i)
{
struct S {
- int ar[1][i]; // { dg-error "15:size of array .ar. is not an integral" "" { target c++11 } }
-// { dg-error "array bound" "" { target c++98_only } .-1 }
+ int ar[1][i]; // { dg-error "15:size of array .ar. is not an integral" }
} s;
s.ar[0][0] = 0; // { dg-prune-output "no member" }
diff --git a/gcc/testsuite/g++.dg/ext/vla15.C b/gcc/testsuite/g++.dg/ext/vla15.C
index 77436cb58f3..bce4d7b0af7 100644
--- a/gcc/testsuite/g++.dg/ext/vla15.C
+++ b/gcc/testsuite/g++.dg/ext/vla15.C
@@ -3,12 +3,14 @@
// { dg-options "" }
// { dg-require-effective-target alloca }
+typedef int int32_t __attribute__((mode (__SI__)));
+
void *volatile p;
int
main (void)
{
- int n = 0;
+ int32_t n = 0;
lab:;
int x[n % 1000 + 1];
x[0] = 1;
diff --git a/gcc/testsuite/g++.dg/ext/vla23.C b/gcc/testsuite/g++.dg/ext/vla23.C
new file mode 100644
index 00000000000..317a824b2f3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/vla23.C
@@ -0,0 +1,14 @@
+// PR c++/95552
+// Test for VLA and cloned constructor.
+// { dg-additional-options -Wno-vla }
+// { dg-require-effective-target alloca }
+
+struct VB { };
+struct ViewDom: virtual VB
+{
+ ViewDom(int i) { char (*a)[i]; }
+};
+void element( )
+{
+ ViewDom a(2);
+}
diff --git a/gcc/testsuite/g++.dg/gcov/loop.C b/gcc/testsuite/g++.dg/gcov/loop.C
index 24f580634d9..e63cb92e6e6 100644
--- a/gcc/testsuite/g++.dg/gcov/loop.C
+++ b/gcc/testsuite/g++.dg/gcov/loop.C
@@ -24,4 +24,4 @@ int main(int argc, char **argv)
return 0; /* count(1) */
}
-/* { dg-final { run-gcov branches { -abj loop.C } } } */
+/* { dg-final { run-gcov branches { -abH loop.C } } } */
diff --git a/gcc/testsuite/g++.dg/gomp/critical-3.C b/gcc/testsuite/g++.dg/gomp/critical-3.C
index b8dc496198f..788582f367e 100644
--- a/gcc/testsuite/g++.dg/gomp/critical-3.C
+++ b/gcc/testsuite/g++.dg/gomp/critical-3.C
@@ -2,7 +2,15 @@ int i;
template <int N>
void
-foo (void)
+foo0 (void)
+{
+ #pragma omp critical (foo), hint (N + 1) // { dg-error "critical' with 'hint' clause requires a name, except when 'omp_sync_hint_none' is used" }
+ i++;
+}
+
+template <int N>
+void
+foo_1 (void)
{
#pragma omp critical (foo), hint (N + 1)
i++;
@@ -10,6 +18,22 @@ foo (void)
template <int N>
void
+foobar0 (void)
+{
+ #pragma omp critical hint (N + 0)
+ i++;
+}
+
+template <int N>
+void
+foobar1 (void)
+{
+ #pragma omp critical hint (N + 0) // { dg-error "critical' with 'hint' clause requires a name, except when 'omp_sync_hint_none' is used" }
+ i++;
+}
+
+template <int N>
+void
bar (void)
{
#pragma omp critical (bar), hint (N + i) // { dg-error "constant integer expression" }
@@ -27,7 +51,10 @@ baz (T x)
void
test ()
{
- foo <0> ();
+ foo0 <0> (); // Error
+ foo_1 <-1> (); // OK
+ foobar0 <0> (); // OK
+ foobar1 <1> (); // Error
bar <0> ();
baz (0.0);
}
diff --git a/gcc/testsuite/g++.dg/gomp/gomp.exp b/gcc/testsuite/g++.dg/gomp/gomp.exp
index 56357a9be30..f5c68fb0e81 100644
--- a/gcc/testsuite/g++.dg/gomp/gomp.exp
+++ b/gcc/testsuite/g++.dg/gomp/gomp.exp
@@ -29,7 +29,7 @@ dg-init
# Main loop.
g++-dg-runtest [lsort [concat \
[find $srcdir/$subdir *.C] \
- [find $srcdir/c-c++-common/gomp *.c]]] "" "-fopenmp -Wno-hsa"
+ [find $srcdir/c-c++-common/gomp *.c]]] "" "-fopenmp"
# All done.
dg-finish
diff --git a/gcc/testsuite/g++.dg/gomp/loop-1.C b/gcc/testsuite/g++.dg/gomp/loop-1.C
index b3db0f4736b..abfd1e30424 100644
--- a/gcc/testsuite/g++.dg/gomp/loop-1.C
+++ b/gcc/testsuite/g++.dg/gomp/loop-1.C
@@ -74,12 +74,12 @@ f1 (int x)
for (j = 0; j < 16; j++)
;
#pragma omp for collapse(2)
- for (i = 0; i < 16; i = i + 2) /* { dg-error "initializer expression refers to iteration variable" } */
+ for (i = 0; i < 16; i = i + 2)
for (j = i; j < 16; j += 2)
;
#pragma omp for collapse(2)
for (i = 0; i < 16; i = i + 2)
- for (j = i + 3; j < 16; j += 2) /* { dg-error "initializer expression refers to iteration variable" } */
+ for (j = i + 3; j < 16; j += 2)
;
#pragma omp for collapse(2)
for (i = 0; i < 16; i++)
@@ -91,11 +91,11 @@ f1 (int x)
;
#pragma omp for collapse(2)
for (i = 0; i < 16; i++)
- for (j = 0; j < i; j++) /* { dg-error "condition expression refers to iteration variable" } */
+ for (j = 0; j < i; j++)
;
#pragma omp for collapse(2)
for (i = 0; i < 16; i++)
- for (j = 0; j < i + 4; j++) /* { dg-error "condition expression refers to iteration variable" } */
+ for (j = 0; j < i + 4; j++)
;
#pragma omp for collapse(2)
for (i = 0; i < j + 4; i++) /* { dg-error "condition expression refers to iteration variable" } */
@@ -207,12 +207,12 @@ f2 (int x)
for (int j = 0; j < 16; j += 2)
;
#pragma omp for collapse(2)
- for (int i = 0; i < 16; i = i + 2) /* { dg-error "initializer expression refers to iteration variable" } */
+ for (int i = 0; i < 16; i = i + 2)
for (int j = i; j < 16; j += 2)
;
#pragma omp for collapse(2)
for (int i = 0; i < 16; i = i + 2)
- for (int j = i + 3; j < 16; j += 2) /* { dg-error "initializer expression refers to iteration variable" } */
+ for (int j = i + 3; j < 16; j += 2)
;
#pragma omp for collapse(2)
for (int i = 0; i < 16; i++)
@@ -224,11 +224,11 @@ f2 (int x)
;
#pragma omp for collapse(2)
for (int i = 0; i < 16; i++)
- for (int j = 0; j < i; j++) /* { dg-error "condition expression refers to iteration variable" } */
+ for (int j = 0; j < i; j++)
;
#pragma omp for collapse(2)
for (int i = 0; i < 16; i++)
- for (int j = 0; j < i + 4; j++) /* { dg-error "condition expression refers to iteration variable" } */
+ for (int j = 0; j < i + 4; j++)
;
#pragma omp for collapse(2)
for (int i = 0; i < 16; i++)
diff --git a/gcc/testsuite/g++.dg/gomp/loop-2.C b/gcc/testsuite/g++.dg/gomp/loop-2.C
index 9deeaa5d887..327fb0e10fe 100644
--- a/gcc/testsuite/g++.dg/gomp/loop-2.C
+++ b/gcc/testsuite/g++.dg/gomp/loop-2.C
@@ -75,12 +75,12 @@ f1 (int x)
for (j = 0; j < 16; j++)
;
#pragma omp for collapse(2)
- for (i = 0; i < 16; i = i + 2) /* { dg-error "initializer expression refers to iteration variable" } */
+ for (i = 0; i < 16; i = i + 2)
for (j = i; j < 16; j += 2)
;
#pragma omp for collapse(2)
for (i = 0; i < 16; i = i + 2)
- for (j = i + 3; j < 16; j += 2) /* { dg-error "initializer expression refers to iteration variable" } */
+ for (j = i + 3; j < 16; j += 2)
;
#pragma omp for collapse(2)
for (i = 0; i < 16; i++)
@@ -92,11 +92,11 @@ f1 (int x)
;
#pragma omp for collapse(2)
for (i = 0; i < 16; i++)
- for (j = 0; j < i; j++) /* { dg-error "condition expression refers to iteration variable" } */
+ for (j = 0; j < i; j++)
;
#pragma omp for collapse(2)
for (i = 0; i < 16; i++)
- for (j = 0; j < i + 4; j++) /* { dg-error "condition expression refers to iteration variable" } */
+ for (j = 0; j < i + 4; j++)
;
#pragma omp for collapse(2)
for (i = 0; i < j + 4; i++) /* { dg-error "condition expression refers to iteration variable" } */
@@ -209,12 +209,12 @@ f2 (int x)
for (int j = 0; j < 16; j += 2)
;
#pragma omp for collapse(2)
- for (int i = 0; i < 16; i = i + 2) /* { dg-error "initializer expression refers to iteration variable" } */
+ for (int i = 0; i < 16; i = i + 2)
for (int j = i; j < 16; j += 2)
;
#pragma omp for collapse(2)
for (int i = 0; i < 16; i = i + 2)
- for (int j = i + 3; j < 16; j += 2) /* { dg-error "initializer expression refers to iteration variable" } */
+ for (int j = i + 3; j < 16; j += 2)
;
#pragma omp for collapse(2)
for (int i = 0; i < 16; i++)
@@ -226,11 +226,11 @@ f2 (int x)
;
#pragma omp for collapse(2)
for (int i = 0; i < 16; i++)
- for (int j = 0; j < i; j++) /* { dg-error "condition expression refers to iteration variable" } */
+ for (int j = 0; j < i; j++)
;
#pragma omp for collapse(2)
for (int i = 0; i < 16; i++)
- for (int j = 0; j < i + 4; j++) /* { dg-error "condition expression refers to iteration variable" } */
+ for (int j = 0; j < i + 4; j++)
;
#pragma omp for collapse(2)
for (int i = 0; i < 16; i++)
diff --git a/gcc/testsuite/g++.dg/gomp/loop-5.C b/gcc/testsuite/g++.dg/gomp/loop-5.C
new file mode 100644
index 00000000000..8601d031a1d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/loop-5.C
@@ -0,0 +1,50 @@
+void
+foo ()
+{
+ int i = 0;
+ #pragma omp for collapse(2)
+ for (i = 0; i < 16; i++) // { dg-error "the same loop iteration variables 'i' used in multiple associated loops" }
+ for (i = 1; i < 32; i++)
+ ;
+ #pragma omp taskloop collapse(2)
+ for (int j = 0; j < 16; j++) // { dg-error "the same loop iteration variables 'j' used in multiple associated loops" }
+ for (j = 0; j < 16; j++)
+ ;
+}
+
+template <int N>
+void
+bar ()
+{
+ int i = 0;
+ #pragma omp for collapse(2)
+ for (i = 0; i < 16; i++) // { dg-error "the same loop iteration variables 'i' used in multiple associated loops" }
+ for (i = 1; i < 32; i++)
+ ;
+ #pragma omp taskloop collapse(2)
+ for (int j = 0; j < 16; j++) // { dg-error "the same loop iteration variables 'j' used in multiple associated loops" }
+ for (j = 0; j < 16; j++)
+ ;
+}
+
+template <typename T>
+void
+baz ()
+{
+ T i = 0;
+ #pragma omp for collapse(2) // { dg-error "the same loop iteration variables 'i' used in multiple associated loops" }
+ for (i = 0; i < 16; i++)
+ for (i = 1; i < 32; i++)
+ ;
+ #pragma omp taskloop collapse(2) // { dg-error "the same loop iteration variables 'j' used in multiple associated loops" }
+ for (T j = 0; j < 16; j++)
+ for (j = 0; j < 16; j++)
+ ;
+}
+
+void
+test ()
+{
+ bar <0> ();
+ baz <int> ();
+}
diff --git a/gcc/testsuite/g++.dg/gomp/loop-6.C b/gcc/testsuite/g++.dg/gomp/loop-6.C
new file mode 100644
index 00000000000..902fef3c1be
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/loop-6.C
@@ -0,0 +1,69 @@
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
+
+template <typename T>
+class I
+{
+public:
+ typedef ptrdiff_t difference_type;
+ I ();
+ ~I ();
+ I (T *);
+ I (const I &);
+ T &operator * ();
+ T *operator -> ();
+ T &operator [] (const difference_type &) const;
+ I &operator = (const I &);
+ I &operator ++ ();
+ I operator ++ (int);
+ I &operator -- ();
+ I operator -- (int);
+ I &operator += (const difference_type &);
+ I &operator -= (const difference_type &);
+ I operator + (const difference_type &) const;
+ I operator - (const difference_type &) const;
+ template <typename S> friend bool operator == (I<S> &, I<S> &);
+ template <typename S> friend bool operator == (const I<S> &, const I<S> &);
+ template <typename S> friend bool operator < (I<S> &, I<S> &);
+ template <typename S> friend bool operator < (const I<S> &, const I<S> &);
+ template <typename S> friend bool operator <= (I<S> &, I<S> &);
+ template <typename S> friend bool operator <= (const I<S> &, const I<S> &);
+ template <typename S> friend bool operator > (I<S> &, I<S> &);
+ template <typename S> friend bool operator > (const I<S> &, const I<S> &);
+ template <typename S> friend bool operator >= (I<S> &, I<S> &);
+ template <typename S> friend bool operator >= (const I<S> &, const I<S> &);
+ template <typename S> friend typename I<S>::difference_type operator - (I<S> &, I<S> &);
+ template <typename S> friend typename I<S>::difference_type operator - (const I<S> &, const I<S> &);
+ template <typename S> friend I<S> operator + (typename I<S>::difference_type , const I<S> &);
+private:
+ T *p;
+};
+
+template <typename T> bool operator == (I<T> &, I<T> &);
+template <typename T> bool operator == (const I<T> &, const I<T> &);
+template <typename T> bool operator != (I<T> &, I<T> &);
+template <typename T> bool operator != (const I<T> &, const I<T> &);
+template <typename T> bool operator < (I<T> &, I<T> &);
+template <typename T> bool operator < (const I<T> &, const I<T> &);
+template <typename T> bool operator <= (I<T> &, I<T> &);
+template <typename T> bool operator <= (const I<T> &, const I<T> &);
+template <typename T> bool operator > (I<T> &, I<T> &);
+template <typename T> bool operator > (const I<T> &, const I<T> &);
+template <typename T> bool operator >= (I<T> &, I<T> &);
+template <typename T> bool operator >= (const I<T> &, const I<T> &);
+template <typename T> typename I<T>::difference_type operator - (I<T> &, I<T> &);
+template <typename T> typename I<T>::difference_type operator - (const I<T> &, const I<T> &);
+template <typename T> I<T> operator + (typename I<T>::difference_type, const I<T> &);
+
+void
+f1 (I<int> &x, I<int> &y)
+{
+ I<int> i;
+ #pragma omp for collapse(2)
+ for (i = x; i < y; i++) // { dg-error "the same loop iteration variables 'i' used in multiple associated loops" }
+ for (i = x; i < y; i++)
+ ;
+ #pragma omp for collapse(2)
+ for (I<int> j = x; j < y; j++)// { dg-error "the same loop iteration variables 'j' used in multiple associated loops" }
+ for (j = y; j > x; j--)
+ ;
+}
diff --git a/gcc/testsuite/g++.dg/gomp/parallel-2.C b/gcc/testsuite/g++.dg/gomp/parallel-2.C
index 68e577766b1..38875ad94ed 100644
--- a/gcc/testsuite/g++.dg/gomp/parallel-2.C
+++ b/gcc/testsuite/g++.dg/gomp/parallel-2.C
@@ -4,11 +4,11 @@ void foo()
{
int i;
- #pragma omp parallel default(none) // { dg-error "enclosing" }
+ #pragma omp parallel default(none) // { dg-message "note: enclosing 'parallel'" }
{
#pragma omp parallel
{
- #pragma omp parallel default(none) // { dg-error "enclosing" }
+ #pragma omp parallel default(none) // { dg-message "note: enclosing 'parallel'" }
{
i++; // { dg-error "not specified" }
}
diff --git a/gcc/testsuite/g++.dg/gomp/pr95063.C b/gcc/testsuite/g++.dg/gomp/pr95063.C
new file mode 100644
index 00000000000..fe5894c73b0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr95063.C
@@ -0,0 +1,24 @@
+// PR c++/95063
+
+template <typename T>
+struct S {
+ T a : 12;
+ S () : a(0)
+ {
+#pragma omp for linear(a)
+ for (int k = 0; k < 64; ++k)
+ a++;
+ }
+};
+struct U {
+ int a : 12;
+ U () : a(0)
+ {
+#pragma omp for linear(a)
+ for (int k = 0; k < 64; ++k)
+ a++;
+ }
+};
+
+S<int> s;
+U u;
diff --git a/gcc/testsuite/g++.dg/gomp/predetermined-1.C b/gcc/testsuite/g++.dg/gomp/predetermined-1.C
index 084f04ec90f..74cd74febdf 100644
--- a/gcc/testsuite/g++.dg/gomp/predetermined-1.C
+++ b/gcc/testsuite/g++.dg/gomp/predetermined-1.C
@@ -15,19 +15,19 @@ const A foo (const A d, const C e)
const A f;
const B b = { 4 };
A g;
- #pragma omp parallel default (none) // { dg-error "enclosing 'parallel'" }
+ #pragma omp parallel default (none) // { dg-message "note: enclosing 'parallel'" }
bar (&a); // { dg-error "not specified" }
- #pragma omp parallel default (none) // { dg-error "enclosing 'parallel'" }
+ #pragma omp parallel default (none) // { dg-message "note: enclosing 'parallel'" }
bar (&b); // { dg-error "not specified" }
- #pragma omp parallel default (none) // { dg-error "enclosing 'parallel'" }
+ #pragma omp parallel default (none) // { dg-message "note: enclosing 'parallel'" }
bar (&c); // { dg-error "not specified" }
- #pragma omp parallel default (none) // { dg-error "enclosing 'parallel'" }
+ #pragma omp parallel default (none) // { dg-message "note: enclosing 'parallel'" }
bar (&d); // { dg-error "not specified" }
- #pragma omp parallel default (none) // { dg-error "enclosing 'parallel'" }
+ #pragma omp parallel default (none) // { dg-message "note: enclosing 'parallel'" }
bar (&e); // { dg-error "not specified" }
- #pragma omp parallel default (none) // { dg-error "enclosing 'parallel'" }
+ #pragma omp parallel default (none) // { dg-message "note: enclosing 'parallel'" }
bar (&f); // { dg-error "not specified" }
- #pragma omp parallel default (none) // { dg-error "enclosing 'parallel'" }
+ #pragma omp parallel default (none) // { dg-message "note: enclosing 'parallel'" }
bar (&g); // { dg-error "not specified" }
return f;
}
diff --git a/gcc/testsuite/g++.dg/gomp/sharing-1.C b/gcc/testsuite/g++.dg/gomp/sharing-1.C
index ac6908b68ac..4506170c247 100644
--- a/gcc/testsuite/g++.dg/gomp/sharing-1.C
+++ b/gcc/testsuite/g++.dg/gomp/sharing-1.C
@@ -52,7 +52,7 @@ main (void)
*p = 7;
s = 6;
l = 0;
-#pragma omp parallel for /* { dg-error "enclosing 'parallel'" } */ \
+#pragma omp parallel for /* { dg-message "note: enclosing 'parallel'" } */ \
default (none) private (p) shared (s)
for (i = 0; i < 64; i++)
{
diff --git a/gcc/testsuite/g++.dg/init/array11.C b/gcc/testsuite/g++.dg/init/array11.C
index e52effe9ff7..9c12831bbea 100644
--- a/gcc/testsuite/g++.dg/init/array11.C
+++ b/gcc/testsuite/g++.dg/init/array11.C
@@ -1,3 +1,4 @@
+// { dg-require-effective-target size32plus }
/* PR 11665
Orgin: jwhite@cse.unl.edu
The problem was in initializer_constant_valid_p,
diff --git a/gcc/testsuite/g++.dg/init/array15.C b/gcc/testsuite/g++.dg/init/array15.C
index 17160d07611..024d93ed4ab 100644
--- a/gcc/testsuite/g++.dg/init/array15.C
+++ b/gcc/testsuite/g++.dg/init/array15.C
@@ -1,4 +1,5 @@
// { dg-do run }
+// { dg-require-effective-target size24plus }
// Copyright (C) 2004 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 8 Dec 2004 <nathan@codesourcery.com>
diff --git a/gcc/testsuite/g++.dg/init/array4.C b/gcc/testsuite/g++.dg/init/array4.C
index 67519bf7c35..4712e9d7253 100644
--- a/gcc/testsuite/g++.dg/init/array4.C
+++ b/gcc/testsuite/g++.dg/init/array4.C
@@ -1,4 +1,5 @@
// { dg-do compile }
+// { dg-require-effective-target size20plus }
// Origin: Markus Breuer <markus.breuer@materna.de>
// PR c++/6944
diff --git a/gcc/testsuite/g++.dg/init/const7.C b/gcc/testsuite/g++.dg/init/const7.C
index e1f31bccf7c..e1dd4d802db 100644
--- a/gcc/testsuite/g++.dg/init/const7.C
+++ b/gcc/testsuite/g++.dg/init/const7.C
@@ -3,7 +3,7 @@
struct s { int x, y; };
short offsets[1] = {
- ((char*) &(((struct s*)16)->y) - (char *)16), // { dg-message "narrowing" "" { target c++11 } }
+ ((char*) &(((struct s*)16)->y) - (char *)16), // { dg-message "narrowing" "" { target { c++11 && { ! ptr_eq_short } } } }
};
// This ensures that we get a dump whether or not the bug is present.
diff --git a/gcc/testsuite/g++.dg/init/new18.C b/gcc/testsuite/g++.dg/init/new18.C
index 5f07aaa40d0..afe3da9b53e 100644
--- a/gcc/testsuite/g++.dg/init/new18.C
+++ b/gcc/testsuite/g++.dg/init/new18.C
@@ -1,6 +1,5 @@
// { dg-do compile }
-// { dg-options "-O2 -fstrict-aliasing" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-O2 -fstrict-aliasing -Wno-return-type" }
// This caused an ICE during placement new.
diff --git a/gcc/testsuite/g++.dg/init/new38.C b/gcc/testsuite/g++.dg/init/new38.C
index cf73aa18e60..405b67d151f 100644
--- a/gcc/testsuite/g++.dg/init/new38.C
+++ b/gcc/testsuite/g++.dg/init/new38.C
@@ -40,7 +40,7 @@ template <typename T>
void
large_array_template3(int n)
{
- new T[n] // { dg-error "size of array exceeds maximum object size" }
+ new T[n] // { dg-error "size.*of array exceeds maximum object size" }
[(1ULL << (sizeof(void *) * 4)) / sizeof(T)]
[1ULL << (sizeof(void *) * 4)];
}
diff --git a/gcc/testsuite/g++.dg/init/new44.C b/gcc/testsuite/g++.dg/init/new44.C
index a10ef424136..cf4bc160746 100644
--- a/gcc/testsuite/g++.dg/init/new44.C
+++ b/gcc/testsuite/g++.dg/init/new44.C
@@ -42,8 +42,8 @@ test_one_dim_char_array ()
p = new char [MAX - 2]; // { dg-error "size .\[0-9\]+. of array" }
p = new char [MAX - 99]; // { dg-error "size .\[0-9\]+. of array" }
p = new char [MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
- p = new char [MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
- p = new char [MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
+ p = new char [MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
// Avoid testing the expressions below since whether or not they
// are accepted depends on the precision of size_t (which also
@@ -76,7 +76,7 @@ test_one_dim_short_array ()
p = new short [MAX / 2 - 6]; // { dg-error "size .\[0-9\]+. of array" }
p = new short [MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of array" }
p = new short [MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of array" }
- p = new short [MAX / 4]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new short [MAX / 4]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
// Avoid exercising data model-dependent expressions.
// p = new short [MAX / 4 - 1];
@@ -93,8 +93,8 @@ test_two_dim_char_array ()
p = new char [1][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
p = new char [1][MAX - 99]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
p = new char [1][MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
- p = new char [1][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
- p = new char [1][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [1][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
+ p = new char [1][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
// Avoid exercising data model-dependent expressions.
// p = new char [1][MAX / 2 - 3];
@@ -125,8 +125,8 @@ test_two_dim_char_array ()
p = new char [MAX][2]; // { dg-error "size .\[0-9\]+. of array" }
p = new char [MAX][1]; // { dg-error "size .\[0-9\]+. of array" }
p = new char [MAX / 2][1]; // { dg-error "size .\[0-9\]+. of array" }
- p = new char [MAX / 2 - 1][1]; // { dg-error "size .\[0-9\]+. of array" }
- p = new char [MAX / 2 - 2][1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2 - 1][1]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
+ p = new char [MAX / 2 - 2][1]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
// Avoid exercising data model-dependent expressions.
// p = new char [MAX / 2 - 3][1];
@@ -148,8 +148,8 @@ test_three_dim_char_array ()
p = new char [1][1][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
p = new char [1][1][MAX - 99]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
p = new char [1][1][MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
- p = new char [1][1][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
- p = new char [1][1][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [1][1][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
+ p = new char [1][1][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
// Avoid exercising data model-dependent expressions.
// p = new char [1][1][MAX / 2 - 3];
@@ -173,7 +173,7 @@ test_three_dim_char_array ()
p = new char [1][2][MAX / 2 - 6]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
p = new char [1][2][MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
p = new char [1][2][MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
- p = new char [1][2][MAX / 4]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [1][2][MAX / 4]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
// Avoid exercising data model-dependent expressions.
// p = new char [1][2][MAX / 4 - 1];
@@ -195,7 +195,7 @@ test_three_dim_char_array ()
p = new char [2][1][MAX / 2 - 6]; // { dg-error "size .\[0-9\]+. of array" }
p = new char [2][1][MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of array" }
p = new char [2][1][MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of array" }
- p = new char [2][1][MAX / 4]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][1][MAX / 4]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
// Avoid exercising data model-dependent expressions.
// p = new char [2][1][MAX / 4 - 1];
@@ -290,16 +290,20 @@ test_N_dim_char_array ()
{
#if __SIZEOF_SIZE_T__ == 8
enum { N = 256 };
-#else
+#elif __SIZEOF_SIZE_T__ == 4
enum { N = 16 };
+#else
+ enum { N = 4 };
#endif
+#ifndef __MSP430X_LARGE__ /* 20-bit size_t. */
p = new char [N][N][N][N][N][N][N];
p = new char [N / 2][2][N][N][N][N][N][N];
p = new char [N - 1][N / 2][N][N][N][N][N][N];
- p = new char [N / 2][N][N][N][N][N][N][N]; // { dg-error "size .\[0-9\]+. of array" }
- p = new char [N - 1][N][N][N][N][N][N][N]; // { dg-error "size .\[0-9\]+. of array" }
- p = new char [N] [N][N][N][N][N][N][N]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [N / 2][N][N][N][N][N][N][N]; // { dg-error "size .\[0-9\]+. of array" "" { target { ! msp430_large } } }
+ p = new char [N - 1][N][N][N][N][N][N][N]; // { dg-error "size .\[0-9\]+. of array" "" { target { ! msp430_large } } }
+ p = new char [N] [N][N][N][N][N][N][N]; // { dg-error "size .\[0-9\]+. of array" "" { target { ! msp430_large } } }
+#endif
}
typedef struct Byte {
@@ -321,8 +325,8 @@ test_one_dim_byte_array (void *p)
p = new (p) B [MAX - 2]; // { dg-error "size .\[0-9\]+. of array" }
p = new (p) B [MAX - 99]; // { dg-error "size .\[0-9\]+. of array" }
p = new (p) B [MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
- p = new (p) B [MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
- p = new (p) B [MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
+ p = new (p) B [MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
// Avoid testing the expressions below since whether or not they
// are accepted depends on the precision of size_t (which determines
@@ -348,8 +352,8 @@ test_placement_two_dim_byte_struct_array (void *p)
p = new (p) B [1][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
p = new (p) B [1][MAX - 99]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
p = new (p) B [1][MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
- p = new (p) B [1][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
- p = new (p) B [1][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [1][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
+ p = new (p) B [1][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
// Avoid exercising data model-dependent expressions.
// p = new (p) B [1][MAX / 2 - 3];
@@ -380,8 +384,8 @@ test_placement_two_dim_byte_struct_array (void *p)
p = new (p) B [MAX][2]; // { dg-error "size .\[0-9\]+. of array" }
p = new (p) B [MAX][1]; // { dg-error "size .\[0-9\]+. of array" }
p = new (p) B [MAX / 2][1]; // { dg-error "size .\[0-9\]+. of array" }
- p = new (p) B [MAX / 2 - 1][1]; // { dg-error "size .\[0-9\]+. of array" }
- p = new (p) B [MAX / 2 - 2][1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2 - 1][1]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
+ p = new (p) B [MAX / 2 - 2][1]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
// Avoid exercising data model-dependent expressions.
// p = new (p) B [MAX / 2 - 3][1];
@@ -403,8 +407,8 @@ test_placement_three_dim_byte_struct_array (void *p)
p = new (p) B [1][1][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
p = new (p) B [1][1][MAX - 99]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
p = new (p) B [1][1][MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
- p = new (p) B [1][1][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
- p = new (p) B [1][1][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [1][1][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
+ p = new (p) B [1][1][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
// Avoid exercising data model-dependent expressions.
// p = new (p) B [1][1][MAX / 2 - 3];
@@ -428,7 +432,7 @@ test_placement_three_dim_byte_struct_array (void *p)
p = new (p) B [1][2][MAX / 2 - 6]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
p = new (p) B [1][2][MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
p = new (p) B [1][2][MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
- p = new (p) B [1][2][MAX / 4]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [1][2][MAX / 4]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
// Avoid exercising data model-dependent expressions.
// p = new (p) B [1][2][MAX / 4 - 1];
@@ -450,7 +454,7 @@ test_placement_three_dim_byte_struct_array (void *p)
p = new (p) B [2][1][MAX / 2 - 6]; // { dg-error "size .\[0-9\]+. of array" }
p = new (p) B [2][1][MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of array" }
p = new (p) B [2][1][MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of array" }
- p = new (p) B [2][1][MAX / 4]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][1][MAX / 4]; // { dg-error "size .\[0-9\]+. of array" "cookie required" { target { ! msp430_small } } }
// Avoid exercising data model-dependent expressions.
// p = new (p) B [2][1][MAX / 4 - 1];
diff --git a/gcc/testsuite/g++.dg/init/value9.C b/gcc/testsuite/g++.dg/init/value9.C
index 4899bd81001..25abd60ff3b 100644
--- a/gcc/testsuite/g++.dg/init/value9.C
+++ b/gcc/testsuite/g++.dg/init/value9.C
@@ -1,6 +1,8 @@
// PR c++/50793
// { dg-do run }
+typedef int int32_t __attribute__((mode (__SI__)));
+
struct NonTrivial
{
NonTrivial() { }
@@ -9,7 +11,7 @@ struct NonTrivial
struct S
{
NonTrivial nt;
- int i;
+ int32_t i;
};
int f(S s)
diff --git a/gcc/testsuite/g++.dg/ipa/devirt-19.C b/gcc/testsuite/g++.dg/ipa/devirt-19.C
index f35bc32f85b..c14b969a26f 100644
--- a/gcc/testsuite/g++.dg/ipa/devirt-19.C
+++ b/gcc/testsuite/g++.dg/ipa/devirt-19.C
@@ -2,8 +2,7 @@
Previously we were failing by considering CLOBBER statement to be
a type change. */
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-ipa-cp -fipa-cp-clone" } */
-/* { dg-additional-options "-Wno-return-type" } */
+/* { dg-options "-O2 -fdump-ipa-cp -fipa-cp-clone -Wno-return-type" } */
struct A {
void operator==(const A &);
diff --git a/gcc/testsuite/g++.dg/ipa/devirt-52.C b/gcc/testsuite/g++.dg/ipa/devirt-52.C
index 5c736c4037a..1c6aa3e789b 100644
--- a/gcc/testsuite/g++.dg/ipa/devirt-52.C
+++ b/gcc/testsuite/g++.dg/ipa/devirt-52.C
@@ -1,7 +1,6 @@
// PR middle-end/77259
// { dg-do compile { target c++11 } }
-// { dg-options "-O2" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-O2 -Wno-return-type" }
template <typename, typename = int> class A;
template <typename, typename> struct A
diff --git a/gcc/testsuite/g++.dg/ipa/pr44372.C b/gcc/testsuite/g++.dg/ipa/pr44372.C
index dbdd865cfb6..539f32ba7a3 100644
--- a/gcc/testsuite/g++.dg/ipa/pr44372.C
+++ b/gcc/testsuite/g++.dg/ipa/pr44372.C
@@ -1,6 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O -fipa-cp -fipa-cp-clone" } */
-/* { dg-additional-options "-Wno-return-type" } */
+/* { dg-options "-O -fipa-cp -fipa-cp-clone -Wno-return-type" } */
template < typename > class S3;
diff --git a/gcc/testsuite/g++.dg/ipa/pr58371.C b/gcc/testsuite/g++.dg/ipa/pr58371.C
index cfcf677e3d0..02c14fa6fe6 100644
--- a/gcc/testsuite/g++.dg/ipa/pr58371.C
+++ b/gcc/testsuite/g++.dg/ipa/pr58371.C
@@ -1,6 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2" } */
-/* { dg-additional-options "-Wno-return-type" } */
+/* { dg-options "-O2 -Wno-return-type" } */
typedef int size_t;
diff --git a/gcc/testsuite/g++.dg/ipa/pr63587-2.C b/gcc/testsuite/g++.dg/ipa/pr63587-2.C
index 7a9b2454507..559a94a5438 100644
--- a/gcc/testsuite/g++.dg/ipa/pr63587-2.C
+++ b/gcc/testsuite/g++.dg/ipa/pr63587-2.C
@@ -1,7 +1,6 @@
// PR ipa/63587
// { dg-do compile { target c++11 } }
-// { dg-options "-O2" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-O2 -Wno-return-type" }
namespace boost {
class basic_cstring
diff --git a/gcc/testsuite/g++.dg/ipa/pr77333.C b/gcc/testsuite/g++.dg/ipa/pr77333.C
index 1ef997f7a54..444805dca8c 100644
--- a/gcc/testsuite/g++.dg/ipa/pr77333.C
+++ b/gcc/testsuite/g++.dg/ipa/pr77333.C
@@ -1,6 +1,8 @@
// { dg-do run }
// { dg-options "-O2 -fno-ipa-sra" }
+typedef int int32_t __attribute__((mode (__SI__)));
+
volatile int global;
int __attribute__((noinline, noclone))
get_data (int i)
@@ -18,7 +20,7 @@ char buf[512];
class A
{
public:
- int field;
+ int32_t field;
char *s;
A() : field(223344)
diff --git a/gcc/testsuite/g++.dg/ipa/pr78211.C b/gcc/testsuite/g++.dg/ipa/pr78211.C
index 510fca573de..ac8c893334e 100644
--- a/gcc/testsuite/g++.dg/ipa/pr78211.C
+++ b/gcc/testsuite/g++.dg/ipa/pr78211.C
@@ -1,7 +1,6 @@
// PR lto/78211
// { dg-do compile { target { lto && c++11 } } }
-// { dg-options "-fcompare-debug -fno-printf-return-value -flto -fno-use-linker-plugin -O3" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-fcompare-debug -fno-printf-return-value -flto -fno-use-linker-plugin -O3 -Wno-return-type" }
namespace std {
typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/g++.dg/ipa/pr83667.C b/gcc/testsuite/g++.dg/ipa/pr83667.C
index 25522daf04b..a8a5a5adb3a 100644
--- a/gcc/testsuite/g++.dg/ipa/pr83667.C
+++ b/gcc/testsuite/g++.dg/ipa/pr83667.C
@@ -22,4 +22,4 @@ struct c : a, b
c c;
-// { dg-final { scan-ipa-dump "summary for void c::\[^\\n\]*THUNK0" "inline" } }
+// { dg-final { scan-ipa-dump "summary for void c::\[^\\n\]*THUNK\\.*0" "inline" } }
diff --git a/gcc/testsuite/g++.dg/ipa/pr94856.C b/gcc/testsuite/g++.dg/ipa/pr94856.C
index 5315c52d80e..40f3a167e29 100644
--- a/gcc/testsuite/g++.dg/ipa/pr94856.C
+++ b/gcc/testsuite/g++.dg/ipa/pr94856.C
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fno-tree-dse --param uninlined-function-insns=0 --param early-inlining-insns=3 -fgnu-tm " } */
+/* { dg-require-effective-target fgnu_tm } */
class a {
public:
diff --git a/gcc/testsuite/g++.dg/lookup/koenig15.C b/gcc/testsuite/g++.dg/lookup/koenig15.C
new file mode 100644
index 00000000000..f317c010dde
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/koenig15.C
@@ -0,0 +1,45 @@
+// PR c++/95074 - Function found via ADL when it should not.
+// { dg-do compile }
+
+namespace N {
+ struct S { };
+ void f(S);
+}
+
+namespace M {
+ void f(int);
+}
+
+void
+fn0 ()
+{
+ N::S s;
+ using M::f;
+ f (s);
+}
+
+void
+fn1 ()
+{
+ N::S s;
+ extern void f(char);
+ using M::f;
+ f (s); // { dg-error "no matching function" }
+}
+
+void
+fn2 ()
+{
+ N::S s;
+ using M::f;
+ extern void f(char);
+ f (s); // { dg-error "no matching function" }
+}
+
+void
+fn3 ()
+{
+ N::S s;
+ extern void (*f)(char);
+ f (s); // { dg-error "cannot convert" }
+}
diff --git a/gcc/testsuite/g++.dg/lookup/missing-std-include-10.C b/gcc/testsuite/g++.dg/lookup/missing-std-include-10.C
new file mode 100644
index 00000000000..9dfa78fb60e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/missing-std-include-10.C
@@ -0,0 +1,43 @@
+// { dg-do compile }
+// { dg-additional-options -fdiagnostics-show-caret }
+// comment
+
+
+
+
+
+
+// Intentional blank lines
+
+
+
+
+
+
+
+
+#include "missing-std-include-10.h"
+// HERE
+
+
+
+
+
+
+// Intentional blank lines
+
+
+
+
+
+
+
+
+
+int main ()
+{
+ return strcmp ("", "");
+}
+// { dg-additional-files "missing-std-include-10.h" }
+// { dg-regexp {[^\n]*: error: 'strcmp' was not declared in this scope\n *return strcmp [^\n]*;\n *\^~*\n} }
+// { dg-regexp {[^\n]* note: 'strcmp' is defined in header[^\n]*\n #include "missing-std-include-10.h"\n\+#include <cstring>\n // HERE\n} }
diff --git a/gcc/testsuite/g++.dg/lookup/missing-std-include-10.h b/gcc/testsuite/g++.dg/lookup/missing-std-include-10.h
new file mode 100644
index 00000000000..40a8c178f10
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/missing-std-include-10.h
@@ -0,0 +1 @@
+/* empty */
diff --git a/gcc/testsuite/g++.dg/lookup/missing-std-include-11.C b/gcc/testsuite/g++.dg/lookup/missing-std-include-11.C
new file mode 100644
index 00000000000..ec2c494c557
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/missing-std-include-11.C
@@ -0,0 +1,43 @@
+// { dg-do compile }
+// { dg-additional-options {-fdiagnostics-show-caret -save-temps} }
+// comment save-temps causes us to compile preprocessed output
+
+
+
+
+
+
+// Intentional blank lines
+
+
+
+
+
+
+
+
+#include "missing-std-include-10.h"
+// HERE
+
+
+
+
+
+
+// Intentional blank lines
+
+
+
+
+
+
+
+
+
+int main ()
+{
+ return strcmp ("", "");
+}
+// { dg-additional-files "missing-std-include-10.h" }
+// { dg-regexp {[^\n]*: error: 'strcmp' was not declared in this scope\n *return strcmp [^\n]*;\n *\^~*\n} }
+// { dg-regexp {[^\n]* note: 'strcmp' is defined in header[^\n]*\n #include "missing-std-include-10.h"\n\+#include <cstring>\n // HERE\n} }
diff --git a/gcc/testsuite/g++.dg/lookup/this1.C b/gcc/testsuite/g++.dg/lookup/this1.C
index 20051bf7515..6b85cefcd37 100644
--- a/gcc/testsuite/g++.dg/lookup/this1.C
+++ b/gcc/testsuite/g++.dg/lookup/this1.C
@@ -4,5 +4,5 @@
struct A
{
template<int> static void foo();
- static void bar() { this->A::foo<0>(); } // { dg-error "unavailable" }
+ static void bar() { this->A::foo<0>(); } // { dg-error "unavailable|not a class|expected" }
};
diff --git a/gcc/testsuite/g++.dg/lto/20080908-1_0.C b/gcc/testsuite/g++.dg/lto/20080908-1_0.C
index 42b20cb3b3a..92dec575f9b 100644
--- a/gcc/testsuite/g++.dg/lto/20080908-1_0.C
+++ b/gcc/testsuite/g++.dg/lto/20080908-1_0.C
@@ -1,16 +1,18 @@
/* { dg-lto-do run } */
extern "C" { extern void *memcpy (void *, const void *, __SIZE_TYPE__); }
-inline int
+typedef int int32_t __attribute__((mode (__SI__)));
+
+inline int32_t
bci (const float &source)
{
- int dest;
+ int32_t dest;
memcpy (&dest, &source, sizeof (dest));
return dest;
}
inline float
-bcf (const int &source)
+bcf (const int32_t &source)
{
float dest;
memcpy (&dest, &source, sizeof (dest));
@@ -20,9 +22,9 @@ bcf (const int &source)
float
Foo ()
{
- const int foo = bci (0.0f);
- int bar = foo;
- const int baz = foo & 1;
+ const int32_t foo = bci (0.0f);
+ int32_t bar = foo;
+ const int32_t baz = foo & 1;
if (!baz && (foo & 2))
bar = 0;
return bcf (bar);
@@ -30,7 +32,10 @@ Foo ()
int main ()
{
- if (Foo () != 0.0)
- return 1;
+ if (sizeof (int32_t) == sizeof (float))
+ {
+ if (Foo () != 0.0)
+ return 1;
+ }
return 0;
}
diff --git a/gcc/testsuite/g++.dg/lto/20081219_1.C b/gcc/testsuite/g++.dg/lto/20081219_1.C
index 1bb96ef37de..8d64a0212cb 100644
--- a/gcc/testsuite/g++.dg/lto/20081219_1.C
+++ b/gcc/testsuite/g++.dg/lto/20081219_1.C
@@ -7,7 +7,7 @@ namespace std __attribute__ ((__visibility__ ("default")))
{
using::mbstate_t;
typedef int *__c_locale;
- class locale
+ struct locale
{
class facet;
};
diff --git a/gcc/testsuite/g++.dg/lto/20091002-1_0.C b/gcc/testsuite/g++.dg/lto/20091002-1_0.C
index 4ddb3854c64..e09ce01cdfc 100644
--- a/gcc/testsuite/g++.dg/lto/20091002-1_0.C
+++ b/gcc/testsuite/g++.dg/lto/20091002-1_0.C
@@ -14,7 +14,7 @@ namespace std __attribute__ ((__visibility__ ("default")))
typedef basic_ostream<char> ostream;
template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
class num_get;
- class locale {
+ struct locale {
class facet;
};
class locale::facet {
diff --git a/gcc/testsuite/g++.dg/lto/pr65475c_0.C b/gcc/testsuite/g++.dg/lto/pr65475c_0.C
index 73686918c2c..4e3de7d6a34 100644
--- a/gcc/testsuite/g++.dg/lto/pr65475c_0.C
+++ b/gcc/testsuite/g++.dg/lto/pr65475c_0.C
@@ -24,7 +24,9 @@ namespace std
{
class locale
{
+public:
class facet;
+private:
class _Impl;
_Impl *_M_impl;
};
@@ -70,6 +72,7 @@ class ios_base
int _M_word_size;
_Words *_M_word;
locale _M_ios_locale;
+protected:
virtual ~ ios_base ();
};
template < typename, typename > class istreambuf_iterator
diff --git a/gcc/testsuite/g++.dg/lto/pr84805_0.C b/gcc/testsuite/g++.dg/lto/pr84805_0.C
index c9e00add79f..1509eae4845 100644
--- a/gcc/testsuite/g++.dg/lto/pr84805_0.C
+++ b/gcc/testsuite/g++.dg/lto/pr84805_0.C
@@ -11,7 +11,7 @@ struct __is_void_helper : false_type {};
struct is_void : __is_void_helper {};
template < typename > struct is_array : false_type {};
namespace __gnu_cxx {
-enum _Lock_policy { _S_single, _S_mutex, _S_atomic }; // { dg-lto-warning "6: type '_Lock_policy' violates the C\\+\\+ One Definition Rule" }
+enum _Lock_policy { _S_single, _S_mutex, _S_atomic }; // { dg-lto-warning "6: type '__gnu_cxx::_Lock_policy' violates the C\\+\\+ One Definition Rule" }
const _Lock_policy __default_lock_policy = _S_atomic;
} namespace std {
using __gnu_cxx::_Lock_policy;
diff --git a/gcc/testsuite/g++.dg/opt/dump1.C b/gcc/testsuite/g++.dg/opt/dump1.C
index 38ed055d5c6..558bee00762 100644
--- a/gcc/testsuite/g++.dg/opt/dump1.C
+++ b/gcc/testsuite/g++.dg/opt/dump1.C
@@ -1,8 +1,7 @@
// PR c++/57102
-// { dg-options "-O2 -fno-inline -fdump-final-insns" }
+// { dg-options "-O2 -fno-inline -fdump-final-insns -Wno-return-type" }
// { dg-do compile { target c++11 } }
// { dg-final cleanup-final-insns-dump }
-// { dg-additional-options "-Wno-return-type" }
namespace std
{
@@ -397,7 +396,7 @@ namespace std __attribute__ ((__visibility__ ("default")))
;
template<typename _Signature>
class function;
- class _Function_base
+ struct _Function_base
{
template<typename _Functor>
class _Base_manager
diff --git a/gcc/testsuite/g++.dg/opt/flifetime-dse2.C b/gcc/testsuite/g++.dg/opt/flifetime-dse2.C
index 5f78bc999a2..16d9a748781 100644
--- a/gcc/testsuite/g++.dg/opt/flifetime-dse2.C
+++ b/gcc/testsuite/g++.dg/opt/flifetime-dse2.C
@@ -1,6 +1,5 @@
// { dg-options "-O3 -flifetime-dse" }
// { dg-do run }
-// { dg-xfail-run-if "AIX operator new" { powerpc-ibm-aix* } }
typedef __SIZE_TYPE__ size_t;
inline void * operator new (size_t, void *p) { return p; }
diff --git a/gcc/testsuite/g++.dg/opt/flifetime-dse4.C b/gcc/testsuite/g++.dg/opt/flifetime-dse4.C
index 4a6fe571ef4..c72444a6d65 100644
--- a/gcc/testsuite/g++.dg/opt/flifetime-dse4.C
+++ b/gcc/testsuite/g++.dg/opt/flifetime-dse4.C
@@ -1,6 +1,5 @@
// { dg-options "-O3 -flifetime-dse=1" }
// { dg-do run }
-// { dg-xfail-run-if "AIX operator new" { powerpc-ibm-aix* } }
typedef __SIZE_TYPE__ size_t;
inline void * operator new (size_t, void *p) { return p; }
diff --git a/gcc/testsuite/g++.dg/opt/flifetime-dse7.C b/gcc/testsuite/g++.dg/opt/flifetime-dse7.C
new file mode 100644
index 00000000000..4fe1eb062f4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/flifetime-dse7.C
@@ -0,0 +1,16 @@
+// { dg-options "-O3 -flifetime-dse" }
+// { dg-do run }
+
+template <class T>
+void f()
+{
+ T t = 42;
+ t.~T();
+ if (t == 42) __builtin_abort();
+}
+
+int main()
+{
+ f<int>();
+}
+
diff --git a/gcc/testsuite/g++.dg/opt/pr44919.C b/gcc/testsuite/g++.dg/opt/pr44919.C
index 1916a2b359d..b76bb546735 100644
--- a/gcc/testsuite/g++.dg/opt/pr44919.C
+++ b/gcc/testsuite/g++.dg/opt/pr44919.C
@@ -1,6 +1,5 @@
// { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } }
-// { dg-options "-O3 -fselective-scheduling2" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-O3 -fselective-scheduling2 -Wno-return-type" }
namespace std {
diff --git a/gcc/testsuite/g++.dg/opt/pr47615.C b/gcc/testsuite/g++.dg/opt/pr47615.C
index bc467b0c883..f502e397fe4 100644
--- a/gcc/testsuite/g++.dg/opt/pr47615.C
+++ b/gcc/testsuite/g++.dg/opt/pr47615.C
@@ -1,6 +1,5 @@
// { dg-do compile }
-// { dg-options "-O -fstrict-aliasing -ftree-pre -fno-tree-fre -fno-tree-sra" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-O -fstrict-aliasing -ftree-pre -fno-tree-fre -fno-tree-sra -Wno-return-type" }
typedef __SIZE_TYPE__ size_t;
namespace std
diff --git a/gcc/testsuite/g++.dg/opt/pr55717.C b/gcc/testsuite/g++.dg/opt/pr55717.C
index 7b3af589ee6..c03badd258f 100644
--- a/gcc/testsuite/g++.dg/opt/pr55717.C
+++ b/gcc/testsuite/g++.dg/opt/pr55717.C
@@ -2,6 +2,8 @@
// { dg-do compile }
// { dg-options "-O -g" }
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
+
struct DebugOnly {};
template <class T>
struct StripConst { typedef T result; };
@@ -90,7 +92,7 @@ bool IsScriptMarked (JSScript **);
struct AllocationSiteKey
{
JSScript *script;
- unsigned offset : 24;
+ uint32_t offset : 24;
int kind;
typedef AllocationSiteKey Lookup;
static unsigned hash (AllocationSiteKey key) { return (long (key.script->code + key.offset)) ^ key.kind; }
diff --git a/gcc/testsuite/g++.dg/opt/pr60597.C b/gcc/testsuite/g++.dg/opt/pr60597.C
index c61f7679765..ee2a78b4962 100644
--- a/gcc/testsuite/g++.dg/opt/pr60597.C
+++ b/gcc/testsuite/g++.dg/opt/pr60597.C
@@ -2,44 +2,46 @@
// { dg-do compile }
// { dg-options "-O2 -g" }
+typedef int int32_t __attribute__((mode (__SI__)));
+
struct A
{
- int foo () const;
- int bar () const;
- int a;
+ int32_t foo () const;
+ int32_t bar () const;
+ int32_t a;
};
struct B
{
- int foo ();
- int bar ();
+ int32_t foo ();
+ int32_t bar ();
};
-int *c, d;
+int32_t *c, d;
-int
+int32_t
A::foo () const
{
- int b = a >> 16;
+ int32_t b = a >> 16;
return b;
}
-int
+int32_t
A::bar () const
{
- int b = a;
+ int32_t b = a;
return b;
}
void
-baz (A &x, B h, int i, int j)
+baz (A &x, B h, int32_t i, int32_t j)
{
for (; i < h.bar (); ++i)
for (; h.foo (); ++j)
{
- int g = x.foo ();
- int f = x.bar ();
- int e = c[0] & 1;
+ int32_t g = x.foo ();
+ int32_t f = x.bar ();
+ int32_t e = c[0] & 1;
d = (e << 1) | (g << 16) | (f & 1);
c[j] = 0;
}
diff --git a/gcc/testsuite/g++.dg/opt/pr81715.C b/gcc/testsuite/g++.dg/opt/pr81715.C
index c38b22b7daa..522af3b5aa7 100644
--- a/gcc/testsuite/g++.dg/opt/pr81715.C
+++ b/gcc/testsuite/g++.dg/opt/pr81715.C
@@ -2,6 +2,7 @@
// { dg-do compile }
// Verify the variables for inlined foo parameters are reused
// { dg-options "-O2 -Wframe-larger-than=16384" }
+// { dg-require-effective-target size20plus }
struct S { int a, b, c, d, e; char f[1024]; };
void baz (int *, int *, int *, struct S *, int *, int *);
diff --git a/gcc/testsuite/g++.dg/opt/pr82159-2.C b/gcc/testsuite/g++.dg/opt/pr82159-2.C
index c9797105562..28a3e80aabd 100644
--- a/gcc/testsuite/g++.dg/opt/pr82159-2.C
+++ b/gcc/testsuite/g++.dg/opt/pr82159-2.C
@@ -1,7 +1,6 @@
// PR c++/82159
// { dg-do compile }
-// { dg-options "" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options " -Wno-return-type" }
template <typename T> struct D { T e; };
struct F : D<int[0]> {
diff --git a/gcc/testsuite/g++.dg/opt/pr95080.C b/gcc/testsuite/g++.dg/opt/pr95080.C
new file mode 100644
index 00000000000..2da7df73b72
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr95080.C
@@ -0,0 +1,41 @@
+// PR debug/95080
+// { dg-do compile }
+// { dg-options "-Og -fcse-follow-jumps -fnon-call-exceptions -fcompare-debug" }
+
+char *a;
+
+void baz ();
+
+static inline bool
+bar ()
+{
+ int j = a[0] - 1;
+ switch (j)
+ {
+ case 0:
+ case 2:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static inline bool
+foo ()
+{
+ if (bar ())
+ baz ();
+ return 0;
+}
+
+struct S
+{
+ int h;
+ ~S ();
+};
+
+S::~S ()
+{
+ if (a[0] == 0)
+ foo () != h;
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr95528.C b/gcc/testsuite/g++.dg/opt/pr95528.C
new file mode 100644
index 00000000000..64073298551
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr95528.C
@@ -0,0 +1,27 @@
+// PR target/95528
+// { dg-do compile { target c++11 } }
+// { dg-options "-O3" }
+// { dg-additional-options "-march=skylake-avx512" { target i?86-*-*- x86_64-*-* } }
+
+template <typename a> struct b {
+ typedef a c __attribute__((vector_size(sizeof(a) * 4)));
+ union {
+ c d;
+ struct {
+ a e, f, g, h;
+ };
+ };
+ b();
+ b(const b &i) : d(i.d) {}
+ static b j(c);
+ template <typename k> operator b<k>() {
+ b<k>::j(typename b<k>::c{k(e), k(f), k(g), k(h)});
+ return b<k>();
+ }
+};
+template <typename a> using l = b<a>;
+using m = l<char>;
+using n = l<short>;
+m o(n i) { return i; }
+b<short> q;
+void p() { o(q); }
diff --git a/gcc/testsuite/g++.dg/opt/pr96194.C b/gcc/testsuite/g++.dg/opt/pr96194.C
new file mode 100644
index 00000000000..749be2a2322
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr96194.C
@@ -0,0 +1,21 @@
+// PR middle-end/96194
+// { dg-do compile }
+// { dg-options "-O2" }
+
+#include <new>
+
+struct A { ~A (); };
+struct B : A { float e[64]; };
+
+B *
+foo ()
+{
+ return new ((void *) 0) B ();
+}
+
+B *
+bar (void *x, bool y)
+{
+ void *p = y ? x : (void *) 0;
+ return new (p) B ();
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr96354.C b/gcc/testsuite/g++.dg/opt/pr96354.C
new file mode 100644
index 00000000000..601ce2a9444
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr96354.C
@@ -0,0 +1,24 @@
+// PR debug/96354
+// { dg-do compile }
+// { dg-options "-O2 -g -fopenmp-simd" }
+
+template <int N> struct A { typedef double T[N]; };
+template <int N> struct B { typename A<N>::T b; double *baz () { return b; } };
+template <int N> struct C { B<N> d; C (); };
+template <int N> C<N>::C () { double c = *d.baz (); }
+template <int N> void operator- (C<N>, const C<N> &);
+template <int> struct D {};
+template <int N, int M> C<N> foo (D<N>, C<M>) { C<N> t; return t; }
+int e;
+struct E { D<3> d; void bar (); };
+
+void
+E::bar ()
+{
+#pragma omp simd
+ for (int i = 0; i < e; i++)
+ {
+ C<3> f, g;
+ g - foo (d, f);
+ }
+}
diff --git a/gcc/testsuite/g++.dg/opt/reload3.C b/gcc/testsuite/g++.dg/opt/reload3.C
index 12f3e66f369..daa7ffdbcef 100644
--- a/gcc/testsuite/g++.dg/opt/reload3.C
+++ b/gcc/testsuite/g++.dg/opt/reload3.C
@@ -4,6 +4,8 @@
#include <cstdlib>
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
+
class QTime
{
public:
@@ -15,7 +17,7 @@ private:
unsigned ds;
};
-static const unsigned MSECS_PER_DAY = 86400000;
+static const uint32_t MSECS_PER_DAY = 86400000;
QTime QTime::addMSecs(int ms) const
{
diff --git a/gcc/testsuite/g++.dg/opt/temp2.C b/gcc/testsuite/g++.dg/opt/temp2.C
index 35520a2427c..533579a0599 100644
--- a/gcc/testsuite/g++.dg/opt/temp2.C
+++ b/gcc/testsuite/g++.dg/opt/temp2.C
@@ -1,4 +1,5 @@
// { dg-do run }
+// { dg-require-effective-target size20plus }
// Copyright (C) 2006 Free Software Foundation, Inc.
diff --git a/gcc/testsuite/g++.dg/opt/thunk1.C b/gcc/testsuite/g++.dg/opt/thunk1.C
index 566c0f2fcc5..cbda9187d5b 100644
--- a/gcc/testsuite/g++.dg/opt/thunk1.C
+++ b/gcc/testsuite/g++.dg/opt/thunk1.C
@@ -1,13 +1,14 @@
// PR 6788
// Test that the thunk adjusts the this pointer properly.
// { dg-do run }
+// { dg-require-effective-target size20plus }
extern "C" void abort ();
struct A
{
virtual void foo() = 0;
- char large[33*1024];
+ char large[33*1024U];
};
struct B
diff --git a/gcc/testsuite/g++.dg/other/error23.C b/gcc/testsuite/g++.dg/other/error23.C
index c60603e8ff5..81eec7ce7c7 100644
--- a/gcc/testsuite/g++.dg/other/error23.C
+++ b/gcc/testsuite/g++.dg/other/error23.C
@@ -1,5 +1,5 @@
// PR c++/34918
// { dg-do compile }
-int v __attribute ((vector_size (8)));
+int v __attribute ((vector_size (__SIZEOF_INT__ * 2)));
bool b = !(v - v); // { dg-error "not convert .__vector.2. int. to .bool. in initialization" }
diff --git a/gcc/testsuite/g++.dg/other/error35.C b/gcc/testsuite/g++.dg/other/error35.C
index e9c8371f18b..063bc4a9680 100644
--- a/gcc/testsuite/g++.dg/other/error35.C
+++ b/gcc/testsuite/g++.dg/other/error35.C
@@ -9,6 +9,6 @@ template <typename> struct S {
enum S<char>::E;
template <typename T> enum S<T>::E : int { b };
template <typename T>
-constexpr int S<T>::g() const { b; } // { dg-error "not declared" }
+constexpr int S<T>::g() const { b; if (false) return 0; } // { dg-error "not declared" }
static_assert(S<char>().g() == 1, ""); // { dg-error "" }
// { dg-message "in .constexpr. expansion of" "" { target *-*-* } .-1 }
diff --git a/gcc/testsuite/g++.dg/other/i386-2.C b/gcc/testsuite/g++.dg/other/i386-2.C
index 95314157170..04d5fec0f6c 100644
--- a/gcc/testsuite/g++.dg/other/i386-2.C
+++ b/gcc/testsuite/g++.dg/other/i386-2.C
@@ -1,11 +1,11 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512dq -mavx512bw -mavx512vl -mavx512ifma -mavx512vbmi -mavx512vbmi2 -mavx5124fmaps -mavx5124vnniw -mavx512vpopcntdq -mclwb -mmwaitx -mclzero -mpku -msgx -mrdpid -mgfni -mavx512bitalg -mpconfig -mwbnoinvd -mavx512bf16 -menqcmd -mavx512vp2intersect" } */
+/* { dg-options "-O -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512dq -mavx512bw -mavx512vl -mavx512ifma -mavx512vbmi -mavx512vbmi2 -mavx5124fmaps -mavx5124vnniw -mavx512vpopcntdq -mclwb -mmwaitx -mclzero -mpku -msgx -mrdpid -mgfni -mavx512bitalg -mpconfig -mwbnoinvd -mavx512bf16 -menqcmd -mavx512vp2intersect -mserialize -mtsxldtrk" } */
/* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, mm3dnow.h, fma4intrin.h,
xopintrin.h, abmintrin.h, bmiintrin.h, tbmintrin.h, lwpintrin.h,
popcntintrin.h, fmaintrin.h, pkuintrin.h, avx5124fmapsintrin.h,
avx5124vnniwintrin.h, avx512vpopcntdqintrin.h gfniintrin.h
- avx512bitalgintrin.h, avx512vp2intersectintrin.h,
+ avx512bitalgintrin.h, avx512vp2intersectintrin.h, tsxldtrkintrin.h,
avx512vp2intersectvlintrin.h and mm_malloc.h.h are usable
with -O -pedantic-errors. */
diff --git a/gcc/testsuite/g++.dg/other/i386-3.C b/gcc/testsuite/g++.dg/other/i386-3.C
index 4912e7f40d1..f40172ee9b5 100644
--- a/gcc/testsuite/g++.dg/other/i386-3.C
+++ b/gcc/testsuite/g++.dg/other/i386-3.C
@@ -1,11 +1,11 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O -fkeep-inline-functions -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512dq -mavx512bw -mavx512vl -mavx512ifma -mavx512vbmi -mavx512vbmi2 -mavx5124fmaps -mavx5124vnniw -mavx512vpopcntdq -mclwb -mmwaitx -mclzero -mpku -msgx -mrdpid -mgfni -mavx512bitalg -mpconfig -mwbnoinvd -mavx512bf16 -menqcmd -mavx512vp2intersect" } */
+/* { dg-options "-O -fkeep-inline-functions -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512dq -mavx512bw -mavx512vl -mavx512ifma -mavx512vbmi -mavx512vbmi2 -mavx5124fmaps -mavx5124vnniw -mavx512vpopcntdq -mclwb -mmwaitx -mclzero -mpku -msgx -mrdpid -mgfni -mavx512bitalg -mpconfig -mwbnoinvd -mavx512bf16 -menqcmd -mavx512vp2intersect -mserialize -mtsxldtrk" } */
/* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, mm3dnow.h, fma4intrin.h,
xopintrin.h, abmintrin.h, bmiintrin.h, tbmintrin.h, lwpintrin.h,
popcntintrin.h, fmaintrin.h, pkuintrin.h, avx5124fmapsintrin.h,
avx5124vnniwintrin.h, avx512vpopcntdqintrin.h gfniintrin.h
- avx512bitalgintrin.h, avx512vp2intersectintrin.h,
+ avx512bitalgintrin.h, avx512vp2intersectintrin.h, tsxldtrkintrin.h,
avx512vp2intersectvlintrin.h and mm_malloc.h are usable
with -O -fkeep-inline-functions. */
diff --git a/gcc/testsuite/g++.dg/other/operator1.C b/gcc/testsuite/g++.dg/other/operator1.C
index d0b0cb25f8c..121c106ad18 100644
--- a/gcc/testsuite/g++.dg/other/operator1.C
+++ b/gcc/testsuite/g++.dg/other/operator1.C
@@ -1,7 +1,7 @@
// PR c++/27547
// { dg-do compile }
-int operator=(int); // { dg-error "5:.int operator=\\(int\\). must be a nonstatic member function" }
+int operator=(int); // { dg-error "5:.int operator=\\(int\\). must be a non-static member function" }
void foo()
{
diff --git a/gcc/testsuite/g++.dg/other/pr31078.C b/gcc/testsuite/g++.dg/other/pr31078.C
index 7f610713084..3ea1af25042 100644
--- a/gcc/testsuite/g++.dg/other/pr31078.C
+++ b/gcc/testsuite/g++.dg/other/pr31078.C
@@ -1,4 +1,5 @@
-typedef int SLONG;
+typedef int SLONG __attribute__((mode (__SI__)));
+
typedef char SCHAR;
typedef short SSHORT;
typedef char TEXT;
diff --git a/gcc/testsuite/g++.dg/other/pr52048.C b/gcc/testsuite/g++.dg/other/pr52048.C
index cf388a5a045..7edd283cbd2 100644
--- a/gcc/testsuite/g++.dg/other/pr52048.C
+++ b/gcc/testsuite/g++.dg/other/pr52048.C
@@ -1,7 +1,6 @@
// PR debug/52048
// { dg-do compile }
-// { dg-options "-fcompare-debug -fnon-call-exceptions -fno-tree-dominator-opts -O2" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-fcompare-debug -fnon-call-exceptions -fno-tree-dominator-opts -O2 -Wno-return-type" }
template <typename T> struct A;
template <typename T>
diff --git a/gcc/testsuite/g++.dg/other/pr53574.C b/gcc/testsuite/g++.dg/other/pr53574.C
index cc899a552c8..87622d522ee 100644
--- a/gcc/testsuite/g++.dg/other/pr53574.C
+++ b/gcc/testsuite/g++.dg/other/pr53574.C
@@ -6,7 +6,7 @@ template <typename> struct A { typedef int type; };
struct B {
typedef __SIZE_TYPE__ H;
};
-template <typename> class allocator : B {};
+template <typename> class allocator : public B {};
template <typename _Alloc> struct C {
template <typename T>
static typename T::H foo(T *);
diff --git a/gcc/testsuite/g++.dg/other/pr95231.C b/gcc/testsuite/g++.dg/other/pr95231.C
new file mode 100644
index 00000000000..de063662528
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/pr95231.C
@@ -0,0 +1,4 @@
+/* { dg-do compile { target c++11 } } */
+/* { dg-options "-O3 -fnon-call-exceptions" } */
+
+#include "vector-compare.C"
diff --git a/gcc/testsuite/g++.dg/other/switch4.C b/gcc/testsuite/g++.dg/other/switch4.C
index 42acb1b0d95..5d0047b89c8 100644
--- a/gcc/testsuite/g++.dg/other/switch4.C
+++ b/gcc/testsuite/g++.dg/other/switch4.C
@@ -4,3 +4,4 @@ class a b; // { dg-error "aggregate" }
void c() {
switch () // { dg-error "expected" }
case b // { dg-error "expected" }
+ // { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/overload/builtin4.C b/gcc/testsuite/g++.dg/overload/builtin4.C
new file mode 100644
index 00000000000..567bb933fde
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/builtin4.C
@@ -0,0 +1,31 @@
+// DR 1512
+// PR c++/87699
+// { dg-do compile { target c++11 } }
+
+using nullptr_t = decltype(nullptr);
+
+template<typename T>
+struct S { operator T(); };
+
+void
+fn ()
+{
+ S<nullptr_t> s;
+ // Make sure we create a builtin operator overload candidate for == and !=.
+ if (s == s) { }
+ if (s != s) { }
+
+ // But not for these.
+ if (s > s) { } // { dg-error "no match for" }
+ if (s < s) { } // { dg-error "no match for" }
+ if (s <= s) { } // { dg-error "no match for" }
+ if (s >= s) { } // { dg-error "no match for" }
+
+ S<int *> r;
+ if (s == r) { } // { dg-error "no match for" }
+ if (s != r) { } // { dg-error "no match for" }
+ if (s > r) { } // { dg-error "no match for" }
+ if (s < r) { } // { dg-error "no match for" }
+ if (s >= r) { } // { dg-error "no match for" }
+ if (s <= r) { } // { dg-error "no match for" }
+}
diff --git a/gcc/testsuite/g++.dg/overload/builtin5.C b/gcc/testsuite/g++.dg/overload/builtin5.C
new file mode 100644
index 00000000000..a30251dc79d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/builtin5.C
@@ -0,0 +1,21 @@
+// { dg-do compile { target c++17 } }
+// Don't add built-in operator for ++ on bool.
+
+template<typename T>
+struct S { operator T&(); };
+
+template<int> void
+foo (S<bool>& s)
+{
+ --s; // { dg-error "no match for" }
+ ++s; // { dg-error "no match for" }
+ s++; // { dg-error "declared for postfix" }
+ s--; // { dg-error "declared for postfix" }
+}
+
+void
+bar ()
+{
+ S<bool> s;
+ foo<0> (s);
+}
diff --git a/gcc/testsuite/g++.dg/overload/operator2.C b/gcc/testsuite/g++.dg/overload/operator2.C
index b60c629744e..64640b6cfe0 100644
--- a/gcc/testsuite/g++.dg/overload/operator2.C
+++ b/gcc/testsuite/g++.dg/overload/operator2.C
@@ -3,7 +3,7 @@
struct A
{
- static operator int(); // { dg-error "10:.static A::operator int\\(\\). must be a nonstatic member function" }
+ static operator int(); // { dg-error "10:.static A::operator int\\(\\). must be a non-static member function" }
};
struct B
@@ -11,4 +11,4 @@ struct B
static int operator*(); // { dg-error "14:.static int B::operator\\*\\(\\). must be either a non-static member function or a non-member function" }
};
-static operator int(); // { dg-error "8:.operator int\\(\\). must be a nonstatic member function" }
+static operator int(); // { dg-error "8:.operator int\\(\\). must be a non-static member function" }
diff --git a/gcc/testsuite/g++.dg/parse/attr4.C b/gcc/testsuite/g++.dg/parse/attr4.C
index 7713fc96c64..36ebdbd0bae 100644
--- a/gcc/testsuite/g++.dg/parse/attr4.C
+++ b/gcc/testsuite/g++.dg/parse/attr4.C
@@ -1,3 +1,4 @@
// PR c++/93684 - ICE-on-invalid with broken attribute.
-[[a:: // { dg-error "expected|expected" }
+[[a:: // { dg-error "expected" }
+ // { dg-error "-:expected" "" { target c++11 } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/concat1.C b/gcc/testsuite/g++.dg/parse/concat1.C
index 7d19a7db84d..e5748c02eab 100644
--- a/gcc/testsuite/g++.dg/parse/concat1.C
+++ b/gcc/testsuite/g++.dg/parse/concat1.C
@@ -3,7 +3,7 @@
/* Intended as a compile-time test for string literal concatenation. */
-#define e0 "a" /* { dg-error "size of string literal is too large" "" { target { ! size32plus } } } */
+#define e0 "a" /* { dg-error "size of string literal is too large" "" { target { ! size20plus } } } */
#define e1 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0
#define e2 e1 e1 e1 e1 e1 e1 e1 e1 e1 e1
#define e3 e2 e2 e2 e2 e2 e2 e2 e2 e2 e2
diff --git a/gcc/testsuite/g++.dg/parse/cond4.C b/gcc/testsuite/g++.dg/parse/cond4.C
index ae210e0d750..893caeaa571 100644
--- a/gcc/testsuite/g++.dg/parse/cond4.C
+++ b/gcc/testsuite/g++.dg/parse/cond4.C
@@ -4,3 +4,4 @@
void foo()
{
if (struct A{}// { dg-error "types may not be defined|expected" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/constructor2.C b/gcc/testsuite/g++.dg/parse/constructor2.C
index e514e9397e9..d620f41e027 100644
--- a/gcc/testsuite/g++.dg/parse/constructor2.C
+++ b/gcc/testsuite/g++.dg/parse/constructor2.C
@@ -5,7 +5,7 @@ class T
{
public:
T(short,short f=0) {}
- T<TClass>(int f) {}
- T<TClass>(int f=0,const char* b=0) {}
+ T<TClass>(int f) {} // { dg-error "expected" "" { target c++20 } }
+ T<TClass>(int f=0,const char* b=0) {} // { dg-error "expected" "" { target c++20 } }
};
diff --git a/gcc/testsuite/g++.dg/parse/crash10.C b/gcc/testsuite/g++.dg/parse/crash10.C
index 24822423488..7e2dec6bcb3 100644
--- a/gcc/testsuite/g++.dg/parse/crash10.C
+++ b/gcc/testsuite/g++.dg/parse/crash10.C
@@ -5,9 +5,8 @@
// PR c++ 10953. ICE
-// { dg-bogus "" "" { target *-*-* } 14 }
-
class
{
typename::
-; // { dg-error "" }
+; // { dg-error "expected" }
+ // { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/crash18.C b/gcc/testsuite/g++.dg/parse/crash18.C
index 7e326aa9827..596d3109ccc 100644
--- a/gcc/testsuite/g++.dg/parse/crash18.C
+++ b/gcc/testsuite/g++.dg/parse/crash18.C
@@ -4,4 +4,4 @@
// PR 18095: ICE
// Origin: Volker Reichelt <reichelt@gcc.gnu.org>
-struct A // { dg-error "expected" }
+struct A // { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/crash27.C b/gcc/testsuite/g++.dg/parse/crash27.C
index 217928781d3..08977b2a4a8 100644
--- a/gcc/testsuite/g++.dg/parse/crash27.C
+++ b/gcc/testsuite/g++.dg/parse/crash27.C
@@ -1,4 +1,5 @@
// Bug: 23225
void Dispatcher()
- (__builtin_offsetof (ArgsType, largeMsgLen)) // { dg-error "initialize|end of input" }
+ (__builtin_offsetof (ArgsType, largeMsgLen)) // { dg-error "initialize" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/crash34.C b/gcc/testsuite/g++.dg/parse/crash34.C
index 181e5841747..86f79cc4aef 100644
--- a/gcc/testsuite/g++.dg/parse/crash34.C
+++ b/gcc/testsuite/g++.dg/parse/crash34.C
@@ -3,4 +3,5 @@
void foo()
{
- namespace N { /* { dg-error "is not allowed|at end of input" } */
+ namespace N { /* { dg-error "is not allowed" } */
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/crash35.C b/gcc/testsuite/g++.dg/parse/crash35.C
index 161edad32a2..05f0a631a31 100644
--- a/gcc/testsuite/g++.dg/parse/crash35.C
+++ b/gcc/testsuite/g++.dg/parse/crash35.C
@@ -4,4 +4,4 @@
struct a {};
class foo : public a, a // { dg-error "duplicate base" }
-{ /* { dg-error "at end of input" } */
+{ // { dg-error "-:at end of input" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/crash52.C b/gcc/testsuite/g++.dg/parse/crash52.C
index bc7f03c8d97..5dfb69c41d6 100644
--- a/gcc/testsuite/g++.dg/parse/crash52.C
+++ b/gcc/testsuite/g++.dg/parse/crash52.C
@@ -1,3 +1,4 @@
// PR c++/39053
-void foo() = // { dg-error "initialized|expected" }
+void foo() = // { dg-error "initialized" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/crash55.C b/gcc/testsuite/g++.dg/parse/crash55.C
index 23ce203b3b5..2e88c476fc7 100644
--- a/gcc/testsuite/g++.dg/parse/crash55.C
+++ b/gcc/testsuite/g++.dg/parse/crash55.C
@@ -1,8 +1,8 @@
// PR c++/42038
-extern int __cxa_begin_catch; // { dg-error "declared incorrectly" }
+extern int __cxa_begin_catch; // { dg-message "previous declaration" }
void f(void)
{
- try { } catch (int) { }
+ try { } catch (int) { } // { dg-error "redeclared" }
}
diff --git a/gcc/testsuite/g++.dg/parse/crash59.C b/gcc/testsuite/g++.dg/parse/crash59.C
index 7e90dde6c8a..7526b08e105 100644
--- a/gcc/testsuite/g++.dg/parse/crash59.C
+++ b/gcc/testsuite/g++.dg/parse/crash59.C
@@ -1,4 +1,4 @@
// PR c++/53003
struct A{ void a{} return b // { dg-error "16:function definition" }
-// { dg-error "expected" "" { target *-*-* } .-1 }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/crash61.C b/gcc/testsuite/g++.dg/parse/crash61.C
index b2004b85173..713fe9f15e1 100644
--- a/gcc/testsuite/g++.dg/parse/crash61.C
+++ b/gcc/testsuite/g++.dg/parse/crash61.C
@@ -5,3 +5,4 @@
struct pair { constexpr pair (const) : }; // { dg-error "" }
template <0> make_pair () {} // { dg-error "" }
pair prefix[] = { 0, make_pair } // { dg-error "" }
+// { dg-error "-:expected" "" { target c++11 } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/crash67.C b/gcc/testsuite/g++.dg/parse/crash67.C
index dee0fc72212..2a5bb3f1d91 100644
--- a/gcc/testsuite/g++.dg/parse/crash67.C
+++ b/gcc/testsuite/g++.dg/parse/crash67.C
@@ -3,4 +3,5 @@
class x0;
template <x1> x2() { // { dg-error "declared|type" }
-x0 x3 = x3. // { dg-error "expected|incomplete type" }
+x0 x3 = x3. // { dg-error "incomplete type" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/ctor3.C b/gcc/testsuite/g++.dg/parse/ctor3.C
index e597d926f40..786f9fc98c1 100644
--- a/gcc/testsuite/g++.dg/parse/ctor3.C
+++ b/gcc/testsuite/g++.dg/parse/ctor3.C
@@ -4,5 +4,5 @@ struct A {};
struct B : A
{
- B() : A {} // { dg-error "initializer|expected" }
-};
+ B() : A {} // { dg-error "initializer" "" { target c++98_only } }
+}; // { dg-error "expected" }
diff --git a/gcc/testsuite/g++.dg/parse/defarg5.C b/gcc/testsuite/g++.dg/parse/defarg5.C
index 01a67ed5915..a81b3c4d391 100644
--- a/gcc/testsuite/g++.dg/parse/defarg5.C
+++ b/gcc/testsuite/g++.dg/parse/defarg5.C
@@ -6,10 +6,13 @@
// PR c++/12167 - infinite recursion
+typedef int int32_t __attribute__((mode (__SI__)));
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
+
class A {
- void report(int d
+ void report(int32_t d
// the default arg is what NAN etc can expand to, but
// with the floatiness removed.
- = (__extension__ ((union { unsigned l; int d; })
+ = (__extension__ ((union { uint32_t l; int32_t d; })
{ l: 0x7fc00000U }).d));
};
diff --git a/gcc/testsuite/g++.dg/parse/dtor12.C b/gcc/testsuite/g++.dg/parse/dtor12.C
index 1acdfa36b69..dda7388192b 100644
--- a/gcc/testsuite/g++.dg/parse/dtor12.C
+++ b/gcc/testsuite/g++.dg/parse/dtor12.C
@@ -2,5 +2,5 @@
template <class T> class a
{
- ~a<T>();
+ ~a<T>(); // { dg-error "template-id not allowed for destructor" "" { target c++20 } }
};
diff --git a/gcc/testsuite/g++.dg/parse/dtor4.C b/gcc/testsuite/g++.dg/parse/dtor4.C
index 729ee2fa130..1a1a8458745 100644
--- a/gcc/testsuite/g++.dg/parse/dtor4.C
+++ b/gcc/testsuite/g++.dg/parse/dtor4.C
@@ -7,4 +7,4 @@ template <int N> struct X {
};
template <int N>
-X<N>::~X<N>(){}
+X<N>::~X<N>(){} // { dg-error "template-id not allowed for destructor" "" { target c++20 } }
diff --git a/gcc/testsuite/g++.dg/parse/enum14.C b/gcc/testsuite/g++.dg/parse/enum14.C
new file mode 100644
index 00000000000..be09cca5211
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/enum14.C
@@ -0,0 +1,7 @@
+// PR c++/96077
+
+int main ()
+{
+ enum { E = (2 } e; // { dg-error "expected" }
+ enum { F = true ? 2 : (3 /* missing ")" here */ } f; // { dg-error "expected" }
+}
diff --git a/gcc/testsuite/g++.dg/parse/error11.C b/gcc/testsuite/g++.dg/parse/error11.C
index 1a49d6edb12..4baf97e531d 100644
--- a/gcc/testsuite/g++.dg/parse/error11.C
+++ b/gcc/testsuite/g++.dg/parse/error11.C
@@ -1,5 +1,5 @@
// { dg-do compile }
-// { dg-options "-fshow-column" }"
+// { dg-options "-fshow-column" }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// Try to find out when the digraph '<:' is used as a mistake, and parse it
// correctly to avoid cascaded errors.
@@ -50,12 +50,16 @@ void func(void)
// the special error message.
Foo<: :B> k2; // { dg-bogus "cannot begin|alternate spelling" "smart error should not be triggered here" }
Foo[:B> k1; // { dg-bogus "cannot begin|alternate spelling" "smart error should not be triggered here" }
-// { dg-error "6:missing template arguments before" "template" { target *-*-* } 51 }
-// { dg-error "9:expected primary-expression before ':' token" "primary" { target *-*-* } 51 }
-// { dg-error "8:expected '\]' before ':' token" "backslash" { target *-*-* } 51 }
-// { dg-error "6:missing template arguments before" "template" { target *-*-* } 52 }
-// { dg-error "7:expected primary-expression before ':' token" "primary" { target *-*-* } 52 }
-// { dg-error "7:expected '\]' before ':' token" "backslash" { target *-*-* } 52 }
+// { dg-error "6:missing template arguments before" "template" { target c++14_down } .-2 }
+// { dg-error "9:expected primary-expression before ':' token" "primary" { target c++14_down } .-3 }
+// { dg-error "8:expected '\]' before ':' token" "backslash" { target c++14_down } .-4 }
+// { dg-error "6:missing template arguments before" "template" { target c++14_down } .-4 }
+// { dg-error "7:expected primary-expression before ':' token" "primary" { target c++14_down } .-5 }
+// { dg-error "7:expected '\]' before ':' token" "backslash" { target c++14_down } .-6 }
+// { dg-error "9:expected identifier" "" { target c++17 } .-8 }
+// { dg-error "8:expected" "" { target c++17 } .-9 }
+// { dg-error "7:expected identifier" "" { target c++17 } .-9 }
+// { dg-error "7:expected" "" { target c++17 } .-10 }
//
int Foo[2];
Foo[::value] = 0;
diff --git a/gcc/testsuite/g++.dg/parse/error14.C b/gcc/testsuite/g++.dg/parse/error14.C
index e87ce83201d..fd654180007 100644
--- a/gcc/testsuite/g++.dg/parse/error14.C
+++ b/gcc/testsuite/g++.dg/parse/error14.C
@@ -19,6 +19,5 @@ struct X
Zinc<int>( //);
// }
-}; // { dg-error "2:expected '.' at end of input" "at end of input" }
- // { dg-error "1:expected primary-expression before '.' token" "primary" { target *-*-* } .-1 }
- // { dg-error "1:expected unqualified-id" "unqualified-id" { target *-*-* } .-2 }
+}; // { dg-error "1:expected primary-expression before '.' token" "primary" }
+// { dg-error "-:expected" "at end of input" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/error33.C b/gcc/testsuite/g++.dg/parse/error33.C
index 0d25386a879..61b0cc3f2dc 100644
--- a/gcc/testsuite/g++.dg/parse/error33.C
+++ b/gcc/testsuite/g++.dg/parse/error33.C
@@ -8,9 +8,9 @@ struct A
typedef void (A::T)(); /* { dg-error "15:typedef name may not be a nested" } */
-void bar(T); /* { dg-message "note: declared here" } */
+void bar(T);
void baz()
{
- bar(&A::foo); /* { dg-error "too many arguments" } */
+ bar(&A::foo);
}
diff --git a/gcc/testsuite/g++.dg/parse/error4.C b/gcc/testsuite/g++.dg/parse/error4.C
index 792bf4dc063..fe8de73790d 100644
--- a/gcc/testsuite/g++.dg/parse/error4.C
+++ b/gcc/testsuite/g++.dg/parse/error4.C
@@ -7,4 +7,4 @@ struct X {
int);
};
-// { dg-error "4:'itn' has not been declared" "" { target *-*-* } 6 }
+// { dg-error "18:'itn' has not been declared" "" { target *-*-* } 6 }
diff --git a/gcc/testsuite/g++.dg/parse/error5.C b/gcc/testsuite/g++.dg/parse/error5.C
index 576ae9fd09b..53a46219a35 100644
--- a/gcc/testsuite/g++.dg/parse/error5.C
+++ b/gcc/testsuite/g++.dg/parse/error5.C
@@ -12,7 +12,7 @@ class Foo { int foo() return 0; } };
// message has been generated by cp_parser_error() which does not
// necessarily allow accurate column number display. At some point, we will
// need make cp_parser_error() report more accurate column numbers.
-// { dg-error "30:expected '\{' at end of input" "brace" { target *-*-* } 5 }
+// { dg-error "31:expected '\{' at end of input" "brace" { target *-*-* } 5 }
// { dg-error "34:expected ';' after class definition" "semicolon" {target *-*-* } 5 }
diff --git a/gcc/testsuite/g++.dg/parse/error56.C b/gcc/testsuite/g++.dg/parse/error56.C
index 7c81ab4488f..11d31973138 100644
--- a/gcc/testsuite/g++.dg/parse/error56.C
+++ b/gcc/testsuite/g++.dg/parse/error56.C
@@ -2,4 +2,6 @@
template <0> int __copy_streambufs_eof; // { dg-error "" }
class {
+// { dg-error "forbids" "" { target *-*-* } .+1 }
friend __copy_streambufs_eof <> ( // { dg-error "" }
+ // { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/invalid1.C b/gcc/testsuite/g++.dg/parse/invalid1.C
index f72e277488d..cb4ef1a6902 100644
--- a/gcc/testsuite/g++.dg/parse/invalid1.C
+++ b/gcc/testsuite/g++.dg/parse/invalid1.C
@@ -2,4 +2,5 @@
// { dg-do compile { target c++11 } }
// { dg-options "-w" }
-int foo ( foo += *[ // { dg-error "" }
+int foo ( foo += *[ // { dg-error "expected" }
+// { dg-error "-:invalid|expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C b/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C
index 5ff3fb21929..c6106d5206e 100644
--- a/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C
+++ b/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C
@@ -3,4 +3,5 @@
// { dg-do compile }
struct {
- a(void = 0; a(0), a(0) // { dg-error "" }
+ a(void = 0; a(0), a(0) // { dg-error "" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/parser-pr28152-2.C b/gcc/testsuite/g++.dg/parse/parser-pr28152-2.C
index 11e1063e12a..28048bd1a9a 100644
--- a/gcc/testsuite/g++.dg/parse/parser-pr28152-2.C
+++ b/gcc/testsuite/g++.dg/parse/parser-pr28152-2.C
@@ -8,4 +8,4 @@ main (void)
z = __complex__ (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '__complex__'" "primary-expression" }
z = __complex__ (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '__complex__'" "primaty-expression" }
- // { dg-error "at end of input" "end" { target *-*-* } .-1 }
+ // { dg-error "-:at end of input" "end" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/parser-pr28152.C b/gcc/testsuite/g++.dg/parse/parser-pr28152.C
index ceefee3790c..34617340fab 100644
--- a/gcc/testsuite/g++.dg/parse/parser-pr28152.C
+++ b/gcc/testsuite/g++.dg/parse/parser-pr28152.C
@@ -8,4 +8,4 @@ main (void)
z = _Complex (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '_Complex'" "primary-expression" }
z = _Complex (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '_Complex'" "primary-expression" }
- // { dg-error "at end of input" "end" { target *-*-* } .-1 }
+ // { dg-error "-:at end of input" "end" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/pr68722.C b/gcc/testsuite/g++.dg/parse/pr68722.C
index 44a6213a0a6..26f6d11cfe1 100644
--- a/gcc/testsuite/g++.dg/parse/pr68722.C
+++ b/gcc/testsuite/g++.dg/parse/pr68722.C
@@ -4,6 +4,6 @@ class A {
&__loc // { dg-error "" }
} class ios_base { // { dg-error "" }
A _M_ios_locale ios_base(ios_base &) template <_Traits> class basic_ios { // { dg-error "" }
-basic_ios basic_ios = operator= // { dg-error "" }
-
+ basic_ios basic_ios = operator= // { dg-error "" }
// { dg-prune-output "file ends in default argument" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/parse/pr96257.C b/gcc/testsuite/g++.dg/parse/pr96257.C
new file mode 100644
index 00000000000..34b0208c5d7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/pr96257.C
@@ -0,0 +1,18 @@
+// PR96257 we scan forwards checking for a compound literal. Do not
+// eat the tokens when doing that!
+/* { dg-require-effective-target fopenmp } */
+/* { dg-additional-options -fopenmp } */
+
+int
+f2 ()
+{
+ int s = (int // { dg-error "expected" }
+#pragma omp atomic capture
+ ){1};
+
+ int t = (int // { dg-error "expected" }
+#pragma omp atomic capture ){
+ {1};
+
+ return s + t;
+} // { dg-bogus "expected" }
diff --git a/gcc/testsuite/g++.dg/parse/pragma-recovery.C b/gcc/testsuite/g++.dg/parse/pragma-recovery.C
new file mode 100644
index 00000000000..cc9d323ad19
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/pragma-recovery.C
@@ -0,0 +1,32 @@
+/* { dg-additional-options -fopenmp } */
+/* { dg-require-effective-target fopenmp } */
+
+// Make sure error recovery doesn't get confused by tokens inside a
+// deferred pragma.
+// OpenMP is a convenient deferred pragma insertion mechanism.
+
+void foo ()
+{
+ 1 * "" // { dg-error "invalid" }
+#pragma omp atomic {
+ ;
+
+ }
+
+void bar ()
+{
+ 1 * "" // { dg-error "invalid" }
+#pragma omp atomic }
+ ;
+
+ }
+
+void baz ()
+{
+ 1 * "" // { dg-error "invalid" }
+#pragma omp atomic ;
+ 0;
+
+
+ }
+
diff --git a/gcc/testsuite/g++.dg/pr46852.C b/gcc/testsuite/g++.dg/pr46852.C
index 2c9d8dd4144..5cfeaf96e19 100644
--- a/gcc/testsuite/g++.dg/pr46852.C
+++ b/gcc/testsuite/g++.dg/pr46852.C
@@ -4,4 +4,5 @@
template
<
class
-{ // { dg-error "" }
+{ // { dg-error "" }
+// { dg-error "-:" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/pr46868.C b/gcc/testsuite/g++.dg/pr46868.C
index 544c7b219df..25b8c966f4d 100644
--- a/gcc/testsuite/g++.dg/pr46868.C
+++ b/gcc/testsuite/g++.dg/pr46868.C
@@ -2,3 +2,4 @@
// { dg-do compile }
template < int > struct S { S < // { dg-error "" }
+ // { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/pr48484.C b/gcc/testsuite/g++.dg/pr48484.C
index 19e9b9a8d0a..9dc6d1c4f21 100644
--- a/gcc/testsuite/g++.dg/pr48484.C
+++ b/gcc/testsuite/g++.dg/pr48484.C
@@ -2,9 +2,11 @@
/* { dg-options "-O -finline-functions -finline-small-functions -Wuninitialized" } */
/* { dg-add-options bind_pic_locally } */
+typedef int int32_t __attribute__((mode (__SI__)));
+
struct SQObjectPtr
{
- int _type;
+ int32_t _type;
SQObjectPtr operator = (long);
};
struct SQObjectPtrVec
@@ -53,11 +55,11 @@ bool
nrefidx = 0;
switch (o1._type)
{
- case 0x02000000:
+ case 0x02000000L:
o4 = nrefidx;
jump = 1;
return true;
- case 0x00000080:
+ case 0x00000080L:
{
long
idx = 10;
diff --git a/gcc/testsuite/g++.dg/pr53037-2.C b/gcc/testsuite/g++.dg/pr53037-2.C
index e617f9051f0..e716beed6ab 100644
--- a/gcc/testsuite/g++.dg/pr53037-2.C
+++ b/gcc/testsuite/g++.dg/pr53037-2.C
@@ -2,6 +2,8 @@
/* { dg-do compile } */
/* { dg-options "-O0 -Wpacked-not-aligned" } */
+typedef int int32_t __attribute__((mode (__SI__)));
+
struct __attribute__ ((aligned (8))) S8 { char a[8]; };
struct __attribute__ ((packed)) S1 { /* { dg-warning "alignment 1 of 'S1' is less than 8" } */
struct S8 s8;
@@ -12,13 +14,13 @@ struct __attribute__ ((packed, aligned (8))) S2 {
};
struct __attribute__ ((packed, aligned (8))) S3 {
- int i1;
+ int32_t i1;
struct S8 s8; /* { dg-warning "'S3::s8' offset 4 in 'S3' isn't aligned to 8" } */
};
struct __attribute__ ((packed, aligned (8))) S4 {
- int i1;
- int i2;
+ int32_t i1;
+ int32_t i2;
struct S8 s8;
};
@@ -27,11 +29,11 @@ struct __attribute__ ((packed)) S5 {
};
union __attribute__ ((packed)) U1 { /* { dg-warning "alignment 1 of 'U1' is less than 8" } */
- int i1;
+ int32_t i1;
struct S8 s8;
};
union __attribute__ ((packed, aligned (8))) U2 {
- int i1;
+ int32_t i1;
struct S8 s8;
};
diff --git a/gcc/testsuite/g++.dg/pr53037-3.C b/gcc/testsuite/g++.dg/pr53037-3.C
index 1ed6354f677..c79268f7cc8 100644
--- a/gcc/testsuite/g++.dg/pr53037-3.C
+++ b/gcc/testsuite/g++.dg/pr53037-3.C
@@ -2,6 +2,8 @@
/* { dg-do compile } */
/* { dg-options "-O0 -Wall" } */
+typedef int int32_t __attribute__((mode (__SI__)));
+
struct __attribute__ ((aligned (8))) S8 { char a[8]; };
struct __attribute__ ((packed)) S1 { /* { dg-warning "alignment 1 of 'S1' is less than 8" } */
struct S8 s8;
@@ -12,13 +14,13 @@ struct __attribute__ ((packed, aligned (8))) S2 {
};
struct __attribute__ ((packed, aligned (8))) S3 {
- int i1;
+ int32_t i1;
struct S8 s8; /* { dg-warning "'S3::s8' offset 4 in 'S3' isn't aligned to 8" } */
};
struct __attribute__ ((packed, aligned (8))) S4 {
- int i1;
- int i2;
+ int32_t i1;
+ int32_t i2;
struct S8 s8;
};
@@ -27,11 +29,11 @@ struct __attribute__ ((packed)) S5 {
};
union __attribute__ ((packed)) U1 { /* { dg-warning "alignment 1 of 'U1' is less than 8" } */
- int i1;
+ int32_t i1;
struct S8 s8;
};
union __attribute__ ((packed, aligned (8))) U2 {
- int i1;
+ int32_t i1;
struct S8 s8;
};
diff --git a/gcc/testsuite/g++.dg/pr57662.C b/gcc/testsuite/g++.dg/pr57662.C
index 2180914ce46..a23bfc9f2fb 100644
--- a/gcc/testsuite/g++.dg/pr57662.C
+++ b/gcc/testsuite/g++.dg/pr57662.C
@@ -1,6 +1,5 @@
/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O2 -fselective-scheduling2 -fsel-sched-pipelining" } */
-/* { dg-additional-options "-Wno-return-type" } */
+/* { dg-options "-O2 -fselective-scheduling2 -fsel-sched-pipelining -Wno-return-type" } */
extern "C" {
typedef struct _IO_FILE FILE;
diff --git a/gcc/testsuite/g++.dg/pr59510.C b/gcc/testsuite/g++.dg/pr59510.C
index 4ac5becfd26..14a6af33183 100644
--- a/gcc/testsuite/g++.dg/pr59510.C
+++ b/gcc/testsuite/g++.dg/pr59510.C
@@ -1,7 +1,6 @@
// PR debug/59510
// { dg-do compile }
-// { dg-options "-O2 -g --param=large-stack-frame-growth=1" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-O2 -g --param=large-stack-frame-growth=1 -Wno-return-type" }
template <typename _Iterator>
struct _Iter_base
diff --git a/gcc/testsuite/g++.dg/pr66655.C b/gcc/testsuite/g++.dg/pr66655.C
index 218a2c63eb3..e4a40b02912 100644
--- a/gcc/testsuite/g++.dg/pr66655.C
+++ b/gcc/testsuite/g++.dg/pr66655.C
@@ -7,13 +7,13 @@ extern "C" void abort (void);
#define COOKIE 0xabcd0123
-int
+int32_t
g (void)
{
return COOKIE;
}
-extern int f (void);
+extern int32_t f (void);
int
main (void)
diff --git a/gcc/testsuite/g++.dg/pr66655.h b/gcc/testsuite/g++.dg/pr66655.h
index ff638f43970..c730fbad48e 100644
--- a/gcc/testsuite/g++.dg/pr66655.h
+++ b/gcc/testsuite/g++.dg/pr66655.h
@@ -1,5 +1,7 @@
+typedef int int32_t __attribute__((mode (__SI__)));
+
struct S
{
- static int i;
- static void set (int ii) { i = -ii; }
+ static int32_t i;
+ static void set (int32_t ii) { i = -ii; }
};
diff --git a/gcc/testsuite/g++.dg/pr66655_1.cc b/gcc/testsuite/g++.dg/pr66655_1.cc
index d42344c4a04..96a10714cfc 100644
--- a/gcc/testsuite/g++.dg/pr66655_1.cc
+++ b/gcc/testsuite/g++.dg/pr66655_1.cc
@@ -1,13 +1,13 @@
#include "pr66655.h"
-extern int g (void);
+extern int32_t g (void);
-int S::i;
+int32_t S::i;
-int
+int32_t
f (void)
{
- int ret = g ();
+ int32_t ret = g ();
S::set (ret);
return ret;
diff --git a/gcc/testsuite/g++.dg/pr67351.C b/gcc/testsuite/g++.dg/pr67351.C
index f5bdda6cca7..152d92af188 100644
--- a/gcc/testsuite/g++.dg/pr67351.C
+++ b/gcc/testsuite/g++.dg/pr67351.C
@@ -3,7 +3,7 @@
typedef unsigned char uchar;
typedef unsigned short ushort;
-typedef unsigned int uint;
+typedef unsigned uint __attribute__((mode (__SI__)));
typedef unsigned long long uint64;
class MyRgba
diff --git a/gcc/testsuite/g++.dg/pr67989.C b/gcc/testsuite/g++.dg/pr67989.C
index 26748997fdd..7967f692b03 100644
--- a/gcc/testsuite/g++.dg/pr67989.C
+++ b/gcc/testsuite/g++.dg/pr67989.C
@@ -1,6 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-std=c++11 -O2" } */
-/* { dg-additional-options "-Wno-return-type" } */
+/* { dg-options "-std=c++11 -O2 -Wno-return-type" } */
__extension__ typedef unsigned long long int uint64_t;
namespace std __attribute__ ((__visibility__ ("default")))
diff --git a/gcc/testsuite/g++.dg/pr71973-2.C b/gcc/testsuite/g++.dg/pr71973-2.C
index d8271b1d874..b0719b6a5a2 100644
--- a/gcc/testsuite/g++.dg/pr71973-2.C
+++ b/gcc/testsuite/g++.dg/pr71973-2.C
@@ -10,7 +10,7 @@ __attribute__ ((__nothrow__));
void foo () throw ()
{
- strftime (0,0,0,0); // { dg-warning "null argument where non-null required" }
+ strftime (0,0,0,0); // { dg-warning "argument \(1|3|4\) null where non-null expected" }
// { dg-warning "too many arguments for format" "" { target *-*-* } .-1 }
}
diff --git a/gcc/testsuite/g++.dg/pr81194.C b/gcc/testsuite/g++.dg/pr81194.C
index 08f6fc0f39f..b3019170d1e 100644
--- a/gcc/testsuite/g++.dg/pr81194.C
+++ b/gcc/testsuite/g++.dg/pr81194.C
@@ -1,6 +1,5 @@
// { dg-do compile { target c++17 } }
-// { dg-options "-O2 -fno-exceptions" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-O2 -fno-exceptions -Wno-return-type" }
template <class a> struct b { typedef a *c; };
class e {};
diff --git a/gcc/testsuite/g++.dg/pr96308.C b/gcc/testsuite/g++.dg/pr96308.C
new file mode 100644
index 00000000000..9009bba5e82
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr96308.C
@@ -0,0 +1,7 @@
+// { dg-do compile }
+// { dg-options "-Os -fno-move-loop-invariants -std=c++11" }
+
+struct NonTrivial3 {
+ ~NonTrivial3();
+};
+void i() { thread_local NonTrivial3 tlarr[10]; }
diff --git a/gcc/testsuite/g++.dg/spellcheck-inttypes.C b/gcc/testsuite/g++.dg/spellcheck-inttypes.C
new file mode 100644
index 00000000000..84bfc125513
--- /dev/null
+++ b/gcc/testsuite/g++.dg/spellcheck-inttypes.C
@@ -0,0 +1,80 @@
+/* { dg-options "-std=c++11" } */
+#include <cstdio>
+#include <cstdint>
+/* Missing <cinttypes>. */
+
+int8_t i8;
+int16_t i16;
+int32_t i32;
+int64_t i64;
+
+intptr_t ip;
+uintptr_t up;
+
+/* As an identifier. */
+const char *hex8_fmt = PRIx8; /* { dg-error "'PRIx8' was not declared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIx8' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+const char *hex16_fmt = PRIx16; /* { dg-error "'PRIx16' was not declared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIx16' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+const char *hex32_fmt = PRIx32; /* { dg-error "'PRIx32' was not declared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIx32' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+const char *hex64_fmt = PRIx64; /* { dg-error "'PRIx64' was not declared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIx64' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+const char *hexptr_fmt = PRIxPTR; /* { dg-error "'PRIxPTR' was not declared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIxPTR' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+
+/* As a part of a string-literal. */
+const char *dec8msg_fmt = "Provide %" PRId8 "\n"; /* { dg-error "expected" "expected string-literal" { target *-*-* } } */
+/* { dg-message "'PRId8' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+const char *dec16msg_fmt = "Provide %" PRId16 "\n"; /* { dg-error "expected" "expected string-literal" { target *-*-* } } */
+/* { dg-message "'PRId16' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+const char *dec32msg_fmt = "Provide %" PRId32 "\n"; /* { dg-error "expected" "expected string-literal" { target *-*-* } } */
+/* { dg-message "'PRId32' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+const char *dec64msg_fmt = "Provide %" PRId64 "\n"; /* { dg-error "expected" "expected string-literal" { target *-*-* } } */
+/* { dg-message "'PRId64' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+const char *decptrmsg_fmt = "Provide %" PRIdPTR "\n"; /* { dg-error "expected" "expected string-literal" { target *-*-* } } */
+/* { dg-message "'PRIdPTR' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+
+void test_printf (void)
+{
+ printf ("some format strings %s, %s, %s, %s, %s, %s\n",
+ PRId8, /* { dg-error "'PRId8' was not declared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRId8' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+ PRIi16, /* { dg-error "'PRIi16' was not declared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIi16' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+ PRIo32, /* { dg-error "'PRIo32' was not declared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIo32' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+ PRIu64, /* { dg-error "'PRIu64' was not declared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIu64' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+ PRIx32, /* { dg-error "'PRIx32' was not declared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIx32' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+ PRIoPTR); /* { dg-error "'PRIoPTR' was not declared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIoPTR' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+
+ printf ("%" PRIo8 "\n", i8); /* { dg-error "expected" } */
+/* { dg-message "'PRIo8' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+ printf ("%" PRIo16 "\n", i16); /* { dg-error "expected" } */
+/* { dg-message "'PRIo16' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+ printf ("%" PRIo32 "\n", i32); /* { dg-error "expected" } */
+/* { dg-message "'PRIo32' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+ printf ("%" PRIo64 "\n", i64); /* { dg-error "expected" } */
+/* { dg-message "'PRIo64' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+ printf ("%" PRIoPTR "\n", ip); /* { dg-error "expected" } */
+/* { dg-message "'PRIoPTR' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+}
+
+void test_scanf (void)
+{
+ scanf ("%" SCNu8 "\n", &i8); /* { dg-error "expected" } */
+/* { dg-message "'SCNu8' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+ scanf ("%" SCNu16 "\n", &i16); /* { dg-error "expected" } */
+/* { dg-message "'SCNu16' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+ scanf ("%" SCNu32 "\n", &i32); /* { dg-error "expected" } */
+/* { dg-message "'SCNu32' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+ scanf ("%" SCNu64 "\n", &i64); /* { dg-error "expected" } */
+/* { dg-message "'SCNu64' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+ scanf ("%" SCNuPTR "\n", &ip); /* { dg-error "expected" } */
+/* { dg-message "'SCNuPTR' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+ scanf ("%" SCNxPTR "\n", &up); /* { dg-error "expected" } */
+/* { dg-message "'SCNxPTR' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?" "replacement note" { target *-*-* } .-1 } */
+}
diff --git a/gcc/testsuite/g++.dg/spellcheck-stdint.C b/gcc/testsuite/g++.dg/spellcheck-stdint.C
new file mode 100644
index 00000000000..b9ce3b7aed8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/spellcheck-stdint.C
@@ -0,0 +1,68 @@
+/* { dg-options "-std=c++11" } */
+/* Missing <cstdint>. */
+
+char c = INT8_MAX; // { dg-error "'INT8_MAX' was not declared" }
+// { dg-message "'INT8_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+
+short s = INT16_MAX; // { dg-error "'INT16_MAX' was not declared" }
+// { dg-message "'INT16_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+
+int i = INT32_MAX; // { dg-error "'INT32_MAX' was not declared" }
+// { dg-message "'INT32_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+
+long l = INT64_MAX; // { dg-error "'INT64_MAX' was not declared" }
+// { dg-message "'INT64_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+
+intptr_t test_intptr (void) // { dg-error "'intptr_t' does not name a type" }
+// { dg-message "'intptr_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+{
+ return 0;
+}
+
+int test_intptr_max (void)
+{
+ return (int) INTPTR_MAX; // { dg-error "'INTPTR_MAX' was not declared" }
+// { dg-message "'INTPTR_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+}
+
+uintptr_t test_uintptr (void) // { dg-error "'uintptr_t' does not name a type" }
+// { dg-message "'uintptr_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+{
+ return 0;
+}
+
+unsigned int test_uintptr_max (void)
+{
+ return (unsigned int) UINTPTR_MAX; // { dg-error "'UINTPTR_MAX' was not declared" }
+// { dg-message "'UINTPTR_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+}
+
+int8_t i8; // { dg-error "'int8_t' does not name a type" }
+// { dg-message "'int8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+int16_t i16; // { dg-error "'int16_t' does not name a type" }
+// { dg-message "'int16_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+int32_t i32; // { dg-error "'int32_t' does not name a type" }
+// { dg-message "'int32_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+int64_t i64; // { dg-error "'int64_t' does not name a type" }
+// { dg-message "'int64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+
+void test_uint_t (void)
+{
+ char bu8[(unsigned int)UINT8_MAX]; // { dg-error "'UINT8_MAX' was not declared" }
+ // { dg-message "'UINT8_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+ char bu16[(unsigned int)UINT16_MAX]; // { dg-error "'UINT16_MAX' was not declared" }
+ // { dg-message "'UINT16_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+ char bu32[(unsigned int)UINT32_MAX]; // { dg-error "'UINT32_MAX' was not declared" }
+ // { dg-message "'UINT32_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+ char bu64[(unsigned int)UINT64_MAX]; // { dg-error "'UINT64_MAX' was not declared" }
+ // { dg-message "'UINT64_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+
+ auto ui8 = (uint8_t) 8; // { dg-error "'uint8_t' was not declared" }
+ // { dg-message "'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+ auto ui16 = (uint16_t) 16; // { dg-error "'uint16_t' was not declared" }
+ // { dg-message "'uint16_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+ auto ui32 = (uint32_t) 32; // { dg-error "'uint32_t' was not declared" }
+ // { dg-message "'uint32_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+ auto ui64 = (uint64_t) 64; // { dg-error "'uint64_t' was not declared" }
+ // { dg-message "'uint64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?" "" { target *-*-* } .-1 }
+}
diff --git a/gcc/testsuite/g++.dg/template/access30.C b/gcc/testsuite/g++.dg/template/access30.C
new file mode 100644
index 00000000000..b03a99af1f0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/access30.C
@@ -0,0 +1,10 @@
+// PR c++/41437
+// { dg-do compile }
+
+class A { struct B { B(); }; };
+template<typename T> void f() { A::B b; } // { dg-error "private" }
+void g() { f<int>(); }
+
+class X { template<typename> struct A{}; };
+
+X::A<int> a; // { dg-error "private" }
diff --git a/gcc/testsuite/g++.dg/template/access31.C b/gcc/testsuite/g++.dg/template/access31.C
new file mode 100644
index 00000000000..0aa7dbbf8f1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/access31.C
@@ -0,0 +1,29 @@
+// PR c++/47346
+// { dg-do compile }
+
+class C
+{
+ struct Private { };
+};
+
+template<typename T>
+struct exploit1
+{
+ typedef C::Private type; // { dg-error "private" }
+};
+exploit1<int>::type x1;
+
+template<typename T>
+struct exploit2 : C::Private // { dg-error "private" }
+{
+};
+exploit2<int> x2;
+
+template<typename T>
+struct exploit3
+{
+ template<class U = C::Private> // { dg-error "private" }
+ struct E {};
+};
+
+exploit3<int>::E<> e;
diff --git a/gcc/testsuite/g++.dg/template/array30.C b/gcc/testsuite/g++.dg/template/array30.C
index 98723ace609..34f8a58aad8 100644
--- a/gcc/testsuite/g++.dg/template/array30.C
+++ b/gcc/testsuite/g++.dg/template/array30.C
@@ -1,7 +1,9 @@
-template <int I>
+typedef int int32_t __attribute__((mode (__SI__)));
+
+template <int32_t I>
struct A
{
- int ar[I][I][I][I][I][I][I][I][I][I]; // { dg-error "exceeds maximum object size" }
+ int32_t ar[I][I][I][I][I][I][I][I][I][I]; // { dg-error "exceeds maximum object size" }
};
A<66000> a;
diff --git a/gcc/testsuite/g++.dg/template/array9.C b/gcc/testsuite/g++.dg/template/array9.C
index f3e8335c943..ce9fb649d3a 100644
--- a/gcc/testsuite/g++.dg/template/array9.C
+++ b/gcc/testsuite/g++.dg/template/array9.C
@@ -7,8 +7,8 @@ struct Tree {
Tree* R[subtrees]; // { dg-error "" }
~Tree()
{
- delete [] L[0]; // { dg-error "" }
- delete [] R[0]; // { dg-error "" }
+ delete [] L[0];
+ delete [] R[0];
}
};
diff --git a/gcc/testsuite/g++.dg/template/canon-type-8.C b/gcc/testsuite/g++.dg/template/canon-type-8.C
index b72bd0fb770..dde7d20f84c 100644
--- a/gcc/testsuite/g++.dg/template/canon-type-8.C
+++ b/gcc/testsuite/g++.dg/template/canon-type-8.C
@@ -1,8 +1,7 @@
// PR c++/45984
// We were getting different canonical types for matching types because
// TYPE_ALIGN wasn't propagated to all the variants fast enough.
-// { dg-options "" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-Wno-return-type" }
typedef __SIZE_TYPE__ size_t;
enum { chunk_size = 16 };
diff --git a/gcc/testsuite/g++.dg/template/cast6.C b/gcc/testsuite/g++.dg/template/cast6.C
new file mode 100644
index 00000000000..743eadaa5dd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/cast6.C
@@ -0,0 +1,19 @@
+// PR c++/95728
+
+template<typename T>
+ void
+ construct(T* p)
+ { ::new(static_cast<void*>(p)) T; } // { dg-error "invalid .static_cast." }
+
+template<typename T>
+void
+f(const T* t)
+{
+ construct(t);
+}
+
+int main()
+{
+ int i[1];
+ f(i);
+}
diff --git a/gcc/testsuite/g++.dg/template/constant1.C b/gcc/testsuite/g++.dg/template/constant1.C
index a2c5a08d366..850d02ded0d 100644
--- a/gcc/testsuite/g++.dg/template/constant1.C
+++ b/gcc/testsuite/g++.dg/template/constant1.C
@@ -3,7 +3,13 @@
extern void foo(int);
template <class Key, class Value> void Basic() {
+#if __SIZEOF_INT__ == 4
const int kT = 1.5e6; // <--- causes ICE
+#elif __SIZEOF_INT__ == 2
+ const int kT = 1.5e4; // <--- causes ICE
+#elif __SIZEOF_INT__ == 1
+ const int kT = 1.5e2; // <--- causes ICE
+#endif
int size = kT*2/3;
do {
foo(size);
diff --git a/gcc/testsuite/g++.dg/template/constant2.C b/gcc/testsuite/g++.dg/template/constant2.C
index f71e4f56a22..ddf16694c31 100644
--- a/gcc/testsuite/g++.dg/template/constant2.C
+++ b/gcc/testsuite/g++.dg/template/constant2.C
@@ -3,7 +3,13 @@
template<class C>
class test {
protected:
+#if __SIZEOF_INT__ == 4
static const int versionConst = 0x80000000;
+#elif __SIZEOF_INT__ == 2
+ static const int versionConst = 0x8000;
+#elif __SIZEOF_INT__ == 1
+ static const int versionConst = 0x80;
+#endif
enum { versionEnum = versionConst };
public:
int getVersion();
diff --git a/gcc/testsuite/g++.dg/template/conv16.C b/gcc/testsuite/g++.dg/template/conv16.C
new file mode 100644
index 00000000000..c0843efdf9d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/conv16.C
@@ -0,0 +1,17 @@
+// PR c++/95508
+// { dg-do compile }
+
+template <typename>
+struct A;
+template <typename>
+struct B {
+ operator int () { return 0; }
+};
+template <>
+struct A<unsigned> : B<int> {};
+struct D {
+ template <typename>
+ int foo () { return e[f]; }
+ int e[6];
+ A<unsigned> f;
+};
diff --git a/gcc/testsuite/g++.dg/template/crash106.C b/gcc/testsuite/g++.dg/template/crash106.C
index 8d972699900..f904bd4dc9b 100644
--- a/gcc/testsuite/g++.dg/template/crash106.C
+++ b/gcc/testsuite/g++.dg/template/crash106.C
@@ -4,11 +4,9 @@ typedef double T;
struct A
{
- template<T> void foo(); // { dg-error "type" }
+ template<T> void foo(); // { dg-error "type" "" { target c++17_down } }
};
-template<T N = 0, void (A::*)() = &A::foo<N> > struct B {}; // { dg-error "type|declared" }
+template<T N = 0.0, void (A::*)() = &A::foo<N> > struct B {}; // { dg-error "type|declared" "" { target c++17_down } }
-B<> b; // { dg-message "non-type" }
-
-// { dg-prune-output "(could not convert|no matches)" }
+B<> b; // { dg-error "(could not convert|no matches)" "" { target c++17_down } }
diff --git a/gcc/testsuite/g++.dg/template/crash107.C b/gcc/testsuite/g++.dg/template/crash107.C
index 9d8d394d93d..aab882d8446 100644
--- a/gcc/testsuite/g++.dg/template/crash107.C
+++ b/gcc/testsuite/g++.dg/template/crash107.C
@@ -1,7 +1,6 @@
// PR c++/44625
// { dg-do compile }
-// { dg-options "" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-Wno-return-type" }
template<typename FP_> struct Vec { // { dg-message "note" "" { target c++17_down } }
Vec& operator^=(Vec& rhs) {
@@ -11,9 +10,9 @@ template<typename FP_> struct Vec { // { dg-message "note" "" { target c++17_dow
X = y*rhs.z() - z*rhs.y(); // { dg-error "not declared|no member" }
}
Vec& operator^(Vec& rhs) {
- return Vec(*this)^=rhs; // { dg-message "required" }
+ return Vec(*this)^=rhs;
}
};
Vec<double> v(3,4,12); // { dg-error "no matching|too many initializers" }
Vec<double> V(12,4,3); // { dg-error "no matching|too many initializers" }
-Vec<double> c = v^V; // { dg-message "required" }
+Vec<double> c = v^V;
diff --git a/gcc/testsuite/g++.dg/template/crash115.C b/gcc/testsuite/g++.dg/template/crash115.C
index 80f8683a136..c1a72352714 100644
--- a/gcc/testsuite/g++.dg/template/crash115.C
+++ b/gcc/testsuite/g++.dg/template/crash115.C
@@ -1,3 +1,4 @@
// PR c++/56534
template < struct template rebind < > // { dg-error "expected|must follow" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/template/crash119.C b/gcc/testsuite/g++.dg/template/crash119.C
index 95d80a8ffc5..3911327ad3a 100644
--- a/gcc/testsuite/g++.dg/template/crash119.C
+++ b/gcc/testsuite/g++.dg/template/crash119.C
@@ -1,6 +1,6 @@
// PR c++/59115
-template<typename T, float, int, typename U> void foo(T, U) {} // { dg-error "valid type" }
+template<typename T, float, int, typename U> void foo(T, U) {} // { dg-error "valid type" "" { target c++17_down } }
void bar()
{
diff --git a/gcc/testsuite/g++.dg/template/crash43.C b/gcc/testsuite/g++.dg/template/crash43.C
index cbb1221b355..3647a17cad8 100644
--- a/gcc/testsuite/g++.dg/template/crash43.C
+++ b/gcc/testsuite/g++.dg/template/crash43.C
@@ -4,5 +4,5 @@ extern "C" {
template<typename _Tp> // { dg-error "C" }
struct ___is_pod {
enum {
- __value = (sizeof(__gnu_internal::__test_type<_Tp>(0)))}; // { dg-error "declared|expected" }
-
+ __value = (sizeof(__gnu_internal::__test_type<_Tp>(0)))}; // { dg-error "expected|declared" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/template/crash87.C b/gcc/testsuite/g++.dg/template/crash87.C
index af81edbfd80..7da6623612a 100644
--- a/gcc/testsuite/g++.dg/template/crash87.C
+++ b/gcc/testsuite/g++.dg/template/crash87.C
@@ -17,7 +17,7 @@ template <bool name>
class BUG2 : BUG
{
public:
- typedef BUG1_5<name> ptr; // { dg-error "convert" }
+ typedef BUG1_5<name> ptr; // { dg-error "BUG::name" }
};
int main()
diff --git a/gcc/testsuite/g++.dg/template/crash90.C b/gcc/testsuite/g++.dg/template/crash90.C
index 4cfc40822a8..e2a58e31819 100644
--- a/gcc/testsuite/g++.dg/template/crash90.C
+++ b/gcc/testsuite/g++.dg/template/crash90.C
@@ -4,4 +4,6 @@ template < unsigned >
struct A ;
template < typename >
struct B ;
-template < typename T , A < B < T > {}// { dg-error "initializer|parse error|type|expected" }
+template < typename T , A < B < T > {} // { dg-error "parse error|non-type|initializer" }
+
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/template/dtor4.C b/gcc/testsuite/g++.dg/template/dtor4.C
index 4f277b248bd..917681fc13e 100644
--- a/gcc/testsuite/g++.dg/template/dtor4.C
+++ b/gcc/testsuite/g++.dg/template/dtor4.C
@@ -5,5 +5,5 @@
template<int> struct A
{
- ~A<0>(); // { dg-error "parse error|declaration" }
+ ~A<0>(); // { dg-error "parse error|declaration|template-id" }
};
diff --git a/gcc/testsuite/g++.dg/template/error-recovery1.C b/gcc/testsuite/g++.dg/template/error-recovery1.C
index ef9dc141bc7..6f9ce6d6bc2 100644
--- a/gcc/testsuite/g++.dg/template/error-recovery1.C
+++ b/gcc/testsuite/g++.dg/template/error-recovery1.C
@@ -6,4 +6,5 @@ template < typename > struct T
template < typename >
template < bool > struct T < S > // { dg-error "" }
{
- void f () { // { dg-error "" }
+ void f () { // { dg-error "expected" }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/template/error30.C b/gcc/testsuite/g++.dg/template/error30.C
index e1706af0b7a..3a87872d526 100644
--- a/gcc/testsuite/g++.dg/template/error30.C
+++ b/gcc/testsuite/g++.dg/template/error30.C
@@ -2,4 +2,4 @@
template<int> struct A;
-template<template<typename> class B> A<B<int>::x> operator() (); // { dg-error "51:.A<B<int>::x> operator\\(\\)\\(\\). must be a nonstatic member function" }
+template<template<typename> class B> A<B<int>::x> operator() (); // { dg-error "51:.A<B<int>::x> operator\\(\\)\\(\\). must be a non-static member function" }
diff --git a/gcc/testsuite/g++.dg/template/error34.C b/gcc/testsuite/g++.dg/template/error34.C
index d0cbcaef28e..ab688d9ba8c 100644
--- a/gcc/testsuite/g++.dg/template/error34.C
+++ b/gcc/testsuite/g++.dg/template/error34.C
@@ -3,27 +3,27 @@
template<typename T> struct A
{
- A<__builtin_offsetof(T, x)>(); // { dg-error "type/value mismatch|offsetof\\(T, x\\)" }
+ A<__builtin_offsetof(T, x)>(); // { dg-error "type/value mismatch|offsetof\\(T, x\\)|expected" }
};
template<typename T> struct B
{
- B<__builtin_offsetof(T, x.y)>(); // { dg-error "type/value mismatch|offsetof\\(T, x.y\\)" }
+ B<__builtin_offsetof(T, x.y)>(); // { dg-error "type/value mismatch|offsetof\\(T, x.y\\)|expected" }
};
template<typename T> struct C
{
- C<__builtin_offsetof(T, x[6])>(); // { dg-error "type/value mismatch|offsetof\\(T, x\\\[6\\\]\\)" }
+ C<__builtin_offsetof(T, x[6])>(); // { dg-error "type/value mismatch|offsetof\\(T, x\\\[6\\\]\\)|expected" }
};
template<typename T> struct D
{
- D<__builtin_offsetof(T, x.y[6].z)>(); // { dg-error "type/value mismatch|offsetof\\(T, x.y\\\[6\\\].z\\)" }
+ D<__builtin_offsetof(T, x.y[6].z)>(); // { dg-error "type/value mismatch|offsetof\\(T, x.y\\\[6\\\].z\\)|expected" }
};
struct E { int x; };
template<typename T> struct F
{
- F<__builtin_offsetof(E, x)>(); // { dg-error "type/value mismatch|offsetof\\(E, x\\)" }
+ F<__builtin_offsetof(E, x)>(); // { dg-error "type/value mismatch|offsetof\\(E, x\\)|expected" }
};
diff --git a/gcc/testsuite/g++.dg/template/error35.C b/gcc/testsuite/g++.dg/template/error35.C
index d52e599315e..0ba8635507b 100644
--- a/gcc/testsuite/g++.dg/template/error35.C
+++ b/gcc/testsuite/g++.dg/template/error35.C
@@ -1,3 +1,3 @@
// PR c++/33494
-template<int> void foo(int(*f=0)()); // { dg-error "declared void|scope|erroneous-expression" }
+template<int> void foo(int(*f=0)()); // { dg-error "declared void|scope|cannot be used as a function" }
diff --git a/gcc/testsuite/g++.dg/template/error41.C b/gcc/testsuite/g++.dg/template/error41.C
index c92b8497aff..21e8ffbc20e 100644
--- a/gcc/testsuite/g++.dg/template/error41.C
+++ b/gcc/testsuite/g++.dg/template/error41.C
@@ -8,5 +8,5 @@ struct A
template <int> struct B
{
- int x[A::i]; // { dg-error "array bound is not an integer constant" }
+ int x[A::i]; // { dg-error "not an integral constant-expression" }
};
diff --git a/gcc/testsuite/g++.dg/template/error56.C b/gcc/testsuite/g++.dg/template/error56.C
index 3eda04c3225..e85471a50b0 100644
--- a/gcc/testsuite/g++.dg/template/error56.C
+++ b/gcc/testsuite/g++.dg/template/error56.C
@@ -9,4 +9,6 @@ struct A
int main()
{
A().f<1>(); // { dg-error "f<1>" }
+ // { dg-error "type/value mismatch at argument 1" "" { target *-*-* } .-1 }
+ // { dg-message "expected a type, got .1." "" { target *-*-* } .-2 }
}
diff --git a/gcc/testsuite/g++.dg/template/error57.C b/gcc/testsuite/g++.dg/template/error57.C
index f67e0a6fa63..121fbb1d523 100644
--- a/gcc/testsuite/g++.dg/template/error57.C
+++ b/gcc/testsuite/g++.dg/template/error57.C
@@ -2,4 +2,4 @@
template <int()> struct a;
template <int(b)> a < b // { dg-error "int" }
-// { dg-error "expected" "" { target *-*-* } .-1 }
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.dg/template/error59.C b/gcc/testsuite/g++.dg/template/error59.C
new file mode 100644
index 00000000000..f81a28c2f1a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/error59.C
@@ -0,0 +1,11 @@
+template<int N> struct S { };
+
+template<template<typename> class TT>
+void foo();
+
+void bar()
+{
+ foo<S>(); // { dg-error "no matching function" }
+ // { dg-error "type/value mismatch at argument 1" "" { target *-*-* } .-1 }
+ // { dg-message "expected a template of type .template<class> class TT., got .template<int N> struct S." "" { target *-*-* } .-2 }
+}
diff --git a/gcc/testsuite/g++.dg/template/friend18.C b/gcc/testsuite/g++.dg/template/friend18.C
index 712d4889fea..a9c51788661 100644
--- a/gcc/testsuite/g++.dg/template/friend18.C
+++ b/gcc/testsuite/g++.dg/template/friend18.C
@@ -5,9 +5,11 @@
// PR 10158. implicit inline template friends ICE'd
-template <int N> struct X
+typedef int int32_t __attribute__((mode (__SI__)));
+
+template <int32_t N> struct X
{
- template <int M> friend int foo(X const &, X<M> const&)
+ template <int32_t M> friend int32_t foo(X const &, X<M> const&)
{
return N * 10000 + M;
}
diff --git a/gcc/testsuite/g++.dg/template/incomplete12.C b/gcc/testsuite/g++.dg/template/incomplete12.C
new file mode 100644
index 00000000000..335e5356874
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/incomplete12.C
@@ -0,0 +1,9 @@
+// PR c++/96132
+// { dg-do compile }
+
+template <int> class a;
+
+template <int b> class c {
+ a<b> e;
+ void operator=(c d) { e = d; }
+};
diff --git a/gcc/testsuite/g++.dg/template/lookup12.C b/gcc/testsuite/g++.dg/template/lookup12.C
new file mode 100644
index 00000000000..fc5939ab0f6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/lookup12.C
@@ -0,0 +1,26 @@
+// PR c++/94799 - member template function lookup fails.
+
+template<typename T> struct B {
+ void foo ();
+ int i;
+};
+
+template<typename T>
+struct D : public B<T> { };
+
+template<typename T>
+void fn (D<T> d)
+{
+ d.template B<T>::foo ();
+ d.template B<T>::i = 42;
+ D<T>().template B<T>::foo ();
+ d.template D<T>::template B<T>::foo ();
+ d.template D<T>::template B<T>::i = 10;
+}
+
+int
+main ()
+{
+ D<int> d;
+ fn(d);
+}
diff --git a/gcc/testsuite/g++.dg/template/lookup13.C b/gcc/testsuite/g++.dg/template/lookup13.C
new file mode 100644
index 00000000000..a8c7e18a707
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/lookup13.C
@@ -0,0 +1,28 @@
+// PR c++/94799 - member template function lookup fails.
+
+template <typename T>
+struct A {
+ int a() {
+ return 42;
+ }
+
+ template<typename> struct X { typedef int type; };
+};
+
+template <typename T>
+struct B {
+ int b(A<T> *p) {
+ int i = 0;
+ i += p->a();
+ i += p->template A<T>::a();
+ i += p->template A<T>::template A<T>::a();
+ i += A<T>().template A<T>::a();
+ return i;
+ }
+};
+
+int main() {
+ A<int> a;
+ B<int> b;
+ return b.b(&a);
+}
diff --git a/gcc/testsuite/g++.dg/template/lookup14.C b/gcc/testsuite/g++.dg/template/lookup14.C
new file mode 100644
index 00000000000..e1c945a6dca
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/lookup14.C
@@ -0,0 +1,11 @@
+// PR c++/94799 - member template function lookup fails.
+
+template<typename T>
+struct A { };
+
+template<typename T>
+void fn (A<T> a)
+{
+ // Don't perform name lookup of foo when parsing this template.
+ a.template A<T>::foo ();
+}
diff --git a/gcc/testsuite/g++.dg/template/lookup15.C b/gcc/testsuite/g++.dg/template/lookup15.C
new file mode 100644
index 00000000000..c7f3ba01576
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/lookup15.C
@@ -0,0 +1,24 @@
+// PR c++/94799 - member template function lookup fails.
+
+template<typename>
+struct M { void fn() { } };
+
+M<int>* bar (int);
+M<int> bar2 (int);
+
+template<typename T>
+struct X : M<T> {
+ void xfn ()
+ {
+ this->template M<T>::fn ();
+ bar((T)1)->template M<T>::fn ();
+ bar2((T)1).template M<T>::fn ();
+ }
+};
+
+int
+main ()
+{
+ X<int> x;
+ x.xfn();
+}
diff --git a/gcc/testsuite/g++.dg/template/nontype12.C b/gcc/testsuite/g++.dg/template/nontype12.C
index 4ec22ef94e3..e37cf8f7646 100644
--- a/gcc/testsuite/g++.dg/template/nontype12.C
+++ b/gcc/testsuite/g++.dg/template/nontype12.C
@@ -3,19 +3,19 @@
template<typename T> struct A
{
- template<T> int foo(); // { dg-error "double" }
- template<template<T> class> int bar(); // { dg-error "double" }
- template<T> struct X; // { dg-error "double" }
+ template<T> int foo(); // { dg-error "double" "" { target c++17_down } }
+ template<template<T> class> int bar(); // { dg-error "double" "" { target c++17_down } }
+ template<T> struct X; // { dg-error "double" "" { target c++17_down } }
};
A<char> a1;
-A<double> a2; // { dg-message "required" }
+A<double> a2; // { dg-message "required" "" { target c++17_down } }
template<typename T> struct B
{
- template<double> int foo(); // { dg-error "double" }
- template<template<double> class> int bar(); // { dg-error "double" }
- template<double> struct X; // { dg-error "double" }
+ template<double> int foo(); // { dg-error "double" "" { target c++17_down } }
+ template<template<double> class> int bar(); // { dg-error "double" "" { target c++17_down } }
+ template<double> struct X; // { dg-error "double" "" { target c++17_down } }
};
template<void> int foo(); // { dg-error "void" }
@@ -24,12 +24,12 @@ template<void> struct X; // { dg-error "void" }
template<typename T> struct C
{
- template<T> int foo(); // { dg-error "double" }
+ template<T> int foo(); // { dg-error "double" "" { target c++17_down } }
};
-template<typename T> int baz(T) { C<T> c; return 0;} // { dg-message "required" }
+template<typename T> int baz(T) { C<T> c; return 0;} // { dg-message "required" "" { target c++17_down } }
void foobar()
{
- baz(1.2); // { dg-message "required" }
+ baz(1.2); // { dg-message "required" "" { target c++17_down } }
}
diff --git a/gcc/testsuite/g++.dg/template/nontype13.C b/gcc/testsuite/g++.dg/template/nontype13.C
index 3250109aa4a..4d6b323ed64 100644
--- a/gcc/testsuite/g++.dg/template/nontype13.C
+++ b/gcc/testsuite/g++.dg/template/nontype13.C
@@ -11,7 +11,7 @@ struct Dummy
template<bool B>
void tester()
{
- bar<evil>()(); // { dg-error "constant|template|convert" }
+ bar<evil>()(); // { dg-error "constant|template|convert|member function" }
}
template<bool B>
struct bar
diff --git a/gcc/testsuite/g++.dg/template/nontype18.C b/gcc/testsuite/g++.dg/template/nontype18.C
index cbe0a1b5a0d..b68416dca61 100644
--- a/gcc/testsuite/g++.dg/template/nontype18.C
+++ b/gcc/testsuite/g++.dg/template/nontype18.C
@@ -5,4 +5,4 @@ template<int I> struct A
template<typename T> void foo();
};
-template<int I> template<typename T> void A<0>::foo() {} // { dg-error "template parameter" }
+template<int I> template<typename T> void A<0>::foo() {} // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/template/nontype25.C b/gcc/testsuite/g++.dg/template/nontype25.C
index 3918bea4246..aba85092794 100644
--- a/gcc/testsuite/g++.dg/template/nontype25.C
+++ b/gcc/testsuite/g++.dg/template/nontype25.C
@@ -7,16 +7,16 @@ template<const A* a> class C {};
template<const B* b> class D {};
template<B* b> class E {};
-template<const B* b> void f(D<b> &, C<static_cast<const A*>(b)> &) {} // { dg-error "" }
+template<const B* b> void f(D<b> &, C<static_cast<const A*>(b)> &) {} // { dg-error "" "" { target { ! c++20 } } }
template<const B* b> void g(D<b> &, E<const_cast<B*>(b)> &) {} // { dg-error "" "" { target { ! c++11 } } }
B b;
int main()
{
- C<static_cast<const A*>(&b)> c; // { dg-error "" }
+ C<static_cast<const A*>(&b)> c; // { dg-error "" "" { target c++17_down } }
D<&b> d;
E<const_cast<B*>(&b)> e; // { dg-error "" "" { target { ! c++11 } } }
- f(d, c); // { dg-error "" "" { target c++11 } }
+ f(d, c); // { dg-error "" "" { target { c++11 && { ! c++20 } } } }
g(d, e);
}
diff --git a/gcc/testsuite/g++.dg/template/nontype8.C b/gcc/testsuite/g++.dg/template/nontype8.C
index b4fbeaed2d8..a0458b91ed4 100644
--- a/gcc/testsuite/g++.dg/template/nontype8.C
+++ b/gcc/testsuite/g++.dg/template/nontype8.C
@@ -6,9 +6,9 @@ template<int* p> class X { };
int a[10];
struct S { int m; static int s; } s;
-X<&a[2]> x3; // { dg-error "3:.& a\\\[2\\\]. is not a valid template argument" "" { target c++17 } }
+X<&a[2]> x3; // { dg-error "3:.& a\\\[2\\\]. is not a valid template argument" "" { target c++17_only } }
// { dg-error "" "" { target c++14_down } .-1 }
-X<&s.m> x4; // { dg-error "3:.& s.S::m. is not a valid template argument" "" { target c++17 } }
+X<&s.m> x4; // { dg-error "3:.& s.S::m. is not a valid template argument" "" { target c++17_only } }
// { dg-error "" "" { target c++14_down } .-1 }
X<&s.s> x5; // { dg-error "" "" { target { ! c++17 } } } &S::s must be used
X<&S::s> x6; // OK: address of static member
diff --git a/gcc/testsuite/g++.dg/template/partial-order1.C b/gcc/testsuite/g++.dg/template/partial-order1.C
index 0832ea535ca..624bb4bc0f0 100644
--- a/gcc/testsuite/g++.dg/template/partial-order1.C
+++ b/gcc/testsuite/g++.dg/template/partial-order1.C
@@ -14,5 +14,5 @@ void f(typename A<T>::size_type, T);
int main()
{
- f(1,2); // { dg-error "ambiguous" }
+ f(1,2);
}
diff --git a/gcc/testsuite/g++.dg/template/partial-order2.C b/gcc/testsuite/g++.dg/template/partial-order2.C
new file mode 100644
index 00000000000..2aed6008d05
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/partial-order2.C
@@ -0,0 +1,20 @@
+// CWG 2235
+
+namespace X
+{
+ template<typename T> struct Const { typedef void type; };
+ template<typename T> void f(T, typename Const<T>::type*); // T1
+ template<typename T> void f(T, void *); // T2
+ void g(void *p) { f(0, p); }
+}
+
+namespace Y
+{
+ struct A { A(int); };
+ struct B { B(int); };
+
+ template<typename T> void f(T, A);
+ template<typename T> void f(T*, B);
+
+ void g(int *p) { f(p, 0); } // { dg-error "ambiguous" }
+}
diff --git a/gcc/testsuite/g++.dg/template/pr39425.C b/gcc/testsuite/g++.dg/template/pr39425.C
index d55f547e253..cd304896a61 100644
--- a/gcc/testsuite/g++.dg/template/pr39425.C
+++ b/gcc/testsuite/g++.dg/template/pr39425.C
@@ -5,14 +5,16 @@ class a {
template<unsigned int s>
struct _rec {
- static const char size = _rec< (s >> 1) >::size;
+ static const char size = _rec< (s >> 1) >::size; // { dg-error "depth" }
};
template<> // { dg-error "explicit" }
- struct _rec <0> {
+ struct _rec <0> { // { dg-error "too few" }
static const char size = 0;
};
static const unsigned int value = _rec < 1 >::size;
-} // { dg-error "after class definition" }
+};
+
+// { dg-prune-output "compilation terminated" }
diff --git a/gcc/testsuite/g++.dg/template/pr68978.C b/gcc/testsuite/g++.dg/template/pr68978.C
index 19045329f01..cf91558847f 100644
--- a/gcc/testsuite/g++.dg/template/pr68978.C
+++ b/gcc/testsuite/g++.dg/template/pr68978.C
@@ -1,39 +1,41 @@
// PR c++/68978
-int i = 0, c = 0, radix = 10, max = 0x7fffffff;
+typedef int int32_t __attribute__((mode (__SI__)));
-template <typename T> int toi_1() {
+int32_t i = 0, c = 0, radix = 10, max = 0x7fffffff;
+
+template <typename T> int32_t toi_1() {
if (max < ((i *= radix) += c))
return 0;
return i;
}
-template <typename T> int toi_2() {
+template <typename T> int32_t toi_2() {
if (max < ((i = radix) = c))
return 0;
return i;
}
-template <typename T> int toi_3() {
+template <typename T> int32_t toi_3() {
if (max < ((i = radix) += c))
return 0;
return i;
}
-template <typename T> int toi_4() {
+template <typename T> int32_t toi_4() {
if (max < ((i += radix) = c))
return 0;
return i;
}
-template <typename T> int toi_5() {
+template <typename T> int32_t toi_5() {
if (max < (((i = radix) += (c += 5)) *= 30))
return 0;
return i;
}
-int x = toi_1<int> ();
-int y = toi_2<int> ();
-int z = toi_3<int> ();
-int w = toi_4<int> ();
-int r = toi_5<int> ();
+int32_t x = toi_1<int32_t> ();
+int32_t y = toi_2<int32_t> ();
+int32_t z = toi_3<int32_t> ();
+int32_t w = toi_4<int32_t> ();
+int32_t r = toi_5<int32_t> ();
diff --git a/gcc/testsuite/g++.dg/template/pr79650.C b/gcc/testsuite/g++.dg/template/pr79650.C
index 72c78140942..11d28c5b207 100644
--- a/gcc/testsuite/g++.dg/template/pr79650.C
+++ b/gcc/testsuite/g++.dg/template/pr79650.C
@@ -11,10 +11,10 @@ foo ()
static int a, b;
lab1:
lab2:
- A<(intptr_t)&&lab1 - (__INTPTR_TYPE__)&&lab2> c; // { dg-error "not a constant integer" }
- A<(intptr_t)&&lab1 - (__INTPTR_TYPE__)&&lab1> d;
- A<(intptr_t)&a - (intptr_t)&b> e; // { dg-error "is not a constant expression" }
- A<(intptr_t)&a - (intptr_t)&a> f;
- A<(intptr_t)sizeof(a) + (intptr_t)&a> g; // { dg-error "not a constant integer" }
+ A<(intptr_t)&&lab1 - (__INTPTR_TYPE__)&&lab2> c; // { dg-error "conversion from pointer type" }
+ A<(intptr_t)&&lab1 - (__INTPTR_TYPE__)&&lab1> d; // { dg-error "conversion from pointer type" }
+ A<(intptr_t)&a - (intptr_t)&b> e; // { dg-error "conversion from pointer type" }
+ A<(intptr_t)&a - (intptr_t)&a> f; // { dg-error "conversion from pointer type" }
+ A<(intptr_t)sizeof(a) + (intptr_t)&a> g; // { dg-error "conversion from pointer type" }
A<(intptr_t)&a> h; // { dg-error "conversion from pointer type" }
}
diff --git a/gcc/testsuite/g++.dg/template/pr95263.C b/gcc/testsuite/g++.dg/template/pr95263.C
new file mode 100644
index 00000000000..08a1b8730c0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/pr95263.C
@@ -0,0 +1,23 @@
+// { dg-do compile { target c++11 } }
+// PR C++/95263
+// ICE on alias template instantiation
+
+template <typename> class TPL {
+ template <int> using INT = int;
+};
+
+template <typename T> class Klass
+{
+public:
+ template <int I> using ALIAS = typename TPL<T>::INT<I>;
+
+ template <int> static void FUNC (); // OK
+
+ template <int I, typename> static ALIAS<I> FUNC (); // SFINAE ICE
+};
+
+void Fn ()
+{
+ Klass<int>::FUNC<0> ();
+}
+
diff --git a/gcc/testsuite/g++.dg/template/pr95672.C b/gcc/testsuite/g++.dg/template/pr95672.C
new file mode 100644
index 00000000000..c752b4a2c08
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/pr95672.C
@@ -0,0 +1,3 @@
+// PR c++/95672
+// { dg-do compile { target c++14 } }
+struct g_class : decltype (auto) ... { }; // { dg-error "invalid use of pack expansion" }
diff --git a/gcc/testsuite/g++.dg/template/sfinae30.C b/gcc/testsuite/g++.dg/template/sfinae30.C
new file mode 100644
index 00000000000..82f31aaa625
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/sfinae30.C
@@ -0,0 +1,21 @@
+// PR c++/79706
+// { dg-do compile { target c++11 } }
+
+struct A {
+ void operator delete(void*) = delete;
+private:
+ void operator delete[](void*);
+};
+
+extern A *p;
+
+template<typename T>
+auto foo(T *t) -> decltype(delete t); // { dg-error "use of deleted function" }
+
+template<typename T>
+auto bar(T *t) -> decltype(delete[] t); // { dg-error "private within this context" }
+
+void baz() {
+ foo<A>(p); // { dg-error "no match" }
+ bar<A>(p); // { dg-error "no match" }
+}
diff --git a/gcc/testsuite/g++.dg/template/sfinae31.C b/gcc/testsuite/g++.dg/template/sfinae31.C
new file mode 100644
index 00000000000..b31a5aeb73a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/sfinae31.C
@@ -0,0 +1,14 @@
+// PR c++/78446
+// { dg-do compile { target c++11 } }
+
+struct A { void operator()(); };
+struct B { void operator()(); };
+struct C : A, B {};
+
+template<class T>
+decltype(T()()) foo(int);
+
+template<class> int foo(...);
+
+using type = decltype(foo<C>(0));
+using type = int;
diff --git a/gcc/testsuite/g++.dg/template/show-template-tree-3.C b/gcc/testsuite/g++.dg/template/show-template-tree-3.C
index 7bb93ba4f60..ef3113711ae 100644
--- a/gcc/testsuite/g++.dg/template/show-template-tree-3.C
+++ b/gcc/testsuite/g++.dg/template/show-template-tree-3.C
@@ -8,8 +8,7 @@
(again, with the "double" and "float" highlighted, though we can't test
for that in this case). */
-// { dg-options "-fdiagnostics-show-template-tree" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-fdiagnostics-show-template-tree -Wno-return-type" }
#include <map>
#include <vector>
diff --git a/gcc/testsuite/g++.dg/template/sizeof-template-argument.C b/gcc/testsuite/g++.dg/template/sizeof-template-argument.C
index 2bfff6d9a18..b5e12d699ae 100644
--- a/gcc/testsuite/g++.dg/template/sizeof-template-argument.C
+++ b/gcc/testsuite/g++.dg/template/sizeof-template-argument.C
@@ -3,9 +3,9 @@
template<int> struct A {};
-template<typename> struct B : A <sizeof(=)> {}; /* { dg-error "expected primary-expression" } */
+template<typename> struct B : A <sizeof(=)> {}; /* { dg-error "" } */
-template<typename> struct C : A <sizeof(=)> {}; /* { dg-error "expected primary-expression" } */
+template<typename> struct C : A <sizeof(=)> {}; /* { dg-error "" } */
int a;
diff --git a/gcc/testsuite/g++.dg/template/spec41.C b/gcc/testsuite/g++.dg/template/spec41.C
new file mode 100644
index 00000000000..249fde74c3a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/spec41.C
@@ -0,0 +1,17 @@
+// PR c++/94255 - crash with template spec in different namespace.
+// { dg-do compile { target c++11 } }
+
+namespace N {
+ class S {
+ template <typename> struct foo;
+ };
+ namespace M {
+ using S = ::N::S;
+ }
+}
+
+namespace N {
+ namespace M {
+ template <> struct S::foo<int> {}; // { dg-error "specialization of" }
+ }
+}
diff --git a/gcc/testsuite/g++.dg/template/template-keyword3.C b/gcc/testsuite/g++.dg/template/template-keyword3.C
new file mode 100644
index 00000000000..91af2b3dc02
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/template-keyword3.C
@@ -0,0 +1,11 @@
+// PR c++/96082
+// { dg-do compile { target c++11 } }
+
+template <class> class A {};
+
+void
+f ()
+{
+ typename::template A <int> a;
+ ::template A <int> a2;
+}
diff --git a/gcc/testsuite/g++.dg/template/typename23.C b/gcc/testsuite/g++.dg/template/typename23.C
new file mode 100644
index 00000000000..d2fb0ca72f5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/typename23.C
@@ -0,0 +1,10 @@
+// PR c++/95223
+// { dg-do compile }
+// { dg-additional-options "--param=hash-table-verification-limit=10000" }
+
+template <typename> struct j {};
+template <typename t> struct n {
+ typedef int m;
+ j<n<t>::m> p();
+};
+template <typename o> j<typename n<o>::m> n<o>::p() { return o::f(); }
diff --git a/gcc/testsuite/g++.dg/template/virtual5.C b/gcc/testsuite/g++.dg/template/virtual5.C
new file mode 100644
index 00000000000..4d9044579ca
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/virtual5.C
@@ -0,0 +1,31 @@
+// PR c++/95158
+// { dg-do run }
+
+class Base {
+ public:
+ virtual void foo()=0;
+};
+
+template <typename T>
+class MiddleA : virtual public Base {
+ public:
+ virtual void foo() {}
+};
+
+class MiddleB : virtual public Base {};
+
+template <typename T>
+class Derived : public MiddleA<T>, public MiddleB {
+ public:
+ void bar()
+ {
+ Derived d;
+ d.foo();
+ }
+};
+
+int main()
+{
+ Derived<void> a;
+ a.bar(); // Instantiate the template
+}
diff --git a/gcc/testsuite/g++.dg/template/void3.C b/gcc/testsuite/g++.dg/template/void3.C
index 1124e441033..6526a2a47be 100644
--- a/gcc/testsuite/g++.dg/template/void3.C
+++ b/gcc/testsuite/g++.dg/template/void3.C
@@ -1,5 +1,5 @@
//PR c++/28637
template<void> struct A {}; // { dg-error "not a valid type" }
-A<0> a; // { dg-message "non-type" }
+A<0> a;
diff --git a/gcc/testsuite/g++.dg/template/void7.C b/gcc/testsuite/g++.dg/template/void7.C
index 5edff9e8563..2c464b3a055 100644
--- a/gcc/testsuite/g++.dg/template/void7.C
+++ b/gcc/testsuite/g++.dg/template/void7.C
@@ -5,4 +5,4 @@ template<void> struct A // { dg-error "not a valid type" }
static int i;
};
-A<0> a; // { dg-message "non-type" }
+A<0> a;
diff --git a/gcc/testsuite/g++.dg/template/void9.C b/gcc/testsuite/g++.dg/template/void9.C
index 319a684fa43..37aafd0b975 100644
--- a/gcc/testsuite/g++.dg/template/void9.C
+++ b/gcc/testsuite/g++.dg/template/void9.C
@@ -1,4 +1,4 @@
//PR c++/28738
template<int,void> struct A {}; // { dg-error "not a valid type" }
-template<int N> struct A<N,0> {}; // { dg-message "invalid" }
+template<int N> struct A<N,0> {};
diff --git a/gcc/testsuite/g++.dg/tm/cgraph_edge.C b/gcc/testsuite/g++.dg/tm/cgraph_edge.C
index b2649e8f521..1a6138bd449 100644
--- a/gcc/testsuite/g++.dg/tm/cgraph_edge.C
+++ b/gcc/testsuite/g++.dg/tm/cgraph_edge.C
@@ -1,6 +1,5 @@
// { dg-do compile }
-// { dg-options "-fgnu-tm -O3" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-fgnu-tm -O3 -Wno-return-type" }
template<typename _InputIterator, typename _Distance> inline void advance(_InputIterator& __i, _Distance __n)
{
diff --git a/gcc/testsuite/g++.dg/torture/20141013.C b/gcc/testsuite/g++.dg/torture/20141013.C
index e6c83ffab21..fea70ec7ea5 100644
--- a/gcc/testsuite/g++.dg/torture/20141013.C
+++ b/gcc/testsuite/g++.dg/torture/20141013.C
@@ -1,5 +1,4 @@
-/* { dg-options "-fno-short-enums" } */
-/* { dg-additional-options "-Wno-return-type" } */
+/* { dg-options "-fno-short-enums -Wno-return-type" } */
enum
{
_sch_isdigit = 0x0004,
diff --git a/gcc/testsuite/g++.dg/torture/pr34641.C b/gcc/testsuite/g++.dg/torture/pr34641.C
index 72a98ad8f46..44f2d5c58ee 100644
--- a/gcc/testsuite/g++.dg/torture/pr34641.C
+++ b/gcc/testsuite/g++.dg/torture/pr34641.C
@@ -1,8 +1,7 @@
// { dg-do compile }
// { dg-require-effective-target fpic }
// { dg-require-visibility "" }
-// { dg-options "-fPIC" }
-/* { dg-additional-options "-Wno-return-type" } */
+// { dg-options "-fPIC -Wno-return-type" }
typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/g++.dg/torture/pr34850.C b/gcc/testsuite/g++.dg/torture/pr34850.C
index 60a6c6ae57d..59dd5dfde7d 100644
--- a/gcc/testsuite/g++.dg/torture/pr34850.C
+++ b/gcc/testsuite/g++.dg/torture/pr34850.C
@@ -1,7 +1,6 @@
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
-/* { dg-options "-ffat-lto-objects" } */
-/* { dg-additional-options "-Wno-return-type" } */
+/* { dg-options "-ffat-lto-objects -Wno-return-type -Wno-attribute-warning" } */
typedef unsigned char uint8_t;
typedef unsigned int uint32_t;
diff --git a/gcc/testsuite/g++.dg/torture/pr36745.C b/gcc/testsuite/g++.dg/torture/pr36745.C
index 56fa9d8028d..b1ff2995db9 100644
--- a/gcc/testsuite/g++.dg/torture/pr36745.C
+++ b/gcc/testsuite/g++.dg/torture/pr36745.C
@@ -1,7 +1,6 @@
/* PR target/36745 */
/* { dg-do compile } */
-/* { dg-options "-O2 -fPIC" } */
-/* { dg-additional-options "-Wno-return-type" } */
+/* { dg-options "-O2 -fPIC -Wno-return-type" } */
/* { dg-require-effective-target fpic } */
typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/g++.dg/torture/pr37421.C b/gcc/testsuite/g++.dg/torture/pr37421.C
index 4b8447eac49..c8cfd00cc15 100644
--- a/gcc/testsuite/g++.dg/torture/pr37421.C
+++ b/gcc/testsuite/g++.dg/torture/pr37421.C
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-require-effective-target int_eq_float } */
#include <stdio.h>
#include <string.h>
diff --git a/gcc/testsuite/g++.dg/torture/pr40991.C b/gcc/testsuite/g++.dg/torture/pr40991.C
index bce5f7e6893..f314ebc5821 100644
--- a/gcc/testsuite/g++.dg/torture/pr40991.C
+++ b/gcc/testsuite/g++.dg/torture/pr40991.C
@@ -1,5 +1,4 @@
-/* { dg-options "-std=gnu++0x" } */
-/* { dg-additional-options "-Wno-return-type" } */
+/* { dg-options "-std=gnu++0x -Wno-return-type" } */
typedef __SIZE_TYPE__ size_t;
namespace std __attribute__ ((__visibility__ ("default"))) {
diff --git a/gcc/testsuite/g++.dg/torture/pr48271.C b/gcc/testsuite/g++.dg/torture/pr48271.C
index 2e3eb5bfd05..917814eedbc 100644
--- a/gcc/testsuite/g++.dg/torture/pr48271.C
+++ b/gcc/testsuite/g++.dg/torture/pr48271.C
@@ -1,6 +1,5 @@
// { dg-do compile }
-// { dg-options "-ftree-vrp -fno-guess-branch-probability -fnon-call-exceptions" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-ftree-vrp -fno-guess-branch-probability -fnon-call-exceptions -Wno-return-type" }
void *xalloc ();
void xfree (void *);
diff --git a/gcc/testsuite/g++.dg/torture/pr49394.C b/gcc/testsuite/g++.dg/torture/pr49394.C
index 7bd8fd4dc72..75901a5d668 100644
--- a/gcc/testsuite/g++.dg/torture/pr49394.C
+++ b/gcc/testsuite/g++.dg/torture/pr49394.C
@@ -7,6 +7,8 @@ struct Mutex
~Mutex ()
#if __cplusplus <= 201402L
throw(int) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
+#else
+ noexcept(false)
#endif
{
if (locked)
diff --git a/gcc/testsuite/g++.dg/torture/pr53602.C b/gcc/testsuite/g++.dg/torture/pr53602.C
index 67d9ed848f0..d84a940ccc5 100644
--- a/gcc/testsuite/g++.dg/torture/pr53602.C
+++ b/gcc/testsuite/g++.dg/torture/pr53602.C
@@ -1,6 +1,5 @@
// { dg-do compile }
-// { dg-options "-std=c++11" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-std=c++11 -Wno-return-type" }
namespace std
{
diff --git a/gcc/testsuite/g++.dg/torture/pr53752.C b/gcc/testsuite/g++.dg/torture/pr53752.C
index 61febdeb6b8..fe0459e3839 100644
--- a/gcc/testsuite/g++.dg/torture/pr53752.C
+++ b/gcc/testsuite/g++.dg/torture/pr53752.C
@@ -1,6 +1,5 @@
// { dg-do compile }
-// { dg-options "-g" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-g -Wno-return-type" }
typedef unsigned int uint32_t;
typedef unsigned long int uint64_t;
diff --git a/gcc/testsuite/g++.dg/torture/pr54838.C b/gcc/testsuite/g++.dg/torture/pr54838.C
index c3308210ebe..63804ba8cbd 100644
--- a/gcc/testsuite/g++.dg/torture/pr54838.C
+++ b/gcc/testsuite/g++.dg/torture/pr54838.C
@@ -1,6 +1,5 @@
// { dg-do compile }
-// { dg-options "-ftracer -fno-tree-dce -fno-tree-sra" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-ftracer -fno-tree-dce -fno-tree-sra -Wno-return-type" }
struct bidirectional_iterator_tag
{};
diff --git a/gcc/testsuite/g++.dg/torture/pr58252.C b/gcc/testsuite/g++.dg/torture/pr58252.C
index db3270d9afb..0e5529d5b37 100644
--- a/gcc/testsuite/g++.dg/torture/pr58252.C
+++ b/gcc/testsuite/g++.dg/torture/pr58252.C
@@ -1,6 +1,5 @@
// { dg-do compile }
-// { dg-options "-fpermissive" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-fpermissive -Wno-return-type" }
typedef long unsigned int size_t;
typedef bool _CORBA_Boolean;
typedef unsigned int _CORBA_ULong;
diff --git a/gcc/testsuite/g++.dg/torture/pr82154.C b/gcc/testsuite/g++.dg/torture/pr82154.C
index e229c3e640e..698340d8c65 100644
--- a/gcc/testsuite/g++.dg/torture/pr82154.C
+++ b/gcc/testsuite/g++.dg/torture/pr82154.C
@@ -1,5 +1,6 @@
// { dg-do compile }
-// { dg-additional-options "-Wno-deprecated" }
+// { dg-additional-options "-std=c++14 -Wno-deprecated" }
+// C++17 does not allow dynamic exception specification.
namespace a {
int b;
diff --git a/gcc/testsuite/g++.dg/torture/pr88861.C b/gcc/testsuite/g++.dg/torture/pr88861.C
index d2b6a4b7a47..ff66d5e1635 100644
--- a/gcc/testsuite/g++.dg/torture/pr88861.C
+++ b/gcc/testsuite/g++.dg/torture/pr88861.C
@@ -4,7 +4,11 @@ struct Ax {
int n, a[];
};
+#if __SIZEOF_INT__ < 4
+int i = 12345;
+#else
int i = 12345678;
+#endif
int main() {
static Ax s{456, i};
((s.a[0]) ? (void)0 : (void)0);
diff --git a/gcc/testsuite/g++.dg/torture/pr95268.C b/gcc/testsuite/g++.dg/torture/pr95268.C
new file mode 100644
index 00000000000..8385b86e179
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr95268.C
@@ -0,0 +1,46 @@
+// { dg-do compile }
+// { dg-require-effective-target lp64 }
+// { dg-additional-options "-Wno-overflow" }
+
+#include <algorithm>
+
+extern short var_0, var_2, var_3, var_9, var_11, var_13, var_14, var_19, var_22,
+ var_32, var_37, var_44, var_57, var_59, var_63, var_70;
+extern unsigned var_5;
+extern char var_6, var_12, var_18, var_38, var_39, var_43, var_55, var_64,
+ arr_35;
+extern long var_7, var_8, var_10, var_15, var_25, var_56;
+extern int var_21, var_36, var_51, var_65, var_68, arr_7;
+extern bool var_46, var_58, var_67;
+
+void test() {
+ var_12 = 0 >= 0;
+ var_13 = arr_7;
+ var_14 = (unsigned long)var_7 >> -564810131 + 564810189;
+ var_15 = var_5;
+ var_18 = -602739307623583391;
+ var_19 = -~0;
+ var_21 = var_10 >> var_8 - 17101301574577641170ULL;
+ var_22 = var_5;
+ var_25 = var_9;
+ var_32 = std::max((unsigned)var_2, var_5);
+ var_36 = 9557;
+ var_37 = 394545925;
+ var_38 = 0 >= 0;
+ var_39 = var_5;
+ var_43 = 0;
+ var_44 = arr_35;
+ var_46 = var_7;
+ for (short a = 0; a < 9; a = 021)
+ for (short b = 0; b < 024; b += 4)
+ var_51 = std::min((long long)(var_2 ?: var_9), (long long)var_9);
+ var_55 = var_0;
+ var_56 = 3896150587;
+ var_57 = var_11;
+ var_58 = var_59 = var_11;
+ var_63 = 73;
+ var_64 = 10393232284806619711ULL;
+ var_65 = var_3;
+ var_67 = var_6;
+ var_68 = var_70 = 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr95284.C b/gcc/testsuite/g++.dg/torture/pr95284.C
new file mode 100644
index 00000000000..3c273ef8d55
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr95284.C
@@ -0,0 +1,16 @@
+// { dg-do compile }
+// { dg-require-effective-target lp64 }
+
+#include <algorithm>
+
+short a;
+unsigned long long c;
+char d;
+unsigned e;
+
+void f()
+{
+ for (;;)
+ for (char b = 0; b < 19; b += 2)
+ a = std::min((1 ? d : 0) ? e : c, (unsigned long long)72252803048);
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr95308.C b/gcc/testsuite/g++.dg/torture/pr95308.C
new file mode 100644
index 00000000000..01aa8ad17a6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr95308.C
@@ -0,0 +1,21 @@
+// { dg-do compile }
+// { dg-additional-options "-march=skylake-avx512" { target x86_64-*-* i?86-*-* } }
+
+extern int a[][18];
+extern short b[], c[];
+extern char d[][18];
+int e;
+void i(char f, long g[][100][100][100])
+{
+ for (int h = 0;; h += 2)
+ for (char j = 0; j < 17; j++) {
+ if (e ? f : 0) {
+ a[h][j] = 5;
+ for (int k = 0; k < 12; k += 4)
+ for (short l = 0; l < 015; l += 2)
+ b[k * 3 + l] = bool(g[2][j][k][l]);
+ } else
+ d[h][j] = 0;
+ c[j] = 3;
+ }
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr95493-1.C b/gcc/testsuite/g++.dg/torture/pr95493-1.C
new file mode 100644
index 00000000000..907d191ebfe
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr95493-1.C
@@ -0,0 +1,95 @@
+// { dg-do run { target c++11 } }
+// PR rtl-optimization/95493 comment 8
+
+#include <array>
+#include <iostream>
+
+struct Point
+{
+ std::array<int, 3> array;
+
+ Point(int x, int y, int z) : array{x, y, z} {}
+
+ Point(const Point & other) : array{other.array} {} // OK if commented
+ //Point(const Point &) = default; // OK
+
+ //Point(Point && other) = default; // OK
+
+ int operator[] (std::size_t i) const { return array[i]; }
+ int& operator[] (std::size_t i) { return array[i]; }
+};
+
+//using Point = std::array<int, 3>; // OK
+
+struct Cell
+{
+ Point point;
+ Cell(Point const& pt) : point(pt) {}
+ int operator[] (std::size_t i) const { return point[i]; }
+ int& operator[] (std::size_t i) { return point[i]; }
+};
+
+//using Cell = Point; // OK
+
+std::ostream & operator<< (std::ostream & out, Cell const& object)
+//std::ostream & operator<< (std::ostream & out, Cell object) // Fails with f2 too
+{
+ for ( std::size_t i = 0; i < 3; ++i )
+ out << object[ i ] << " ";
+ return out;
+}
+
+
+struct DirIterator
+{
+ std::size_t dir;
+ Cell cell;
+
+ DirIterator(Cell c)
+ : dir(0), cell(c)
+ {
+ find(); // OK if commented
+ }
+
+ void find()
+ {
+ //while (dir < 3) // Fails with f2 too
+ while (dir < 3 && (cell[dir] % 2) == 0)
+ ++dir;
+ }
+};
+
+Cell uIncident(Cell c, std::size_t k)
+//Cell uIncident(Cell& c, std::size_t k) // OK
+{
+ --c[k];
+ return c;
+}
+
+Cell uSpel(Point p)
+{
+ for (std::size_t i = 0; i < 3; ++i)
+ p[i] += p[i] + 1;
+ return Cell(p);
+}
+
+
+int main ()
+{
+ Cell c = uSpel(Point{0, 0, 0}); // Fails
+ //Cell c( Point(1, 1, 1) ); // OK
+
+ auto q = DirIterator( c );
+
+ Cell f1 = uIncident( c, q.dir ); // Fails
+ //Cell f1 = uIncident( c, 0 ); // OK
+
+ Cell f2 = f1; // f2 is the right cell that f1 should be
+
+ std::cout << "q.dir = " << q.dir << " ; f1 = " << f1 << " ; f2 = " << f2 << std::endl;
+ //std::cout << "q.dir = " << q.dir << " ; f1 = " << f1[0] << " " << f1[1] << " " << f1[2] << " ; f2 = " << f2[0] << " " << f2[1] << " " << f2[2] << std::endl; // OK
+
+ for (int i = 0; i < 3; ++i)
+ if (f1[i] != f2[i])
+ __builtin_abort();
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr95493.C b/gcc/testsuite/g++.dg/torture/pr95493.C
new file mode 100644
index 00000000000..e6f441a320c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr95493.C
@@ -0,0 +1,62 @@
+// { dg-do run }
+// { dg-additional-options "-std=c++17 -Wno-psabi -w" }
+
+struct verify
+{
+ const bool m_failed = false;
+
+ [[gnu::noinline]] void print_hex(const void* x, int n) const
+ {
+ const auto* bytes = static_cast<const unsigned char*>(x);
+ for (int i = 0; i < n; ++i)
+ __builtin_printf((i && i % 4 == 0) ? "'%02x" : "%02x", bytes[i]);
+ __builtin_printf("\n");
+ }
+
+ template <typename... Ts>
+ verify(bool ok, const Ts&... extra_info) : m_failed(!ok)
+ {
+ if (m_failed)
+ (print_hex(&extra_info, sizeof(extra_info)), ...);
+ }
+
+ ~verify()
+ {
+ if (m_failed)
+ __builtin_abort();
+ }
+};
+
+using K [[gnu::vector_size(16)]] = int;
+
+int
+main()
+{
+ int count = 1;
+ asm("" : "+m"(count));
+ verify(count == 1, 0, "", 0);
+
+ {
+ struct SW
+ {
+ K d;
+ };
+ struct
+ {
+ SW d;
+ } xx;
+ SW& x = xx.d;
+ x = SW(); // [0, 0, 0, 0]
+ for (int i = 3; i >= 2; --i)
+ {
+ x.d[i] = -1; // [0, 0, 0, -1] ...
+ int a = [](K y) {
+ for (int j = 0; j < 4; ++j)
+ if (y[j] != 0)
+ return j;
+ return -1;
+ }(x.d);
+ verify(a == i, 0, 0, 0, 0, i, x);
+ }
+ }
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr95548.C b/gcc/testsuite/g++.dg/torture/pr95548.C
new file mode 100644
index 00000000000..cd758ebbde7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr95548.C
@@ -0,0 +1,10 @@
+/* { dg-do link } */
+enum A { A1 = (unsigned long)-1 } a;
+enum B { B1 = (unsigned long long)-1, B2 = 0x123456789abcdef0ULL } b;
+#ifdef __SIZEOF_INT128__
+enum C { C1 = (__uint128_t)-1, C2 = ((__uint128_t) 0x123456789abcdef0ULL) << 64 | 0x0fedcba987654321ULL } c;
+#endif
+int
+main ()
+{
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr95717.C b/gcc/testsuite/g++.dg/torture/pr95717.C
new file mode 100644
index 00000000000..362dc10656b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr95717.C
@@ -0,0 +1,12 @@
+// { dg-do compile }
+
+bool a;
+extern bool b[];
+long c, d;
+int *f;
+void g(bool h)
+{
+ for (short e = 0; e < c; e = 4)
+ for (; d; d++)
+ b[d] = a = f[d] ? c ? h : 0 : h;
+}
diff --git a/gcc/testsuite/g++.dg/tree-ssa/final4.C b/gcc/testsuite/g++.dg/tree-ssa/final4.C
new file mode 100644
index 00000000000..387d4bb26c2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/final4.C
@@ -0,0 +1,12 @@
+// PR c++/95719
+// { dg-do compile { target c++11 } }
+// { dg-additional-options -fdump-tree-gimple }
+// { dg-final { scan-tree-dump "S2::f" "gimple" } }
+
+struct S1 { virtual ~S1(); };
+struct S2 {
+ virtual ~S2();
+ virtual void f();
+};
+struct S3 final: S1, S2 { using S2::f; };
+void g(S3 & s) { s.f(); }
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr19807.C b/gcc/testsuite/g++.dg/tree-ssa/pr19807.C
index 6a3fff0d06d..7a9a2e09817 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr19807.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr19807.C
@@ -11,7 +11,7 @@ void foo(void)
z = 1 + &a[1];
}
-/* { dg-final { scan-tree-dump-times "&MEM <int> \\\[\\\(void .\\\)&a \\\+ 8B\\\]" 3 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "&MEM <int> \\\[\\\(void .\\\)&a \\\+ (?:4|8)B\\\]" 3 "optimized" } } */
void bar(int i)
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr22444.C b/gcc/testsuite/g++.dg/tree-ssa/pr22444.C
index 04bf2009cbe..ca081ca1af8 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr22444.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr22444.C
@@ -3,8 +3,7 @@
// to the addressable vars list, because this may cause false aliasing
// with the subvars leading to the subvars not being renamed when they should
// { dg-do compile }
-// { dg-options "-O2" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-O2 -Wno-return-type" }
__extension__ typedef __PTRDIFF_TYPE__ ptrdiff_t;
__extension__ typedef __SIZE_TYPE__ size_t;
namespace std
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr24351-3.C b/gcc/testsuite/g++.dg/tree-ssa/pr24351-3.C
index f3aaee85286..af8576f7584 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr24351-3.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr24351-3.C
@@ -1,6 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2" } */
-// { dg-additional-options "-Wno-return-type" }
+/* { dg-options "-O2 -Wno-return-type" } */
namespace sigc {
template <class T_type> struct type_trait {
typedef T_type& pass;
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr27283.C b/gcc/testsuite/g++.dg/tree-ssa/pr27283.C
index 1623d289a20..78b77f05adf 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr27283.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr27283.C
@@ -1,6 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2" } */
-/* { dg-additional-options "-Wno-return-type" } */
+/* { dg-options "-O2 -Wno-return-type" } */
namespace Gambit
{
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr27291.C b/gcc/testsuite/g++.dg/tree-ssa/pr27291.C
index 24f440dde06..053b768fda6 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr27291.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr27291.C
@@ -1,6 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2" } */
-/* { dg-additional-options "-Wno-return-type" } */
+/* { dg-options "-O2 -Wno-return-type" } */
namespace std
{
@@ -30,7 +29,7 @@ namespace std
static const bool is_integer = true;
};
};
-typedef unsigned int uint32_t;
+typedef unsigned uint32_t __attribute__ ((__mode__ (__SI__)));
namespace std
{
template < typename _Alloc > class allocator;
@@ -70,8 +69,8 @@ namespace boost
{
};
}
- template <> class integer_traits < int >:public std::numeric_limits < int >,
- public detail::integer_traits_base < int, (-2147483647 - 1), 2147483647 >
+ template <> class integer_traits < int32_t >:public std::numeric_limits < int32_t >,
+ public detail::integer_traits_base < int32_t, (-2147483647 - 1), 2147483647 >
{
};
namespace random
@@ -192,11 +191,11 @@ namespace boost
private:UniformRandomNumberGenerator _rng;
};
}
- template < class RealType, int w, unsigned int p,
- unsigned int q > class lagged_fibonacci_01
+ template < class RealType, int32_t w, uint32_t p,
+ uint32_t q > class lagged_fibonacci_01
{
public:typedef RealType result_type;
- static const unsigned int long_lag = p;
+ static const uint32_t long_lag = p;
lagged_fibonacci_01 ()
{
seed ();
@@ -211,7 +210,7 @@ namespace boost
typedef detail::pass_through_engine < Generator & >ref_gen;
uniform_01 < ref_gen, RealType > gen01 =
uniform_01 < ref_gen, RealType > (ref_gen (gen));
- for (unsigned int j = 0; j < long_lag; ++j)
+ for (uint32_t j = 0; j < long_lag; ++j)
x[j] = gen01 ();
}
RealType x[long_lag];
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr27548.C b/gcc/testsuite/g++.dg/tree-ssa/pr27548.C
index cbe7929aefe..c5a6fe184d6 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr27548.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr27548.C
@@ -1,7 +1,6 @@
// PR tree-optimization/27548
// { dg-do compile }
-// { dg-options "-O1" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-O1 -Wno-return-type" }
namespace Gambit
{
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr42337.C b/gcc/testsuite/g++.dg/tree-ssa/pr42337.C
index 61beb737018..a05ba4f8d75 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr42337.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr42337.C
@@ -1,7 +1,6 @@
// PR tree-optimize/42337
// { dg-do compile }
-// { dg-options "-O2" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-O2 -Wno-return-type" }
template<class _T1, class _T2> struct pair {
_T2 second;
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr49516.C b/gcc/testsuite/g++.dg/tree-ssa/pr49516.C
index 2c6fd0496fc..e0e3c5be157 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr49516.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr49516.C
@@ -3,25 +3,25 @@
extern "C" void abort (void);
-typedef int int32;
-typedef unsigned int uint32;
-typedef unsigned long long uint64;
-typedef short int16;
+typedef int int32 __attribute__((mode (__SI__)));
+typedef unsigned uint32 __attribute__((mode (__SI__)));
+typedef unsigned uint64 __attribute__((mode (__DI__)));;
+typedef int int16 __attribute__((mode (__HI__)));;
class Tp {
public:
- Tp(int, const int segment, const int index) __attribute__((noinline));
+ Tp(int32, const int32 segment, const int32 index) __attribute__((noinline));
inline bool operator==(const Tp& other) const;
inline bool operator!=(const Tp& other) const;
- int GetType() const { return type_; }
- int GetSegment() const { return segment_; }
- int GetIndex() const { return index_; }
+ int32 GetType() const { return type_; }
+ int32 GetSegment() const { return segment_; }
+ int32 GetIndex() const { return index_; }
private:
- inline static bool IsValidSegment(const int segment);
- static const int kSegmentBits = 28;
- static const int kTypeBits = 4;
- static const int kMaxSegment = (1 << kSegmentBits) - 1;
+ inline static bool IsValidSegment(const int32 segment);
+ static const int32 kSegmentBits = 28;
+ static const int32 kTypeBits = 4;
+ static const int32 kMaxSegment = (1L << kSegmentBits) - 1;
union {
@@ -38,7 +38,7 @@ class Tp {
};
};
-Tp::Tp(int t, const int segment, const int index)
+Tp::Tp(int32 t, const int32 segment, const int32 index)
: index_(index), segment_(segment), type_(t) {}
inline bool Tp::operator==(const Tp& other) const {
@@ -50,18 +50,18 @@ inline bool Tp::operator!=(const Tp& other) const {
class Range {
public:
- inline Range(const Tp& position, const int count) __attribute__((always_inline));
+ inline Range(const Tp& position, const int32 count) __attribute__((always_inline));
inline Tp GetBeginTokenPosition() const;
inline Tp GetEndTokenPosition() const;
private:
Tp position_;
- int count_;
+ int32 count_;
int16 begin_index_;
int16 end_index_;
};
inline Range::Range(const Tp& position,
- const int count)
+ const int32 count)
: position_(position), count_(count), begin_index_(0), end_index_(0)
{ }
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr95638.C b/gcc/testsuite/g++.dg/tree-ssa/pr95638.C
new file mode 100644
index 00000000000..d1bea6dffaa
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr95638.C
@@ -0,0 +1,150 @@
+// PR tree-optimization/95638
+// { dg-do run }
+// { dg-options "-O2 -std=c++14" }
+
+#include <cassert>
+#include <cstdio>
+#include <cstdint>
+#include <memory>
+#include <type_traits>
+#include <utility>
+
+template <typename Derived>
+class intrusive_ref_counter
+{
+public:
+ intrusive_ref_counter() = default;
+
+ intrusive_ref_counter(intrusive_ref_counter const&) :
+ _counter(0)
+ {
+ }
+
+ friend void intrusive_ptr_add_ref(const intrusive_ref_counter<Derived>* p)
+ {
+ ++p->_counter;
+ }
+
+ friend void intrusive_ptr_release(const intrusive_ref_counter<Derived>* p)
+ {
+ if (--p->_counter == 0)
+ {
+ delete static_cast<const Derived*>(p);
+ }
+ }
+
+private:
+ mutable int _counter = 0;
+};
+
+template <typename T>
+class intrusive_ptr
+{
+public:
+ intrusive_ptr() = default;
+
+ intrusive_ptr(T* p): px(p)
+ {
+ if (px != 0) intrusive_ptr_add_ref(px);
+ }
+
+ intrusive_ptr(intrusive_ptr const & rhs): px(rhs.px)
+ {
+ if (px != 0) intrusive_ptr_add_ref(px);
+ }
+
+ ~intrusive_ptr()
+ {
+ if (px != 0) intrusive_ptr_release(px);
+ }
+
+ intrusive_ptr(intrusive_ptr && rhs) : px(rhs.px)
+ {
+ rhs.px = 0;
+ }
+
+ explicit operator bool() const
+ {
+ return px != 0;
+ }
+
+private:
+ T* px = nullptr;
+};
+
+template <typename T, uint32_t MaxSize = 1>
+class Storage
+{
+public:
+ Storage() = default;
+
+ Storage(Storage&& other)
+ {
+ for (int i = 0; i < other._size; ++i)
+ {
+ new (data() + i) T(std::move(other.data()[i]));
+ ++_size;
+ }
+ }
+
+ ~Storage()
+ {
+ for (int i = 0; i < _size; ++i)
+ {
+ data()[i].~T();
+ }
+ }
+
+ void push_back(const T& value)
+ {
+ assert(_size < MaxSize);
+
+ new (data() + _size) T(value);
+ ++_size;
+ }
+
+ T& operator[](size_t idx)
+ {
+ assert(idx < _size);
+ return data()[idx];
+ }
+
+private:
+ T* data()
+ {
+ return reinterpret_cast<T*>(&_data);
+ }
+
+private:
+ uint32_t _size = 0;
+ std::aligned_storage_t<sizeof(T[MaxSize])> _data;
+};
+
+struct Item: intrusive_ref_counter<Item>
+{
+};
+
+using Collection = Storage<intrusive_ptr<Item>>;
+
+struct Holder
+{
+ __attribute__ ((noinline)) Holder(Collection collection) : collection(std::move(collection)) {}
+
+ int64_t dummy = 0; // this is needed to reproduce the issue.
+ Collection collection;
+};
+
+int main()
+{
+ Collection collection;
+ collection.push_back(intrusive_ptr<Item>(new Item()));
+
+ Holder holder(std::move(collection));
+
+ auto item = holder.collection[0];
+
+ if (!item)
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr95649.C b/gcc/testsuite/g++.dg/tree-ssa/pr95649.C
new file mode 100644
index 00000000000..139f699ee2e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr95649.C
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern unsigned short var_5;
+extern int var_8, var_9;
+extern short arr_7[];
+void test() {
+ for (; 0 < (char)var_5;)
+ for (int a(var_9 ? var_5 : 0); a < 3002972621U + 1291994699;
+ a += 19499 - 19497)
+ for (long b(var_8); b; b += 4)
+ arr_7[a * b] = 0;
+}
diff --git a/gcc/testsuite/g++.dg/ubsan/pr65583.C b/gcc/testsuite/g++.dg/ubsan/pr65583.C
index 02acb361a22..1aae6f4a106 100644
--- a/gcc/testsuite/g++.dg/ubsan/pr65583.C
+++ b/gcc/testsuite/g++.dg/ubsan/pr65583.C
@@ -1,7 +1,6 @@
// PR sanitizer/65583
// { dg-do compile }
-// { dg-options "-std=c++11 -fsanitize=undefined" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-std=c++11 -fsanitize=undefined -Wno-return-type" }
namespace std
{
diff --git a/gcc/testsuite/g++.dg/ubsan/pr85029.C b/gcc/testsuite/g++.dg/ubsan/pr85029.C
index 07472af16a5..836ce69cc15 100644
--- a/gcc/testsuite/g++.dg/ubsan/pr85029.C
+++ b/gcc/testsuite/g++.dg/ubsan/pr85029.C
@@ -1,7 +1,7 @@
// PR sanitizer/85029
// { dg-do compile }
// { dg-skip-if "" { *-*-* } { "-flto -fno-fat-lto-objects" } }
-// { dg-options "-fsanitize=undefined" }
+// { dg-options "-fsanitize=undefined -Wno-register" }
struct B {
virtual B bar ();
diff --git a/gcc/testsuite/g++.dg/ubsan/ubsan.exp b/gcc/testsuite/g++.dg/ubsan/ubsan.exp
index 11b92bff980..2bc98831d2e 100644
--- a/gcc/testsuite/g++.dg/ubsan/ubsan.exp
+++ b/gcc/testsuite/g++.dg/ubsan/ubsan.exp
@@ -26,7 +26,7 @@ ubsan_init
# Main loop.
if [check_effective_target_fsanitize_undefined] {
- gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C $srcdir/c-c++-common/ubsan/*.c]] "" ""
+ g++-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C $srcdir/c-c++-common/ubsan/*.c]] "" ""
}
# All done.
diff --git a/gcc/testsuite/g++.dg/ubsan/vla-2.C b/gcc/testsuite/g++.dg/ubsan/vla-2.C
new file mode 100644
index 00000000000..342d30bfeac
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ubsan/vla-2.C
@@ -0,0 +1,14 @@
+// PR c++/95232
+// { dg-additional-options "-Wno-vla -ftrapv -fnon-call-exceptions -O -fsanitize=undefined" }
+
+template <typename T>
+int tmain(T argc) {
+ typedef double (*chunk_t)[argc[0][0]];
+ chunk_t var;
+ (void)var[0][0];
+ return 0;
+}
+
+int main (int argc, char **argv) {
+ return tmain(argv);
+}
diff --git a/gcc/testsuite/g++.dg/ubsan/vptr-14.C b/gcc/testsuite/g++.dg/ubsan/vptr-14.C
index 2247ad99fcc..06cd66347d4 100644
--- a/gcc/testsuite/g++.dg/ubsan/vptr-14.C
+++ b/gcc/testsuite/g++.dg/ubsan/vptr-14.C
@@ -1,5 +1,5 @@
// PR sanitizer/89869
-// { dg-do run }
+// { dg-do run { target c++11 } }
// { dg-options "-fsanitize=vptr -fno-sanitize-recover=vptr" }
struct S { S *s = 0; virtual ~S () {} };
diff --git a/gcc/testsuite/g++.dg/ubsan/vptr-16.C b/gcc/testsuite/g++.dg/ubsan/vptr-16.C
new file mode 100644
index 00000000000..a3db66e9140
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ubsan/vptr-16.C
@@ -0,0 +1,14 @@
+// PR c++/95311
+// { dg-additional-options -fsanitize=undefined }
+
+class a {
+ virtual long b() const;
+};
+class c : a {
+public:
+ long b() const;
+};
+class d : c {
+ long e();
+};
+long d::e() { b(); return 0; }
diff --git a/gcc/testsuite/g++.dg/ubsan/vptr-17.C b/gcc/testsuite/g++.dg/ubsan/vptr-17.C
new file mode 100644
index 00000000000..b7f6a4cb4df
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ubsan/vptr-17.C
@@ -0,0 +1,15 @@
+// PR c++/95466
+// { dg-additional-options -fsanitize=vptr }
+
+class A {
+ virtual void m_fn1();
+};
+class C {
+public:
+ virtual void m_fn2();
+};
+class B : A, public C {};
+int main() {
+ B b;
+ static_cast<C *>(&b)->m_fn2();
+}
diff --git a/gcc/testsuite/g++.dg/vect/pr95290.cc b/gcc/testsuite/g++.dg/vect/pr95290.cc
new file mode 100644
index 00000000000..150bbf72103
--- /dev/null
+++ b/gcc/testsuite/g++.dg/vect/pr95290.cc
@@ -0,0 +1,25 @@
+// { dg-do compile }
+
+typedef short a;
+enum b {};
+typedef struct {
+ a c;
+} d;
+typedef struct {
+ a e, f;
+} g;
+typedef struct {
+ g h;
+} i;
+typedef struct {
+ d j;
+ int k;
+} l;
+class m
+{
+ i imgdata;
+ void n();
+ l o;
+};
+void m::n() try { imgdata.h.e = imgdata.h.f = o.j.c >> o.j.c; } catch (b) {
+}
diff --git a/gcc/testsuite/g++.dg/vect/pr95297.cc b/gcc/testsuite/g++.dg/vect/pr95297.cc
new file mode 100644
index 00000000000..6ffc92e5fd0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/vect/pr95297.cc
@@ -0,0 +1,22 @@
+// { dg-do compile }
+// { dg-additional-options "-O3 -fvect-cost-model=dynamic" }
+
+extern bool var_10;
+extern int var_16;
+extern short var_17;
+extern long var_18;
+extern int arr_3[][13];
+
+int min(const int &a, const int &b)
+{
+ return a < b ? a : b;
+}
+
+void test() {
+ for (short a = 0; a < 010; a++)
+ for (char b = 0; b < 012; b++)
+ arr_3[a][b] = min(-var_10, 0) + 2147483647 >> var_10;
+ var_16 = (bool)4;
+ var_17 = 0;
+ var_18 = -1594153176;
+}
diff --git a/gcc/testsuite/g++.dg/vect/pr95487.cc b/gcc/testsuite/g++.dg/vect/pr95487.cc
new file mode 100644
index 00000000000..34023d25572
--- /dev/null
+++ b/gcc/testsuite/g++.dg/vect/pr95487.cc
@@ -0,0 +1,20 @@
+// { dg-do compile }
+// { dg-additional-options "-O3" }
+// { dg-additional-options "-march=skylake-avx512" { target x86_64-*-* i?86-*-* } }
+
+int a;
+bool d;
+char e;
+extern short f[];
+extern int g[];
+short j;
+void h() {
+ for (short b = j; b < 0; b += 2) {
+ f[b] = 0;
+ if (d) {
+ for (char c = 0; c < a; c += 3)
+ e = 0;
+ g[b] = 0;
+ }
+ }
+}
diff --git a/gcc/testsuite/g++.dg/vect/pr95576.cc b/gcc/testsuite/g++.dg/vect/pr95576.cc
new file mode 100644
index 00000000000..64e0e2dae7f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/vect/pr95576.cc
@@ -0,0 +1,23 @@
+// { dg-do compile }
+// { dg-additional-options "-O3 -fno-tree-forwprop -fcompare-debug" }
+
+struct S {
+ virtual ~S();
+ struct S *s;
+ virtual void m();
+ int f;
+ void *d;
+};
+
+struct T : S {
+ void m();
+};
+
+S::~S() {
+ if (s) {
+ s->f = 0;
+ s->d = __null;
+ }
+}
+
+void T::m() {}
diff --git a/gcc/testsuite/g++.dg/vect/pr96022.cc b/gcc/testsuite/g++.dg/vect/pr96022.cc
new file mode 100644
index 00000000000..ca6b27696f5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/vect/pr96022.cc
@@ -0,0 +1,12 @@
+// { dg-do compile }
+// { dg-additional-options "-O3" }
+
+extern int arr_6[];
+extern char arr_7[] __attribute__((aligned));
+void test(short a, bool, int p8) {
+ for (bool b = 0; b < (bool)p8; b = 1)
+ for (short c = 0; c < 5; c++) {
+ arr_6[c] = (long)2 << a - 30574;
+ arr_7[c] = 0;
+ }
+}
diff --git a/gcc/testsuite/g++.dg/vect/pr96163.cc b/gcc/testsuite/g++.dg/vect/pr96163.cc
new file mode 100644
index 00000000000..3bd376f67f6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/vect/pr96163.cc
@@ -0,0 +1,146 @@
+// { dg-do compile }
+// { dg-require-effective-target c++17 }
+
+typedef double b __attribute__((__vector_size__(16)));
+b c;
+enum { d };
+namespace e {
+template <typename> struct g;
+struct h {
+ enum { i, j };
+};
+template <typename> struct aa;
+} // namespace e
+template <typename> struct k;
+template <typename> class l;
+template <typename, int = e::h::j> class ab;
+template <typename, int m, int n, int = 0, int = m, int = n> class o;
+template <typename> class ac;
+class p;
+namespace e {
+template <typename> struct q { typedef ac<o<double, 2, 1>> ae; };
+struct s {
+ template <int, typename t> void af(double *ak, t) { *(b *)ak = c; }
+};
+} // namespace e
+template <typename ad> class ab<ad, d> : public k<ad> {};
+template <typename ad> class ab<ad> : public ab<ad, d> {
+public:
+ typedef typename e::g<ad>::ag ag;
+ using ab<ad, d>::ah;
+ ag ai() {
+ long aj = 0;
+ return e::aa(ah()).ai(aj);
+ }
+ ag operator[](long) { return ai(); }
+};
+template <typename ad> class ay : public ab<ad> {
+public:
+ enum { a, al };
+};
+template <typename ad> class ac : public ay<ad> {
+public:
+ p am();
+};
+template <typename> struct k {
+ o<double, 2, 1> &ah() { return *static_cast<o<double, 2, 1> *>(this); }
+};
+namespace e {
+template <typename f> struct aa { aa(f); };
+template <typename ad> struct aa<l<ad>> {
+ typedef ad ao;
+ typedef typename ao::ag ag;
+ aa(ao &ak) : ap(ak.aq()) {}
+ ag &ai(long ak) { return ap[ak]; }
+ ag *ap;
+};
+template <typename ag, int ar, int as, int at, int au, int av>
+struct aa<o<ag, ar, as, at, au, av>> : aa<l<o<ag, ar, as>>> {
+ typedef o<ag, ar, as> aw;
+ aa(aw &ak) : aa<l<aw>>(ak) {}
+};
+template <typename ax> struct u {
+ enum { az, ba, bb };
+ static void bc(ax ak) { ak.template be<bb, d, typename ax::bf>(az, ba); }
+};
+template <typename ax> struct v {
+ static void bc(ax ak) { u<ax>::bc(ak); }
+};
+template <typename bg, typename bh> class w {
+ typedef bg bi;
+
+public:
+ typedef bg bj;
+ typedef bg bf;
+ w(bj ak, int, bh, bi x) : bk(ak), bl(x) {}
+ template <int bm, int, typename> void be(long, long) {
+ bn.template af<bm>(&bk.ai(0), 0);
+ }
+ bj bk;
+ bh bn;
+ bi bl;
+};
+template <typename bi, typename bo, typename bh> void bp(bi &ak, bo, bh bq) {
+ typedef aa<bi> bj;
+ bo br;
+ bj bs(ak);
+ typedef w<bj, bh> ax;
+ ax bd(bs, br, bq, ak);
+ v<ax>::bc(bd);
+}
+template <typename> struct bt;
+template <typename bu, typename bv, typename bw> void bx(bu &ak, bv by, bw bq) {
+ bt<bw>::bc(ak, by, bq);
+}
+template <typename> struct bt {
+ static void bc(o<double, 2, 1> &ak, int by, s bq) { bp(ak, by, bq); }
+};
+} // namespace e
+class bz {
+public:
+ template <typename an> void operator*(an);
+};
+namespace e {
+template <int ca> struct cb { double am[ca]; };
+} // namespace e
+template <int ca> class cc {
+ e::cb<ca> ap;
+
+public:
+ double *aq() { return ap.am; }
+};
+template <typename ad> class l : public e::q<ad>::ae {
+public:
+ typedef typename e::q<ad>::ae cd;
+ typedef typename e::g<ad>::ag ag;
+ cc<cd::al> ce;
+ ag *aq() { return ce.aq(); }
+ l() {}
+ template <typename an> l(an ak) { bx(this->ah(), ak, e::s()); }
+ template <typename cf, typename cg> void ch(cf, cg by) {
+ ag *z, *y;
+ { z = aq(); }
+ y = z;
+ y[0] = aq()[1] = by;
+ }
+};
+namespace e {
+template <typename ci, int m, int n, int cj, int ck, int cl>
+struct g<o<ci, m, n, cj, ck, cl>> {
+ typedef ci ag;
+};
+} // namespace e
+template <typename, int m, int n, int, int, int>
+class o : public l<o<double, m, n>> {
+public:
+ typedef l<o> cd;
+ template <typename cf, typename cg> o(cf ak, cg by) { cd::ch(ak, by); }
+ template <typename an> o(an ak) : cd(ak) {}
+};
+class p : public bz {};
+double cq;
+void cm() {
+ o<double, 2, 1> r = 0;
+ o cn = r;
+ cn.am() * o<double, 2, 1>(0, r[0] / cq).am();
+}
diff --git a/gcc/testsuite/g++.dg/vect/slp-pr56812.cc b/gcc/testsuite/g++.dg/vect/slp-pr56812.cc
index 3e7a495aadd..37c47acd191 100644
--- a/gcc/testsuite/g++.dg/vect/slp-pr56812.cc
+++ b/gcc/testsuite/g++.dg/vect/slp-pr56812.cc
@@ -14,6 +14,6 @@ public:
void mydata::Set (float x)
{
/* We want to vectorize this either as loop or basic-block. */
- for (int i=0; i<upper(); i++) /* { dg-optimized "\[^\n\]* vectorized" } */
+ for (int i=0; i<upper(); i++) /* { dg-optimized "\[^\n\]* vectorized" "" { target *-*-* } 0 } */
data[i] = x;
}
diff --git a/gcc/testsuite/g++.dg/vect/slp-pr87105.cc b/gcc/testsuite/g++.dg/vect/slp-pr87105.cc
index 5518f319be3..d07b1cd46b7 100644
--- a/gcc/testsuite/g++.dg/vect/slp-pr87105.cc
+++ b/gcc/testsuite/g++.dg/vect/slp-pr87105.cc
@@ -102,4 +102,4 @@ void quadBoundingBoxA(const Point bez[3], Box& bBox) noexcept {
// { dg-final { scan-tree-dump-times "basic block part vectorized" 1 "slp2" { xfail { { ! vect_element_align } && { ! vect_hw_misalign } } } } }
// It's a bit awkward to detect that all stores were vectorized but the
// following more or less does the trick
-// { dg-final { scan-tree-dump "vect_iftmp\[^\r\m\]* = MIN" "slp2" { xfail { { ! vect_element_align } && { ! vect_hw_misalign } } } } }
+// { dg-final { scan-tree-dump "vect_\[^\r\m\]* = MIN" "slp2" { xfail { { ! vect_element_align } && { ! vect_hw_misalign } } } } }
diff --git a/gcc/testsuite/g++.dg/vect/vec-cond-expr-eh.C b/gcc/testsuite/g++.dg/vect/vec-cond-expr-eh.C
new file mode 100644
index 00000000000..00fe2422444
--- /dev/null
+++ b/gcc/testsuite/g++.dg/vect/vec-cond-expr-eh.C
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fnon-call-exceptions" } */
+
+typedef double v2df __attribute__((vector_size(16)));
+
+v2df foo (v2df a, v2df b, v2df c, v2df d)
+{
+ try
+ {
+ v2df res = a < b ? c : d;
+ return res;
+ }
+ catch (...)
+ {
+ return (v2df){};
+ }
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wconversion-integer.C b/gcc/testsuite/g++.dg/warn/Wconversion-integer.C
index 42d9cb00044..2849e81595d 100644
--- a/gcc/testsuite/g++.dg/warn/Wconversion-integer.C
+++ b/gcc/testsuite/g++.dg/warn/Wconversion-integer.C
@@ -6,15 +6,18 @@
#include <limits.h>
+typedef signed int int32_t __attribute__((mode (__SI__)));
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
+
void fsc (signed char sc);
void fuc (unsigned char uc);
-unsigned fui (unsigned int ui);
-void fsi (signed int ui);
+unsigned fui (uint32_t ui);
+void fsi (int32_t ui);
-void h (int x)
+void h (int32_t x)
{
- unsigned int ui = 3;
- int si = 3;
+ uint32_t ui = 3;
+ int32_t si = 3;
unsigned char uc = 3;
signed char sc = 3;
diff --git a/gcc/testsuite/g++.dg/warn/Wconversion-null-2.C b/gcc/testsuite/g++.dg/warn/Wconversion-null-2.C
index 98f5c405165..3ba756e596b 100644
--- a/gcc/testsuite/g++.dg/warn/Wconversion-null-2.C
+++ b/gcc/testsuite/g++.dg/warn/Wconversion-null-2.C
@@ -6,6 +6,9 @@
void g(int) {}
void g(long) {}
void g(long long) {}
+#ifdef __MSP430X_LARGE__
+void g(__int20) {}
+#endif
extern void g(void*);
template <int I>
@@ -25,6 +28,11 @@ void l(long) {}
template <>
void l(long long) {}
+#ifdef __MSP430X_LARGE__
+template <>
+void l(__int20) {}
+#endif
+
void warn_for_NULL()
{
int i = NULL; // { dg-warning "" } converting NULL to non-pointer type
diff --git a/gcc/testsuite/g++.dg/warn/Wconversion-null.C b/gcc/testsuite/g++.dg/warn/Wconversion-null.C
index e2ca13e514c..4c68d233450 100644
--- a/gcc/testsuite/g++.dg/warn/Wconversion-null.C
+++ b/gcc/testsuite/g++.dg/warn/Wconversion-null.C
@@ -6,6 +6,9 @@
void g(int) {}
void g(long) {}
void g(long long) {}
+#ifdef __MSP430X_LARGE__
+void g(__int20) {}
+#endif
extern void g(void*);
template <int I>
@@ -25,6 +28,11 @@ void l(long) {}
template <>
void l(long long) {}
+#ifdef __MSP430X_LARGE__
+template <>
+void l(__int20) {}
+#endif
+
int main()
{
int i = NULL; // converting NULL to non-pointer type
diff --git a/gcc/testsuite/g++.dg/warn/Wconversion3.C b/gcc/testsuite/g++.dg/warn/Wconversion3.C
index 71604f9a8e6..81682524fd5 100644
--- a/gcc/testsuite/g++.dg/warn/Wconversion3.C
+++ b/gcc/testsuite/g++.dg/warn/Wconversion3.C
@@ -19,7 +19,7 @@ void test1 (void)
unsigned char f = (int) uc;
signed char g = (int) sc;
unsigned char h = (unsigned int) (short int) uc;
- signed char i = (int) (unsigned short int) sc; // { dg-warning "may change value" }
+ signed char i = (int) (unsigned short int) sc; // { dg-warning "may change value" "" { target { ! short_eq_int } } }
unsigned char j = (unsigned int) (short int) us; // { dg-warning "may change value" }
signed char k = (int) (unsigned short int) ss; // { dg-warning "may change value" }
}
diff --git a/gcc/testsuite/g++.dg/warn/Wdiv-by-zero-3.C b/gcc/testsuite/g++.dg/warn/Wdiv-by-zero-3.C
new file mode 100644
index 00000000000..424eb0c3d49
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wdiv-by-zero-3.C
@@ -0,0 +1,17 @@
+// PR c++/94938
+
+template <typename T, int N> int
+foo (T t, int i)
+{
+ int m1 = 10 / t;
+ int m2 = 10 / i;
+ int m3 = 10 / (sizeof(T) - sizeof(int)); // { dg-warning "division by" }
+ int m4 = 10 / N; // { dg-warning "division by" }
+ return m1 + m2 + m3 + m4;
+}
+
+void
+f ()
+{
+ foo<int, 0>(0, 0);
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wduplicated-branches1.C b/gcc/testsuite/g++.dg/warn/Wduplicated-branches1.C
index 1553613f9ec..30cea63b1e9 100644
--- a/gcc/testsuite/g++.dg/warn/Wduplicated-branches1.C
+++ b/gcc/testsuite/g++.dg/warn/Wduplicated-branches1.C
@@ -6,7 +6,7 @@ template <typename T>
void
f (signed char i, int *p)
{
- if (i)
+ if (i) // { dg-warning "this condition has identical branches" "" { target short_eq_int } }
*p = (signed short) i;
else
*p = (unsigned short) i;
diff --git a/gcc/testsuite/g++.dg/warn/Wextra-3.C b/gcc/testsuite/g++.dg/warn/Wextra-3.C
index 1bf2a6e4977..1b596b3f3e2 100644
--- a/gcc/testsuite/g++.dg/warn/Wextra-3.C
+++ b/gcc/testsuite/g++.dg/warn/Wextra-3.C
@@ -1,9 +1,8 @@
// PR c++/45278
-// { dg-options "-Wextra" }
extern void* p;
-int f1() { return ( p < 0 ? 1 : 0 ); } // { dg-warning "23:ordered comparison" }
-int f2() { return ( p <= 0 ? 1 : 0 ); } // { dg-warning "23:ordered comparison" }
-int f3() { return ( p > 0 ? 1 : 0 ); } // { dg-warning "23:ordered comparison" }
-int f4() { return ( p >= 0 ? 1 : 0 ); } // { dg-warning "23:ordered comparison" }
+int f1() { return ( p < 0 ? 1 : 0 ); } // { dg-error "23:ordered comparison" }
+int f2() { return ( p <= 0 ? 1 : 0 ); } // { dg-error "23:ordered comparison" }
+int f3() { return ( p > 0 ? 1 : 0 ); } // { dg-error "23:ordered comparison" }
+int f4() { return ( p >= 0 ? 1 : 0 ); } // { dg-error "23:ordered comparison" }
diff --git a/gcc/testsuite/g++.dg/warn/Wmismatched-tags-7.C b/gcc/testsuite/g++.dg/warn/Wmismatched-tags-7.C
new file mode 100644
index 00000000000..3180c22c054
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wmismatched-tags-7.C
@@ -0,0 +1,13 @@
+/* Verify that -Wmismatched-tags doesn't print stray notes for warnings
+ disabled in system headers.
+ { dg-do "compile" }
+ { dg-options "-Wmismatched-tags" } */
+
+# 6 "Wmismatched-tags-7.C" 1
+# 1 "system-header.h" 1 3 4
+# 9 "system-header.h" 3 4
+class A; // { dg-bogus "first declared" }
+struct A; // { dg-bogus "replace" }
+# 12 "Wmismatched-tags-7.C" 2
+class B; // { dg-message "first declared" }
+struct B; // { dg-warning "\\\[-Wmismatched-tags" }
diff --git a/gcc/testsuite/g++.dg/warn/Wmismatched-tags-8.C b/gcc/testsuite/g++.dg/warn/Wmismatched-tags-8.C
new file mode 100644
index 00000000000..0ebca3db90f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wmismatched-tags-8.C
@@ -0,0 +1,22 @@
+/* Verify that #pragma GCC diagnostic works for -Wmismatched-tags.
+ { dg-do "compile" }
+ { dg-options "-Wmismatched-tags" } */
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic error "-Wmismatched-tags"
+class A; // { dg-message "first declared"
+struct A; // { dg-error "\\\[-Werror=mismatched-tags" }
+
+#pragma GCC diagnostic ignored "-Wmismatched-tags"
+class B; // { dg-bogus "first declared" }
+struct B;
+
+#pragma GCC diagnostic warning "-Wmismatched-tags"
+class C; // { dg-message "first declared"
+struct C; // { dg-warning "\\\[-Wmismatched-tags" }
+#pragma GCC diagnostic pop
+
+class D; // { dg-message "first declared"
+struct D; // { dg-warning "\\\[-Wmismatched-tags" }
+
+// { dg-prune-output "some warnings being treated as errors" }
diff --git a/gcc/testsuite/g++.dg/warn/Wnonnull3.C b/gcc/testsuite/g++.dg/warn/Wnonnull3.C
index d1918ef8e90..cebf36d581d 100644
--- a/gcc/testsuite/g++.dg/warn/Wnonnull3.C
+++ b/gcc/testsuite/g++.dg/warn/Wnonnull3.C
@@ -10,6 +10,6 @@ struct S2 { static const int i = 1; typedef void* U; };
void
g ()
{
- f<S1>(0); // { dg-warning "null argument where non-null required" }
- f<S2>(0); // { dg-warning "null argument where non-null required" }
+ f<S1>(0); // { dg-warning "argument 1 null where non-null expected" }
+ f<S2>(0); // { dg-warning "argument 1 null where non-null expected" }
}
diff --git a/gcc/testsuite/g++.dg/warn/Wnonnull4.C b/gcc/testsuite/g++.dg/warn/Wnonnull4.C
index d07a4452ddb..215781613b2 100644
--- a/gcc/testsuite/g++.dg/warn/Wnonnull4.C
+++ b/gcc/testsuite/g++.dg/warn/Wnonnull4.C
@@ -10,8 +10,8 @@ int
main ()
{
int *const p = 0;
- declared_not_defined (p); // { dg-warning "null argument where non-null required" }
- declared_and_defined (p); // { dg-warning "null argument where non-null required" }
+ declared_not_defined (p); // { dg-warning "argument 1 null where non-null expected" }
+ declared_and_defined (p); // { dg-warning "argument 1 null where non-null expected" }
}
void *
diff --git a/gcc/testsuite/g++.dg/warn/Wnonnull5.C b/gcc/testsuite/g++.dg/warn/Wnonnull5.C
new file mode 100644
index 00000000000..8b25d2d9f86
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wnonnull5.C
@@ -0,0 +1,108 @@
+/* PR c++/86568 - -Wnonnull warnings should highlight the relevant argument
+ not the closing parenthesis.
+ { dg-do compile }
+ { dg-options "-O2 -Wall" } */
+
+#define NONNULL __attribute__ ((nonnull))
+
+#if __cplusplus < 201103L
+# define nullptr __null
+#endif
+
+struct S
+{
+ void
+ f0 (const void*) const; // { dg-message "in a call to non-static member function 'void S::f0\\(const void\\*\\) const'" }
+
+ void
+ f1 (const void*) const; // { dg-message "in a call to non-static member function 'void S::f1\\(const void\\*\\) const'" }
+
+ void
+ f2 (const void*) const; // { dg-message "in a call to non-static member function 'void S::f2\\(const void\\*\\) const'" }
+
+ NONNULL void
+ f3 (const void*, const void*); // { dg-message "in a call to function 'void S::f3\\(const void\\*, const void\\*\\)' declared 'nonnull'" }
+
+ NONNULL void
+ f4 (const void*, const void*); // { dg-message "in a call to function 'void S::f4\\(const void\\*, const void\\*\\)' declared 'nonnull'" }
+
+ NONNULL void
+ f5 (const void*, const void*); // { dg-message "in a call to function 'void S::f5\\\(const void\\*, const void\\*\\)' declared 'nonnull'" }
+
+ NONNULL void
+ f6 (const void*, const void*); // { dg-message "in a call to function 'void S::f6\\\(const void\\*, const void\\*\\)' declared 'nonnull'" }
+};
+
+void warn_nullptr_this ()
+{
+ ((S*)nullptr)->f0 (""); // { dg-warning "3:'this' pointer null" "pr86568" { xfail *-*-* } }
+ // { dg-warning "this' pointer null" "pr86568" { target *-*-* } .-1 }
+}
+
+void warn_null_this_cst ()
+{
+ S* const null = 0;
+ null->f1 (""); // { dg-warning "3:'this' pointer null" }
+}
+
+void warn_null_this_var ()
+{
+ S* null = 0;
+ null->f2 (&null); // { dg-warning "3:'this' pointer null" "pr86568" { xfail *-*-* } }
+ // { dg-warning "'this' pointer null" "pr86568" { target *-*-* } .-1 }
+}
+
+void warn_nullptr (S s)
+{
+ s.f3 (nullptr, &s); // { dg-warning "9:argument 1 null where non-null expected" "pr86568" { xfail *-*-* } }
+ // { dg-warning "argument 1 null where non-null expected" "pr86568" { target *-*-* } .-1 }
+ s.f3 (&s, nullptr); // { dg-warning "13:argument 2 null where non-null expected" "pr86568" { xfail *-*-* } }
+ // { dg-warning "argument 2 null where non-null expected" "pr86568" { target *-*-* } .-1 }
+}
+
+
+void warn_null_cst (S s)
+{
+ void* const null = 0;
+ s.f4 (null, &s); // { dg-warning "9:argument 1 null where non-null expected" }
+ s.f4 (&s, null); // { dg-warning "13:argument 2 null where non-null expected" }
+}
+
+void warn_null_var (S s)
+{
+ void* null = 0;
+ s.f5 (null, &s); // { dg-warning "9:argument 1 null where non-null expected" "pr86568" { xfail *-*-* } }
+ // { dg-warning "argument 1 null where non-null expected" "pr86568" { target *-*-* } .-1 }
+ s.f5 (&s, null); // { dg-warning "16:argument 2 null where non-null expected" "pr86568" { xfail *-*-* } }
+ // { dg-warning "argument 2 null where non-null expected" "pr86568" { target *-*-* } .-1 }
+}
+
+void warn_null_cond (S s, void *null)
+{
+ if (null)
+ return;
+
+ s.f6 (null, &s); // { dg-warning "9:argument 1 null where non-null expected" "pr86568" { xfail *-*-* } }
+ // { dg-warning "argument 1 null where non-null expected" "pr86568" { target *-*-* } .-1 }
+ s.f6 (&s, null); // { dg-warning "13:argument 2 null where non-null expected" "pr86568" { xfail *-*-* } }
+ // { dg-warning "argument 2 null where non-null expected" "pr86568" { target *-*-* } .-1 }
+}
+
+
+typedef NONNULL void Fvp (const void*, const void*);
+
+void warn_fptr_null_cst (Fvp *p)
+{
+ void* const null = 0;
+ p (null, ""); // { dg-warning "6:argument 1 null where non-null expected" }
+ p ("", null); // { dg-warning "10:argument 2 null where non-null expected" }
+}
+
+typedef NONNULL void (S::*SMemFvp) (const void*, const void*);
+
+void warn_memfptr_null_cst (S *p, SMemFvp pmf)
+{
+ void* const null = 0;
+ (p->*pmf) (null, ""); // { dg-warning "14:argument 1 null where non-null expected" }
+ (p->*pmf) ("", null); // { dg-warning "18:argument 2 null where non-null expected" }
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wnonnull6.C b/gcc/testsuite/g++.dg/warn/Wnonnull6.C
new file mode 100644
index 00000000000..dae6dd2d912
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wnonnull6.C
@@ -0,0 +1,37 @@
+/* PR c++/95984 - Internal compiler error: Error reporting routines re-entered
+ in -Wnonnull on a variadic lamnda
+ PR c++/missing -Wnonnull passing nullptr to a nonnull variadic lambda
+ { dg-do compile { target c++11 } }
+ { dg-options "-Wall" } */
+
+typedef int F (int);
+
+F* pr95984 ()
+{
+ // This also triggered the ICE.
+ return [](auto...) { return 0; }; // { dg-bogus "\\\[-Wnonnull" }
+}
+
+
+__attribute__ ((nonnull)) void f (int, ...);
+void ff ()
+{
+ f (1, nullptr); // { dg-warning "\\\[-Wnonnull" }
+}
+
+template <class T> void g (T t)
+{
+ t (1, nullptr); // { dg-warning "\\\[-Wnonnull" }
+}
+
+void gg (void)
+{
+ g ([](int, auto...) __attribute__ ((nonnull)) { });
+}
+
+template <class T> __attribute__ ((nonnull)) void h (T);
+
+void hh ()
+{
+ h (nullptr); // { dg-warning "\\\[-Wnonnull" }
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wnonnull7.C b/gcc/testsuite/g++.dg/warn/Wnonnull7.C
new file mode 100644
index 00000000000..7611c18d948
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wnonnull7.C
@@ -0,0 +1,36 @@
+/* PR c++/96003 - spurious -Wnonnull calling a member on the result
+ of static_cast
+ { dg-do compile }
+ { dg-options "-Wall" } */
+
+struct D;
+struct B
+{
+ B* next;
+ D* Next ();
+};
+
+struct D: B
+{
+ virtual ~D ();
+};
+
+struct Iterator
+{
+ D* p;
+ void advance ()
+ {
+ p = static_cast<B*>(p)->Next (); // { dg-bogus "\\\[-Wnonnull" }
+ }
+};
+
+// Test case from comment #11.
+
+struct S1 { virtual ~S1 (); };
+struct S2 { virtual ~S2 (); };
+struct S3: S1, S2 { void f (); };
+
+void f (S2 *p)
+{
+ static_cast<S3 *>(p)->f (); // { dg-bogus "\\\[-Wnonnull" }
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wnonnull8.C b/gcc/testsuite/g++.dg/warn/Wnonnull8.C
new file mode 100644
index 00000000000..7820b2e3b79
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wnonnull8.C
@@ -0,0 +1,20 @@
+/* PR c++/96310 - Ignoring -Wnonnull via pragma gcc diagnostics still produces
+ an unwanted note
+ { dg-do compile }
+ { dg-options "-Wall" } */
+
+struct C {
+ void f (); // { dg-message "in a call" }
+ void g (); // { dg-bogus "in a call" }
+};
+
+void f ()
+{
+ static_cast<C*>(0)->f (); // { dg-warning "\\\[-Wnonnull" }
+}
+
+void g ()
+{
+#pragma GCC diagnostic ignored "-Wnonnull"
+ static_cast<C*>(0)->g ();
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wplacement-new-size-5.C b/gcc/testsuite/g++.dg/warn/Wplacement-new-size-5.C
index 0bed5771531..4afc7e503ab 100644
--- a/gcc/testsuite/g++.dg/warn/Wplacement-new-size-5.C
+++ b/gcc/testsuite/g++.dg/warn/Wplacement-new-size-5.C
@@ -11,17 +11,19 @@
void* operator new (__SIZE_TYPE__ n, void *p) { return p; }
void* operator new[] (__SIZE_TYPE__ n, void *p) { return p; }
+typedef int int32_t __attribute__((mode (__SI__)));
+
struct A { };
char carr[2];
-int iarr[2];
+int32_t iarr[2];
struct C0 { char i, carr[0]; };
-struct I0 { int i, iarr[0]; };
+struct I0 { int32_t i, iarr[0]; };
struct CX { char i, carr[]; };
-struct IX { int i, iarr[]; };
+struct IX { int32_t i, iarr[]; };
-void test_single (C0 *pc, CX *qc, I0 *pi, IX *qi, int n)
+void test_single (C0 *pc, CX *qc, I0 *pi, IX *qi, int32_t n)
{
new (&carr[DIFF_MIN]) A (); // { dg-warning "placement new constructing an object of type .A. and size .1. in a region of type .char \\\[2]. and size .0." }
new (&carr[-1]) A; // { dg-warning "\\\[-Wplacement-new" }
diff --git a/gcc/testsuite/g++.dg/warn/Wplacement-new-size.C b/gcc/testsuite/g++.dg/warn/Wplacement-new-size.C
index 2bafff34577..48d6b15656a 100644
--- a/gcc/testsuite/g++.dg/warn/Wplacement-new-size.C
+++ b/gcc/testsuite/g++.dg/warn/Wplacement-new-size.C
@@ -3,6 +3,8 @@
typedef __typeof__ (sizeof 0) size_t;
+typedef int int32_t __attribute__((mode (__SI__)));
+
void* operator new (size_t, void *p) { return p; }
void* operator new[] (size_t, void *p) { return p; }
@@ -31,7 +33,7 @@ static __attribute__ ((used))struct SAC2 { char ac [2]; } sac2;
static __attribute__ ((used))struct SAC3 { char ac [3]; } sac3;
static __attribute__ ((used))struct SAC4 { char ac [4]; } sac4;
-static __attribute__ ((used))struct SSC { SC sc; int x; } ssc;
+static __attribute__ ((used))struct SSC { SC sc; int32_t x; } ssc;
static __attribute__ ((used))struct SSAC1 { SAC1 sac; } ssac1;
static __attribute__ ((used))struct SSAC2 { SAC2 sac; } ssac2;
static __attribute__ ((used))struct SSAC3 { SAC3 sac; } ssac3;
@@ -55,7 +57,7 @@ static __attribute__ ((used))void *r;
static __attribute__ ((used))void* ptr () { return 0; }
static __attribute__ ((used))
-void test (void *p, int n)
+void test (void *p, int32_t n)
{
{
void *q = p;
@@ -167,83 +169,83 @@ void test (void *p, int n)
new (ac8) char [2][2][2];
new (ac8) char [2][2][3]; // { dg-warning "placement" }
- new (&c) int; // { dg-warning "placement" }
+ new (&c) int32_t; // { dg-warning "placement" }
- new (&ac1) int; // { dg-warning "placement" }
- new (&ac2) int; // { dg-warning "placement" }
- new (&ac3) int; // { dg-warning "placement" }
- new (&ac4) int;
+ new (&ac1) int32_t; // { dg-warning "placement" }
+ new (&ac2) int32_t; // { dg-warning "placement" }
+ new (&ac3) int32_t; // { dg-warning "placement" }
+ new (&ac4) int32_t;
// Constructing at an address of an array element.
- new (&ac1 [0]) int; // { dg-warning "placement" }
- new (&ac2 [0]) int; // { dg-warning "placement" }
- new (&ac3 [0]) int; // { dg-warning "placement" }
- new (&ac4 [0]) int;
+ new (&ac1 [0]) int32_t; // { dg-warning "placement" }
+ new (&ac2 [0]) int32_t; // { dg-warning "placement" }
+ new (&ac3 [0]) int32_t; // { dg-warning "placement" }
+ new (&ac4 [0]) int32_t;
// ...plus or minus a constant offset.
- new (&ac1 [0] + 0) int; // { dg-warning "placement" }
- new (&ac2 [0] + 0) int; // { dg-warning "placement" }
- new (&ac3 [0] + 0) int; // { dg-warning "placement" }
- new (&ac4 [0] + 0) int;
- new (&ac4 [1] + 0) int; // { dg-warning "placement" }
- new (&ac4 [1] - 1) int;
- new (&ac4 [2] - 1) int; // { dg-warning "placement" }
- new (&ac4 [2] - 2) int;
- new (&ac4 [3] - 1) int; // { dg-warning "placement" }
- new (&ac4 [3] - 2) int; // { dg-warning "placement" }
- new (&ac4 [3] - 3) int;
- new (&ac4 [4] - 1) int; // { dg-warning "placement" }
- new (&ac4 [4] - 2) int; // { dg-warning "placement" }
- new (&ac4 [4] - 3) int; // { dg-warning "placement" }
- new (&ac4 [4] - 4) int;
-
- new (&ac1 [0] + 1) int; // { dg-warning "placement" }
- new (&ac2 [0] + 1) int; // { dg-warning "placement" }
- new (&ac3 [0] + 1) int; // { dg-warning "placement" }
- new (&ac4 [0] + 1) int; // { dg-warning "placement" }
-
- new (&ac3 [0] + n) int; // { dg-warning "placement" }
- new (&ac4 [0] + n) int; // no warning (n could be zero)
- new (&ac4 [1] + n) int; // no warning (n could be negative)
- new (&ac4 [2] + n) int; // ditto
- new (&ac4 [3] + n) int; // ditto
- new (&ac4 [4] + n) int; // ditto
- new (&ac4 [4] - n) int; // (or positive)
-
- new (&c + 0) int; // { dg-warning "placement" }
- new (&c + 1) int; // { dg-warning "placement" }
+ new (&ac1 [0] + 0) int32_t; // { dg-warning "placement" }
+ new (&ac2 [0] + 0) int32_t; // { dg-warning "placement" }
+ new (&ac3 [0] + 0) int32_t; // { dg-warning "placement" }
+ new (&ac4 [0] + 0) int32_t;
+ new (&ac4 [1] + 0) int32_t; // { dg-warning "placement" }
+ new (&ac4 [1] - 1) int32_t;
+ new (&ac4 [2] - 1) int32_t; // { dg-warning "placement" }
+ new (&ac4 [2] - 2) int32_t;
+ new (&ac4 [3] - 1) int32_t; // { dg-warning "placement" }
+ new (&ac4 [3] - 2) int32_t; // { dg-warning "placement" }
+ new (&ac4 [3] - 3) int32_t;
+ new (&ac4 [4] - 1) int32_t; // { dg-warning "placement" }
+ new (&ac4 [4] - 2) int32_t; // { dg-warning "placement" }
+ new (&ac4 [4] - 3) int32_t; // { dg-warning "placement" }
+ new (&ac4 [4] - 4) int32_t;
+
+ new (&ac1 [0] + 1) int32_t; // { dg-warning "placement" }
+ new (&ac2 [0] + 1) int32_t; // { dg-warning "placement" }
+ new (&ac3 [0] + 1) int32_t; // { dg-warning "placement" }
+ new (&ac4 [0] + 1) int32_t; // { dg-warning "placement" }
+
+ new (&ac3 [0] + n) int32_t; // { dg-warning "placement" }
+ new (&ac4 [0] + n) int32_t; // no warning (n could be zero)
+ new (&ac4 [1] + n) int32_t; // no warning (n could be negative)
+ new (&ac4 [2] + n) int32_t; // ditto
+ new (&ac4 [3] + n) int32_t; // ditto
+ new (&ac4 [4] + n) int32_t; // ditto
+ new (&ac4 [4] - n) int32_t; // (or positive)
+
+ new (&c + 0) int32_t; // { dg-warning "placement" }
+ new (&c + 1) int32_t; // { dg-warning "placement" }
// Constructing at an offset into the address of an array.
- new (&ac1 + 0) int; // { dg-warning "placement" }
- new (&ac1 + 1) int; // { dg-warning "placement" }
- new (&ac1 + n) int; // { dg-warning "placement" }
- new (&ac2 + 0) int; // { dg-warning "placement" }
- new (&ac2 + 1) int; // { dg-warning "placement" }
- new (&ac2 + n) int; // { dg-warning "placement" }
- new (&ac3 + 0) int; // { dg-warning "placement" }
- new (&ac3 + 1) int; // { dg-warning "placement" }
+ new (&ac1 + 0) int32_t; // { dg-warning "placement" }
+ new (&ac1 + 1) int32_t; // { dg-warning "placement" }
+ new (&ac1 + n) int32_t; // { dg-warning "placement" }
+ new (&ac2 + 0) int32_t; // { dg-warning "placement" }
+ new (&ac2 + 1) int32_t; // { dg-warning "placement" }
+ new (&ac2 + n) int32_t; // { dg-warning "placement" }
+ new (&ac3 + 0) int32_t; // { dg-warning "placement" }
+ new (&ac3 + 1) int32_t; // { dg-warning "placement" }
// Even though n below is uknown an array of 3 bytes isn't large
- // enugh for an int.
- new (&ac3 + n) int; // { dg-warning "placement" }
+ // enugh for an int32_t.
+ new (&ac3 + n) int32_t; // { dg-warning "placement" }
- new (&ac4 + 0) int;
- new (&ac4 + 1) int; // { dg-warning "placement" }
- new (&ac4 + n) int; // no warning (n could be zero)
+ new (&ac4 + 0) int32_t;
+ new (&ac4 + 1) int32_t; // { dg-warning "placement" }
+ new (&ac4 + n) int32_t; // no warning (n could be zero)
// Constructing in an array object.
- new (ac1) int; // { dg-warning "placement" }
- new (ac2) int; // { dg-warning "placement" }
- new (ac3) int; // { dg-warning "placement" }
- new (ac4) int;
- new (ac5) int;
- new (ac5 + 0) int;
- new (ac5 + 1) int;
- new (ac5 + n) int; // no warning (n could be zero)
- new (ac5 + 2) int; // { dg-warning "placement" }
- new (ac5 + 3) int; // { dg-warning "placement" }
- new (ac5 + 4) int; // { dg-warning "placement" }
- new (ac5 + 5) int; // { dg-warning "placement" }
+ new (ac1) int32_t; // { dg-warning "placement" }
+ new (ac2) int32_t; // { dg-warning "placement" }
+ new (ac3) int32_t; // { dg-warning "placement" }
+ new (ac4) int32_t;
+ new (ac5) int32_t;
+ new (ac5 + 0) int32_t;
+ new (ac5 + 1) int32_t;
+ new (ac5 + n) int32_t; // no warning (n could be zero)
+ new (ac5 + 2) int32_t; // { dg-warning "placement" }
+ new (ac5 + 3) int32_t; // { dg-warning "placement" }
+ new (ac5 + 4) int32_t; // { dg-warning "placement" }
+ new (ac5 + 5) int32_t; // { dg-warning "placement" }
new (ac1_1) char;
new (ac1_1) char[1];
@@ -278,65 +280,65 @@ void test (void *p, int n)
new (ac2_2) char[4][2]; // { dg-warning "placement" }
new (ac2_2) char[5]; // { dg-warning "placement" }
- new (&s) int; // { dg-warning "placement" }
- new (&as1) int; // { dg-warning "placement" }
- new (&as2) int;
+ new (&s) int32_t; // { dg-warning "placement" }
+ new (&as1) int32_t; // { dg-warning "placement" }
+ new (&as2) int32_t;
- new (as1) int; // { dg-warning "placement" }
- new (as2) int;
+ new (as1) int32_t; // { dg-warning "placement" }
+ new (as2) int32_t;
- new (&sc.c) int; // { dg-warning "placement" }
- new (&sac1.ac) int; // { dg-warning "placement" }
- new (&sac2.ac) int; // { dg-warning "placement" }
- new (&sac3.ac) int; // { dg-warning "placement" }
- new (&sac4.ac) int;
+ new (&sc.c) int32_t; // { dg-warning "placement" }
+ new (&sac1.ac) int32_t; // { dg-warning "placement" }
+ new (&sac2.ac) int32_t; // { dg-warning "placement" }
+ new (&sac3.ac) int32_t; // { dg-warning "placement" }
+ new (&sac4.ac) int32_t;
new (sc.pc) char;
- new (sc.pc) int;
- new (sc.pc) int[1024];
- new (sc.pc + 0) int;
- new (sc.pc + 0) int[2048];
- new (sc.pv) int;
+ new (sc.pc) int32_t;
+ new (sc.pc) int32_t[1024];
+ new (sc.pc + 0) int32_t;
+ new (sc.pc + 0) int32_t[2048];
+ new (sc.pv) int32_t;
new (sc.pv) char[1024];
- new (sac1.ac) int; // { dg-warning "placement" }
- new (sac2.ac) int; // { dg-warning "placement" }
- new (sac3.ac) int; // { dg-warning "placement" }
- new (sac4.ac) int;
+ new (sac1.ac) int32_t; // { dg-warning "placement" }
+ new (sac2.ac) int32_t; // { dg-warning "placement" }
+ new (sac3.ac) int32_t; // { dg-warning "placement" }
+ new (sac4.ac) int32_t;
new (&ssc.sc) SSC; // { dg-warning "placement" }
- new (&ssac1.sac) int; // { dg-warning "placement" }
- new (&ssac2.sac) int; // { dg-warning "placement" }
- new (&ssac3.sac) int; // { dg-warning "placement" }
- new (&ssac4.sac) int;
+ new (&ssac1.sac) int32_t; // { dg-warning "placement" }
+ new (&ssac2.sac) int32_t; // { dg-warning "placement" }
+ new (&ssac3.sac) int32_t; // { dg-warning "placement" }
+ new (&ssac4.sac) int32_t;
new (&sssac4_2) char[sizeof sssac4_2];
new (&sssac4_2) char[sizeof sssac4_2 + 1]; // { dg-warning "placement" }
// taking the address of a temporary is allowed with -fpermissive
- new (&fsc ().c) int; // { dg-warning "18:taking address|placement" }
- new (&fasc1 ().ac) int; // { dg-warning "20:taking address|placement" }
- new (&fasc2 ().ac) int; // { dg-warning "20:taking address|placement" }
- new (&fasc3 ().ac) int; // { dg-warning "20:taking address|placement" }
- new (&fasc4 ().ac) int; // { dg-warning "20:taking address|placement" }
-
- new (&uac1) int; // { dg-warning "placement" }
- new (&uac2) int; // { dg-warning "placement" }
- new (&uac3) int; // { dg-warning "placement" }
- new (&uac4) int;
- new (&uac4 + 1) int; // { dg-warning "placement" }
-
- new (&uac1.c) int; // { dg-warning "placement" }
- new (&uac2.c) int; // { dg-warning "placement" }
- new (&uac3.c) int; // { dg-warning "placement" }
+ new (&fsc ().c) int32_t; // { dg-warning "18:taking address|placement" }
+ new (&fasc1 ().ac) int32_t; // { dg-warning "20:taking address|placement" }
+ new (&fasc2 ().ac) int32_t; // { dg-warning "20:taking address|placement" }
+ new (&fasc3 ().ac) int32_t; // { dg-warning "20:taking address|placement" }
+ new (&fasc4 ().ac) int32_t; // { dg-warning "20:taking address|placement" }
+
+ new (&uac1) int32_t; // { dg-warning "placement" }
+ new (&uac2) int32_t; // { dg-warning "placement" }
+ new (&uac3) int32_t; // { dg-warning "placement" }
+ new (&uac4) int32_t;
+ new (&uac4 + 1) int32_t; // { dg-warning "placement" }
+
+ new (&uac1.c) int32_t; // { dg-warning "placement" }
+ new (&uac2.c) int32_t; // { dg-warning "placement" }
+ new (&uac3.c) int32_t; // { dg-warning "placement" }
// Diagnose the following even though the size of uac4.c could be
// expected to extend to the end of the union (as it is by Built-in
// Object Size and so isn't diagnosed in calls to functions like
- // memset(&uac4.c, 0, sizeof(int)) when _FORTIFY_SOURCE is non-zero. */
- new (&uac4.c) int; // { dg-warning "placement" }
+ // memset(&uac4.c, 0, sizeof(int32_t)) when _FORTIFY_SOURCE is non-zero. */
+ new (&uac4.c) int32_t; // { dg-warning "placement" }
- new (&uac4.c + 1) int; // { dg-warning "placement" }
+ new (&uac4.c + 1) int32_t; // { dg-warning "placement" }
}
@@ -344,7 +346,7 @@ struct S { char c [2]; };
// Verify the full text of the warning message.
static __attribute__ ((used))
-void test_message (int i)
+void test_message (int32_t i)
{
char a [2];
@@ -364,7 +366,7 @@ void test_message (int i)
struct ClassWithMemberNew {
- struct Object { int i; } *pobj;
+ struct Object { int32_t i; } *pobj;
unsigned nobj;
ClassWithMemberNew ();
@@ -382,7 +384,7 @@ void ClassWithMemberNew::foo()
struct ClassWithGlobalNew {
- int a [4];
+ int32_t a [4];
ClassWithGlobalNew ();
};
@@ -425,16 +427,16 @@ extern TemplateClass<void> exttempl_void;
static __attribute__ ((used))
void test_extern_buffer_of_unknown_size ()
{
- new (extbuf) int ();
- new (extbuf) int [1024];
+ new (extbuf) int32_t ();
+ new (extbuf) int32_t [1024];
- new (&exttempl_void) int ();
- new (&exttempl_void) int [1024];
+ new (&exttempl_void) int32_t ();
+ new (&exttempl_void) int32_t [1024];
}
-extern char extbuf_size_int [sizeof (int)];
+extern char extbuf_size_int [sizeof (int32_t)];
-extern TemplateClass<int> exttempl;
+extern TemplateClass<int32_t> exttempl;
// Verify that a warning is issued as expected when placement new is
// called with an extern buffer of known size (and the case is handled
@@ -442,14 +444,14 @@ extern TemplateClass<int> exttempl;
static __attribute__ ((used))
void test_extern_buffer ()
{
- new (extbuf_size_int) int ();
- new (extbuf_size_int) int [1];
+ new (extbuf_size_int) int32_t ();
+ new (extbuf_size_int) int32_t [1];
- struct S { int a [2]; };
+ struct S { int32_t a [2]; };
new (extbuf_size_int) S; // { dg-warning "placement" }
- new (extbuf_size_int) int [2]; // { dg-warning "placement" }
+ new (extbuf_size_int) int32_t [2]; // { dg-warning "placement" }
- new (&exttempl) int (); // { dg-warning "placement" }
- new (&exttempl) int [1024]; // { dg-warning "placement" }
+ new (&exttempl) int32_t (); // { dg-warning "placement" }
+ new (&exttempl) int32_t [1024]; // { dg-warning "placement" }
}
diff --git a/gcc/testsuite/g++.dg/warn/Wshadow-local-3.C b/gcc/testsuite/g++.dg/warn/Wshadow-local-3.C
new file mode 100644
index 00000000000..fd743eca347
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wshadow-local-3.C
@@ -0,0 +1,7 @@
+// PR c++/95560
+// { dg-do compile { target c++11 } }
+
+template <typename> void fn1() {
+ bool ready;
+ enum class State { ready };
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-5.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-5.C
index a0492511865..84c493c435f 100644
--- a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-5.C
+++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-5.C
@@ -1,9 +1,11 @@
/* { dg-do compile } */
/* { dg-options "-Wstrict-aliasing=2 -O2" } */
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
+
float foo ()
{
- unsigned int MASK = 0x80000000;
+ uint32_t MASK = 0x80000000;
return (float &) MASK; /* { dg-warning "strict-aliasing" } */
}
diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C
index 5e71ebff805..971e535590c 100644
--- a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C
+++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C
@@ -1,10 +1,12 @@
/* { dg-do compile } */
/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+typedef int int32_t __attribute__((mode (__SI__)));
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
-int foo () {
- int i;
- unsigned int* pu = reinterpret_cast<unsigned int*> (&i); /* { dg-bogus "signed vs. unsigned" } */
+int32_t foo () {
+ int32_t i;
+ uint32_t* pu = reinterpret_cast<uint32_t*> (&i); /* { dg-bogus "signed vs. unsigned" } */
*pu = 1000000;
return i;
}
diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-tmpl.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-tmpl.C
new file mode 100644
index 00000000000..d0375042e42
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-tmpl.C
@@ -0,0 +1,12 @@
+// PR c++/94951
+// { dg-do compile }
+// { dg-options "-O2 -Wall" }
+
+struct A { int a; };
+template <int N>
+struct B : public A
+{
+ static B<N> foo () { B<N> t; t.a = 4; return t; } // { dg-bogus "dereferencing type-punned pointer will break strict-aliasing rules" }
+};
+
+B<0> b = B<0>::foo ();
diff --git a/gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C b/gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C
index 99e1e89b4b7..813cefc2f70 100644
--- a/gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C
+++ b/gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C
@@ -22,10 +22,14 @@ void a (unsigned char x)
void b (unsigned short x)
{
- if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */
- if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" } */
- if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" } */
- if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" } */
+ if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { ! short_eq_int } } } */
+ /* { dg-warning "comparison of unsigned expression in '< 0' is always false" "" { target short_eq_int } .-1 } */
+ if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { ! short_eq_int } } } */
+ /* { dg-warning "comparison of unsigned expression in '>= 0' is always true" "" { target short_eq_int } .-1 } */
+ if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { ! short_eq_int } } } */
+ /* { dg-warning "comparison of unsigned expression in '< 0' is always false" "" { target short_eq_int } .-1 } */
+ if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { ! short_eq_int } } } */
+ /* { dg-warning "comparison of unsigned expression in '>= 0' is always true" "" { target short_eq_int } .-1 } */
}
void c (unsigned int x)
diff --git a/gcc/testsuite/g++.dg/warn/Wtype-limits.C b/gcc/testsuite/g++.dg/warn/Wtype-limits.C
index 6a968d953db..104f53c7b56 100644
--- a/gcc/testsuite/g++.dg/warn/Wtype-limits.C
+++ b/gcc/testsuite/g++.dg/warn/Wtype-limits.C
@@ -22,10 +22,14 @@ void a (unsigned char x)
void b (unsigned short x)
{
- if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */
- if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" } */
- if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" } */
- if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" } */
+ if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { ! short_eq_int } } } */
+ /* { dg-warning "comparison of unsigned expression in '< 0' is always false" "" { target short_eq_int } .-1 } */
+ if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { ! short_eq_int } } } */
+ /* { dg-warning "comparison of unsigned expression in '>= 0' is always true" "" { target short_eq_int } .-1 } */
+ if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { ! short_eq_int } } } */
+ /* { dg-warning "comparison of unsigned expression in '< 0' is always false" "" { target short_eq_int } .-1 } */
+ if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { ! short_eq_int } } } */
+ /* { dg-warning "comparison of unsigned expression in '>= 0' is always true" "" { target short_eq_int } .-1 } */
}
void c (unsigned int x)
diff --git a/gcc/testsuite/g++.dg/warn/Wtype-limits4.C b/gcc/testsuite/g++.dg/warn/Wtype-limits4.C
new file mode 100644
index 00000000000..3ae44b4f25a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wtype-limits4.C
@@ -0,0 +1,23 @@
+// PR c++/94938
+// { dg-additional-options "-Wtype-limits" }
+
+template<unsigned N> struct B { unsigned arr[N]; };
+template<> struct B<1u> { int arr[10]; };
+
+template <unsigned N> bool
+foo(B<N> l)
+{
+ int i = 0;
+ return l.arr[i] < 0;
+}
+
+void
+j()
+{
+ B<1u> b;
+ foo (b);
+ B<2u> b2;
+ // I think that in this instantiation we could warn, but it breaks
+ // gcc bootstrap (marek 5/2020).
+ foo (b2);
+}
diff --git a/gcc/testsuite/g++.dg/warn/deprecated-6.C b/gcc/testsuite/g++.dg/warn/deprecated-6.C
index b3c390be385..605b507f534 100644
--- a/gcc/testsuite/g++.dg/warn/deprecated-6.C
+++ b/gcc/testsuite/g++.dg/warn/deprecated-6.C
@@ -89,7 +89,7 @@ struct SS2 *p2; /* { dg-warning "'SS2' is deprecated: Please avoid SS2" } */
class T {
public:
void member1(int) __attribute__ ((deprecated("Please avoid member1")));
- void member2(INT1) __attribute__ ((__deprecated__("Please avoid member2"))); /* { dg-warning "'INT1' is deprecated" } */
+ void member2(INT1) __attribute__ ((__deprecated__("Please avoid member2")));
int member3(T *);
int x;
} __attribute__ ((deprecated("Please avoid T")));
diff --git a/gcc/testsuite/g++.dg/warn/deprecated.C b/gcc/testsuite/g++.dg/warn/deprecated.C
index c5ccbf3271f..3817e620250 100644
--- a/gcc/testsuite/g++.dg/warn/deprecated.C
+++ b/gcc/testsuite/g++.dg/warn/deprecated.C
@@ -93,7 +93,7 @@ struct SS2 *p2; /* { dg-warning "'SS2' is deprecated" } */
class T {
public:
void member1(int) __attribute__ ((deprecated));
- void member2(INT1) __attribute__ ((__deprecated__)); /* { dg-warning "'INT1' is deprecated" } */
+ void member2(INT1) __attribute__ ((__deprecated__));
int member3(T *);
int x;
} __attribute__ ((deprecated));
diff --git a/gcc/testsuite/g++.dg/warn/forward-inner.C b/gcc/testsuite/g++.dg/warn/forward-inner.C
index 5336d4ed946..d7b93f8ad08 100644
--- a/gcc/testsuite/g++.dg/warn/forward-inner.C
+++ b/gcc/testsuite/g++.dg/warn/forward-inner.C
@@ -70,7 +70,7 @@ template class TC6<int>::TC7; // Valid explicit instantiation, no warning
// Verify that friend declarations, also easy to confuse with forward
-// declrations, are similarly not warned about.
+// declarations, are similarly not warned about.
class C8 {
public:
class C9 { };
@@ -79,3 +79,10 @@ class C10 {
public:
friend class C8::C9; // Valid friend declaration, no warning
};
+
+#if __cplusplus >= 201103L
+// Verify that alias-declarations using an elaborated-type-specifier and
+// nested-name-specifier are not warned about (PR c++/66159).
+struct C11;
+using A1 = struct ::C11; // Valid alias-decl, no warning
+#endif
diff --git a/gcc/testsuite/g++.dg/warn/pr94038-2.C b/gcc/testsuite/g++.dg/warn/pr94038-2.C
new file mode 100644
index 00000000000..a468cc055eb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pr94038-2.C
@@ -0,0 +1,28 @@
+// PR c++/94038
+// { dg-do compile { target c++11 } }
+// { dg-additional-options "-O -Wall" }
+
+static constexpr int x = 0;
+
+template<typename T>
+constexpr const int&
+foo()
+{
+ static_assert(T(1) == 0, "");
+ return x;
+}
+
+template<typename T>
+constexpr const int&
+bar()
+{
+ return foo<T>();
+}
+
+constexpr int
+baz(int a)
+{
+ return a;
+}
+
+static_assert(decltype(baz(bar<int>())){} == 0, "");
diff --git a/gcc/testsuite/g++.dg/warn/pr94038-3.C b/gcc/testsuite/g++.dg/warn/pr94038-3.C
new file mode 100644
index 00000000000..49b6d133f08
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pr94038-3.C
@@ -0,0 +1,15 @@
+// PR c++/94038
+// { dg-do compile { target c++20 } }
+// { dg-additional-options "-Wall" }
+
+template<typename T>
+constexpr int foo() {
+ return T::x;
+}
+
+constexpr bool bar(bool a) { return a; }
+
+template<typename T>
+concept C = foo<T>() == 0;
+
+static_assert(decltype(bar(C<int>)){} == false);
diff --git a/gcc/testsuite/g++.dg/warn/template-2.C b/gcc/testsuite/g++.dg/warn/template-2.C
new file mode 100644
index 00000000000..1d29528b2ac
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/template-2.C
@@ -0,0 +1,22 @@
+// PR c++/94938 - ICE in value_dependent_expression_p in C++98 mode.
+// { dg-do compile }
+
+template <typename> struct S { S(); S(bool); };
+
+struct C {
+ bool operator()(S<float>);
+};
+
+S<float> fn (bool);
+
+template<typename T> void
+foo (T)
+{
+ S<float> s;
+ S<float> x = fn(false || C()(s));
+}
+
+int main ()
+{
+ foo(int());
+}
diff --git a/gcc/testsuite/g++.dg/wrappers/wrapper-around-type-pack-expansion.C b/gcc/testsuite/g++.dg/wrappers/wrapper-around-type-pack-expansion.C
index 5072d1ad59d..1f9ad5fdb47 100644
--- a/gcc/testsuite/g++.dg/wrappers/wrapper-around-type-pack-expansion.C
+++ b/gcc/testsuite/g++.dg/wrappers/wrapper-around-type-pack-expansion.C
@@ -35,7 +35,7 @@ struct __alloc_traits : allocator_traits<_Alloc> {
template<typename _Tp> struct rebind { typedef typename _Base_type::template rebind_alloc<_Tp> other; };
};
-template<typename _Tp> class allocator {
+template<typename _Tp> struct allocator {
typedef _Tp value_type;
template<typename _Tp1> struct rebind { typedef allocator<_Tp1> other; };
};
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash11.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash11.C
index 96ebb71645c..d2b37a5122d 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/crash11.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash11.C
@@ -9,13 +9,13 @@ class A {
int h;
A() { i=10; j=20; }
virtual void f1() { printf("i=%d j=%d\n",i,j); }
- friend virtual void f2() { printf("i=%d j=%d\n",i,j); } // { dg-error "9:virtual functions cannot be friends" }
+ friend virtual void f2() { printf("i=%d j=%d\n",i,j); } // { dg-error "16:virtual functions cannot be friends" }
};
class B : public A {
public:
virtual void f1() { printf("i=%d j=%d\n",i,j); }// { dg-error "" } member.*// ERROR - member.*
- friend virtual void f2() { printf("i=%d j=%d\n",i,j); } // { dg-error "9:virtual functions cannot be friends" }
+ friend virtual void f2() { printf("i=%d j=%d\n",i,j); } // { dg-error "16:virtual functions cannot be friends" }
// { dg-error "private" "" { target *-*-* } .-1 }
};
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/enum11.C b/gcc/testsuite/g++.old-deja/g++.brendan/enum11.C
index fda718b4f7e..2979c77718f 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/enum11.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/enum11.C
@@ -1,5 +1,6 @@
// { dg-do assemble }
// GROUPS passed enums
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
class X
{
enum
@@ -8,7 +9,7 @@ class X
twoMask = 0x000F0000,
thiMask = 0xFFF00000, // { dg-error "comma at end" "" { target { ! c++11 } } }
};
- unsigned int foo;
+ uint32_t foo;
public:
X (int) : foo (oneMask | twoMask ) {} // No warning
diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900227_01.C b/gcc/testsuite/g++.old-deja/g++.bugs/900227_01.C
index c42557a5c16..453eb540ca2 100644
--- a/gcc/testsuite/g++.old-deja/g++.bugs/900227_01.C
+++ b/gcc/testsuite/g++.old-deja/g++.bugs/900227_01.C
@@ -33,7 +33,7 @@
int main ();
-short s = (short) &main; // { dg-error "11:cast \[^\n\r]* loses precision" "lose" { xfail h8*-*-* xstormy16-*-* } }
+short s = (short) &main; // { dg-error "11:cast \[^\n\r]* loses precision" "lose" { target { ! ptr_eq_short } } }
char c = (char) &main; // { dg-error "10:cast \[^\n\r]* loses precision" "lose" }
int main () { return 0; }
diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C b/gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C
index 04ff6690549..86117939637 100644
--- a/gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C
+++ b/gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C
@@ -7,12 +7,14 @@
// elaborated-type-specifier with class key, or an enum-specifier. The
// declaration below contains neither.
-// g++ fails to flag errors for such usage.
+// Since C++11 this is allowed as an empty-declaration.
+
+// g++ fails to flag errors for such usage in C++98.
// keywords: semicolon, vacuous, file scope, declaration
int i;
-; // { dg-error "extra ';'" }
+; // { dg-error "extra ';'" "" { target c++98_only } 0 }
int main () { return 0; }
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/operator.C b/gcc/testsuite/g++.old-deja/g++.jason/operator.C
index 69a41cf2448..79c1932a353 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/operator.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/operator.C
@@ -6,7 +6,7 @@ typedef __SIZE_TYPE__ size_t;
struct A {
int operator?:(int a, int b); // { dg-error "prohibits overloading" }
- static int operator()(int a); // { dg-error "14:.static int A::operator\\(\\)\\(int\\). must be a nonstatic member function" }
+ static int operator()(int a); // { dg-error "14:.static int A::operator\\(\\)\\(int\\). must be a non-static member function" }
static int operator+(A,A); // { dg-error "14:.static int A::operator\\+\\(A, A\\). must be either a non-static member function or a non-member function" }
int operator+(int a, int b = 1); // { dg-error "7:.int A::operator\\+\\(int, int\\). must have either zero or one argument" }
int operator++(char); // { dg-error "7:postfix .int A::operator\\+\\+\\(char\\). must have .int. as its argument" }
@@ -29,4 +29,4 @@ void * operator new (A a); // { dg-error ".operator new. takes type .size_t." }
void operator delete (A a); // { dg-error ".operator delete. takes type .void\\*. as first parameter" }
char * operator char * (int); // { dg-error "return type" "ret" }
-// { dg-error "8:.operator char\\*\\*\\(int\\). must be a nonstatic member function" "mem" { target *-*-* } .-1 }
+// { dg-error "8:.operator char\\*\\*\\(int\\). must be a non-static member function" "mem" { target *-*-* } .-1 }
diff --git a/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C b/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C
index ee69e1156cc..eaf8c01b679 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C
@@ -15,9 +15,9 @@
#endif
inline int max(int a, int b) {return a > b ? a : b;}; // { dg-message "note" }
- // { dg-error "extra ';'" "extra ;" { target *-*-* } .-1 }
+ // { dg-error "extra ';'" "extra ;" { target c++98_only } .-1 }
inline double max(double a, double b) {return a > b ? a : b;}; // { dg-message "note" } candidate
- // { dg-error "extra ';'" "extra ;" { target *-*-* } .-1 }
+ // { dg-error "extra ';'" "extra ;" { target c++98_only } .-1 }
int main() {
static void foo(int i, int j, double x, double y) ;// { dg-error "" } .*
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns15.C b/gcc/testsuite/g++.old-deja/g++.mike/ns15.C
index 7768f698e37..b4cf044a80b 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/ns15.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns15.C
@@ -1,5 +1,6 @@
// { dg-do assemble }
// { dg-xfail-if "" { xstormy16-*-* } }
+// { dg-require-effective-target size20plus }
#include <stdio.h>
#include <stdlib.h>
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash31.C b/gcc/testsuite/g++.old-deja/g++.other/crash31.C
index b6d19527a5a..610dfe11270 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/crash31.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash31.C
@@ -6,4 +6,5 @@ namespace bar
struct foo
{
foo();
-}; // { dg-error "expected" }
+};
+// { dg-error "-:expected" "" { target *-*-* } .+1 }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/exprstmt1.C b/gcc/testsuite/g++.old-deja/g++.other/exprstmt1.C
index abe072999d1..5970cb21b62 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/exprstmt1.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/exprstmt1.C
@@ -3,23 +3,22 @@
// { dg-error "limited range of data type" "16-bit target" { target xstormy16-*-* } 0 }
// { dg-error "shift count >=" "16-bit target" { target xstormy16-*-* } 0 }
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
+
int main()
{
- unsigned int x = 1381237248;
-
- if (sizeof (x) != 4)
- return 0;
+ uint32_t x = 1381237248;
x =
({
- unsigned int y = x;
+ uint32_t y = x;
({
- unsigned int z = y;
- (unsigned int)
- ((((unsigned int)z & (unsigned int)0x000000ffUL) << 24)
- | (((unsigned int)z & (unsigned int)0x0000ff00UL) << 8)
- | (((unsigned int)z & (unsigned int)0x00ff0000UL) >> 8)
- | (((unsigned int)z & (unsigned int)0xff000000UL) >> 24));
+ uint32_t z = y;
+ (uint32_t)
+ ((((uint32_t)z & (uint32_t)0x000000ffUL) << 24)
+ | (((uint32_t)z & (uint32_t)0x0000ff00UL) << 8)
+ | (((uint32_t)z & (uint32_t)0x00ff0000UL) >> 8)
+ | (((uint32_t)z & (uint32_t)0xff000000UL) >> 24));
});
});
return x != 152658;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline12.C b/gcc/testsuite/g++.old-deja/g++.other/inline12.C
index c91845c411e..5702141babe 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/inline12.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline12.C
@@ -4,7 +4,7 @@
// Origin: Hans-Peter Nilsson <hp@axis.com>
// See <URL:http://gcc.gnu.org/ml/gcc-patches/2000-06/msg00310.html>
-typedef unsigned int udword;
+typedef unsigned udword __attribute__((mode (__SI__)));
extern "C" {
void __assert (const char *, int, const char *);
}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline15.C b/gcc/testsuite/g++.old-deja/g++.other/inline15.C
index 43f7f5e3025..a31c60960a5 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/inline15.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline15.C
@@ -1,4 +1,4 @@
-// { dg-do assemble }
+// { dg-do assemble { target c++17_down } }
// { dg-options "-O1" }
// Origin: Jakub Jelinek <jakub@redhat.com>
diff --git a/gcc/testsuite/g++.old-deja/g++.other/new6.C b/gcc/testsuite/g++.old-deja/g++.other/new6.C
index 7013337b21b..a3a98a722e2 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/new6.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/new6.C
@@ -5,8 +5,10 @@
using namespace std;
extern "C" void *malloc (size_t);
-int special;
-int space = 0xdeadbeef;
+typedef int int32_t __attribute__((mode (__SI__)));
+
+int32_t special;
+int32_t space = 0xdeadbeef;
void *operator new (size_t size)
#if __cplusplus <= 199711L
@@ -21,7 +23,7 @@ void *operator new (size_t size)
int main ()
{
special = 1;
- int *p = new int();
+ int32_t *p = new int32_t();
special = 0;
return *p != 0;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash10.C b/gcc/testsuite/g++.old-deja/g++.pt/crash10.C
index a84b19004ee..012e3d0c11b 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/crash10.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/crash10.C
@@ -6,6 +6,7 @@ public:
enum { val = (N == 0) ? M : GCD<N, M % N>::val };
// { dg-error "constant expression" "valid" { target *-*-* } .-1 }
// { dg-message "template argument" "valid" { target *-*-* } .-2 }
+// { dg-warning "division by" "" { target *-*-* } .-3 }
};
int main() {
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash16.C b/gcc/testsuite/g++.old-deja/g++.pt/crash16.C
index 30bd0cc2dd5..1ac630bc01f 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/crash16.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/crash16.C
@@ -1,6 +1,7 @@
// { dg-do assemble }
// { dg-xfail-if "" { xstormy16-*-* } }
// { dg-options "" }
+// { dg-skip-if "16-bit int overflow" int16 }
extern "C" void qsort(void *base, __SIZE_TYPE__ nmemb, __SIZE_TYPE__ size,
int (*compar)(const void *, const void *));
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ctor2.C b/gcc/testsuite/g++.old-deja/g++.pt/ctor2.C
index a8be91ddbb9..bf418ba48c7 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/ctor2.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ctor2.C
@@ -4,7 +4,7 @@
template <class T>
struct A {
- A<T>();
+ A<T>(); // { dg-error "expected" "" { target c++20 } }
};
template <class T>
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/overload2.C b/gcc/testsuite/g++.old-deja/g++.pt/overload2.C
index b438543d445..bbc9e51aff6 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/overload2.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/overload2.C
@@ -12,5 +12,5 @@ int
main()
{
C<char*> c;
- char* p = Z(c.O); //{ dg-error "13:'Z' was not declared" } ambiguous c.O
+ char* p = Z(c.O); //{ dg-error "29:'Z' was not declared" } ambiguous c.O
}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec20.C b/gcc/testsuite/g++.old-deja/g++.pt/spec20.C
index 610e6c73371..51bc26906eb 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/spec20.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/spec20.C
@@ -10,7 +10,8 @@ struct S {
template <class U> void f(U);
template <> void f<int>(int); // { dg-error "20:template-id .f<int>. in declaration|explicit specialization" }
- template <class V> struct I {}; // { dg-error "template" }
- template <class V> struct I<V*> {}; // { dg-error "template" }
+ template <class V> struct I {};
+ template <class V> struct I<V*> {};
+
template <> struct I<int>; // { dg-error "" } invalid specialization
};
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C
index 6dc2c55be58..b98e8da6b1e 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C
@@ -48,8 +48,8 @@ ostream& operator<<(ostream& os, Graph<VertexType,EdgeType>& G)
// The compiler does not like this line!!!!!!
typename Graph<VertexType, EdgeType>::Successor::iterator
- startN = G[i].second.begin(), // { dg-error "14:no match" } no index operator
- endN = G[i].second.end(); // { dg-error "14:no match" } no index operator
+ startN = G[i].second.begin(), // { dg-error "21:no match" } no index operator
+ endN = G[i].second.end(); // { dg-error "21:no match" } no index operator
while(startN != endN)
{
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C
index 2fe151cea7d..0df2e10ae79 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C
@@ -1,6 +1,5 @@
// { dg-do assemble }
-// { dg-options "-Wno-deprecated" }
-// { dg-additional-options "-Wno-return-type" }
+// { dg-options "-Wno-deprecated -Wno-return-type" }
/* bug.cc */
/* simple program to demonstrate the bug with named return values in gcc
*/
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb76.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb76.C
index 3125dc15f34..8109a2f0eaa 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb76.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb76.C
@@ -1,5 +1,6 @@
// { dg-do assemble }
// { dg-options "-fno-short-enums" }
+// { dg-skip-if "" int16 }
// the template operator!= interferes. It should be in a namespace.
#include <utility>
diff --git a/gcc/testsuite/g++.old-deja/g++.warn/flow1.C b/gcc/testsuite/g++.old-deja/g++.warn/flow1.C
index 61f6a554970..fa2b3e5cd1a 100644
--- a/gcc/testsuite/g++.old-deja/g++.warn/flow1.C
+++ b/gcc/testsuite/g++.old-deja/g++.warn/flow1.C
@@ -2,13 +2,15 @@
// { dg-options "-Wreturn-type" }
// Test that we don't get a warning about flowing off the end.
+typedef int int32_t __attribute__((mode (__SI__)));
+
struct A {
~A ();
};
-int f()
+int32_t f()
{
A a1[2];
A a2[2];
- return 1234567;
+ return 1234567L;
}
diff --git a/gcc/testsuite/g++.target/aarch64/pr94052.C b/gcc/testsuite/g++.target/aarch64/pr94052.C
index d36c9bdc158..b3bc3e24682 100644
--- a/gcc/testsuite/g++.target/aarch64/pr94052.C
+++ b/gcc/testsuite/g++.target/aarch64/pr94052.C
@@ -26,7 +26,7 @@ public:
d x();
d y();
};
-class z : ad<int> {};
+class z : public ad<int> {};
struct ae {
p af;
};
diff --git a/gcc/testsuite/g++.target/aarch64/pr95114.C b/gcc/testsuite/g++.target/aarch64/pr95114.C
new file mode 100644
index 00000000000..1689159e47c
--- /dev/null
+++ b/gcc/testsuite/g++.target/aarch64/pr95114.C
@@ -0,0 +1,3 @@
+template<typename T> struct foo { virtual void f() = 0; };
+extern foo<__Int8x8_t> &x;
+void f() { x.f(); }
diff --git a/gcc/testsuite/g++.target/aarch64/pr95726.C b/gcc/testsuite/g++.target/aarch64/pr95726.C
new file mode 100644
index 00000000000..ddd69b8b0da
--- /dev/null
+++ b/gcc/testsuite/g++.target/aarch64/pr95726.C
@@ -0,0 +1,46 @@
+#include <arm_neon.h>
+
+typedef float vecf __attribute__((vector_size(16)));
+
+// This assertion must hold: vecf and float32x4_t have distinct identities
+// and mangle differently, so they are not interchangeable.
+template<typename T> struct bar;
+template<> struct bar<vecf> { static const int x = 1; };
+template<> struct bar<float32x4_t> { static const int x = 2; };
+static_assert(bar<vecf>::x + bar<float32x4_t>::x == 3, "boo");
+
+// GCC 10.1 and earlier accepted this. However, the rule should be
+// that GNU vectors and Advanced SIMD vectors are distinct types but
+// that each one implicitly converts to the other. The types are not
+// reference-compatible.
+//
+// The behavior tested below is consistent with Clang.
+vecf x;
+float32x4_t y;
+float32x4_t &z = x; // { dg-error {cannot bind non-const lvalue reference} }
+
+// These assignment must be valid even in the strictest mode: vecf must
+// implicitly convert to float32x4_t and vice versa.
+void foo() { x = y; y = x; }
+
+// Previously GCC accepted this and took the type of "d" from the "then" arm.
+// It therefore mangled the functions as:
+//
+// _Z4sel1bRDv4_f
+// _Z4sel2bR13__Float32x4_t
+//
+// Clang currently also accepts it and takes the type of "d" from the
+// "else" arm. It therefore mangles the functions as follows, which is
+// inconsistent with the old GCC behavior:
+//
+// _Z4sel1b13__Float32x4_t
+// _Z4sel2bDv4_f
+//
+// Given that the types have distinct identities and that each one
+// implicitly converts to the other (see above), the expression ought
+// to be rejected as invalid. This is consistent (by analogy) with the
+// standard C++ handling of conditional expressions involving class types,
+// in cases where the "then" value implicitly converts to the "else" type
+// and the "else" value implicitly converts to the "then" type.
+auto sel1(bool c, decltype(c ? x : y) d) { return d; } // { dg-error {operands to '\?:' have different types} }
+auto sel2(bool c, decltype(c ? y : x) d) { return d; } // { dg-error {operands to '\?:' have different types} }
diff --git a/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/attributes_1.C b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/attributes_1.C
new file mode 100644
index 00000000000..befd494cd13
--- /dev/null
+++ b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/attributes_1.C
@@ -0,0 +1,122 @@
+/* { dg-options "-msve-vector-bits=256 -W -Wall" } */
+
+#include <arm_sve.h>
+
+#define N __ARM_FEATURE_SVE_BITS
+#define FIXED_ATTR __attribute__ ((arm_sve_vector_bits (N)))
+
+template<typename T> struct foo { T var; };
+
+typedef svint8_t var1;
+typedef __SVInt8_t var2;
+
+typedef const var1 const_var1;
+typedef const var2 const_var2;
+
+typedef svint8_t fixed1 FIXED_ATTR;
+typedef svint8_t fixed1_alias FIXED_ATTR;
+typedef __SVInt8_t fixed2 FIXED_ATTR;
+
+typedef const_var1 const_fixed1 FIXED_ATTR;
+typedef const var1 const_fixed1_alias FIXED_ATTR;
+typedef const_var2 const_fixed2 FIXED_ATTR;
+
+extern fixed1 extern1;
+extern fixed1_alias extern1_alias;
+extern fixed2 extern2;
+
+extern foo<fixed1> extern1_foo;
+extern foo<fixed1_alias> extern1_alias_foo;
+extern foo<fixed2> extern2_foo;
+
+extern const_fixed1 const_extern1;
+extern const_fixed1_alias const_extern1_alias;
+extern const_fixed2 const_extern2;
+
+extern foo<const_fixed1> const_extern1_foo;
+extern foo<const_fixed1_alias> const_extern1_alias_foo;
+extern foo<const_fixed2> const_extern2_foo;
+
+fixed1 &ref1a = extern1;
+fixed1_alias &ref1b = extern1;
+fixed2 &ref1c = extern1;
+
+fixed1 &ref2a = extern1_alias;
+fixed1_alias &ref2b = extern1_alias;
+fixed2 &ref2c = extern1_alias;
+
+fixed1 &ref3a = extern2;
+fixed1_alias &ref3b = extern2;
+fixed2 &ref3c = extern2;
+
+fixed1 &ref1a_foo = extern1_foo.var;
+fixed1_alias &ref1b_foo = extern1_foo.var;
+fixed2 &ref1c_foo = extern1_foo.var;
+
+fixed1 &ref2a_foo = extern1_alias_foo.var;
+fixed1_alias &ref2b_foo = extern1_alias_foo.var;
+fixed2 &ref2c_foo = extern1_alias_foo.var;
+
+fixed1 &ref3a_foo = extern2_foo.var;
+fixed1_alias &ref3b_foo = extern2_foo.var;
+fixed2 &ref3c_foo = extern2_foo.var;
+
+fixed1 &ref4a = const_extern1; // { dg-error {discards qualifiers} }
+fixed1_alias &ref4b = const_extern1; // { dg-error {discards qualifiers} }
+fixed2 &ref4c = const_extern1; // { dg-error {discards qualifiers} }
+
+fixed1 &ref4a_foo = const_extern1_foo.var; // { dg-error {discards qualifiers} }
+fixed1_alias &ref4b_foo = const_extern1_foo.var; // { dg-error {discards qualifiers} }
+fixed2 &ref4c_foo = const_extern1_foo.var; // { dg-error {discards qualifiers} }
+
+const fixed1 &ref5a = const_extern2;
+const fixed1_alias &ref5b = const_extern2;
+const fixed2 &ref5c = const_extern2;
+
+const_fixed1 &const_ref1a = extern1;
+const_fixed1_alias &const_ref1b = extern1;
+const_fixed2 &const_ref1c = extern1;
+
+const_fixed1 &const_ref2a = extern1_alias;
+const_fixed1_alias &const_ref2b = extern1_alias;
+const_fixed2 &const_ref2c = extern1_alias;
+
+const_fixed1 &const_ref3a = extern2;
+const_fixed1_alias &const_ref3b = extern2;
+const_fixed2 &const_ref3c = extern2;
+
+const_fixed1 &const_ref1a_foo = extern1_foo.var;
+const_fixed1_alias &const_ref1b_foo = extern1_foo.var;
+const_fixed2 &const_ref1c_foo = extern1_foo.var;
+
+const_fixed1 &const_ref2a_foo = extern1_alias_foo.var;
+const_fixed1_alias &const_ref2b_foo = extern1_alias_foo.var;
+const_fixed2 &const_ref2c_foo = extern1_alias_foo.var;
+
+const_fixed1 &const_ref3a_foo = extern2_foo.var;
+const_fixed1_alias &const_ref3b_foo = extern2_foo.var;
+const_fixed2 &const_ref3c_foo = extern2_foo.var;
+
+const_fixed1 &const_ref4a = const_extern1;
+const_fixed1_alias &const_ref4b = const_extern1;
+const_fixed2 &const_ref4c = const_extern1;
+
+const_fixed1 &const_ref5a = const_extern1_alias;
+const_fixed1_alias &const_ref5b = const_extern1_alias;
+const_fixed2 &const_ref5c = const_extern1_alias;
+
+const_fixed1 &const_ref6a = const_extern2;
+const_fixed1_alias &const_ref6b = const_extern2;
+const_fixed2 &const_ref6c = const_extern2;
+
+const_fixed1 &const_ref4a_foo = const_extern1_foo.var;
+const_fixed1_alias &const_ref4b_foo = const_extern1_foo.var;
+const_fixed2 &const_ref4c_foo = const_extern1_foo.var;
+
+const_fixed1 &const_ref5a_foo = const_extern1_alias_foo.var;
+const_fixed1_alias &const_ref5b_foo = const_extern1_alias_foo.var;
+const_fixed2 &const_ref5c_foo = const_extern1_alias_foo.var;
+
+const_fixed1 &const_ref6a_foo = const_extern2_foo.var;
+const_fixed1_alias &const_ref6b_foo = const_extern2_foo.var;
+const_fixed2 &const_ref6c_foo = const_extern2_foo.var;
diff --git a/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C
new file mode 100644
index 00000000000..e607d58d726
--- /dev/null
+++ b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C
@@ -0,0 +1,15 @@
+/* { dg-options "-msve-vector-bits=256" } */
+
+#include <arm_sve.h>
+
+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32)));
+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32)));
+
+void
+f (svuint8_t sve_u1, svint8_t sve_s1,
+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1)
+{
+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 };
+ gnu_uint8_t arr2[] = { gnu_s1 }; // { dg-error "cannot convert" }
+ gnu_uint8_t arr3[] = { sve_s1 }; // { dg-error "cannot convert" }
+}
diff --git a/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C
new file mode 100644
index 00000000000..ac4e0d12ff8
--- /dev/null
+++ b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C
@@ -0,0 +1,15 @@
+/* { dg-options "-msve-vector-bits=256 -flax-vector-conversions" } */
+
+#include <arm_sve.h>
+
+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32)));
+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32)));
+
+void
+f (svuint8_t sve_u1, svint8_t sve_s1,
+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1)
+{
+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 };
+ gnu_uint8_t arr2[] = { gnu_s1 };
+ gnu_uint8_t arr3[] = { sve_s1 };
+}
diff --git a/gcc/testsuite/g++.target/arm/pr95726.C b/gcc/testsuite/g++.target/arm/pr95726.C
new file mode 100644
index 00000000000..5f7dbf11ddc
--- /dev/null
+++ b/gcc/testsuite/g++.target/arm/pr95726.C
@@ -0,0 +1,49 @@
+// { dg-require-effective-target arm_neon_ok }
+// { dg-add-options arm_neon }
+
+#include <arm_neon.h>
+
+typedef float vecf __attribute__((vector_size(16)));
+
+// This assertion must hold: vecf and float32x4_t have distinct identities
+// and mangle differently, so they are not interchangeable.
+template<typename T> struct bar;
+template<> struct bar<vecf> { static const int x = 1; };
+template<> struct bar<float32x4_t> { static const int x = 2; };
+static_assert(bar<vecf>::x + bar<float32x4_t>::x == 3, "boo");
+
+// GCC 10.1 and earlier accepted this. However, the rule should be
+// that GNU vectors and Advanced SIMD vectors are distinct types but
+// that each one implicitly converts to the other. The types are not
+// reference-compatible.
+//
+// The behavior tested below is consistent with Clang.
+vecf x;
+float32x4_t y;
+float32x4_t &z = x; // { dg-error {cannot bind non-const lvalue reference} }
+
+// These assignment must be valid even in the strictest mode: vecf must
+// implicitly convert to float32x4_t and vice versa.
+void foo() { x = y; y = x; }
+
+// Previously GCC accepted this and took the type of "d" from the "then" arm.
+// It therefore mangled the functions as:
+//
+// _Z4sel1bRDv4_f
+// _Z4sel2bR19__simd128_float32_t
+//
+// Clang currently also accepts it and takes the type of "d" from the
+// "else" arm. It therefore mangles the functions as follows, which is
+// inconsistent with the old GCC behavior:
+//
+// _Z4sel1b19__simd128_float32_t
+// _Z4sel2bDv4_f
+//
+// Given that the types have distinct identities and that each one
+// implicitly converts to the other (see above), the expression ought
+// to be rejected as invalid. This is consistent (by analogy) with the
+// standard C++ handling of conditional expressions involving class types,
+// in cases where the "then" value implicitly converts to the "else" type
+// and the "else" value implicitly converts to the "then" type.
+auto sel1(bool c, decltype(c ? x : y) d) { return d; } // { dg-error {operands to '\?:' have different types} }
+auto sel2(bool c, decltype(c ? y : x) d) { return d; } // { dg-error {operands to '\?:' have different types} }
diff --git a/gcc/testsuite/g++.target/i386/mv16.C b/gcc/testsuite/g++.target/i386/mv16.C
index 422b9cd6842..9b29a1a3e1a 100644
--- a/gcc/testsuite/g++.target/i386/mv16.C
+++ b/gcc/testsuite/g++.target/i386/mv16.C
@@ -80,6 +80,14 @@ int __attribute__ ((target("arch=cooperlake"))) foo () {
return 21;
}
+int __attribute__ ((target("arch=sapphirerapids"))) foo () {
+ return 22;
+}
+
+int __attribute__ ((target("arch=alderlake"))) foo () {
+ return 23;
+}
+
int main ()
{
int val = foo ();
@@ -112,6 +120,10 @@ int main ()
assert (val == 20);
else if (__builtin_cpu_is ("cooperlake"))
assert (val == 21);
+ else if (__builtin_cpu_is ("sapphirerapids"))
+ assert (val == 22);
+ else if (__builtin_cpu_is ("alderlake"))
+ assert (val == 23);
else
assert (val == 0);
diff --git a/gcc/testsuite/g++.target/i386/pr95229.C b/gcc/testsuite/g++.target/i386/pr95229.C
new file mode 100644
index 00000000000..98bdd57794c
--- /dev/null
+++ b/gcc/testsuite/g++.target/i386/pr95229.C
@@ -0,0 +1,24 @@
+// PR target/95229
+// { dg-do compile }
+// { dg-options "-O3 -march=znver1" }
+
+struct a {
+ unsigned long long b;
+ unsigned long long c;
+};
+
+class my_class {
+public:
+ a d;
+} e;
+
+struct f {
+ unsigned g;
+ unsigned h;
+ void i();
+};
+
+void f::i() {
+ e.d.b += g;
+ e.d.c += h;
+}
diff --git a/gcc/testsuite/g++.target/riscv/frflags.C b/gcc/testsuite/g++.target/riscv/frflags.C
new file mode 100644
index 00000000000..6353044dcf7
--- /dev/null
+++ b/gcc/testsuite/g++.target/riscv/frflags.C
@@ -0,0 +1,7 @@
+/* { dg-options "-O2 -march=rv32if -mabi=ilp32f" } */
+/* { dg-do compile } */
+
+int f()
+{
+ return __builtin_riscv_frflags();
+}
diff --git a/gcc/testsuite/g++.target/xtensa/pr95571.C b/gcc/testsuite/g++.target/xtensa/pr95571.C
new file mode 100644
index 00000000000..59fe2852838
--- /dev/null
+++ b/gcc/testsuite/g++.target/xtensa/pr95571.C
@@ -0,0 +1,43 @@
+/* { dg-do run } */
+
+extern "C" void abort(void);
+extern "C" void __xtensa_libgcc_window_spill(void);
+
+static int call;
+static int cnt;
+
+extern "C" void *memcpy(void *dst, const void *src, unsigned int sz)
+{
+ char *a = (char *)dst;
+ const char *b = (const char *)src;
+
+ if (call++ == cnt)
+ __xtensa_libgcc_window_spill();
+
+ while (sz--)
+ *a++ = *b++;
+
+ return dst;
+}
+
+int main()
+{
+ int i;
+
+ for (i = 0; i < 100; ++i)
+ {
+ call = 0;
+ cnt = i;
+
+ try
+ {
+ throw 1;
+ }
+ catch (int v)
+ {
+ if (v != 1)
+ abort ();
+ }
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.target/xtensa/xtensa.exp b/gcc/testsuite/g++.target/xtensa/xtensa.exp
new file mode 100644
index 00000000000..f4191201d11
--- /dev/null
+++ b/gcc/testsuite/g++.target/xtensa/xtensa.exp
@@ -0,0 +1,43 @@
+# Specific regression driver for Xtensa.
+# Copyright (C) 2020 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>. */
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Exit immediately if this isn't an Xtensa target.
+if {![istarget xtensa*-*-*] } then {
+ return
+}
+
+# Load support procs.
+load_lib g++-dg.exp
+
+global DEFAULT_CXXFLAGS
+if ![info exists DEFAULT_CXXFLAGS] then {
+ set DEFAULT_CXXFLAGS " -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C]] \
+ "" $DEFAULT_CXXFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.c-torture/compile/packed-aligned-1.c b/gcc/testsuite/gcc.c-torture/compile/packed-aligned-1.c
new file mode 100644
index 00000000000..9f0923e29ee
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/packed-aligned-1.c
@@ -0,0 +1,11 @@
+struct c {
+ double a;
+} __attribute((packed)) __attribute((aligned));
+
+void f(struct c *, struct c);
+
+void g(struct c *ptr)
+{
+ ptr++;
+ f(ptr, *ptr);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr96426.c b/gcc/testsuite/gcc.c-torture/compile/pr96426.c
new file mode 100644
index 00000000000..bd573fe5366
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr96426.c
@@ -0,0 +1,10 @@
+/* PR middle-end/96426 */
+
+typedef long long V __attribute__((vector_size(16)));
+typedef double W __attribute__((vector_size(16)));
+
+void
+foo (V *v)
+{
+ __builtin_convertvector (*v, W);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/noinit-attribute.c b/gcc/testsuite/gcc.c-torture/execute/noinit-attribute.c
index b99417c404e..20a2a452e79 100644
--- a/gcc/testsuite/gcc.c-torture/execute/noinit-attribute.c
+++ b/gcc/testsuite/gcc.c-torture/execute/noinit-attribute.c
@@ -1,8 +1,12 @@
/* { dg-do run } */
/* { dg-require-effective-target noinit } */
/* { dg-options "-O2" } */
+/* { dg-skip-if "data LMA != VMA" { msp430-*-* } { "-mlarge" } } */
-/* This test checks that noinit data is handled correctly. */
+/* This test checks that noinit data is handled correctly.
+ If data LMA != VMA (e.g. for simulating the copy of data from ROM to RAM),
+ then var_init will always be re-initialized to 2 and this test will loop
+ forever. */
extern void _start (void) __attribute__ ((noreturn));
extern void abort (void) __attribute__ ((noreturn));
diff --git a/gcc/testsuite/gcc.c-torture/execute/packed-aligned.c b/gcc/testsuite/gcc.c-torture/execute/packed-aligned.c
new file mode 100644
index 00000000000..f768af0ab02
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/packed-aligned.c
@@ -0,0 +1,28 @@
+struct c {
+ double a;
+} __attribute((packed)) __attribute((aligned));
+
+extern void abort(void);
+
+double g_expect = 32.25;
+
+void f(unsigned x, struct c y)
+{
+ if (x != 0)
+ abort();
+
+ if (y.a != g_expect)
+ abort();
+}
+
+struct c e = { 64.25 };
+
+int main(void)
+{
+ struct c d = { 32.25 };
+ f(0, d);
+
+ g_expect = 64.25;
+ f(0, e);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr23135.c b/gcc/testsuite/gcc.c-torture/execute/pr23135.c
index e740ff52874..ef9b7efc9c4 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr23135.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr23135.c
@@ -1,7 +1,7 @@
/* Based on execute/simd-1.c, modified by joern.rennecke@st.com to
trigger a reload bug. Verified for gcc mainline from 20050722 13:00 UTC
for sh-elf -m4 -O2. */
-/* { dg-options "-Wno-psabi" } */
+/* { dg-options "-Wno-psabi -fwrapv" } */
/* { dg-add-options stack_size } */
#ifndef STACK_SIZE
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr51447.c b/gcc/testsuite/gcc.c-torture/execute/pr51447.c
index 887ddb7d067..1d00953af3a 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr51447.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr51447.c
@@ -14,6 +14,9 @@ int
main (void)
{
__label__ nonlocal_lab;
+#ifdef __x86_64__
+ void *save = ptr;
+#endif
__attribute__((noinline, noclone)) void
bar (void *func)
{
@@ -25,5 +28,8 @@ main (void)
nonlocal_lab:
if (ptr != &&nonlocal_lab)
abort ();
+#ifdef __x86_64__
+ ptr = save; /* Restore the call-saved register. */
+#endif
return 0;
}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr94591.c b/gcc/testsuite/gcc.c-torture/execute/pr94591.c
new file mode 100644
index 00000000000..42271ad8bce
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr94591.c
@@ -0,0 +1,32 @@
+typedef unsigned __attribute__((__vector_size__(8))) V2SI_u;
+typedef int __attribute__((__vector_size__(8))) V2SI_d;
+
+typedef unsigned long __attribute__((__vector_size__(16))) V2DI_u;
+typedef long __attribute__((__vector_size__(16))) V2DI_d;
+
+void id_V2SI(V2SI_d *v)
+{
+ *v = __builtin_shuffle(*v, (V2SI_d)(V2SI_u) { 0, 1 });
+}
+
+void id_V2DI(V2DI_d *v)
+{
+ *v = __builtin_shuffle(*v, (V2DI_d)(V2DI_u) { 0, 1 });
+}
+
+extern void abort(void);
+
+int main(void)
+{
+ V2SI_d si = { 35, 42 };
+ id_V2SI(&si);
+
+ if (si[0] != 35 || si[1] != 42)
+ abort();
+
+ V2DI_d di = { 63, 38 };
+ id_V2DI(&di);
+
+ if (di[0] != 63 || di[1] != 38)
+ abort();
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr96549.c b/gcc/testsuite/gcc.c-torture/execute/pr96549.c
new file mode 100644
index 00000000000..9d992a82c19
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr96549.c
@@ -0,0 +1,12 @@
+/* PR c/96549 */
+
+long c = -1L;
+long b = 0L;
+
+int
+main ()
+{
+ if (3L > (short) ((c ^= (b = 1L)) * 3L))
+ return 0;
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/gcc.dg/20020919-1.c b/gcc/testsuite/gcc.dg/20020919-1.c
index 1dcf75e8ff6..38add3a45f0 100644
--- a/gcc/testsuite/gcc.dg/20020919-1.c
+++ b/gcc/testsuite/gcc.dg/20020919-1.c
@@ -8,7 +8,7 @@
You must be this tall ---> fit two long longs in asm-declared registers
to enter this amusement. */
-/* { dg-do compile { target alpha*-*-* cris-*-* crisv32-*-* i?86-*-* mmix-*-* powerpc*-*-* rs6000-*-* x86_64-*-* } } */
+/* { dg-do compile { target alpha*-*-* cris-*-* i?86-*-* mmix-*-* powerpc*-*-* rs6000-*-* x86_64-*-* } } */
/* { dg-options "-O2" } */
/* Constructed examples; input/output (same register), output, input, and
diff --git a/gcc/testsuite/gcc.dg/20050121-1.c b/gcc/testsuite/gcc.dg/20050121-1.c
index 3fe299a6dc2..e7bfdafeb5c 100644
--- a/gcc/testsuite/gcc.dg/20050121-1.c
+++ b/gcc/testsuite/gcc.dg/20050121-1.c
@@ -1,6 +1,6 @@
/* I accidentally broke this while developing a patch for PR 13000,
and didn't notice since the testsuite didn't catch it -- ian */
-/* { dg-do-compile } */
+/* { dg-do compile } */
void foo()
{
diff --git a/gcc/testsuite/gcc.dg/Walloca-14.c b/gcc/testsuite/gcc.dg/Walloca-14.c
index 657402f3891..51362b2d6be 100644
--- a/gcc/testsuite/gcc.dg/Walloca-14.c
+++ b/gcc/testsuite/gcc.dg/Walloca-14.c
@@ -2,7 +2,8 @@
/* { dg-do compile } */
/* { dg-require-effective-target alloca } */
/* { dg-skip-if "small address space" { "pdp11-*-*" } } */
-/* { dg-options "-O2 -Walloca-larger-than=126812070" } */
+/* { dg-options "-O2 -Walloca-larger-than=126812070" { target ptr32plus } } */
+/* { dg-options "-O2 -Walloca-larger-than=12070" { target { ! ptr32plus } } } */
void
g (int *p)
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-32.c b/gcc/testsuite/gcc.dg/Warray-bounds-32.c
index 54b09bc9b98..9b5f3331735 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-32.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-32.c
@@ -150,8 +150,8 @@ void wide_ptr_index_range_chain (void)
T (p3[0]); /* { dg-warning "array subscript \\\[3, 6] is outside array bounds of .\[a-z \]+\\\[3]." } */
T (p3[1]); /* { dg-warning "array subscript \\\[4, 7] is outside array bounds of .\[a-z \]+\\\[3]." } */
- T (p3[9999]); /* { dg-warning "array subscript \\\[10002, 10005] is outside array bounds of .\[a-z \]+\\\[3]." } */
-
+ T (p3[9999]); /* { dg-warning "array subscript \\\[10002, 10005] is outside array bounds of .\[a-z \]+\\\[3]." "" { target size20plus} } */
+ /* { dg-warning "array subscript \\\[-6382, -6379] is outside array bounds of .\[a-z \]+\\\[3]." "" { target { ! size20plus } } .-1 } */
/* Large offsets are indistinguishable from negative values. */
T (p3[DIFF_MAX]); /* { dg-warning "array subscript" "bug" { xfail *-*-* } } */
}
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-46.c b/gcc/testsuite/gcc.dg/Warray-bounds-46.c
index 9078c6f5998..4effe5c2051 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-46.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-46.c
@@ -3,7 +3,8 @@
Test to verify that past-the-end accesses by string functions to member
arrays by-reference objects are diagnosed.
{ dg-do compile }
- { dg-options "-O2 -Wall -Wno-unused-local-typedefs -Wno-stringop-overflow -ftrack-macro-expansion=0" } */
+ { dg-options "-O2 -Wall -Wno-unused-local-typedefs -Wno-stringop-overflow -ftrack-macro-expansion=0" }
+ { dg-require-effective-target alloca } */
#define SA(expr) typedef int StaticAssert [2 * !!(expr) - 1]
@@ -66,8 +67,10 @@ void strcpy_global (void)
T (gma.a17, 17); // { dg-warning "'strcpy' offset 157 from the object at 'gma' is out of the bounds of referenced subobject 'a17' with type 'char\\\[17]' at offset 140" }
SA (__builtin_offsetof (struct MA17, ax) == 157);
-
- T (gma.ax, 0); // { dg-warning "'strcpy' offset 157 from the object at 'gma' is out of the bounds of referenced subobject 'ax' with type 'char[]' at offset 157|'strcpy' offset 157 is out of the bounds \\\[0, 157] of object 'gma' with type 'struct MA17'" }
+ // GCC allows static initialization of flexible array members of
+ // non-local objects. Verify that writing into one that may be
+ // initialized in another translation unit isn't diagnosed. */
+ T (gma.ax, 0); // { dg-bogus "\\\[-Warray-bounds" }
}
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-48.c b/gcc/testsuite/gcc.dg/Warray-bounds-48.c
index d6a327e3689..13373d1e99e 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-48.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-48.c
@@ -1,7 +1,8 @@
/* PR middle-end/91647 - missing -Warray-bounds accessing a zero-length array
of a declared object
{ dg-do "compile" }
- { dg-options "-O2 -Wall" } */
+ { dg-options "-O2 -Wall" }
+ { dg-require-effective-target alloca } */
typedef __INT16_TYPE__ int16_t;
typedef __INT32_TYPE__ int32_t;
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-50.c b/gcc/testsuite/gcc.dg/Warray-bounds-50.c
index d6edfac6ad7..05c89b2d87f 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-50.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-50.c
@@ -1,6 +1,7 @@
/* PR middle-end/92349 - ICE in -Warray-bounds on a VLA member
{ dg-do compile }
- { dg-options "-O2 -Wall" } */
+ { dg-options "-O2 -Wall" }
+ { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-52.c b/gcc/testsuite/gcc.dg/Warray-bounds-52.c
index 1a7d76fcc2a..729ad45d6ac 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-52.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-52.c
@@ -95,3 +95,6 @@ void ptr_idx_range (void)
i = SR (3, 4);
T (i, (int[]){ 2, 3, 4 }); // { dg-warning "array subscript \\\[3, 4] is outside array bounds of 'int\\\[3]'" }
}
+
+/* Some of the invalid accesses above also trigger -Wuninitialized.
+ { dg-prune-output "\\\[-Wuninitialized" } */
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-53.c b/gcc/testsuite/gcc.dg/Warray-bounds-53.c
index 0f062225b29..80db314b393 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-53.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-53.c
@@ -95,3 +95,6 @@ void ptr_idx_range (void)
i = SR (3, 4);
T (i, (int[]){ 2, 3, 4 }); // { dg-warning "array subscript \\\[3, 4] is outside array bounds of 'int\\\[3]'" }
}
+
+/* Some of the invalid accesses above also trigger -Wuninitialized.
+ { dg-prune-output "\\\[-Wuninitialized" } */
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-54.c b/gcc/testsuite/gcc.dg/Warray-bounds-54.c
index 644fcd02cb6..5df5710c1d9 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-54.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-54.c
@@ -10,9 +10,9 @@ int f0 (void)
return p[2]; // { dg-warning "-Warray-bounds" }
}
-int f1 (void)
+int f1 (int j)
{
- int i;
+ int i = j;
int *p = &i;
return p[2]; // { dg-warning "-Warray-bounds" }
}
@@ -22,3 +22,5 @@ int f2 (int i)
int *p = &i;
return p[2]; // { dg-warning "-Warray-bounds" }
}
+
+/* { dg-prune-output "-Wuninitialized" } */
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-56.c b/gcc/testsuite/gcc.dg/Warray-bounds-56.c
index 399c9b263b3..04c26a659ad 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-56.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-56.c
@@ -42,8 +42,8 @@ struct Flex f3 = { 3, { 1, 2, 3 } };
NOIPA void test_strcpy_flexarray (void)
{
- T (S (0), fx); // { dg-bogus "\\\[-Warray-bounds" "pr92815" { xfail *-*-*} }
- T (S (9), fx); // { dg-bogus "\\\[-Warray-bounds" "pr92815" { xfail *-*-*} }
+ T (S (0), fx); // { dg-bogus "\\\[-Warray-bounds" "pr92815" }
+ T (S (9), fx); // { dg-bogus "\\\[-Warray-bounds" "pr92815" }
T (S (0), f1);
T (S (1), f1); // { dg-warning "\\\[-Warray-bounds" }
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-61.c b/gcc/testsuite/gcc.dg/Warray-bounds-61.c
new file mode 100644
index 00000000000..5b66cdc0aab
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-61.c
@@ -0,0 +1,190 @@
+/* PR middle-end/94940 - spurious -Warray-bounds for a zero length array
+ member of union
+ { dg-do compile }
+ { dg-options "-O2 -Wall" } */
+
+extern int n;
+
+extern union Ua3_a0 {
+ int a3[3];
+ int a2[2]; // can only alias a3[0 - 2]
+ int a1[1]; // can alias all of the union
+ int a0[0]; // ditto
+} ua3_a0;
+
+void test_ua3_ua0_a0 (int i)
+{
+ ua3_a0.a0[0] = 0; // { dg-bogus "\\\[-Warray-bounds" }
+ ua3_a0.a0[1] = 0; // { dg-bogus "\\\[-Warray-bounds" }
+ ua3_a0.a0[2] = 0; // { dg-bogus "\\\[-Warray-bounds" }
+ ua3_a0.a0[3] = 0; // { dg-warning "\\\[-Warray-bounds" }
+ ua3_a0.a0[4] = 0; // { dg-warning "\\\[-Warray-bounds" }
+ ua3_a0.a0[i] = 0; // { dg-bogus "\\\[-Warray-bounds" }
+
+ if (i < __LINE__)
+ i = 5;
+ ua3_a0.a0[i] = 0; // { dg-warning "\\\[-Warray-bounds" }
+
+ if (i > -1)
+ i = -1;
+ ua3_a0.a0[i] = 0; // { dg-warning "\\\[-Warray-bounds" }
+}
+
+void test_ua3_ua0_a1 (int i)
+{
+ /* Abusing one-element array members the same way as those of
+ length zero is discouraged but so far acceted without warnings.
+ This should change at some point. */
+
+ ua3_a0.a1[0] = 0;
+ ua3_a0.a1[1] = 0;
+ ua3_a0.a1[2] = 0;
+ ua3_a0.a1[3] = 0; // { dg-warning "\\\[-Warray-bounds" }
+ ua3_a0.a1[i] = 0;
+
+ if (i > -1)
+ i = -1;
+ ua3_a0.a1[i] = 0; // { dg-warning "\\\[-Warray-bounds" }
+
+ if (i < 7)
+ i = 7;
+ ua3_a0.a1[i] = 0; // { dg-warning "\\\[-Warray-bounds" }
+}
+
+void test_ua3_ua0_a2 (int i)
+{
+ ua3_a0.a2[0] = 0;
+ ua3_a0.a2[1] = 0;
+ ua3_a0.a2[2] = 0; // { dg-warning "\\\[-Warray-bounds" }
+ ua3_a0.a2[i] = 0;
+
+ if (i < __LINE__)
+ i = __LINE__;
+ ua3_a0.a2[i] = 0; // { dg-warning "\\\[-Warray-bounds" }
+
+ if (i > -1)
+ i = -1;
+ ua3_a0.a2[i] = 0; // { dg-warning "\\\[-Warray-bounds" }
+}
+
+
+extern union Ua2_a3 {
+ int a2[2]; // can only alias a3[0 - 1]
+ int a3[3];
+} ua2_a3;
+
+void test_ua2_ua3 (int i)
+{
+ ua2_a3.a2[0] = 0; // { dg-bogus "\\\[-Warray-bounds" }
+ ua2_a3.a2[1] = 0; // { dg-bogus "\\\[-Warray-bounds" }
+ ua2_a3.a2[2] = 0; // { dg-warning "\\\[-Warray-bounds" }
+ ua2_a3.a2[i] = 0;
+
+ if (i < __LINE__)
+ i = __LINE__;
+ ua2_a3.a2[i] = 0; // { dg-warning "\\\[-Warray-bounds" }
+}
+
+
+extern struct SUa2_a0 {
+ union Ua2_a0 {
+ int a2[2];
+ int a0[0];
+ } u;
+} sua2_a0;
+
+void test_sua2_sua0 (int i)
+{
+ n += sua2_a0.u.a0[0];
+ n += sua2_a0.u.a0[1];
+ n += sua2_a0.u.a0[2]; // { dg-warning "\\\[-Warray-bounds" }
+ n += sua2_a0.u.a0[i];
+
+ if (i < __LINE__)
+ i = __LINE__;
+ n += sua2_a0.u.a0[i]; // { dg-warning "\\\[-Warray-bounds" }
+}
+
+void test_sua2_sua0_ptr (int i)
+{
+ union Ua2_a0 *p = &sua2_a0.u;
+
+ n += p->a0[0];
+ n += p->a0[1];
+ n += p->a0[2]; // { dg-warning "\\\[-Warray-bounds" }
+ n += p->a0[i];
+}
+
+
+extern struct SUSa3_a0 {
+ union USa3_a0 {
+ struct {
+ int a3[3];
+ } s;
+ int a2[2]; // can alias s.a3[0 - 2]
+ int a1[1]; // can alias s.a3[0 - 2]
+ int a0[0]; // can alias s.a3[0]
+ } u;
+} susa3_ua0;
+
+void test_susa3_sua0 (int i, int j)
+{
+ n += susa3_ua0.u.a0[0];
+ n += susa3_ua0.u.a0[1];
+ n += susa3_ua0.u.a0[2];
+ n += susa3_ua0.u.a0[3]; // { dg-warning "\\\[-Warray-bounds" }
+}
+
+void test_susa3_sua0_ptr (int i, int j)
+{
+ union USa3_a0 *p = &susa3_ua0.u;
+ n += p->a0[0];
+ n += p->a0[1];
+ n += p->a0[2];
+ n += p->a0[3]; // { dg-warning "\\\[-Warray-bounds" }
+}
+
+void test_susa3_sua1 (int i)
+{
+ n += susa3_ua0.u.a1[0];
+ n += susa3_ua0.u.a1[1];
+ n += susa3_ua0.u.a1[2];
+ n += susa3_ua0.u.a1[3]; // { dg-warning "\\\[-Warray-bounds" }
+
+ if (i < __LINE__)
+ i = __LINE__;
+ n += susa3_ua0.u.a1[i]; // { dg-warning "\\\[-Warray-bounds" }
+}
+
+void test_susa3_sua2 (void)
+{
+ n += susa3_ua0.u.a2[0];
+ n += susa3_ua0.u.a2[1];
+ n += susa3_ua0.u.a2[2]; // { dg-warning "\\\[-Warray-bounds" }
+ n += susa3_ua0.u.a2[3]; // { dg-warning "\\\[-Warray-bounds" }
+}
+
+
+extern struct {
+ union {
+ struct {
+ int a3[3];
+ } s1;
+ struct {
+ int a0[0];
+ } s2;
+ } u;
+} susa3_usa0;
+
+void test_susi3_susi0 (int i)
+{
+ n += susa3_usa0.u.s2.a0[0];
+ n += susa3_usa0.u.s2.a0[1];
+ n += susa3_usa0.u.s2.a0[2];
+ n += susa3_usa0.u.s2.a0[3]; // { dg-warning "\\\[-Warray-bounds" }
+ n += susa3_usa0.u.s2.a0[i];
+
+ if (i < __LINE__)
+ i = __LINE__;
+ n += susa3_usa0.u.s2.a0[i]; // { dg-warning "\\\[-Warray-bounds" }
+}
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-62.c b/gcc/testsuite/gcc.dg/Warray-bounds-62.c
new file mode 100644
index 00000000000..c2421aac1b2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-62.c
@@ -0,0 +1,130 @@
+/* PR tree-optimization/84079 - missing -Warray-bounds taking the address
+ of past-the-end element of a multidimensional array
+ { dg-do compile }
+ { dg-options "-O2 -Wall -ftrack-macro-expansion=0" } */
+
+void sink (int, ...);
+
+#define T(type, dims, inxs) \
+ do { \
+ type a dims; \
+ sink (__LINE__, &a inxs); \
+ } while (0)
+
+
+void test_char_1_1 (int i0, int i1, int i2)
+{
+#undef DIMS
+#define DIMS [1][1]
+
+ T (char, DIMS, [0]);
+ T (char, DIMS, [1]);
+ T (char, DIMS, [2]); // { dg-warning "subscript 2 is above array bounds of 'char\\\[1]\\\[1]'" }
+
+ T (char, DIMS, [0][0]);
+ T (char, DIMS, [0][1]);
+ T (char, DIMS, [0][2]); // { dg-warning "subscript 2 is above array bounds of 'char\\\[1]'" }
+
+ T (char, DIMS, [1][0]); // { dg-warning "subscript 1 is above array bounds of 'char\\\[1]\\\[1]'" }
+ T (char, DIMS, [1][1]); // { dg-warning "subscript 1 is above array bounds of 'char\\\[1]\\\[1]'" }
+ T (char, DIMS, [1][2]); // { dg-warning "subscript 2 is above array bounds of 'char\\\[1]'" }
+
+ // Exercise ranges.
+ if (i0 < 0) i0 = 0;
+ if (i1 < 1) i1 = 1;
+ if (i2 < 2) i2 = 2;
+
+ T (char, DIMS, [i0]);
+ T (char, DIMS, [i1]);
+ T (char, DIMS, [i2]); // { dg-warning "subscript 2 is above array bounds of 'char\\\[1]\\\[1]" }
+
+ T (char, DIMS, [i0][i0]);
+ T (char, DIMS, [i0][i1]);
+ T (char, DIMS, [i1][i0]); // { dg-warning "subscript 1 is above array bounds of 'char\\\[1]\\\[1]'" }
+ T (char, DIMS, [i1][i1]); // { dg-warning "subscript 1 is above array bounds of 'char\\\[1]\\\[1]'" }
+ T (char, DIMS, [i1][i2]); // { dg-warning "subscript 2 is above array bounds of 'char\\\[1]'" }
+}
+
+
+void test_int_3_5 (int i0, int i1, int i2, int i3, int i4, int i5, int i6)
+{
+#undef DIMS
+#define DIMS [3][5]
+
+ T (int, DIMS, [0]);
+ T (int, DIMS, [3]);
+ T (int, DIMS, [4]); // { dg-warning "subscript 4 is above array bounds of 'int\\\[3]\\\[5]'" }
+
+ T (int, DIMS, [0][0]);
+ T (int, DIMS, [0][5]);
+ T (int, DIMS, [0][6]); // { dg-warning "subscript 6 is above array bounds of 'int\\\[5]'" }
+
+ T (int, DIMS, [1][0]);
+ T (int, DIMS, [1][5]);
+ T (int, DIMS, [1][6]); // { dg-warning "subscript 6 is above array bounds of 'int\\\[5]'" }
+
+ T (int, DIMS, [3][0]); // { dg-warning "subscript 3 is above array bounds of 'int\\\[3]\\\[5]'" }
+ T (int, DIMS, [3][5]); // { dg-warning "subscript 3 is above array bounds of 'int\\\[3]\\\[5]'" }
+ T (int, DIMS, [3][6]); // { dg-warning "subscript 6 is above array bounds of 'int\\\[5]'" }
+
+ // Exercise ranges.
+ if (i0 < 0) i0 = 0;
+ if (i1 < 1) i1 = 1;
+ if (i2 < 2) i2 = 2;
+ if (i3 < 3) i3 = 3;
+ if (i4 < 4) i4 = 4;
+ if (i5 < 5) i5 = 5;
+ if (i6 < 6) i6 = 6;
+
+ T (int, DIMS, [i0]);
+ T (int, DIMS, [i3]);
+ T (int, DIMS, [i4]); // { dg-warning "subscript 4 is above array bounds of 'int\\\[3]\\\[5]" }
+
+ T (int, DIMS, [i0][i0]);
+ T (int, DIMS, [i0][i5]);
+ T (int, DIMS, [i0][i6]); // { dg-warning "subscript 6 is above array bounds of 'int\\\[5]'" }
+
+ T (int, DIMS, [i1][i0]);
+ T (int, DIMS, [i1][i5]);
+ T (int, DIMS, [i1][i6]); // { dg-warning "subscript 6 is above array bounds of 'int\\\[5]'" }
+
+ T (int, DIMS, [i3][i0]); // { dg-warning "subscript 3 is above array bounds of 'int\\\[3]\\\[5]'" }
+ T (int, DIMS, [i3][i5]); // { dg-warning "subscript 3 is above array bounds of 'int\\\[3]\\\[5]'" }
+ T (int, DIMS, [i3][i6]); // { dg-warning "subscript 6 is above array bounds of 'int\\\[5]'" }
+}
+
+
+void test_int_2_3_4_5 (void)
+{
+#undef DIMS
+#define DIMS [2][3][4][5]
+
+ T (int, DIMS, [0]);
+ T (int, DIMS, [2]);
+ T (int, DIMS, [3]); // { dg-warning "subscript 3 is above array bounds of 'int\\\[2]\\\[3]\\\[4]\\\[5]'" }
+
+ T (int, DIMS, [0][0]);
+ T (int, DIMS, [0][3]);
+ T (int, DIMS, [0][4]); // { dg-warning "subscript 4 is above array bounds of 'int\\\[3]\\\[4]\\\[5]'" }
+ T (int, DIMS, [0][9]); // { dg-warning "subscript 9 is above array bounds of 'int\\\[3]\\\[4]\\\[5]'" }
+
+ T (int, DIMS, [0][0][0]);
+ T (int, DIMS, [0][0][4]);
+ T (int, DIMS, [0][0][5]); // { dg-warning "subscript 5 is above array bounds of 'int\\\[4]\\\[5]'" }
+
+ T (int, DIMS, [0][0][0][0]);
+ T (int, DIMS, [0][0][0][5]);
+ T (int, DIMS, [0][0][0][6]); // { dg-warning "subscript 6 is above array bounds of 'int\\\[5]'" }
+
+ T (int, DIMS, [0][0][1][0]);
+ T (int, DIMS, [0][0][1][5]);
+ T (int, DIMS, [0][0][1][6]); // { dg-warning "subscript 6 is above array bounds of 'int\\\[5]'" }
+
+ T (int, DIMS, [0][0][3][0]);
+ T (int, DIMS, [0][0][3][5]);
+ T (int, DIMS, [0][0][3][6]); // { dg-warning "subscript 6 is above array bounds of 'int\\\[5]'" }
+
+ T (int, DIMS, [0][0][1][0]);
+ T (int, DIMS, [0][0][1][5]);
+ T (int, DIMS, [0][0][1][6]); // { dg-warning "subscript 6 is above array bounds of 'int\\\[5]'" }
+}
diff --git a/gcc/testsuite/gcc.dg/Wattributes-6.c b/gcc/testsuite/gcc.dg/Wattributes-6.c
index d3dd22d85b9..4ba59bf2806 100644
--- a/gcc/testsuite/gcc.dg/Wattributes-6.c
+++ b/gcc/testsuite/gcc.dg/Wattributes-6.c
@@ -21,7 +21,7 @@ PackedAligned { int i; };
struct ATTR ((aligned (2)))
AlignedMemberPacked
{
- int ATTR ((packed)) i;
+ int ATTR ((packed)) i; // { dg-warning "attribute ignored" "" { target default_packed } }
};
struct ATTR ((packed))
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c
index 856166c6673..e845b43c073 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c
@@ -41,7 +41,7 @@ void test_integer_conversion_abs (void)
i = abs (uc);
i = abs (si);
- i = abs (usi);
+ i = abs (usi); /* { dg-warning ".abs. argument 1 promotes to .unsigned int. where .int. is expected in a call to built-in function declared without prototype" "" { target short_eq_int } } */
i = abs (i);
i = abs (ui); /* { dg-warning ".abs. argument 1 type is .unsigned int. where .int. is expected in a call to built-in function declared without prototype" } */
@@ -77,9 +77,9 @@ void test_integer_conversion_memset (void *d)
/* Passing a ptrdiff_t where size_t is expected may not be unsafe
but because GCC may emits suboptimal code for such calls warning
for them helps improve efficiency. */
- memset (d, 0, diffi); /* { dg-warning ".memset. argument 3 promotes to .ptrdiff_t. {aka .\(long \)?int.} where .\(long \)?unsigned int. is expected" } */
+ memset (d, 0, diffi); /* { dg-warning ".memset. argument 3 promotes to .ptrdiff_t. {aka .\(long \)?\(int\)?\(__int20\)?.} where .\(long \)?\(__int20 \)?unsigned\( int\)?. is expected" } */
- memset (d, 0, 2.0); /* { dg-warning ".memset. argument 3 type is .double. where '\(long \)?unsigned int' is expected" } */
+ memset (d, 0, 2.0); /* { dg-warning ".memset. argument 3 type is .double. where '\(long \)?\(__int20 \)?unsigned\( int\)?' is expected" } */
/* Verify that the same call as above but to the built-in doesn't
trigger a warning. */
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-ignore.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-ignore.c
new file mode 100644
index 00000000000..732c23f91b1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-ignore.c
@@ -0,0 +1,11 @@
+/* Check -Wbuiltin-declaration-mismatch can be ignored with pragma. */
+/* { dg-do compile }
+ { dg-options "-Wno-implicit-function-declaration -Wno-int-conversion -Wbuiltin-declaration-mismatch" } */
+
+#pragma GCC diagnostic ignored "-Wbuiltin-declaration-mismatch"
+int foo (const char *str)
+{
+ int i;
+ sscanf (str, "%d", &i);
+ return i;
+}
diff --git a/gcc/testsuite/gcc.dg/Wno-frame-address.c b/gcc/testsuite/gcc.dg/Wno-frame-address.c
index 51f20b41742..13c42b255e9 100644
--- a/gcc/testsuite/gcc.dg/Wno-frame-address.c
+++ b/gcc/testsuite/gcc.dg/Wno-frame-address.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-skip-if "Cannot access arbitrary stack frames" { arm*-*-* amdgpu-*-* avr-*-* hppa*-*-* ia64-*-* visium-*-* csky-*-* msp430-*-* } } */
+/* { dg-skip-if "Cannot access arbitrary stack frames" { arm*-*-* amdgpu-*-* avr-*-* hppa*-*-* ia64-*-* visium-*-* csky-*-* msp430-*-* cris-*-* mmix-*-* } } */
/* { dg-options "-Werror" } */
/* { dg-additional-options "-mbackchain" { target { s390*-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/Wrestrict-9.c b/gcc/testsuite/gcc.dg/Wrestrict-9.c
index 5ad87401ed9..878fc811bc6 100644
--- a/gcc/testsuite/gcc.dg/Wrestrict-9.c
+++ b/gcc/testsuite/gcc.dg/Wrestrict-9.c
@@ -1,7 +1,7 @@
/* PR tree-optimization/84095 - false-positive -Wrestrict warnings for
strcpy within array
{ dg-do compile }
- { dg-options "-O2 -Wrestrict -ftrack-macro-expansion=0" } */
+ { dg-options "-O2 -Wrestrict -Wno-stringop-overflow -ftrack-macro-expansion=0" } */
typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.dg/Wreturn-local-addr-2.c b/gcc/testsuite/gcc.dg/Wreturn-local-addr-2.c
index 0e3435c8256..9273690fef3 100644
--- a/gcc/testsuite/gcc.dg/Wreturn-local-addr-2.c
+++ b/gcc/testsuite/gcc.dg/Wreturn-local-addr-2.c
@@ -1,6 +1,7 @@
/* PR c/71924 - missing -Wreturn-local-addr returning alloca result
{ dg-do compile }
- { dg-options "-O2 -Wall" } */
+ { dg-options "-O2 -Wall" }
+ { dg-require-effective-target alloca } */
#define ATTR(...) __attribute__ ((__VA_ARGS__))
diff --git a/gcc/testsuite/gcc.dg/Wreturn-local-addr-3.c b/gcc/testsuite/gcc.dg/Wreturn-local-addr-3.c
index 6dad7af97e6..e922888a4bf 100644
--- a/gcc/testsuite/gcc.dg/Wreturn-local-addr-3.c
+++ b/gcc/testsuite/gcc.dg/Wreturn-local-addr-3.c
@@ -1,6 +1,7 @@
/* PR c/71924 - missing -Wreturn-local-addr returning alloca result
{ dg-do compile }
- { dg-options "-O2 -Wall" } */
+ { dg-options "-O2 -Wall" }
+ { dg-require-effective-target alloca } */
#define ATTR(...) __attribute__ ((__VA_ARGS__))
diff --git a/gcc/testsuite/gcc.dg/Wreturn-local-addr-4.c b/gcc/testsuite/gcc.dg/Wreturn-local-addr-4.c
index 0a451efcaf0..4a3b07ba02c 100644
--- a/gcc/testsuite/gcc.dg/Wreturn-local-addr-4.c
+++ b/gcc/testsuite/gcc.dg/Wreturn-local-addr-4.c
@@ -1,6 +1,7 @@
/* PR c/71924 - missing -Wreturn-local-addr returning alloca result
{ dg-do compile }
- { dg-options "-O2 -Wall" } */
+ { dg-options "-O2 -Wall" }
+ { dg-require-effective-target alloca } */
#define ATTR(...) __attribute__ ((__VA_ARGS__))
diff --git a/gcc/testsuite/gcc.dg/Wreturn-local-addr-6.c b/gcc/testsuite/gcc.dg/Wreturn-local-addr-6.c
index 70138b3eff8..844660ff015 100644
--- a/gcc/testsuite/gcc.dg/Wreturn-local-addr-6.c
+++ b/gcc/testsuite/gcc.dg/Wreturn-local-addr-6.c
@@ -1,6 +1,7 @@
/* PR c/71924 - missing -Wreturn-local-addr returning alloca result
{ dg-do compile }
- { dg-options "-O2 -Wall" } */
+ { dg-options "-O2 -Wall" }
+ { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.dg/Wstack-usage.c b/gcc/testsuite/gcc.dg/Wstack-usage.c
index 4738b69478b..11e3a27b66b 100644
--- a/gcc/testsuite/gcc.dg/Wstack-usage.c
+++ b/gcc/testsuite/gcc.dg/Wstack-usage.c
@@ -1,6 +1,7 @@
/* PR 90983/manual documents `-Wno-stack-usage` flag, but it is unrecognized
{ dg-do compile }
- { dg-options "-Wall -Wstack-usage=123 -Wno-stack-usage" } */
+ { dg-options "-Wall -Wstack-usage=123 -Wno-stack-usage" }
+ { dg-require-effective-target alloca } */
void f (void*);
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-12.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-12.c
index 5a05f5cf7cf..1e67b5fd928 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-12.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-12.c
@@ -29,15 +29,15 @@ void test_memcpy_array_cst_range_off (const void *s)
T (d + UR (1, 2), 6); /* { dg-warning ".memcpy. writing 6 bytes into a region of size 5 overflows the destination" } */
T (d + UR (1, 2), 7); /* { dg-warning "writing 7 bytes into a region of size 5 " } */
- T (d + SR (-3, -2), 1); /* { dg-warning "writing 1 byte into a region of size 0 " "pr85350" { xfail *-*-* } } */
+ T (d + SR (-3, -2), 1); /* { dg-warning "writing 1 byte into a region of size 0 " } */
T (d + SR (-2, -1), 1);
T (d + SR (-2, -1), 2); /* { dg-warning "writing 2 bytes into a region of size 7 " "pr89428" { xfail *-*-* } } */
- T (d + SR (-2, -1), 9); /* { dg-warning "writing 9 bytes into a region of size 7 " "pr85350" { xfail *-*-* } } */
+ T (d + SR (-2, -1), 9); /* { dg-warning "writing 9 bytes into a region of size 7 " } */
d = ga7 + 7;
T (d + SR (-7, -6), 1);
T (d + SR (-7, -1), 1);
- T (d + SR (-2, -1), 3); /* { dg-warning "writing 3 bytes into a region of size 2 " "pr85350" { xfail *-*-* } } */
+ T (d + SR (-2, -1), 3); /* { dg-warning "writing 3 bytes into a region of size 2 " } */
T (d + UR (1, 2), 1); /* { dg-warning "writing 1 byte into a region of size 0 " } */
}
@@ -67,15 +67,15 @@ void test_memset_array_unsigned_off (void)
T (d + UR (1, 2), 6); /* { dg-warning ".memset. writing 6 bytes into a region of size 5 overflows the destination" } */
T (d + UR (1, 2), 7); /* { dg-warning "writing 7 bytes into a region of size 5 " } */
- T (d + SR (-3, -2), 1); /* { dg-warning "writing 1 byte into a region of size 0 " "pr85350" { xfail *-*-* } } */
+ T (d + SR (-3, -2), 1); /* { dg-warning "writing 1 byte into a region of size 0 " } */
T (d + SR (-2, -1), 1);
T (d + SR (-2, -1), 2); /* { dg-warning "writing 2 bytes into a region of size 7 " "pr89428" { xfail *-*-* } } */
- T (d + SR (-2, -1), 9); /* { dg-warning "writing 9 bytes into a region of size 7 " "pr85350" { xfail *-*-* } } */
+ T (d + SR (-2, -1), 9); /* { dg-warning "writing 9 bytes into a region of size 7 " } */
d = ga7 + 7;
T (d + SR (-7, -6), 1);
T (d + SR (-7, -1), 1);
- T (d + SR (-2, -1), 3); /* { dg-warning "writing 3 bytes into a region of size 2 " "pr85350" { xfail *-*-* } } */
+ T (d + SR (-2, -1), 3); /* { dg-warning "writing 3 bytes into a region of size 2 " } */
T (d + UR (1, 2), 1); /* { dg-warning "writing 1 byte into a region of size 0 " } */
}
@@ -110,8 +110,8 @@ void test_memcpy_array_signed_off (const void *s)
T (d + SR (-7, 7), 7);
T (d + SR (-1, 1), 7);
- T (d + SR (-1, 1), 9); /* { dg-warning "writing 9 bytes into a region of size " "pr89428" { xfail *-*-* } } */
- T (d + SR (-1, 2), 9); /* { dg-warning "writing 9 bytes into a region of size " "pr89428" { xfail *-*-* } } */
+ T (d + SR (-1, 1), 9); /* { dg-warning "writing 9 bytes into a region of size " } */
+ T (d + SR (-1, 2), 9); /* { dg-warning "writing 9 bytes into a region of size " } */
T (d + SR (1, 2), 1);
T (d + SR (1, 2), 5);
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-15.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-15.c
index 12f8f9d353b..1907bac2722 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-15.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-15.c
@@ -4,7 +4,8 @@
for either kind of VLAs (member and non-member).
Diagnosing the accesses is the subject of pr82608.
{ dg-do compile }
- { dg-options "-O2 -Wall -Wno-array-bounds" } */
+ { dg-options "-O2 -Wall -Wno-array-bounds" }
+ { dg-require-effective-target alloca } */
void sink (void*);
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-23.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-23.c
index 6d9fcb9d52e..69c71cc4c30 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-23.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-23.c
@@ -4,7 +4,8 @@
warnings are issued for calls to user-defined functions with attribute
access and with non-constant out-of-bounds arguments.
{ dg-do compile }
- { dg-options "-O2 -Wall" } */
+ { dg-options "-O2 -Wall" }
+ { dg-require-effective-target alloca } */
#include "range.h"
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c
index 01807207acc..bc609587575 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c
@@ -1,6 +1,7 @@
/* PR middle-end/91582 - missing heap overflow detection for strcpy
{ dg-do compile }
- { dg-options "-O2 -Wall -Wno-array-bounds -ftrack-macro-expansion=0" } */
+ { dg-options "-O2 -Wall -Wno-array-bounds -ftrack-macro-expansion=0" }
+ { dg-require-effective-target alloca } */
#include "range.h"
@@ -370,14 +371,14 @@ NOIPA void test_strcpy_malloc_flexarray (void)
size_t r_2_3 = UR (2, 3);
T (char, S (0), r_0_1);
- T (char, S (1), r_0_1); // { dg-warning "\\\[-Wstringop-overflow" "pr92814" { xfail *-*-* } }
+ T (char, S (1), r_0_1); // { dg-warning "\\\[-Wstringop-overflow" "pr92814" }
T (char, S (0), r_1_2);
T (char, S (1), r_1_2);
- T (char, S (2), r_1_2); // { dg-warning "\\\[-Wstringop-overflow" "pr92814" { xfail *-*-* } }
+ T (char, S (2), r_1_2); // { dg-warning "\\\[-Wstringop-overflow" "pr92814" }
T (char, S (0), r_2_3);
T (char, S (2), r_2_3);
- T (char, S (3), r_2_3); // { dg-warning "\\\[-Wstringop-overflow" "pr92814" { xfail *-*-* } }
- T (char, S (9), r_2_3); // { dg-warning "\\\[-Wstringop-overflow" "pr92814" { xfail *-*-* } }
+ T (char, S (3), r_2_3); // { dg-warning "\\\[-Wstringop-overflow" "pr92814" }
+ T (char, S (9), r_2_3); // { dg-warning "\\\[-Wstringop-overflow" "pr92814" }
}
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-27.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-27.c
index 8e2cfe30725..37c1ca29713 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-27.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-27.c
@@ -2,7 +2,8 @@
PR middle-end/85484 - missing -Wstringop-overflow for strcpy with
a string of non-const length
{ dg-do compile }
- { dg-options "-O2 -Wall -Wno-array-bounds" } */
+ { dg-options "-O2 -Wall -Wno-array-bounds" }
+ { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-28.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-28.c
index 8844b9f5e71..be7f51ad3a5 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-28.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-28.c
@@ -224,7 +224,7 @@ void ptr_sub_from_end (int n, int i0, int i1, int i2, int i3)
q += n; // N=1 N=2
q[-1] = 0; // p[0] p[1]
q[-2] = 1; // p[-1] p[0]
- q[-3] = 2; // p[-2] p[-1] // { dg-warning "\\\[-Wstringop-overflow" "pr92939: negative offset from end" { xfail *-*-* } }
+ q[-3] = 2; // p[-2] p[-1] // { dg-warning "\\\[-Wstringop-overflow" "pr92939: negative offset from end" }
/* The following isn't diagnosed because the warning doesn't recognize
the index below as necessarily having the same value as the size
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-33.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-33.c
new file mode 100644
index 00000000000..cb8aeb9b5d9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-33.c
@@ -0,0 +1,40 @@
+/* PR middle-end/82456 - missing -Wstringop-overflow on strcpy reading past
+ the end of an array
+ { dg-do compile }
+ { dg-options "-O2 -Wall" } */
+
+void fcst (char *d)
+{
+ char a[2] = "0";
+
+ __builtin_strcpy (d, a + 3); // { dg-warning "\\\[-W(array-bounds|stringop-overflow)" }
+}
+
+void frng (char *d, int i)
+{
+ char a[2] = "0";
+
+ if (i < 3)
+ i = 3;
+
+ __builtin_strcpy (d, a + i); // { dg-warning "\\\[-W(array-bounds|stringop-overflow)" }
+}
+
+void gcst (char *d)
+{
+ char a[2] = "0";
+
+ __builtin_strcpy (d, a + 2); // { dg-warning "\\\[-W(array-bounds|stringop-overflow)" }
+}
+
+void grng (char *d, int i)
+{
+ char a[2] = "0";
+
+ if (i < 2)
+ i = 2;
+
+ __builtin_strcpy (d, a + i); // { dg-warning "\\\[-W(array-bounds|stringop-overflow)" }
+}
+
+/* { dg-prune-output "-Wuninitialized" } */
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-34.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-34.c
new file mode 100644
index 00000000000..fd43f3afb59
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-34.c
@@ -0,0 +1,252 @@
+/* PR middle-end/95353 - spurious -Wstringop-overflow writing to a trailing
+ array plus offset
+ { dg-do compile }
+ { dg-options "-O2 -Wall" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+struct S0 { char n, a[0]; };
+
+
+void s0_nowarn_cstidx (struct S0 *p)
+{
+ char *q = p->a;
+ q[1] = __LINE__;
+ q[9] = __LINE__;
+}
+
+void s0_nowarn_cstoff_cstidx (struct S0 *p)
+{
+ char *q = p->a + 1;
+ q[1] = __LINE__;
+ q[9] = __LINE__;
+}
+
+void s0_nowarn_varoff_cstdix (struct S0 *p, int i)
+{
+ char *q = p->a + i;
+ q[1] = __LINE__; // { dg-bogus "\\\[-Wstringop-overflow" }
+ q[9] = __LINE__; // { dg-bogus "\\\[-Wstringop-overflow" }
+}
+
+void s0_nowarn_cstoff_varidx (struct S0 *p, int i)
+{
+ char *q = p->a + 1;
+ q[i] = __LINE__;
+}
+
+void s0_nowarn_varoff_varidx (struct S0 *p, int i, int j)
+{
+ char *q = p->a + i;
+ q[j] = __LINE__; // { dg-bogus "\\\[-Wstringop-overflow" }
+}
+
+
+/* Accesses past the end of a trailing array with one element is
+ discouraged but still reluctantly not diagnosed. This should
+ change. */
+
+struct S1 { char n, a[1]; };
+
+
+void s1_nowarn_cstidx (struct S1 *p)
+{
+ char *q = p->a;
+ q[1] = __LINE__;
+ q[9] = __LINE__;
+}
+
+void s1_nowarn_cstoff_cstidx (struct S1 *p)
+{
+ char *q = p->a + 1;
+ q[1] = __LINE__;
+ q[9] = __LINE__;
+}
+
+void s1_nowarn_varoff_cstdix (struct S1 *p, int i)
+{
+ char *q = p->a + i;
+ q[1] = __LINE__; // { dg-bogus "\\\[-Wstringop-overflow" }
+ q[9] = __LINE__; // { dg-bogus "\\\[-Wstringop-overflow" }
+}
+
+void s1_nowarn_cstoff_varidx (struct S1 *p, int i)
+{
+ char *q = p->a + 1;
+ q[i] = __LINE__;
+}
+
+void s1_nowarn_varoff_varidx (struct S1 *p, int i, int j)
+{
+ char *q = p->a + i;
+ q[j] = __LINE__;
+}
+
+
+/* Accesses past the end of a trailing array with more than one
+ element should be diagnosed but aren't yet because the MEM_REF
+ makes the out-of-bounds accesses indistinguishable from valid
+ ones to subsequent elements of the array pointed by P. */
+
+struct S2 { char n, a[2]; };
+
+
+void s2_warn_cstidx (struct S2 *p)
+{
+ char *q = p->a;
+
+ /* The following invalid store is represented as
+ MEM[(char *)p_1(D) + 3B] = __LINE__;
+ which is indistinguishable from the valid
+ q = &p[1].n; q[0] = __LINE__;
+ */
+ q[2] = __LINE__; // { dg-warning "\\\[-Wstringop-overflow" "pr?????" { xfail *-*-* } }
+}
+
+void s2_warn_cstoff_cstidx (struct S2 *p)
+{
+ char *q = p->a + 1;
+ q[1] = __LINE__; // { dg-warning "\\\[-Wstringop-overflow" "pr?????" { xfail *-*-* } }
+}
+
+void s2_warn_varoff_cstdix (struct S2 *p, int i)
+{
+ char *q = p->a + i;
+ q[2] = __LINE__; // { dg-warning "\\\[-Wstringop-overflow" "pr?????" { xfail *-*-* } }
+}
+
+void s2_warn_cstoff_varidx (struct S2 *p, int i)
+{
+ char *q = p->a + 1;
+ q[i] = __LINE__; // { dg-warning "\\\[-Wstringop-overflow" "pr?????" { xfail *-*-* } }
+}
+
+void s2_warn_varoff_varidx (struct S2 *p, int i, int j)
+{
+ char *q = p->a + i;
+ q[j] = __LINE__; // { dg-warning "\\\[-Wstringop-overflow" "pr?????" { xfail *-*-* } }
+}
+
+
+/* Verify that none of these triggers a bogus warning (not tested
+ elsewhere but triggered during bootstrap). */
+
+void s2_nowarn_varidx_int (struct S2 *p, int i)
+{
+ extern struct S2 s2;
+ extern struct S2 s2a[];
+
+ s2.a[i - 1] = __LINE__;
+ s2.a[i] = __LINE__;
+ s2.a[i + 1] = __LINE__;
+
+ s2a[i].a[i - 1] = __LINE__;
+ s2a[i].a[i] = __LINE__;
+ s2a[i].a[i + 1] = __LINE__;
+
+ p[i].a[i - 1] = __LINE__;
+ p[i].a[i] = __LINE__;
+ p[i].a[i + 1] = __LINE__;
+
+ char *q = p->a;
+ q[i - 1] = __LINE__;
+ q[i] = __LINE__;
+ q[i + 1] = __LINE__;
+}
+
+/* Same as above but with a size_t index in range [1, SIZE_MAX]. */
+
+void* s2_nowarn_varidx_size (struct S2 *p, size_t i, size_t j)
+{
+ extern struct S2 s2;
+ extern struct S2 s2a[];
+ struct S2 *ps2 = __builtin_malloc (3 * sizeof *ps2);
+
+ s2.a[i - 1] = __LINE__;
+ s2.a[i] = __LINE__;
+ s2.a[i + 1] = __LINE__;
+
+ s2a[i].a[i - 1] = __LINE__;
+ s2a[i].a[i] = __LINE__;
+ s2a[i].a[i + 1] = __LINE__;
+
+ p[i].a[i - 1] = __LINE__;
+ p[i].a[i] = __LINE__;
+ p[i].a[i + 1] = __LINE__;
+
+ ps2->a[i - 1] = __LINE__;
+ ps2->a[i] = __LINE__;
+ ps2->a[i + 1] = __LINE__;
+
+ char *q = p->a;
+ q[i - 1] = __LINE__;
+ q[i] = __LINE__;
+ q[i + 1] = __LINE__;
+
+ if (j == 0)
+ return ps2;
+
+ s2.a[j - 1] = __LINE__;
+ s2.a[j] = __LINE__;
+ s2.a[j + 1] = __LINE__;
+
+ s2a[j].a[j - 1] = __LINE__;
+ s2a[j].a[j] = __LINE__;
+ s2a[j].a[j + 1] = __LINE__;
+
+ p[j].a[j - 1] = __LINE__;
+ p[j].a[j] = __LINE__;
+ p[j].a[j + 1] = __LINE__;
+
+ ps2->a[j - 1] = __LINE__;
+ ps2->a[j] = __LINE__;
+ ps2->a[j + 1] = __LINE__;
+
+ q = p->a;
+ q[j - 1] = __LINE__;
+ q[j] = __LINE__;
+ q[j + 1] = __LINE__;
+
+ return ps2;
+}
+
+/* Verify that accesses to an interior zero-length array are diagnosed. */
+
+struct Si0 { char c, a[0], d; };
+
+void si0_warn_cstidx (struct Si0 *p)
+{
+ // These are indistinguishable from valid accesses to p->d:
+ // MEM[(char *)p_1(D) + 1B] = 0;
+ char *q = p->a;
+ q[1] = __LINE__; // { dg-warning "writing 1 byte into a region of size 0" "pr?????" { xfail *-*-* } }
+ q[9] = __LINE__; // { dg-warning "\\\[-Wstringop-overflow" "pr?????" { xfail *-*-* } }
+}
+
+void si0_warn_cstoff_cstidx (struct Si0 *p)
+{
+ // Like those above, these too are indistinguishable from valid accesses
+ // to p->d.
+ char *q = p->a + 1;
+ q[1] = __LINE__; // { dg-warning "\\\[-Wstringop-overflow" "pr?????" { xfail *-*-* } }
+ q[9] = __LINE__; // { dg-warning "\\\[-Wstringop-overflow" "pr?????" { xfail *-*-* } }
+}
+
+void si0_warn_varoff_cstdix (struct Si0 *p, int i)
+{
+ char *q = p->a + i;
+ q[1] = __LINE__; // { dg-warning "\\\[-Wstringop-overflow" }
+ q[9] = __LINE__; // { dg-warning "\\\[-Wstringop-overflow" }
+}
+
+void si0_warn_cstoff_varidx (struct Si0 *p, int i)
+{
+ char *q = p->a + 1;
+ q[i] = __LINE__; // { dg-warning "\\\[-Wstringop-overflow" "pr?????" { xfail *-*-* } }
+}
+
+void si0_warn_varoff_varidx (struct Si0 *p, int i, int j)
+{
+ char *q = p->a + i;
+ q[j] = __LINE__; // { dg-warning "\\\[-Wstringop-overflow" }
+}
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-35.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-35.c
new file mode 100644
index 00000000000..612137ee469
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-35.c
@@ -0,0 +1,76 @@
+/* Verify that calls to strcpy to write to an element of an array of pointers
+ are not diagnosed (due to mistakenly using the size of the array as that
+ of the destination).
+ { dg-do compile }
+ { dg-options "-O2 -Wall" } */
+
+typedef char A1[1];
+typedef char A2[2];
+typedef char A3[3];
+typedef char A4[4];
+typedef char A5[5];
+typedef char A6[6];
+typedef char A7[7];
+typedef char A8[8];
+typedef char A9[9];
+typedef char A10[10];
+
+A1* pa1[3];
+A2* pa2[3];
+A3* pa3[3];
+A4* pa4[3];
+A5* pa5[3];
+A6* pa6[3];
+A7* pa7[3];
+A8* pa8[3];
+A9* pa9[3];
+A10* pa10[3];
+
+void nowarn_a1_1 (int i)
+{
+ __builtin_strcpy (*pa1[0], "");
+ __builtin_strcpy (*pa1[1], "");
+ __builtin_strcpy (*pa1[i], "");
+}
+
+void nowarn_a2_2 (int i)
+{
+ __builtin_strcpy (*pa2[0], "1");
+ __builtin_strcpy (*pa2[1], "2");
+ __builtin_strcpy (*pa2[i], "3");
+}
+
+void nowarn_a3_3 (int i)
+{
+ __builtin_strcpy (*pa3[0], "12");
+ __builtin_strcpy (*pa3[1], "23");
+ __builtin_strcpy (*pa3[i], "34");
+}
+
+void nowarn_a4_4 (int i)
+{
+ __builtin_strcpy (*pa4[0], "123");
+ __builtin_strcpy (*pa4[1], "234");
+ __builtin_strcpy (*pa4[i], "345");
+}
+
+void nowarn_a5_5 (int i)
+{
+ __builtin_strcpy (*pa5[0], "1234");
+ __builtin_strcpy (*pa5[1], "2345");
+ __builtin_strcpy (*pa5[i], "3456");
+}
+
+void nowarn_a6_6 (int i)
+{
+ __builtin_strcpy (*pa6[0], "12345");
+ __builtin_strcpy (*pa6[1], "23456");
+ __builtin_strcpy (*pa6[1], "34567");
+}
+
+void nowarn_a10_10 (int i)
+{
+ __builtin_strcpy (*pa10[0], "0123456789");
+ __builtin_strcpy (*pa10[1], "1234567890");
+ __builtin_strcpy (*pa10[i], "2345678909");
+}
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-36.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-36.c
new file mode 100644
index 00000000000..3f0874dc5bb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-36.c
@@ -0,0 +1,24 @@
+/* Verify that casts between pointers and integers don't trigger false
+ positives. Test derived from Glibc's _dl_allocate_tls_storage() in
+ dl-tls.c.
+ { dg-do compile }
+ { dg-options "-O2 -Wall -Wno-array-bounds" } */
+
+typedef __SIZE_TYPE__ size_t;
+typedef __UINTPTR_TYPE__ uintptr_t;
+
+size_t a;
+size_t s;
+
+void* _dl_allocate_tls_storage (void)
+{
+ void *p = __builtin_malloc (s + a + sizeof (void *));
+
+ char *q = (char *)(__builtin_constant_p (a) && (((a - 1) & a) == 0)
+ ? ((((uintptr_t)p) + a - 1) & ~(a - 1))
+ : (((((uintptr_t)p) + (a - 1)) / a) * a));
+
+ char *r = q + s - sizeof (int[4]);
+ __builtin_memset (r, '\0', sizeof (int[4]));
+ return r;
+}
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-37.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-37.c
new file mode 100644
index 00000000000..339f904d7a6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-37.c
@@ -0,0 +1,229 @@
+/* Verify that -Wstringop-overflow detects writing past the end of each
+ individual element of a multidimensional array.
+ { dg-do compile }
+ { dg-options "-O2 -Wall -Wno-array-bounds -Wno-stringop-truncation" } */
+
+#define CONCAT(x, y) x ## y
+#define CAT(name, line) CONCAT (name, line)
+#define UNIQ_NAME(name) CAT (name, __LINE__)
+
+typedef __SIZE_TYPE__ size_t;
+
+extern void* malloc (size_t);
+extern char* strncpy (char*, const char*, size_t);
+
+extern char a2_2_8[2][2][8];
+
+void nowarn_a2_2_8 (const char *s)
+{
+ // The following trigger -Wstringop-truncation.
+ strncpy (a2_2_8[0][0], s, 8);
+ strncpy (a2_2_8[0][1], s, 8);
+ strncpy (a2_2_8[1][0], s, 8);
+ strncpy (a2_2_8[1][1], s, 8);
+}
+
+void warn_a2_2_8 (const char *s)
+{
+ strncpy (a2_2_8[0][0], s, 9); // { dg-warning "writing 9 bytes into a region of size 8 " }
+ strncpy (a2_2_8[0][1], s, 9); // { dg-warning "writing 9 bytes into a region of size 8 " }
+ strncpy (a2_2_8[1][0], s, 9); // { dg-warning "writing 9 bytes into a region of size 8 " }
+ strncpy (a2_2_8[1][1], s, 9); // { dg-warning "writing 9 bytes into a region of size 8 " }
+}
+
+
+extern char a2_3_5[2][3][5];
+
+void nowarn_a2_3_5 (const char *s)
+{
+ // The following trigger -Wstringop-truncation.
+ strncpy (a2_3_5[0][0], s, 5);
+ strncpy (a2_3_5[0][1], s, 5);
+ strncpy (a2_3_5[0][2], s, 5);
+ strncpy (a2_3_5[1][0], s, 5);
+ strncpy (a2_3_5[1][1], s, 5);
+ strncpy (a2_3_5[1][2], s, 5);
+}
+
+void warn_a2_3_5 (const char *s)
+{
+ strncpy (a2_3_5[0][0], s, 6); // { dg-warning "writing 6 bytes into a region of size 5 " }
+ strncpy (a2_3_5[0][1], s, 7); // { dg-warning "writing 7 bytes into a region of size 5 " }
+ strncpy (a2_3_5[1][0], s, 8); // { dg-warning "writing 8 bytes into a region of size 5 " }
+ strncpy (a2_3_5[1][1], s, 9); // { dg-warning "writing 9 bytes into a region of size 5 " }
+}
+
+
+void* nowarn_malloc_3_5 (const char *s, unsigned n)
+{
+ if (n < 3 || 5 < n)
+ n = 3;
+ char *p = (char*)malloc (n);
+ strncpy (p + 1, s, 4);
+ return p;
+}
+
+void* warn_malloc_3_5 (const char *s, unsigned n)
+{
+ if (n < 3 || 5 < n)
+ n = 3;
+ char *p = (char*)malloc (n); // { dg-message "at offset 1 into destination object of size \\\[3, 5] allocated by 'malloc'" }
+ // The size below should be a range like the one above.
+ strncpy (p + 1, s, 5); // { dg-warning "writing 5 bytes into a region of size 4 " }
+ return p;
+}
+
+
+typedef __attribute__ ((alloc_size (1, 2))) void* UsrAlloc (int, int);
+
+void* nowarn_use_alloc_3_5 (UsrAlloc *usr_alloc, const char *s, unsigned n)
+{
+ if (n < 3 || 5 < n)
+ n = 3;
+ char *p = (char*)usr_alloc (n, 3);
+ strncpy (p + 1, s, 14);
+ return p;
+}
+
+void* warn_usr_alloc_3_5 (UsrAlloc *usr_alloc, const char *s, unsigned n)
+{
+ if (n < 3 || 5 < n)
+ n = 3;
+ char *p = (char*)usr_alloc (n, 3); // { dg-message "at offset 1 into destination object of size \\\[9, 15] allocated by 'usr_alloc'" }
+ // The size below should be a range like the one above.
+ strncpy (p + 1, s, 15); // { dg-warning "writing 15 bytes into a region of size 14 " }
+ return p;
+}
+
+struct S
+{
+ char a2_3_4[2][3][4];
+ char a3_4_5[3][4][5];
+};
+
+extern struct S sa[];
+
+void nowarn_sa_cstidx_cstsize (const char* const s[])
+{
+ strncpy (sa[0].a2_3_4[0][0], s[0], 4);
+ strncpy (sa[0].a2_3_4[0][1], s[1], 4);
+ strncpy (sa[0].a2_3_4[0][2], s[2], 4);
+
+ strncpy (sa[0].a2_3_4[1][0], s[3], 4);
+ strncpy (sa[0].a2_3_4[1][1], s[4], 4);
+ strncpy (sa[0].a2_3_4[1][2], s[5], 4);
+
+ strncpy (sa[1].a2_3_4[0][0], s[6], 4);
+ strncpy (sa[1].a2_3_4[0][1], s[7], 4);
+ strncpy (sa[1].a2_3_4[0][2], s[8], 4);
+
+ strncpy (sa[1].a2_3_4[1][0], s[9], 4);
+ strncpy (sa[1].a2_3_4[1][1], s[10], 4);
+ strncpy (sa[1].a2_3_4[1][2], s[11], 4);
+}
+
+void warn_sa_cstidx_cstsize (const char* const s[])
+{
+ strncpy (sa[0].a2_3_4[0][0], s[0], 5); // { dg-warning "writing 5 bytes into a region of size 4 " }
+ strncpy (sa[0].a2_3_4[0][1], s[1], 6); // { dg-warning "writing 6 bytes into a region of size 4 " }
+ strncpy (sa[0].a2_3_4[0][2], s[2], 7); // { dg-warning "writing 7 bytes into a region of size 4 " }
+
+ strncpy (sa[0].a2_3_4[1][0], s[3], 5); // { dg-warning "writing 5 bytes into a region of size 4 " }
+ strncpy (sa[0].a2_3_4[1][1], s[4], 6); // { dg-warning "writing 6 bytes into a region of size 4 " }
+ strncpy (sa[0].a2_3_4[1][2], s[5], 7); // { dg-warning "writing 7 bytes into a region of size 4 " }
+
+ strncpy (sa[1].a2_3_4[0][0], s[6], 5); // { dg-warning "writing 5 bytes into a region of size 4 " }
+ strncpy (sa[1].a2_3_4[0][1], s[7], 6); // { dg-warning "writing 6 bytes into a region of size 4 " }
+ strncpy (sa[1].a2_3_4[0][2], s[8], 7); // { dg-warning "writing 7 bytes into a region of size 4 " }
+
+ strncpy (sa[1].a2_3_4[1][0], s[9], 5); // { dg-warning "writing 5 bytes into a region of size 4 " }
+ strncpy (sa[1].a2_3_4[1][1], s[10], 6); // { dg-warning "writing 6 bytes into a region of size 4 " }
+ strncpy (sa[1].a2_3_4[1][2], s[11], 7); // { dg-warning "writing 7 bytes into a region of size 4 " }
+}
+
+void nowarn_sa_cstidx_varsize (const char* const s[], unsigned n)
+{
+ strncpy (sa[0].a2_3_4[0][0], s[0], n);
+ strncpy (sa[0].a2_3_4[0][1], s[1], n);
+ strncpy (sa[0].a2_3_4[0][2], s[2], n);
+
+ strncpy (sa[0].a2_3_4[1][0], s[3], n);
+ strncpy (sa[0].a2_3_4[1][1], s[4], n);
+ strncpy (sa[0].a2_3_4[1][2], s[5], n);
+
+ strncpy (sa[1].a2_3_4[0][0], s[6], n);
+ strncpy (sa[1].a2_3_4[0][1], s[7], n);
+ strncpy (sa[1].a2_3_4[0][2], s[8], n);
+
+ strncpy (sa[1].a2_3_4[1][0], s[9], n);
+ strncpy (sa[1].a2_3_4[1][1], s[10], n);
+ strncpy (sa[1].a2_3_4[1][2], s[11], n);
+}
+
+void nowarn_sa_loop (const char* const s[], unsigned n)
+{
+ for (unsigned i0 = 0; i0 != 5; ++i0)
+ for (unsigned i1 = 0; i1 != 3; ++i1)
+ for (unsigned i2 = 0; i2 != 2; ++i2)
+ strncpy (sa[i0].a2_3_4[i1][i2], s[i2], n);
+}
+
+
+/* Verify that a note after the warning points to the accessed object
+ and mentions the starting offset of the access. Another alternative
+ might be for the offset to be the starting offset of the overflow.
+ As it is, it's not clear to which of the two the offset refers. */
+
+void test_note (const char *s)
+{
+ extern void sink (void*);
+
+ {
+ char a[1][1][2]; // { dg-message "destination object" }
+ strncpy (a[0][0], s, 3); // { dg-warning "writing 3 bytes into a region of size 2 " }
+ sink (a);
+ }
+
+ {
+ char a[1][2][2]; // { dg-message "at offset 2 into " }
+ strncpy (a[0][1], s, 3); // { dg-warning "writing 3 bytes into a region of size 2 " }
+ sink (a);
+ }
+
+ {
+ char a[1][2][2]; // { dg-message "at offset 4 into " }
+ strncpy (a[1][0], s, 3); // { dg-warning "writing 3 bytes into a region of size 2 " }
+ sink (a);
+ }
+
+ {
+ char a[2][1][2]; // { dg-message "at offset 2 into " }
+ strncpy (a[1][0], s, 3); // { dg-warning "writing 3 bytes into a region of size 2 " }
+ sink (a);
+ }
+
+ {
+ char a[2][2][3]; // { dg-message "at offset 9 into " }
+ strncpy (a[1][1], s, 4); // { dg-warning "writing 4 bytes into a region of size 3 " }
+ sink (a);
+ }
+
+ {
+ char a[2][3][3]; // { dg-message "at offset 12 into " }
+ strncpy (a[1][1], s, 5); // { dg-warning "writing 5 bytes into a region of size 3 " }
+ sink (a);
+ }
+
+ {
+ char a[2][3][3]; // { dg-message "at offset 12 into " }
+ strncpy (a[1][1], s, 6); // { dg-warning "writing 6 bytes into a region of size 3 " }
+ sink (a);
+ }
+
+ {
+ char a[2][3][3]; // { dg-message "at offset 15 into " }
+ strncpy (a[1][2], s, 7); // { dg-warning "writing 7 bytes into a region of size 3 " }
+ sink (a);
+ }
+
+}
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-38.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-38.c
new file mode 100644
index 00000000000..12bda2b31a7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-38.c
@@ -0,0 +1,94 @@
+/* Verify that non-constant offsets don't suppress warnings in cases
+ when the size of the access alone makes it invalid, regardless of
+ the offset value.
+ Also verify that writing into unknown objects through pointers
+ (or pointer members) doesn't trigger warnings.
+ { dg-do compile }
+ { dg-options "-O1 -Wall -Wno-array-bounds" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern void* memcpy (void*, const void*, size_t);
+extern void* memset (void*, int, size_t);
+
+
+struct Xp { char *p; } xp;
+struct Xa { char *a[2]; } xa;
+
+void nowarn_copy_read_pointed_obj_plus_cst (void *d)
+{
+ int i = 0;
+ memcpy (d, xp.p + i, 9);
+ memcpy (d, xa.a[i], 9);
+}
+
+void nowarn_copy_read_pointed_obj_plus_var (void *d, int i)
+{
+ memcpy (d, xp.p + i, 9);
+ memcpy (d, xa.a[i], 9);
+}
+
+
+void warn_copy_read_pointer_plus_cst (void *d)
+{
+ int i = 0;
+ memcpy (d, &xp.p + i, 9); // { dg-warning "reading 9 bytes from a region of size . " }
+}
+
+void warn_copy_read_pointer_plus_var (void *d, int i)
+{
+ memcpy (d, &xp.p + i, 9); // { dg-warning "reading 9 bytes from a region of size . " }
+}
+
+
+void nowarn_copy_write_pointed_obj_plus_cst (const void *s)
+{
+ int i = 0;
+ memcpy (xp.p + i, s, 9);
+ memcpy (xa.a[i], s, 9);
+}
+
+void nowarn_copy_write_pointed_obj_plus_var (const void *s, int i)
+{
+ memcpy (xp.p + i, s, 9);
+ memcpy (xa.a[i], s, 9);
+}
+
+
+void warn_copy_write_pointer_plus_cst (const void *s)
+{
+ int i = 0;
+ memcpy (&xp.p + i, s, 9); // { dg-warning "writing 9 bytes into a region of size . " }
+}
+
+void warn_copy_write_pointer_plus_var (const void *s, int i)
+{
+ memcpy (&xp.p + i, s, 9); // { dg-warning "writing 9 bytes into a region of size . " }
+}
+
+
+void nowarn_set_pointed_obj_plus_cst (void)
+{
+ int i = 0;
+ memset (xp.p + i, 0, 9);
+ memset (xa.a[i], 0, 9);
+}
+
+void nowarn_set_pointed_obj_plus_var (int i)
+{
+ memset (xp.p + i, 0, 9);
+ memset (xa.a[i], 0, 9);
+}
+
+
+void warn_set_pointer_plus_cst (void)
+{
+ int i = 0;
+ memset (&xp.p + i, 0, 9); // { dg-warning "writing 9 bytes into a region of size . " }
+}
+
+void warn_set_pointer_plus_var (int i)
+{
+ memset (&xp.p + i, 0, 9); // { dg-warning "writing 9 bytes into a region of size . " }
+ memset (&xa.a[i], 0, 17); // { dg-warning "writing 17 bytes into a region of size \[0-9\]+ " }
+}
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-39.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-39.c
new file mode 100644
index 00000000000..295a38de926
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-39.c
@@ -0,0 +1,119 @@
+/* PR middle-end/95667 - unintended warning for memset writing across multiple
+ members
+ { dg-do compile }
+ { dg-options "-O2 -Wall" }
+ { dg-require-effective-target alloca } */
+
+extern void sink (void*);
+
+struct S1 { char a[3], b[5]; };
+
+void warn_strcpy_s1 (void)
+{
+ struct S1 *p = __builtin_malloc (sizeof *p);
+ char s[] = "1234567";
+ __builtin_strcpy (p->a, s); // { dg-warning "\\\[-Wstringop-overflow" }
+ sink (p);
+}
+
+void nowarn_memset_s1 (void)
+{
+ struct S1 *p = __builtin_malloc (sizeof *p);
+ __builtin_memset (p->a, 0, 8); // { dg-bogus "\\\[-Wstringop-overflow" }
+ sink (p);
+}
+
+struct S2 { char a[2], b[2][2], c[3]; };
+
+void nowarn_memset_s2 (void)
+{
+ struct S2 *p = __builtin_malloc (sizeof *p);
+
+ __builtin_memset (p->a, 0, sizeof *p);
+ sink (p);
+
+ __builtin_memset (p->b, 0, 7);
+ sink (p);
+
+ __builtin_memset (&p->b[0], 0, 7);
+ sink (p);
+
+ __builtin_memset (&p->b[1], 0, 5);
+ sink (p);
+
+ __builtin_memset (&p->b[0][0], 0, 7);
+ sink (p);
+
+ __builtin_memset (&p->b[0][1], 0, 6);
+ sink (p);
+
+ __builtin_memset (&p->b[1][0], 0, 5);
+ sink (p);
+
+ __builtin_memset (&p->b[1][1], 0, 4);
+ sink (p);
+}
+
+void warn_memset_s2 (void)
+{
+ const unsigned n = sizeof (struct S2);
+ struct S2 *p = __builtin_malloc (n);
+
+ /* These should trigger -Wstringop-overflow rather than -Warray-bounds
+ but the main purpose of the test is to verify the absence of warnings
+ above so the exact warning for these overflwing calls isn't important
+ here. */
+
+ __builtin_memset (p->a, 0, n + 1); // { dg-warning "\\\[-Warray-bounds|-Wstringop-overflow" }
+ sink (p);
+
+ __builtin_memset (p->b, 0, 8); // { dg-warning "\\\[-Warray-bounds|-Wstringop-overflow" }
+ sink (p);
+
+ __builtin_memset (&p->b[0], 0, 8); // { dg-warning "\\\[-Warray-bounds|-Wstringop-overflow" }
+ sink (p);
+
+ __builtin_memset (&p->b[0][0], 0, 8); // { dg-warning "\\\[-Warray-bounds|-Wstringop-overflow" }
+ sink (p);
+
+ __builtin_memset (&p->b[1], 0, 6); // { dg-warning "\\\[-Warray-bounds|-Wstringop-overflow" }
+ sink (p);
+
+ __builtin_memset (&p->b[0][1], 0, 7); // { dg-warning "\\\[-Warray-bounds|-Wstringop-overflow" }
+ sink (p);
+}
+
+void nowarn_vl_struct (unsigned n)
+{
+ if (n < 3 || 5 < n)
+ n = 3;
+
+ struct V { char a[3], b[n], c[7]; } v;
+
+ __builtin_memset (v.a, 0, 15);
+ sink (&v);
+
+ __builtin_memset (v.b, 0, 12);
+ sink (&v);
+
+ __builtin_memset (v.c, 0, 7);
+ sink (&v);
+
+ __builtin_memset (v.a, 0, 16); // { dg-warning "\\\[-Warray-bounds|-Wstringop-overflow" }
+ sink (&v);
+
+ __builtin_memset (v.b, 0, 13); // { dg-warning "\\\[-Warray-bounds|-Wstringop-overflow" }
+ sink (&v);
+
+ /* The &V.C argument is represented as a variable offset from
+ the beginning of the allocated object and there's no good
+ way to figure out from its variable offset that it's base
+ is the C member:
+ s.1_12 = __builtin_alloca_with_align (prephitmp_24, 8);
+ _9 = s.1_12 + prephitmp_27;
+ __builtin_memset (_9, 0, 2);
+ */
+
+ __builtin_memset (v.c, 0, 8); // { dg-warning "\\\[-Warray-bounds|-Wstringop-overflow" "pr?????" { xfail *-*-* } }
+ sink (&v);
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-dedupe-issue-2.c b/gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-dedupe-issue-2.c
new file mode 100644
index 00000000000..57fd30add7b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-dedupe-issue-2.c
@@ -0,0 +1,30 @@
+/* { dg-additional-options "-fanalyzer-show-duplicate-count" } */
+
+#include <stdlib.h>
+
+typedef struct _krb5_data {
+ char *data;
+} krb5_data;
+
+/* Ensure that we de-duplicate the various paths to reach here,
+ and only emit one diagnostic. */
+
+void
+recvauth_common(krb5_data common)
+{
+ free(common.data);
+ free(common.data); /* { dg-warning "double-'free' of 'common.data'" "inner warning" } */
+ /* { dg-warning "double-'free' of 'inbuf_a.data' " "inbuf_a warning" { target *-*-* } .-1 } */
+ /* { dg-warning "double-'free' of 'inbuf_b.data' " "inbuf_b warning" { target *-*-* } .-2 } */
+ /* { dg-message "2 duplicates" "duplicates notification" { xfail *-*-* } .-3 } */
+}
+
+void krb5_recvauth(krb5_data inbuf_a)
+{
+ recvauth_common(inbuf_a);
+}
+
+void krb5_recvauth_version(krb5_data inbuf_b)
+{
+ recvauth_common(inbuf_b);
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-dedupe-issue.c b/gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-dedupe-issue.c
index b43148cb4a7..0fc865f599b 100644
--- a/gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-dedupe-issue.c
+++ b/gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-dedupe-issue.c
@@ -14,7 +14,7 @@ recvauth_common(krb5_data inbuf)
{
free(inbuf.data);
free(inbuf.data); /* { dg-warning "double-'free'" "warning" } */
- /* { dg-message "2 duplicates" "duplicates notification" { target *-*-* } .-1 } */
+ /* { dg-message "2 duplicates" "duplicates notification" { xfail *-*-* } .-1 } */
}
void krb5_recvauth(krb5_data inbuf)
diff --git a/gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-minimal.c b/gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-minimal.c
index aa9deb3be19..5edbdb1cc3e 100644
--- a/gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-minimal.c
+++ b/gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-minimal.c
@@ -1,4 +1,5 @@
#include <stdlib.h>
+#include "analyzer-decls.h"
typedef struct _krb5_data {
char *data;
@@ -28,3 +29,63 @@ test_3 (krb5_data inbuf, int flag)
}
free((char *)inbuf.data); /* { dg-warning "double-'free' of 'inbuf.data'" } */
}
+
+extern void unknown_fn (void *);
+
+void
+test_4 (krb5_data inbuf)
+{
+ unknown_fn (NULL);
+ free(inbuf.data); /* { dg-message "first 'free' here" } */
+ free(inbuf.data); /* { dg-warning "double-'free' of 'inbuf.data'" } */
+}
+
+void
+test_5 (krb5_data inbuf)
+{
+ unknown_fn (&inbuf);
+ free(inbuf.data); /* { dg-message "first 'free' here" } */
+ free(inbuf.data); /* { dg-warning "double-'free' of 'inbuf.data'" "inbuf.data" } */
+ /* { dg-bogus "double-'free' of 'inbuf'" "inbuf" { target *-*-* } .-1 } */
+}
+
+typedef struct _padded_krb5_data {
+ int pad;
+ char *data;
+} padded_krb5_data;
+
+void
+test_6 (padded_krb5_data inbuf)
+{
+ unknown_fn (&inbuf.data);
+ free((char *)inbuf.data); /* { dg-message "first 'free' here" } */
+ free((char *)inbuf.data); /* { dg-warning "double-'free' of 'inbuf.data'" "inbuf.data" } */
+}
+
+void
+test_7 (padded_krb5_data inbuf)
+{
+ unknown_fn (&inbuf.data);
+ free((char *)inbuf.data);
+
+ unknown_fn (&inbuf.data);
+ free((char *)inbuf.data);
+}
+
+void
+test_8 (padded_krb5_data inbuf, int flag)
+{
+ if (flag)
+ {
+ unknown_fn (&inbuf.data);
+ free((char *)inbuf.data);
+ }
+ /* Should have two enodes, one for the explicit "freed" state, and one
+ for the implicit "start" state. */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
+
+ unknown_fn (&inbuf.data);
+
+ /* Should have just one enode, for the implicit "start" state. */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/abs-1.c b/gcc/testsuite/gcc.dg/analyzer/abs-1.c
new file mode 100644
index 00000000000..d6ce8d6afad
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/abs-1.c
@@ -0,0 +1,22 @@
+#include "analyzer-decls.h"
+
+extern long int labs (long int x)
+ __attribute__ ((__nothrow__ , __leaf__))
+ __attribute__ ((__const__));
+
+long int test_1 (long int x)
+{
+ return labs (x);
+}
+
+static long __attribute__((noinline))
+hide_long (long x)
+{
+ return x;
+}
+
+long int test_2 (long int x)
+{
+ __analyzer_eval (labs (hide_long (42)) == 42); /* { dg-warning "TRUE" } */
+ __analyzer_eval (labs (hide_long (-17)) == 17); /* { dg-warning "TRUE" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/aliasing-1.c b/gcc/testsuite/gcc.dg/analyzer/aliasing-1.c
new file mode 100644
index 00000000000..26050f1eee3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/aliasing-1.c
@@ -0,0 +1,25 @@
+#include "analyzer-decls.h"
+
+int a;
+void test (int *p, int x)
+{
+ int y;
+
+ a = 17;
+ x = 42;
+ y = 13;
+
+ __analyzer_eval (a == 17); /* { dg-warning "TRUE" } */
+ __analyzer_eval (x == 42); /* { dg-warning "TRUE" } */
+ __analyzer_eval (y == 13); /* { dg-warning "TRUE" } */
+
+ __analyzer_eval (p == &a); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (p == &x); /* { dg-warning "FALSE" } */
+ __analyzer_eval (p == &y); /* { dg-warning "FALSE" } */
+
+ *p = 73;
+
+ __analyzer_eval (a == 17); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (x == 42); /* { dg-warning "TRUE" } */
+ __analyzer_eval (y == 13); /* { dg-warning "TRUE" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/aliasing-2.c b/gcc/testsuite/gcc.dg/analyzer/aliasing-2.c
new file mode 100644
index 00000000000..38ceeffbe37
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/aliasing-2.c
@@ -0,0 +1,32 @@
+#include "analyzer-decls.h"
+
+extern void escape (int *p);
+
+int a;
+void test (int *p, int x)
+{
+ int y;
+
+ a = 17;
+ x = 42;
+ y = 13;
+
+ __analyzer_eval (a == 17); /* { dg-warning "TRUE" } */
+ __analyzer_eval (x == 42); /* { dg-warning "TRUE" } */
+ __analyzer_eval (y == 13); /* { dg-warning "TRUE" } */
+
+ escape (&x);
+ __analyzer_eval (a == 17); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (x == 42); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (y == 13); /* { dg-warning "TRUE" } */
+
+ __analyzer_eval (p == &a); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (p == &x); /* { dg-warning "FALSE" } */
+ __analyzer_eval (p == &y); /* { dg-warning "FALSE" } */
+
+ *p = 73;
+
+ __analyzer_eval (a == 17); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (x == 42); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (y == 13); /* { dg-warning "TRUE" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/alloca-leak.c b/gcc/testsuite/gcc.dg/analyzer/alloca-leak.c
index 6d9fe3431ce..93319932d44 100644
--- a/gcc/testsuite/gcc.dg/analyzer/alloca-leak.c
+++ b/gcc/testsuite/gcc.dg/analyzer/alloca-leak.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target alloca } */
+
#include <alloca.h>
void *test (void)
diff --git a/gcc/testsuite/gcc.dg/analyzer/analyzer-decls.h b/gcc/testsuite/gcc.dg/analyzer/analyzer-decls.h
index 180e873b67c..d96b3f2f29a 100644
--- a/gcc/testsuite/gcc.dg/analyzer/analyzer-decls.h
+++ b/gcc/testsuite/gcc.dg/analyzer/analyzer-decls.h
@@ -7,6 +7,11 @@
/* Trigger a breakpoint in the analyzer when reached. */
extern void __analyzer_break (void);
+/* Emit a warning describing the 2nd argument (which can be of any
+ type), at the given verbosity level. This is for use when
+ debugging, and may be of use in DejaGnu tests. */
+extern void __analyzer_describe (int verbosity, ...);
+
/* Dump copious information about the analyzer’s state when reached. */
extern void __analyzer_dump (void);
@@ -20,8 +25,6 @@ extern void __analyzer_dump (void);
will also dump all of the states within those nodes. */
extern void __analyzer_dump_exploded_nodes (int);
-extern void __analyzer_dump_num_heap_regions (void);
-
/* Emit a placeholder "note" diagnostic with a path to this call site,
if the analyzer finds a feasible path to it. */
extern void __analyzer_dump_path (void);
diff --git a/gcc/testsuite/gcc.dg/analyzer/attribute-nonnull.c b/gcc/testsuite/gcc.dg/analyzer/attribute-nonnull.c
index e0bf1f4aa1c..70bb921e742 100644
--- a/gcc/testsuite/gcc.dg/analyzer/attribute-nonnull.c
+++ b/gcc/testsuite/gcc.dg/analyzer/attribute-nonnull.c
@@ -12,9 +12,10 @@ extern void bar(void *ptrA, void *ptrB, void *ptrC) /* { dg-message "argument 1
void test_1 (void *p, void *q, void *r)
{
foo(p, q, r);
- foo(NULL, q, r);
+ foo(NULL, q, r); /* { dg-warning "use of NULL where non-null expected" "warning" } */
+ /* { dg-message "argument 1 NULL where non-null expected" "note" { target *-*-* } .-1 } */
foo(p, NULL, r);
- foo(p, q, NULL);
+ foo(p, q, NULL); /* { dg-warning "use of NULL where non-null expected" } */
}
void test_1a (void *q, void *r)
@@ -27,9 +28,10 @@ void test_1a (void *q, void *r)
void test_2 (void *p, void *q, void *r)
{
bar(p, q, r);
- bar(NULL, q, r);
- bar(p, NULL, r);
- bar(p, q, NULL);
+ bar(NULL, q, r); /* { dg-warning "use of NULL where non-null expected" "warning" } */
+ bar(p, NULL, r); /* { dg-warning "use of NULL where non-null expected" "warning" } */
+ /* { dg-message "argument 2 NULL where non-null expected" "note" { target *-*-* } .-1 } */
+ bar(p, q, NULL); /* { dg-warning "use of NULL where non-null expected" "warning" } */
}
void test_3 (void *q, void *r)
diff --git a/gcc/testsuite/gcc.dg/analyzer/bzero-1.c b/gcc/testsuite/gcc.dg/analyzer/bzero-1.c
new file mode 100644
index 00000000000..894508611fe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/bzero-1.c
@@ -0,0 +1,11 @@
+#include "analyzer-decls.h"
+
+extern void bzero(void *s, __SIZE_TYPE__ n);
+
+void test_1 (void)
+{
+ char tmp[1024];
+ bzero (tmp, 1024);
+ __analyzer_eval (tmp[0] == 0); /* { dg-warning "TRUE" } */
+ __analyzer_eval (tmp[1023] == 0); /* { dg-warning "TRUE" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/casts-1.c b/gcc/testsuite/gcc.dg/analyzer/casts-1.c
new file mode 100644
index 00000000000..15cd85f77cf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/casts-1.c
@@ -0,0 +1,49 @@
+#include "analyzer-decls.h"
+
+struct s1
+{
+ char a;
+ char b;
+ char c;
+ char d;
+};
+
+struct s2
+{
+ char arr[4];
+};
+
+void test_1 ()
+{
+ struct s1 x = {'A', 'B', 'C', 'D'};
+ __analyzer_eval (x.a == 'A'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (x.b == 'B'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (x.c == 'C'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (x.d == 'D'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (((struct s2 *)&x)->arr[0] == 'A'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (((struct s2 *)&x)->arr[1] == 'B'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (((struct s2 *)&x)->arr[2] == 'C'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (((struct s2 *)&x)->arr[3] == 'D'); /* { dg-warning "TRUE" } */
+
+ ((struct s2 *)&x)->arr[1] = '#';
+ __analyzer_eval (((struct s2 *)&x)->arr[1] == '#'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (x.b == '#'); /* { dg-warning "TRUE" } */
+}
+
+void test_2 ()
+{
+ struct s2 x = {{'A', 'B', 'C', 'D'}};
+ __analyzer_eval (x.arr[0] == 'A'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (x.arr[1] == 'B'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (x.arr[2] == 'C'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (x.arr[3] == 'D'); /* { dg-warning "TRUE" } */
+ struct s1 *p = (struct s1 *)&x;
+ __analyzer_eval (p->a == 'A'); /* { dg-warning "TRUE" "true" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+ __analyzer_eval (p->b == 'B'); /* { dg-warning "TRUE" "true" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+ __analyzer_eval (p->c == 'C'); /* { dg-warning "TRUE" "true" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+ __analyzer_eval (p->d == 'D'); /* { dg-warning "TRUE" "true" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/casts-2.c b/gcc/testsuite/gcc.dg/analyzer/casts-2.c
new file mode 100644
index 00000000000..3eef71726ba
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/casts-2.c
@@ -0,0 +1,15 @@
+#include "analyzer-decls.h"
+
+void test_1 (int i)
+{
+ char c1 = i;
+ char c2 = i;
+ __analyzer_eval (c1 == i); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (c1 == c2); /* { dg-warning "TRUE" } */
+}
+
+void test_2 (char c)
+{
+ int i = c;
+ __analyzer_eval (i == c); /* { dg-warning "TRUE" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/compound-assignment-1.c b/gcc/testsuite/gcc.dg/analyzer/compound-assignment-1.c
index bb03487f23e..0f07818dcdd 100644
--- a/gcc/testsuite/gcc.dg/analyzer/compound-assignment-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/compound-assignment-1.c
@@ -40,13 +40,13 @@ void test_4 (void)
struct ptr_wrapper r;
r.ptr = malloc (sizeof (int)); /* { dg-message "allocated here" } */
} /* { dg-warning "leak of 'r.ptr'" } */
-/* { dg-bogus "leak of '<unknown>'" "unknown leak" { xfail *-*-* } .-1 } */
+/* { dg-bogus "leak of '<unknown>'" "unknown leak" { target *-*-* } .-1 } */
static struct ptr_wrapper __attribute__((noinline))
called_by_test_5a (void)
{
struct ptr_wrapper r;
- r.ptr = malloc (sizeof (int));
+ r.ptr = malloc (sizeof (int)); /* { dg-message "allocated here" } */
return r;
}
@@ -54,15 +54,14 @@ void test_5a (void)
{
struct ptr_wrapper q = called_by_test_5a ();
} /* { dg-warning "leak of 'q.ptr'" } */
-/* TODO: show the allocation point. */
static struct ptr_wrapper __attribute__((noinline))
called_by_test_5b (void)
{
struct ptr_wrapper r;
r.ptr = malloc (sizeof (int));
- return r; /* { dg-warning "leak" } */
- /* TODO: show the allocation point. */
+ return r; /* { dg-warning "leak of '<return-value>.ptr'" } */
+ /* TODO: show the allocation point; improve above message. */
}
void test_5b (void)
diff --git a/gcc/testsuite/gcc.dg/analyzer/compound-assignment-3.c b/gcc/testsuite/gcc.dg/analyzer/compound-assignment-3.c
index 5083faa9ce2..49259262c4a 100644
--- a/gcc/testsuite/gcc.dg/analyzer/compound-assignment-3.c
+++ b/gcc/testsuite/gcc.dg/analyzer/compound-assignment-3.c
@@ -22,4 +22,4 @@ test_2 (void)
{
struct union_wrapper uw2;
uw2.u.ptr = malloc (1024);
-} /* { dg-warning "leak of '\\(void \\*\\)uw2.u'" } */
+} /* { dg-warning "leak of 'uw2.u.ptr'" } */
diff --git a/gcc/testsuite/gcc.dg/analyzer/compound-assignment-4.c b/gcc/testsuite/gcc.dg/analyzer/compound-assignment-4.c
new file mode 100644
index 00000000000..5c0a5f9d47c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/compound-assignment-4.c
@@ -0,0 +1,28 @@
+#include "analyzer-decls.h"
+
+struct coord
+{
+ int x;
+ int y;
+};
+
+void test_1 (void)
+{
+ struct coord arr[16];
+
+ arr[2].y = 4;
+ arr[3].x = 5;
+ arr[3].y = 6;
+ arr[4].x = 7;
+ arr[6].y = 8;
+ arr[8].x = 9;
+
+ arr[7] = arr[3];
+
+ __analyzer_eval (arr[7].x == 5); /* { dg-warning "TRUE" } */
+ __analyzer_eval (arr[7].y == 6); /* { dg-warning "TRUE" } */
+
+ /* Make sure we don't touch the neighbors. */
+ __analyzer_eval (arr[6].y == 8); /* { dg-warning "TRUE" } */
+ __analyzer_eval (arr[8].x == 9); /* { dg-warning "TRUE" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/compound-assignment-5.c b/gcc/testsuite/gcc.dg/analyzer/compound-assignment-5.c
new file mode 100644
index 00000000000..ccf8fe392bf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/compound-assignment-5.c
@@ -0,0 +1,142 @@
+#include "analyzer-decls.h"
+
+struct coord
+{
+ int x;
+ int y;
+};
+
+/* Copying from one on-stack array to another. */
+
+void test_1 (void)
+{
+ struct coord arr_a[16];
+ struct coord arr_b[16];
+ arr_a[3].x = 5;
+ arr_a[3].y = 6;
+
+ arr_b[7] = arr_a[3];
+
+ __analyzer_eval (arr_b[7].x == 5); /* { dg-warning "TRUE" } */
+ __analyzer_eval (arr_b[7].y == 6); /* { dg-warning "TRUE" } */
+}
+
+/* Copying from an on-stack array to a global array. */
+
+struct coord glob_arr[16];
+
+void test_2 (void)
+{
+ struct coord arr[16];
+ arr[3].x = 5;
+ arr[3].y = 6;
+
+ glob_arr[7] = arr[3];
+
+ __analyzer_eval (glob_arr[7].x == 5); /* { dg-warning "TRUE" } */
+ __analyzer_eval (glob_arr[7].y == 6); /* { dg-warning "TRUE" } */
+}
+
+/* Copying from a partially initialized on-stack array to a global array. */
+
+struct coord glob_arr[16];
+
+void test_3 (void)
+{
+ struct coord arr[16];
+ arr[3].y = 6;
+
+ glob_arr[7] = arr[3]; // or should the uninit warning be here?
+
+ __analyzer_eval (glob_arr[7].x); /* { dg-warning "uninitialized" "uninit" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+ __analyzer_eval (glob_arr[7].y == 6); /* { dg-warning "TRUE" } */
+}
+
+/* Symbolic bindings: copying from one array to another. */
+
+struct coord glob_arr[16];
+
+void test_4 (int i)
+{
+ struct coord arr_a[16];
+ struct coord arr_b[16];
+ arr_a[i].x = 5;
+ arr_a[i].y = 6;
+ __analyzer_eval (arr_a[i].x == 5); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
+ __analyzer_eval (arr_a[i].y == 6); /* { dg-warning "TRUE" } */
+
+ arr_b[i] = arr_a[i];
+
+ __analyzer_eval (arr_b[i].x == 5); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
+ __analyzer_eval (arr_b[i].y == 6); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
+}
+
+/* Symbolic bindings: copying within an array: symbolic src and dest */
+
+struct coord glob_arr[16];
+
+void test_5a (int i, int j)
+{
+ struct coord arr[16];
+ arr[i].x = 5;
+ arr[i].y = 6;
+
+ arr[j] = arr[i];
+
+ __analyzer_eval (arr[j].x == 5); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
+ __analyzer_eval (arr[j].y == 6); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
+}
+
+/* Symbolic bindings: copying within an array: symbolic src, concrete dest. */
+
+struct coord glob_arr[16];
+
+void test_5b (int i)
+{
+ struct coord arr[16];
+ arr[i].x = 5;
+ arr[i].y = 6;
+
+ arr[3] = arr[i];
+
+ __analyzer_eval (arr[3].x == 5); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
+ __analyzer_eval (arr[3].y == 6); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
+}
+
+/* Symbolic bindings: copying within an array: concrete src, symbolic dest. */
+
+struct coord glob_arr[16];
+
+void test_5c (int i)
+{
+ struct coord arr[16];
+ arr[3].x = 5;
+ arr[3].y = 6;
+
+ arr[i] = arr[3];
+
+ __analyzer_eval (arr[i].x == 5); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
+ __analyzer_eval (arr[i].y == 6); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
+}
+
+/* No info on the subregion being copied, and hence
+ binding_cluster2::maybe_get_compound_binding should return NULL. */
+
+void test_6 (void)
+{
+ struct coord arr[16];
+ arr[7] = glob_arr[3];
+
+ __analyzer_eval (arr[7].x == 5); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (arr[7].y == 6); /* { dg-warning "UNKNOWN" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/conditionals-notrans.c b/gcc/testsuite/gcc.dg/analyzer/conditionals-notrans.c
index a00127b1a7f..b1ac541920f 100644
--- a/gcc/testsuite/gcc.dg/analyzer/conditionals-notrans.c
+++ b/gcc/testsuite/gcc.dg/analyzer/conditionals-notrans.c
@@ -7,15 +7,12 @@ void test (int i, int j)
{
__analyzer_eval (i > 4); /* { dg-warning "TRUE" } */
__analyzer_eval (i <= 4); /* { dg-warning "FALSE" } */
- __analyzer_eval (i > 3); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
+ __analyzer_eval (i > 3); /* { dg-warning "TRUE" } */
__analyzer_eval (i > 5); /* { dg-warning "UNKNOWN" } */
- __analyzer_eval (i != 3); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
+ __analyzer_eval (i != 3); /* { dg-warning "TRUE" } */
- __analyzer_eval (i == 3); /* { dg-warning "FALSE" "desired" { xfail *-*-* } } */
- /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
+ __analyzer_eval (i == 3); /* { dg-warning "FALSE" } */
__analyzer_eval (i != 4); /* { dg-warning "TRUE" } */
__analyzer_eval (i == 4); /* { dg-warning "FALSE" } */
@@ -43,21 +40,17 @@ void test (int i, int j)
__analyzer_eval (i <= 4); /* { dg-warning "TRUE" } */
__analyzer_eval (i > 3); /* { dg-warning "UNKNOWN" } */
- __analyzer_eval (i > 5); /* { dg-warning "FALSE" "desired" { xfail *-*-* } } */
- /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
+ __analyzer_eval (i > 5); /* { dg-warning "FALSE" } */
__analyzer_eval (i != 3); /* { dg-warning "UNKNOWN" } */
__analyzer_eval (i == 3); /* { dg-warning "UNKNOWN" } */
__analyzer_eval (i != 4); /* { dg-warning "UNKNOWN" } */
__analyzer_eval (i == 4); /* { dg-warning "UNKNOWN" } */
- __analyzer_eval (i == 5); /* { dg-warning "FALSE" "desired" { xfail *-*-* } } */
- /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
- __analyzer_eval (i != 5); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
+ __analyzer_eval (i == 5); /* { dg-warning "FALSE" } */
+ __analyzer_eval (i != 5); /* { dg-warning "TRUE" } */
__analyzer_eval (i < 5); /* { dg-warning "TRUE" } */
- __analyzer_eval (i <= 5); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
+ __analyzer_eval (i <= 5); /* { dg-warning "TRUE" } */
}
}
@@ -101,8 +94,7 @@ void test_range_int_gt_lt (int i)
{
if (i > 3)
if (i < 5)
- __analyzer_eval (i == 4); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
+ __analyzer_eval (i == 4); /* { dg-warning "TRUE" } */
}
void test_range_float_gt_lt (float f)
@@ -116,8 +108,7 @@ void test_range_int_ge_lt (int i)
{
if (i >= 4)
if (i < 5)
- __analyzer_eval (i == 4); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
+ __analyzer_eval (i == 4); /* { dg-warning "TRUE" } */
}
void test_range_float_ge_lt (float f)
@@ -131,8 +122,7 @@ void test_range_int_gt_le (int i)
{
if (i > 3)
if (i <= 4)
- __analyzer_eval (i == 4); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
+ __analyzer_eval (i == 4); /* { dg-warning "TRUE" } */
}
void test_range_float_gt_le (float f)
@@ -146,8 +136,7 @@ void test_range_int_ge_le (int i)
{
if (i >= 4)
if (i <= 4)
- __analyzer_eval (i == 4); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
+ __analyzer_eval (i == 4); /* { dg-warning "TRUE" } */
}
void test_range_float_ge_le (float f)
diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-1.c b/gcc/testsuite/gcc.dg/analyzer/data-model-1.c
index 1db99133d50..3f16a38ab14 100644
--- a/gcc/testsuite/gcc.dg/analyzer/data-model-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/data-model-1.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target alloca } */
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -179,15 +181,8 @@ int test_12d (struct coord c)
{
struct coord d;
d = c;
- __analyzer_eval (d.x == c.x); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "actual" { target *-*-* } .-1 } */
- /* TODO(xfail): c and d share the same unknown value of type "coord", but
- attempts to access the fields lead to different unknown values. */
-
- __analyzer_eval (d.y == c.y); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "actual" { target *-*-* } .-1 } */
- // TODO(xfail): likewise
-
+ __analyzer_eval (d.x == c.x); /* { dg-warning "TRUE" } */
+ __analyzer_eval (d.y == c.y); /* { dg-warning "TRUE" } */
__analyzer_eval (d.x == d.y); /* { dg-warning "UNKNOWN" } */
/* d and c share an unknown value of type "struct coord".
But d.x and d.y should be different unknown values (although they inherit
@@ -209,25 +204,21 @@ void test_13 (struct outer *o)
{
__analyzer_eval (o->mid.in.f == 0.f); /* { dg-warning "UNKNOWN" } */
o->mid.in.f = 0.f;
- __analyzer_eval (o->mid.in.f == 0.f); /* { dg-warning "TRUE" "PR 93356" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "disabled float comparisons" { target *-*-* } .-1 } */
+ __analyzer_eval (o->mid.in.f == 0.f); /* { dg-warning "TRUE" } */
}
void test_14 (struct outer o)
{
__analyzer_eval (o.mid.in.f == 0.f); /* { dg-warning "UNKNOWN" } */
o.mid.in.f = 0.f;
- __analyzer_eval (o.mid.in.f == 0.f); /* { dg-warning "TRUE" "PR 93356" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "disabled float comparisons" { target *-*-* } .-1 } */
+ __analyzer_eval (o.mid.in.f == 0.f); /* { dg-warning "TRUE" } */
}
void test_15 (const char *str)
{
char ch = str[0];
__analyzer_eval (ch == 'a'); /* { dg-warning "UNKNOWN" } */
- __analyzer_eval (ch == str[0]); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
- // TODO(xfail)
+ __analyzer_eval (ch == str[0]); /* { dg-warning "TRUE" } */
ch = 'a';
__analyzer_eval (ch == 'a'); /* { dg-warning "TRUE" } */
@@ -240,15 +231,15 @@ void test_16 (void)
__analyzer_eval (msg != NULL); /* { dg-warning "TRUE" } */
- __analyzer_eval (msg[0] == 'h'); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
- // TODO(xfail)
+ __analyzer_eval (msg[0] == 'h'); /* { dg-warning "TRUE" } */
- __analyzer_eval (msg[1] == 'e'); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
- // TODO(xfail)
+ __analyzer_eval (msg[1] == 'e'); /* { dg-warning "TRUE" } */
__analyzer_eval (strlen (msg) == 11); /* { dg-warning "TRUE" } */
+
+ /* Out-of-bounds. */
+ __analyzer_eval (msg[100] == 'e'); /* { dg-warning "UNKNOWN" } */
+ // TODO: some kind of warning for the out-of-bounds access
}
static const char *__attribute__((noinline))
@@ -263,13 +254,9 @@ void test_16_alt (void)
__analyzer_eval (msg != NULL); /* { dg-warning "TRUE" } */
- __analyzer_eval (msg[0] == 'h'); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
- // TODO(xfail)
+ __analyzer_eval (msg[0] == 'h'); /* { dg-warning "TRUE" } */
- __analyzer_eval (msg[1] == 'e'); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
- // TODO(xfail)
+ __analyzer_eval (msg[1] == 'e'); /* { dg-warning "TRUE" } */
__analyzer_eval (strlen (msg) == 11); /* { dg-warning "TRUE" } */
}
@@ -332,9 +319,6 @@ void test_16e (int i)
__analyzer_eval (j == i); /* { dg-warning "UNKNOWN" } */
}
-/* TODO: and more complicated graph-like examples, where anything that's
- reachable from the pointer might be modified. */
-
void test_17 (int i)
{
int j = 42;
@@ -475,13 +459,7 @@ void test_23 (struct foo *f, struct foo *g)
i = f->i + g->i;
j = f->i + g->i;
k = f->i * g->i;
- __analyzer_eval (i == j); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
- /* TODO(xfail): we'd need to record that the two unknown values are both
- the sum of the two unknown input values (and thus are the same); not
- yet sure if we want arbitrary expression trees in the representation
- (analysis termination concerns). */
-
+ __analyzer_eval (i == j); /* { dg-warning "TRUE" } */
__analyzer_eval (i == k); /* { dg-warning "UNKNOWN" } */
}
@@ -494,9 +472,7 @@ void test_24 (struct foo *f)
/* Overwriting a whole struct should invalidate our knowledge
about fields within it. */
g = *f;
- __analyzer_eval (g.i == 42); /* { dg-warning "UNKNOWN" "desired" { xfail *-*-* } } */
- /* { dg-warning "TRUE" "status quo" { target *-*-* } .-1 } */
- // TODO(xfail)
+ __analyzer_eval (g.i == 42); /* { dg-warning "UNKNOWN" } */
}
void test_25 (struct foo *f)
@@ -511,16 +487,14 @@ void test_25 (struct foo *f)
source value should update our knowledge about fields within
the dest value. */
g = *f;
- __analyzer_eval (g.i == 43); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-warning "FALSE" "status quo" { target *-*-* } .-1 } */
- // TODO(xfail)
+ __analyzer_eval (g.i == 43); /* { dg-warning "TRUE" } */
}
void test_26 (struct coord *p, struct coord *q)
{
p->x = 42;
- q->y = 17;
- __analyzer_eval (p->x == 42); /* { dg-warning "TRUE" } */
+ q->y = 17; /* could clobber p->x. */
+ __analyzer_eval (p->x == 42); /* { dg-warning "UNKNOWN" } */
__analyzer_eval (p->y); /* { dg-warning "UNKNOWN" } */
__analyzer_eval (q->x); /* { dg-warning "UNKNOWN" } */
__analyzer_eval (q->y == 17); /* { dg-warning "TRUE" } */
@@ -529,26 +503,21 @@ void test_26 (struct coord *p, struct coord *q)
source value should update our knowledge about fields within
the dest value. */
*p = *q;
- __analyzer_eval (p->x); /* { dg-warning "UNKNOWN" "desired" { xfail *-*-* } } */
- /* { dg-warning "TRUE" "status quo" { target *-*-* } .-1 } */
- // TODO(xfail): should have been overwritten
+ __analyzer_eval (p->x); /* { dg-warning "UNKNOWN" } */
__analyzer_eval (p->y == 17); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
/* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
// TODO(xfail): should have been overwritten with q->y
__analyzer_eval (q->x); /* { dg-warning "UNKNOWN" } */
- __analyzer_eval (q->y == 17); /* { dg-warning "TRUE" } */
+ __analyzer_eval (q->y == 17); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
+ /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
}
void test_27 (struct coord *p)
{
memset (p, 0, sizeof (struct coord));
- __analyzer_eval (p->x == 0); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
- // TODO(xfail):
- __analyzer_eval (p->y == 0); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
- // TODO(xfail):
+ __analyzer_eval (p->x == 0); /* { dg-warning "TRUE" } */
+ __analyzer_eval (p->y == 0); /* { dg-warning "TRUE" } */
}
void test_28 (struct coord *p)
@@ -661,6 +630,8 @@ void test_29a (struct coord p[])
__analyzer_eval (q[-2].y == 107025); /* { dg-warning "TRUE" } */
q -= 2;
+ __analyzer_eval (q == &p[7]); /* { dg-warning "UNKNOWN" } */
+ // TODO: make this be TRUE
__analyzer_eval (q->x == 107024); /* { dg-warning "TRUE" } */
__analyzer_eval (q->y == 107025); /* { dg-warning "TRUE" } */
@@ -709,6 +680,7 @@ void test_29b (void)
__analyzer_eval (q[-2].y == 107025); /* { dg-warning "TRUE" } */
q -= 2;
+ __analyzer_eval (q == &p[7]); /* { dg-warning "TRUE" } */
__analyzer_eval (q->x == 107024); /* { dg-warning "TRUE" } */
__analyzer_eval (q->y == 107025); /* { dg-warning "TRUE" } */
@@ -757,6 +729,7 @@ void test_29c (int len)
__analyzer_eval (q[-2].y == 107025); /* { dg-warning "TRUE" } */
q -= 2;
+ __analyzer_eval (q == &p[7]); /* { dg-warning "TRUE" } */
__analyzer_eval (q->x == 107024); /* { dg-warning "TRUE" } */
__analyzer_eval (q->y == 107025); /* { dg-warning "TRUE" } */
@@ -934,12 +907,12 @@ void test_41 (void)
union u u;
u.i = 42;
__analyzer_eval (u.i == 42); /* { dg-warning "TRUE" } */
- __analyzer_eval (u.ptr == NULL); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (u.ptr == NULL); /* { dg-warning "UNKNOWN|FALSE" } */
/* Writes to a union member should invalidate knowledge about other members. */
u.ptr = NULL;
__analyzer_eval (u.ptr == NULL); /* { dg-warning "TRUE" } */
- __analyzer_eval (u.i == 42); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (u.i == 42); /* { dg-warning "UNKNOWN|FALSE" } */
}
void test_42 (void)
@@ -948,8 +921,7 @@ void test_42 (void)
float f;
i = 42;
f = i;
- __analyzer_eval (f == 42.0); /* { dg-warning "TRUE" "PR 93356" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "disabled float comparisons" { target *-*-* } .-1 } */
+ __analyzer_eval (f == 42.0); /* { dg-warning "TRUE" } */
}
void test_43 (void)
@@ -1061,10 +1033,8 @@ void test_51 (struct coord c)
{
struct coord d;
memcpy (&d, &c, sizeof (struct coord));
- __analyzer_eval (c.x == d.x); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
- __analyzer_eval (c.y == d.y); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
+ __analyzer_eval (c.x == d.x); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c.y == d.y); /* { dg-warning "TRUE" } */
}
struct big
diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-13.c b/gcc/testsuite/gcc.dg/analyzer/data-model-13.c
index e7cb8455b7d..31c1896b0c2 100644
--- a/gcc/testsuite/gcc.dg/analyzer/data-model-13.c
+++ b/gcc/testsuite/gcc.dg/analyzer/data-model-13.c
@@ -14,8 +14,5 @@ void test_1 (void)
void test_2 (void)
{
global_union.ptr_val = malloc (1024); /* { dg-message "allocated here" } */
- global_union.int_val = 0;
-} /* { dg-warning "leak of '<unknown>' " } */
-/* TODO: something better than "<unknown>". */
-/* TODO: better location for the leak. */
-
+ global_union.int_val = 0; /* { dg-warning "leak of 'global_union.ptr_val' " } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-14.c b/gcc/testsuite/gcc.dg/analyzer/data-model-14.c
index f9bb540b022..1dbcb701123 100644
--- a/gcc/testsuite/gcc.dg/analyzer/data-model-14.c
+++ b/gcc/testsuite/gcc.dg/analyzer/data-model-14.c
@@ -1,6 +1,3 @@
-/* FIXME: we shouldn't need this. */
-/* { dg-additional-options "-fanalyzer-fine-grained" } */
-
#include <stdlib.h>
void *global_ptr;
@@ -8,14 +5,12 @@ void *global_ptr;
void test_1 (int i)
{
global_ptr = malloc (1024); /* { dg-message "allocated here" } */
- *(int *)&global_ptr = i; /* { dg-warning "leak of '<unknown>'" } */
- // TODO: something better than "<unknown>" here ^^^
+ *(int *)&global_ptr = i; /* { dg-warning "leak of 'global_ptr'" } */
}
void test_2 (int i)
{
- void *p = malloc (1024); /* { dg-message "allocated here" "" { xfail *-*-* } } */
- // TODO(xfail)
+ void *p = malloc (1024); /* { dg-message "allocated here" } */
global_ptr = p;
*(int *)&p = i;
p = global_ptr;
diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-16.c b/gcc/testsuite/gcc.dg/analyzer/data-model-16.c
index a8acfbeeb77..616d3537054 100644
--- a/gcc/testsuite/gcc.dg/analyzer/data-model-16.c
+++ b/gcc/testsuite/gcc.dg/analyzer/data-model-16.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target label_values } */
+
/* Labels as values. */
#include "analyzer-decls.h"
diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-18.c b/gcc/testsuite/gcc.dg/analyzer/data-model-18.c
index 0a9ae9ff4d4..86e8110ccf6 100644
--- a/gcc/testsuite/gcc.dg/analyzer/data-model-18.c
+++ b/gcc/testsuite/gcc.dg/analyzer/data-model-18.c
@@ -16,7 +16,5 @@ void test (int *p, int i, int j)
__analyzer_eval (p[3] == 42); /* { dg-warning "UNKNOWN" } */
__analyzer_eval (p[i] == 17); /* { dg-warning "TRUE" } */
- __analyzer_eval (p[j] == 17); /* { dg-warning "UNKNOWN" "desired" { xfail *-*-* } } */
- /* { dg-bogus "TRUE" "status quo" { xfail *-*-* } .-1 } */
- // FIXME(xfails) ^^^
+ __analyzer_eval (p[j] == 17); /* { dg-warning "UNKNOWN" } */
}
diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-20.c b/gcc/testsuite/gcc.dg/analyzer/data-model-20.c
new file mode 100644
index 00000000000..8fdbb6b3df6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/data-model-20.c
@@ -0,0 +1,25 @@
+/* { dg-additional-options "-Wno-analyzer-too-complex" } */
+
+#include <stdlib.h>
+
+struct foo { int dummy; };
+
+struct foo **
+test (int n) {
+ struct foo **arr;
+ int i;
+
+ if ((arr = (struct foo **)malloc(n * sizeof(struct foo *))) == NULL)
+ return NULL;
+
+ for (i = 0; i < n; i++) {
+ if ((arr[i] = (struct foo *)malloc(sizeof(struct foo))) == NULL) {
+ for (; i >= 0; i++) {
+ free(arr[i]); /* { dg-bogus "double-'free'" } */
+ }
+ free(arr);
+ return NULL;
+ }
+ }
+ return arr;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-5.c b/gcc/testsuite/gcc.dg/analyzer/data-model-5.c
index 5cf334768d8..2135c70eb8d 100644
--- a/gcc/testsuite/gcc.dg/analyzer/data-model-5.c
+++ b/gcc/testsuite/gcc.dg/analyzer/data-model-5.c
@@ -90,11 +90,20 @@ void unref (base_obj *obj)
{
if (--obj->ob_refcnt == 0) /* { dg-bogus "dereference of uninitialized pointer 'obj'" } */
obj->ob_type->tp_dealloc (obj);
+ /* { dg-warning "dereference of NULL 'obj'" "deref of NULL" { target *-*-* } .-2 } */
+ /* FIXME: ideally we wouldn't issue this, as we've already issued a
+ warning about str_obj which is now in the "stop" state; the cast
+ confuses things. */
}
void test_1 (const char *str)
{
base_obj *obj = new_string_obj (str);
- //__analyzer_dump();
unref (obj);
-} /* { dg-bogus "leak" } */
+} /* { dg-bogus "leak" "" { xfail *-*-* } } */
+/* XFAIL (false leak):
+ Given that we only know "len" symbolically, this line:
+ str_obj->str_buf[len] = '\0';
+ is a symbolic write which could clobber the ob_type or ob_refcnt.
+ It reports a leak when following the path where the refcount is clobbered
+ to be a value that leads to the deallocator not being called. */
diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-5b.c b/gcc/testsuite/gcc.dg/analyzer/data-model-5b.c
index 76e351d86cb..cd6a4df00dd 100644
--- a/gcc/testsuite/gcc.dg/analyzer/data-model-5b.c
+++ b/gcc/testsuite/gcc.dg/analyzer/data-model-5b.c
@@ -86,8 +86,10 @@ void test_1 (const char *str)
//__analyzer_dump();
if (obj)
unref (obj);
-} /* { dg-bogus "leak of 'obj'" "" { xfail *-*-* } } */
-/* TODO(xfail): the false leak report involves the base_obj.ob_refcnt
- being 1, but the string_obj.str_base.ob_refcnt being unknown (when
- they ought to be the same region), thus allowing for a path in which
- the object is allocated but not freed. */
+} /* { dg-bogus "leak" "" { xfail *-*-* } } */
+/* XFAIL (false leak):
+ Given that we only know "len" symbolically, this line:
+ str_obj->str_buf[len] = '\0';
+ is a symbolic write which could clobber the ob_type or ob_refcnt.
+ It reports a leak when following the path where the refcount is clobbered
+ to be a value that leads to the deallocator not being called. */
diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-5c.c b/gcc/testsuite/gcc.dg/analyzer/data-model-5c.c
index 3aba7bdc2aa..ad4e1d2644d 100644
--- a/gcc/testsuite/gcc.dg/analyzer/data-model-5c.c
+++ b/gcc/testsuite/gcc.dg/analyzer/data-model-5c.c
@@ -75,9 +75,10 @@ void test_1 (const char *str)
string_obj *obj = new_string_obj (str);
if (obj)
unref (obj);
-} /* { dg-bogus "leak of 'obj'" "" { xfail *-*-* } } */
-/* TODO(xfail): the false leak report involves the base_obj.ob_refcnt
- being 1, but the string_obj.str_base.ob_refcnt being unknown (when
- they ought to be the same region), thus allowing for a path in which
- the object is allocated but not freed. */
-
+} /* { dg-bogus "leak" "" { xfail *-*-* } } */
+/* XFAIL (false leak):
+ Given that we only know "len" symbolically, this line:
+ str_obj->str_buf[len] = '\0';
+ is a symbolic write which could clobber the ob_type or ob_refcnt.
+ It reports a leak when following the path where the refcount is clobbered
+ to be a value that leads to the deallocator not being called. */
diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-5d.c b/gcc/testsuite/gcc.dg/analyzer/data-model-5d.c
index 8c7bfa91a96..b4d77a939bc 100644
--- a/gcc/testsuite/gcc.dg/analyzer/data-model-5d.c
+++ b/gcc/testsuite/gcc.dg/analyzer/data-model-5d.c
@@ -5,34 +5,33 @@
#include <stdlib.h>
#include "analyzer-decls.h"
-typedef struct base_obj base_obj;
-typedef struct type_obj type_obj;
-typedef struct string_obj string_obj;
-
-struct base_obj
+typedef struct base_obj
{
struct type_obj *ob_type;
int ob_refcnt;
-};
+} base_obj;
-struct type_obj
+typedef struct type_obj
{
base_obj tp_base;
-};
+ void (*tp_dealloc) (base_obj *);
+} type_obj;
-struct string_obj
+typedef struct boxed_int_obj
{
- base_obj str_base;
- size_t str_len;
- char str_buf[];
-};
+ base_obj int_base;
+ int int_val;
+} boxed_int_obj;
+
+extern void int_del (base_obj *);
type_obj type_type = {
- { &type_type, 1},
+ { &type_type, 1}
};
-type_obj str_type = {
- { &str_type, 1},
+type_obj boxed_int_type = {
+ { &type_type, 1},
+ int_del
};
base_obj *alloc_obj (type_obj *ob_type, size_t sz)
@@ -45,20 +44,28 @@ base_obj *alloc_obj (type_obj *ob_type, size_t sz)
return obj;
}
+base_obj *new_int_obj (int val)
+{
+ boxed_int_obj *int_obj
+ = (boxed_int_obj *)alloc_obj (&boxed_int_type, sizeof (boxed_int_obj));
+ if (!int_obj)
+ return NULL;
+ int_obj->int_val = val;
+ return (base_obj *)int_obj;
+}
+
void unref (base_obj *obj)
{
- //__analyzer_dump();
if (--obj->ob_refcnt == 0)
- free (obj);
+ obj->ob_type->tp_dealloc (obj);
}
-void test_1 ()
+void test_1 (const char *str)
{
- base_obj *obj = alloc_obj (&str_type, sizeof (string_obj));
- if (obj)
- {
- __analyzer_dump_num_heap_regions (); /* { dg-warning "num heap regions: '1'" } */
- unref (obj);
- __analyzer_dump_num_heap_regions (); /* { dg-warning "num heap regions: '0'" } */
- }
-}
+ base_obj *obj = new_int_obj (42);
+ if (!obj)
+ return;
+ __analyzer_eval (((boxed_int_obj *)obj)->int_val == 42); /* { dg-warning "TRUE" } */
+ __analyzer_eval (obj->ob_refcnt == 1); /* { dg-warning "TRUE" } */
+ unref (obj);
+} /* { dg-bogus "leak" "" } */
diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-6.c b/gcc/testsuite/gcc.dg/analyzer/data-model-6.c
deleted file mode 100644
index 78a797ead76..00000000000
--- a/gcc/testsuite/gcc.dg/analyzer/data-model-6.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <stdlib.h>
-#include "analyzer-decls.h"
-
-/* Verify that we don't accumulate state after a malloc/free pair. */
-
-void test (void)
-{
- void *ptr;
- __analyzer_dump_num_heap_regions (); /* { dg-warning "num heap regions: '0'" } */
- ptr = malloc (1024);
- __analyzer_dump_num_heap_regions (); /* { dg-warning "num heap regions: '1'" } */
- free (ptr);
- __analyzer_dump_num_heap_regions (); /* { dg-warning "num heap regions: '0'" } */
-}
diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-8.c b/gcc/testsuite/gcc.dg/analyzer/data-model-8.c
index 939b4c275d8..3e69d0f8aa5 100644
--- a/gcc/testsuite/gcc.dg/analyzer/data-model-8.c
+++ b/gcc/testsuite/gcc.dg/analyzer/data-model-8.c
@@ -21,6 +21,5 @@ void test (void)
struct base *bp = (struct base *)&s;
- __analyzer_eval (bp->i == 3); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
+ __analyzer_eval (bp->i == 3); /* { dg-warning "TRUE" } */
}
diff --git a/gcc/testsuite/gcc.dg/analyzer/describe-1.c b/gcc/testsuite/gcc.dg/analyzer/describe-1.c
new file mode 100644
index 00000000000..bc57c6ecef2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/describe-1.c
@@ -0,0 +1,11 @@
+/* Smoketest for __analyzer_describe. */
+
+#include "analyzer-decls.h"
+
+void test (int i)
+{
+ __analyzer_describe (0, 42); /* { dg-warning "svalue: '\\(int\\)42'" } */
+ __analyzer_describe (0, i); /* { dg-warning "svalue: 'INIT_VAL\\(i.*\\)'" } */
+ __analyzer_describe (0, &i); /* { dg-warning "svalue: '&i'" } */
+ /* Further cases would risk overspecifying things. */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/dot-output.c b/gcc/testsuite/gcc.dg/analyzer/dot-output.c
index 7b69c626f4e..ff418b156c0 100644
--- a/gcc/testsuite/gcc.dg/analyzer/dot-output.c
+++ b/gcc/testsuite/gcc.dg/analyzer/dot-output.c
@@ -18,8 +18,7 @@ int *test (int *buf, int n, int *out)
/* A loop, to ensure we have phi nodes. */
for (i = 0; i < n; i++)
- result[i] = buf[i] + i; /* { dg-warning "possibly-NULL" "" { xfail *-*-* } } */
- /* TODO(xfail): why isn't the warning appearing? */
+ result[i] = buf[i] + i; /* { dg-warning "possibly-NULL" } */
/* Example of a "'" (to test quoting). */
*out = some_call (i, 'a');
diff --git a/gcc/testsuite/gcc.dg/analyzer/explode-1.c b/gcc/testsuite/gcc.dg/analyzer/explode-1.c
index 6b62e8e871c..9b95afd9a03 100644
--- a/gcc/testsuite/gcc.dg/analyzer/explode-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/explode-1.c
@@ -47,7 +47,7 @@ void test (void)
{
default:
case 0:
- *pp = malloc (16);
+ *pp = malloc (16); /* { dg-warning "leak" } */
break;
case 1:
free (*pp);
diff --git a/gcc/testsuite/gcc.dg/analyzer/explode-2.c b/gcc/testsuite/gcc.dg/analyzer/explode-2.c
index d786aa93896..70d8fecae8f 100644
--- a/gcc/testsuite/gcc.dg/analyzer/explode-2.c
+++ b/gcc/testsuite/gcc.dg/analyzer/explode-2.c
@@ -19,31 +19,31 @@ void test (void)
{
default:
case 0:
- p0 = malloc (16);
+ p0 = malloc (16); /* { dg-warning "leak" } */
break;
case 1:
- free (p0); /* { dg-warning "double-'free' of 'p0'" } */
+ free (p0); /* { dg-warning "double-'free' of 'p0'" "" { xfail *-*-* } } */
break;
case 2:
- p1 = malloc (16);
+ p1 = malloc (16); /* { dg-warning "leak" } */
break;
case 3:
- free (p1); /* { dg-warning "double-'free' of 'p1'" } */
+ free (p1); /* { dg-warning "double-'free' of 'p1'" "" { xfail *-*-* } } */
break;
case 4:
- p2 = malloc (16);
+ p2 = malloc (16); /* { dg-warning "leak" } */
break;
case 5:
- free (p2); /* { dg-warning "double-'free' of 'p2'" } */
+ free (p2); /* { dg-warning "double-'free' of 'p2'" "" { xfail *-*-* } } */
break;
case 6:
- p3 = malloc (16);
+ p3 = malloc (16); /* { dg-warning "leak" } */
break;
case 7:
- free (p3); /* { dg-warning "double-'free' of 'p3'" } */
+ free (p3); /* { dg-warning "double-'free' of 'p3'" "" { xfail *-*-* } } */
break;
}
}
diff --git a/gcc/testsuite/gcc.dg/analyzer/feasibility-1.c b/gcc/testsuite/gcc.dg/analyzer/feasibility-1.c
new file mode 100644
index 00000000000..f2a8a4cb0be
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/feasibility-1.c
@@ -0,0 +1,62 @@
+#include "analyzer-decls.h"
+
+void test_1 (void)
+{
+ __analyzer_dump_path (); /* { dg-message "path" } */
+}
+
+void test_2 (int flag)
+{
+ if (flag)
+ __analyzer_dump_path (); /* { dg-message "path" } */
+}
+
+void test_3 (int flag)
+{
+ if (flag)
+ if (!flag)
+ __analyzer_dump_path (); /* { dg-bogus "path" } */
+}
+
+int global_for_test_4;
+static void __attribute__((noinline)) called_by_test_4 () {}
+void test_4 (void)
+{
+ /* Verify that a state change that happens in a stmt that
+ isn't the first within its BB can affect path feasibility. */
+ global_for_test_4 = 0;
+ global_for_test_4 = 1;
+ /* Thwart the optimizer. */
+ called_by_test_4 ();
+ if (global_for_test_4)
+ __analyzer_dump_path (); /* { dg-message "path" } */
+}
+
+/* Verify that loops don't confuse the feasibility checker. */
+
+void test_5 (void)
+{
+ for (int i = 0; i < 1024; i++)
+ {
+ }
+ __analyzer_dump_path (); /* { dg-message "path" } */
+}
+
+/* Reproducer for an issue seen with CVE-2005-1689 (PR analyzer/96374): if we
+ take the shortest path and update state and check feasibility per-edge, we
+ can erroneously reject valid diagnostics. */
+
+int test_6 (int a, int b)
+{
+ int problem = 0;
+ if (a)
+ problem = 1;
+ if (b)
+ {
+ if (!problem)
+ problem = 2;
+ __analyzer_dump_path (); /* { dg-message "path" "" { xfail *-*-* } } */
+ /* XFAIL is PR analyzer/96374. */
+ }
+ return problem;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/first-field-1.c b/gcc/testsuite/gcc.dg/analyzer/first-field-1.c
new file mode 100644
index 00000000000..8b71e1abcae
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/first-field-1.c
@@ -0,0 +1,24 @@
+#include "analyzer-decls.h"
+
+typedef struct base_obj
+{
+ int m_first;
+ int m_second;
+} base_obj;
+
+typedef struct sub_obj
+{
+ base_obj base;
+} sub_obj;
+
+void test (sub_obj *sub)
+{
+ sub->base.m_first = 1;
+ sub->base.m_second = 2;
+ __analyzer_eval (sub->base.m_first == 1); /* { dg-warning "TRUE" } */
+ __analyzer_eval (sub->base.m_second == 2); /* { dg-warning "TRUE" } */
+
+ base_obj *base = (struct base_obj *)sub;
+ __analyzer_eval (base->m_first == 1); /* { dg-warning "TRUE" } */
+ __analyzer_eval (base->m_second == 2); /* { dg-warning "TRUE" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/first-field-2.c b/gcc/testsuite/gcc.dg/analyzer/first-field-2.c
new file mode 100644
index 00000000000..2fb98d3c9d7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/first-field-2.c
@@ -0,0 +1,33 @@
+/* A toy re-implementation of CPython's object model. */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "analyzer-decls.h"
+
+typedef struct base_obj base_obj;
+typedef struct string_obj string_obj;
+
+struct base_obj
+{
+ int ob_refcnt;
+};
+
+struct string_obj
+{
+ base_obj str_base;
+ size_t str_len;
+ char str_buf[];
+};
+
+base_obj *alloc_obj (const char *str)
+{
+ size_t len = strlen (str);
+ base_obj *obj = (base_obj *)malloc (sizeof (string_obj) + len + 1);
+ if (!obj)
+ return NULL;
+ obj->ob_refcnt = 1;
+ string_obj *str_obj = (string_obj *)obj;
+ __analyzer_eval (str_obj->str_base.ob_refcnt == 1); /* { dg-warning "TRUE" } */
+ return obj;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/init.c b/gcc/testsuite/gcc.dg/analyzer/init.c
new file mode 100644
index 00000000000..e51d88e9ff9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/init.c
@@ -0,0 +1,136 @@
+/* Tests of brace-enclosed initializers
+ Some of these use the CONSTRUCTOR tree code, but it appears
+ only for a full zero-init; it appears that by the time the analyzer
+ runs that this initialization has been converted into field-wise
+ gimple assign stmts, with just "zero-init everything" CONSTRUCTORs
+ and "clobber" CONSTRUCTORs. */
+
+#include "analyzer-decls.h"
+
+struct coord
+{
+ int x;
+ int y;
+};
+
+struct tri
+{
+ struct coord v[3];
+};
+
+union iap
+{
+ int i;
+ void *p;
+};
+
+void test_1 (void)
+{
+ struct coord c = {3, 4};
+ __analyzer_eval (c.x == 3); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c.y == 4); /* { dg-warning "TRUE" } */
+}
+
+void test_2 (void)
+{
+ struct coord c = {3};
+ __analyzer_eval (c.x == 3); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c.y == 0); /* { dg-warning "TRUE" } */
+}
+
+void test_3 (void)
+{
+ struct coord c = {};
+ __analyzer_eval (c.x == 0); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c.y == 0); /* { dg-warning "TRUE" } */
+}
+
+void test_4 (void)
+{
+ int c[2] = {3, 4};
+ __analyzer_eval (c[0] == 3); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[1] == 4); /* { dg-warning "TRUE" } */
+}
+
+void test_5 (void)
+{
+ int c[2] = {3};
+ __analyzer_eval (c[0] == 3); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[1] == 0); /* { dg-warning "TRUE" } */
+}
+
+void test_6 (void)
+{
+ int c[2] = {};
+ __analyzer_eval (c[0] == 0); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[1] == 0); /* { dg-warning "TRUE" } */
+}
+
+void test_7 (void)
+{
+ struct coord c[2] = {{3, 4}, {5, 6}};
+ __analyzer_eval (c[0].x == 3); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[0].y == 4); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[1].x == 5); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[1].y == 6); /* { dg-warning "TRUE" } */
+}
+
+void test_8 (void)
+{
+ struct coord c[2] = {{3}, {5}};
+ __analyzer_eval (c[0].x == 3); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[0].y == 0); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[1].x == 5); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[1].y == 0); /* { dg-warning "TRUE" } */
+}
+
+void test_9 (void)
+{
+ struct coord c[2] = {{}, {}};
+ __analyzer_eval (c[0].x == 0); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[0].y == 0); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[1].x == 0); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[1].y == 0); /* { dg-warning "TRUE" } */
+}
+
+void test_10 (void)
+{
+ struct coord c[2] = {{.y = 4, .x = 3}, {5, 6}};
+ __analyzer_eval (c[0].x == 3); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[0].y == 4); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[1].x == 5); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[1].y == 6); /* { dg-warning "TRUE" } */
+}
+
+void test_11 (void)
+{
+ struct coord c[2] = {{.y = 4}, {5, 6}};
+ __analyzer_eval (c[0].x == 0); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[0].y == 4); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[1].x == 5); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c[1].y == 6); /* { dg-warning "TRUE" } */
+}
+
+void test_12 (void)
+{
+ struct tri t = {};
+ __analyzer_eval (t.v[0].x == 0); /* { dg-warning "TRUE" } */
+ __analyzer_eval (t.v[2].y == 0); /* { dg-warning "TRUE" } */
+}
+
+void test_13 (void)
+{
+ struct tri t = {3, 4, 5, 6, 7, 8};
+ __analyzer_eval (t.v[0].x == 3); /* { dg-warning "TRUE" } */
+ __analyzer_eval (t.v[0].y == 4); /* { dg-warning "TRUE" } */
+ __analyzer_eval (t.v[1].x == 5); /* { dg-warning "TRUE" } */
+ __analyzer_eval (t.v[1].y == 6); /* { dg-warning "TRUE" } */
+ __analyzer_eval (t.v[2].x == 7); /* { dg-warning "TRUE" } */
+ __analyzer_eval (t.v[2].y == 8); /* { dg-warning "TRUE" } */
+}
+
+void test_14 (void)
+{
+ union iap u = {};
+ __analyzer_eval (u.i == 0); /* { dg-warning "TRUE" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/leak-2.c b/gcc/testsuite/gcc.dg/analyzer/leak-2.c
new file mode 100644
index 00000000000..bba3e816db7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/leak-2.c
@@ -0,0 +1,9 @@
+#include <stdlib.h>
+
+void *ptr;
+
+void *test (void)
+{
+ ptr = malloc (1024);
+ ptr = NULL; /* { dg-warning "leak of 'ptr'" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/loop-0-up-to-n-by-1-with-iter-obj.c b/gcc/testsuite/gcc.dg/analyzer/loop-0-up-to-n-by-1-with-iter-obj.c
new file mode 100644
index 00000000000..0172c9b324c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/loop-0-up-to-n-by-1-with-iter-obj.c
@@ -0,0 +1,73 @@
+#include <stdlib.h>
+
+#include "analyzer-decls.h"
+
+struct iter
+{
+ int start;
+ int end;
+ int step;
+ int val;
+};
+
+struct iter * __attribute__((noinline))
+iter_new (int start, int end, int step)
+{
+ struct iter *it = (struct iter *)malloc (sizeof (struct iter));
+ if (!it)
+ abort ();
+ it->start = start;
+ it->end = end;
+ it->step = step;
+ it->val = start;
+ return it;
+}
+
+int __attribute__((noinline))
+iter_done_p (struct iter *it)
+{
+ return it->val >= it->end;
+}
+
+void __attribute__((noinline))
+iter_next (struct iter *it)
+{
+ it->val += it->step;
+}
+
+/* Example of an iterator object, to see how well we cope with a well-disguised
+ iteration from 0 to n with a step of 1. */
+
+void test(int n)
+{
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+
+ struct iter *it = iter_new (0, n, 1);
+ while (!iter_done_p (it))
+ {
+ __analyzer_eval (it->val < n); /* { dg-warning "TRUE" "true" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+ /* TODO(xfail^^^): ideally we ought to figure out i > 0 after 1st iteration. */
+
+ __analyzer_eval (it->val == 0); /* { dg-warning "TRUE" "true on 1st iter" } */
+ /* { dg-warning "UNKNOWN" "unknown" { target *-*-* } .-1 } */
+ /* TODO: should we ought to figure out i > 0 after 1st iteration? */
+
+ __analyzer_eval (it->val >= 0); /* { dg-warning "TRUE" } */
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
+
+ iter_next (it);
+ }
+
+ __analyzer_eval (it->val >= n); /* { dg-warning "TRUE" "true" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+
+ __analyzer_eval (it->val == n); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
+ /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
+ /* TODO(xfail^^^): it only figures out i >= 256, rather than i == 256. */
+
+ free (it);
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/loop-0-up-to-n-by-1.c b/gcc/testsuite/gcc.dg/analyzer/loop-0-up-to-n-by-1.c
new file mode 100644
index 00000000000..d49ed130488
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/loop-0-up-to-n-by-1.c
@@ -0,0 +1,31 @@
+#include "analyzer-decls.h"
+
+void test(int n)
+{
+ int i;
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+
+ for (i = 0; i < n; i++) {
+ __analyzer_eval (i < n); /* { dg-warning "TRUE" } */
+ /* (should report TRUE twice). */
+
+ __analyzer_eval (i == 0); /* { dg-warning "TRUE" "1st" } */
+ /* { dg-warning "FALSE" "2nd" { xfail *-*-* } .-1 } */
+ /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-2 } */
+ /* TODO(xfail^^^): ideally we ought to figure out i > 0 after 1st iteration. */
+
+ __analyzer_eval (i >= 0); /* { dg-warning "TRUE" } */
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
+ }
+
+ __analyzer_eval (i >= n); /* { dg-warning "TRUE" "true" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+
+ __analyzer_eval (i == n); /* { dg-warning "TRUE" "true" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+ /* TODO(xfail^^^): it only figures out i >= 256, rather than i == 256. */
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/loop-2a.c b/gcc/testsuite/gcc.dg/analyzer/loop-2a.c
index a392ffc1a63..16b64497cb7 100644
--- a/gcc/testsuite/gcc.dg/analyzer/loop-2a.c
+++ b/gcc/testsuite/gcc.dg/analyzer/loop-2a.c
@@ -14,10 +14,7 @@ void test(void)
for (u.i=0; u.i<256; u.i++) {
- __analyzer_eval (u.i < 256); /* { dg-warning "TRUE" "1st" } */
- /* { dg-warning "TRUE" "2nd" { xfail *-*-* } .-1 } */
- /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-2 } */
- /* (should report TRUE twice). */
+ __analyzer_eval (u.i < 256); /* { dg-warning "TRUE" } */
__analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
@@ -26,11 +23,10 @@ void test(void)
/* TODO(xfail^^^): we're only capturing the first iteration, so
we erroneously get i == 0. */
- //__analyzer_eval (u.i >= 0); /* { d-todo-g-warning "TRUE" } */
+ __analyzer_eval (u.i >= 0); /* { dg-warning "TRUE" } */
}
- __analyzer_eval (u.i >= 256); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
+ __analyzer_eval (u.i >= 256); /* { dg-warning "TRUE" } */
__analyzer_eval (u.i == 256); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
/* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/analyzer/loop-3.c b/gcc/testsuite/gcc.dg/analyzer/loop-3.c
index 1d01771d7cb..0bcf7074623 100644
--- a/gcc/testsuite/gcc.dg/analyzer/loop-3.c
+++ b/gcc/testsuite/gcc.dg/analyzer/loop-3.c
@@ -6,11 +6,8 @@ void test(int c)
char *buffer = (char*)malloc(256);
for (i=0; i<255; i++) {
- buffer[i] = c; /* { dg-warning "use after 'free' of 'buffer'" } */
- /* BUG: the malloc could have failed
- TODO: the checker doesn't yet pick up on this, perhaps
- due to the pointer arithmetic not picking up on the
- state */
+ buffer[i] = c; /* { dg-warning "use after 'free' of 'buffer'" "use after free" { xfail *-*-* } } */
+ /* { dg-warning "possibly-NULL 'buffer'" "deref of unchecked" { target *-*-* } .-1 } */
free(buffer); /* { dg-warning "double-'free' of 'buffer'" } */
}
diff --git a/gcc/testsuite/gcc.dg/analyzer/loop-4.c b/gcc/testsuite/gcc.dg/analyzer/loop-4.c
index e5767de1f96..b66a3459437 100644
--- a/gcc/testsuite/gcc.dg/analyzer/loop-4.c
+++ b/gcc/testsuite/gcc.dg/analyzer/loop-4.c
@@ -1,6 +1,3 @@
-// FIXME:
-/* { dg-additional-options "-fno-analyzer-state-purge" } */
-
/* Example of nested loops. */
#include "analyzer-decls.h"
@@ -13,8 +10,7 @@ void test(void)
for (i=0; i<256; i++) {
- __analyzer_eval (i >= 0); /* { dg-warning "TRUE" "true" } */
- /* { dg-warning "UNKNOWN" "unknown" { target *-*-* } .-1 } */
+ __analyzer_eval (i >= 0); /* { dg-warning "TRUE" } */
__analyzer_eval (i < 256); /* { dg-warning "TRUE" } */
@@ -23,7 +19,9 @@ void test(void)
__analyzer_eval (j >= 0); /* { dg-warning "TRUE" "true" } */
/* { dg-warning "UNKNOWN" "unknown" { target *-*-* } .-1 } */
- __analyzer_eval (j < 256); /* { dg-warning "TRUE" } */
+ __analyzer_eval (j < 256); /* { dg-warning "TRUE" "true" } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+ /* TODO(xfail^^^): should report TRUE twice. */
__analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
@@ -32,7 +30,8 @@ void test(void)
__analyzer_eval (k >= 0); /* { dg-warning "TRUE" "true" } */
/* { dg-warning "UNKNOWN" "unknown" { target *-*-* } .-1 } */
- __analyzer_eval (k < 256); /* { dg-warning "TRUE" } */
+ __analyzer_eval (k < 256); /* { dg-warning "TRUE" "true" } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
__analyzer_dump_exploded_nodes (0); /* { dg-warning "4 processed enodes" } */
}
diff --git a/gcc/testsuite/gcc.dg/analyzer/loop-n-down-to-1-by-1.c b/gcc/testsuite/gcc.dg/analyzer/loop-n-down-to-1-by-1.c
new file mode 100644
index 00000000000..e02a849d4bb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/loop-n-down-to-1-by-1.c
@@ -0,0 +1,35 @@
+#include "analyzer-decls.h"
+
+void test(int n)
+{
+ int i;
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+
+ for (i = n; i > 0; i--) {
+ __analyzer_eval (i > 0); /* { dg-warning "TRUE" "true" } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+ /* TODO(xfail^^^): should report TRUE twice. */
+
+ __analyzer_eval (i == n); /* { dg-warning "TRUE" "1st" } */
+ /* { dg-warning "FALSE" "2nd" { xfail *-*-* } .-1 } */
+ /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-2 } */
+ /* TODO(xfail^^^): ideally we ought to figure out i > 0 after 1st iteration. */
+
+ __analyzer_eval (i <= n); /* { dg-warning "TRUE" "1st" } */
+ /* { dg-warning "TRUE" "2nd" { xfail *-*-* } } */
+ /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-2 } */
+ /* TODO(xfail^^^): ideally we ought to figure out i >= 0 for all iterations. */
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
+ }
+
+ __analyzer_eval (i <= 0); /* { dg-warning "TRUE" "true" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+
+ __analyzer_eval (i == 0); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
+ /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
+ /* TODO(xfail^^^): it only figures out i >= 256, rather than i == 256. */
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/loop-start-down-to-end-by-1.c b/gcc/testsuite/gcc.dg/analyzer/loop-start-down-to-end-by-1.c
new file mode 100644
index 00000000000..3513bf42347
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/loop-start-down-to-end-by-1.c
@@ -0,0 +1,35 @@
+#include "analyzer-decls.h"
+
+void test(int start, int end, int step)
+{
+ int i;
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+
+ for (i = start; i > end; i --) {
+ __analyzer_eval (i > end); /* { dg-warning "TRUE" "true" } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+ /* TODO(xfail^^^): should report TRUE twice. */
+
+ __analyzer_eval (i == start); /* { dg-warning "TRUE" "1st" } */
+ /* { dg-warning "FALSE" "2nd" { xfail *-*-* } .-1 } */
+ /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-2 } */
+ /* TODO(xfail^^^): ideally we ought to figure out i > 0 after 1st iteration. */
+
+ __analyzer_eval (i <= start); /* { dg-warning "TRUE" "true" } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+ /* TODO(xfail^^^): should report TRUE twice. */
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
+ }
+
+ __analyzer_eval (i >= end); /* { dg-warning "TRUE" "true" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+
+ // FIXME: do we know this? What if we overshoot?
+ __analyzer_eval (i == end); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
+ /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
+ /* TODO(xfail^^^): it only figures out i >= 256, rather than i == 256. */
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/loop-start-down-to-end-by-step.c b/gcc/testsuite/gcc.dg/analyzer/loop-start-down-to-end-by-step.c
new file mode 100644
index 00000000000..2692c503b5c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/loop-start-down-to-end-by-step.c
@@ -0,0 +1,30 @@
+#include "analyzer-decls.h"
+
+void test(int start, int end, int step)
+{
+ int i;
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+
+ for (i = start; i > end; i -= step) {
+ __analyzer_eval (i > end); /* { dg-warning "TRUE" "true" } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+ /* TODO(xfail^^^): should report TRUE twice. */
+
+ __analyzer_eval (i == start); /* { dg-warning "TRUE" "1st" } */
+ /* { dg-warning "FALSE" "2nd" { xfail *-*-* } .-1 } */
+ /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-2 } */
+ /* TODO(xfail^^^): ideally we ought to figure out i > 0 after 1st iteration. */
+
+ /* We don't know the direction of step. */
+ __analyzer_eval (i <= start); /* { dg-warning "TRUE" "true" } */
+ /* { dg-warning "UNKNOWN" "unknown" { target *-*-* } .-1 } */
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
+ }
+
+ __analyzer_eval (i <= end); /* { dg-warning "TRUE" "true" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/loop-start-to-end-by-step.c b/gcc/testsuite/gcc.dg/analyzer/loop-start-to-end-by-step.c
new file mode 100644
index 00000000000..3fc1362d1cf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/loop-start-to-end-by-step.c
@@ -0,0 +1,36 @@
+#include "analyzer-decls.h"
+
+void test(int start, int end, int step)
+{
+ int i;
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+
+ for (i = start; i < end; i += step) {
+ __analyzer_eval (i < end); /* { dg-warning "TRUE" "true" } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+ /* TODO(xfail^^^): should report TRUE twice. */
+
+ __analyzer_eval (i == start); /* { dg-warning "TRUE" "1st" } */
+ /* { dg-warning "FALSE" "2nd" { xfail *-*-* } .-1 } */
+ /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-2 } */
+ /* TODO(xfail^^^): ideally we ought to figure out i > 0 after 1st iteration. */
+
+ /* We don't know the direction of step. */
+ __analyzer_eval (i >= start); /* { dg-warning "TRUE" "true" } */
+ /* { dg-warning "UNKNOWN" "unknown" { target *-*-* } .-1 } */
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
+ }
+
+ // FIXME: do we know this? What about direction of step?
+ __analyzer_eval (i >= end); /* { dg-warning "TRUE" "true" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+
+ // FIXME: do we know this? What if we overshoot?
+ __analyzer_eval (i == end); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
+ /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
+ /* TODO(xfail^^^): it only figures out i >= 256, rather than i == 256. */
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/loop-start-up-to-end-by-1.c b/gcc/testsuite/gcc.dg/analyzer/loop-start-up-to-end-by-1.c
new file mode 100644
index 00000000000..ca6a862092c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/loop-start-up-to-end-by-1.c
@@ -0,0 +1,34 @@
+#include "analyzer-decls.h"
+
+void test(int start, int end)
+{
+ int i;
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+
+ for (i = start; i < end; i++) {
+ __analyzer_eval (i < end); /* { dg-warning "TRUE" "true" } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+ /* TODO(xfail^^^): should report TRUE twice. */
+
+ __analyzer_eval (i == start); /* { dg-warning "TRUE" "1st" } */
+ /* { dg-warning "FALSE" "2nd" { xfail *-*-* } .-1 } */
+ /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-2 } */
+ /* TODO(xfail^^^): ideally we ought to figure out i > 0 after 1st iteration. */
+
+ __analyzer_eval (i >= start); /* { dg-warning "TRUE" "true" } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+ /* TODO(xfail^^^): should report TRUE twice. */
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
+ }
+
+ __analyzer_eval (i >= end); /* { dg-warning "TRUE" "true" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
+
+ __analyzer_eval (i == end); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
+ /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
+ /* TODO(xfail^^^): it only figures out i >= end, rather than i == end. */
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/loop.c b/gcc/testsuite/gcc.dg/analyzer/loop.c
index 37b757bf8f4..c4cfd88c912 100644
--- a/gcc/testsuite/gcc.dg/analyzer/loop.c
+++ b/gcc/testsuite/gcc.dg/analyzer/loop.c
@@ -1,5 +1,3 @@
-/* { dg-additional-options "-fno-analyzer-state-purge" } */
-
#include "analyzer-decls.h"
void test(void)
@@ -12,15 +10,12 @@ void test(void)
__analyzer_eval (i < 256); /* { dg-warning "TRUE" } */
/* (should report TRUE twice). */
- __analyzer_eval (i == 0); /* { dg-warning "TRUE" "1st" } */
+ __analyzer_eval (i == 0); /* { dg-warning "TRUE" } */
/* { dg-warning "FALSE" "2nd" { xfail *-*-* } .-1 } */
/* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-2 } */
/* TODO(xfail^^^): ideally we ought to figure out i > 0 after 1st iteration. */
- __analyzer_eval (i >= 0); /* { dg-warning "TRUE" "1st" } */
- /* { dg-warning "TRUE" "2nd" { xfail *-*-* } } */
- /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-2 } */
- /* TODO(xfail^^^): ideally we ought to figure out i >= 0 for all iterations. */
+ __analyzer_eval (i >= 0); /* { dg-warning "TRUE" } */
__analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
}
diff --git a/gcc/testsuite/gcc.dg/analyzer/malloc-1.c b/gcc/testsuite/gcc.dg/analyzer/malloc-1.c
index 3024e546137..c3e1330ec6a 100644
--- a/gcc/testsuite/gcc.dg/analyzer/malloc-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/malloc-1.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target alloca } */
+
#include <alloca.h>
#include <stdlib.h>
@@ -358,7 +360,7 @@ void test_30 (void)
struct link tmp;
tmp.m_ptr = (struct link *)malloc (sizeof (struct link)); /* { dg-message "allocated here" } */
} /* { dg-warning "leak of 'tmp.m_ptr'" } */
-/* { dg-bogus "leak of '<unknown>'" "" { xfail *-*-* } .-1 } */
+/* { dg-bogus "leak of '<unknown>'" "leak of unknown" { target *-*-* } .-1 } */
void test_31 (void)
{
@@ -366,7 +368,7 @@ void test_31 (void)
void *ptr = malloc (sizeof (struct link)); /* { dg-message "allocated here" } */
tmp.m_ptr = (struct link *)ptr;
} /* { dg-warning "leak of 'ptr'" } */
-/* { dg-bogus "leak of 'tmp.m_ptr'" "" { xfail *-*-* } .-1 } */
+/* { dg-bogus "leak of 'tmp.m_ptr'" "" { target *-*-* } .-1 } */
void test_32 (void)
{
@@ -505,8 +507,7 @@ void test_42c (void)
void *p = malloc (1024);
void *q = p + 64;
free (q - 64); /* this is probably OK. */
-} /* { dg-bogus "leak of 'p'" "" { xfail *-*-* } } */
-// TODO(xfail)
+} /* { dg-bogus "leak of 'p'" } */
#if 0
void test_31 (void *p)
@@ -529,10 +530,8 @@ struct link global_link;
void test_43 (void)
{
global_link.m_ptr = malloc (sizeof (struct link)); /* { dg-message "allocated here" } */
- global_link.m_ptr = NULL;
-} /* { dg-warning "leak of '<unknown>'" } */
-/* TODO: should be more precise than just '<unknown>', and
- ideally would be at the assigment to NULL. */
+ global_link.m_ptr = NULL; /* { dg-warning "leak of 'global_link.m_ptr'" } */
+}
struct link *global_ptr;
@@ -589,3 +588,16 @@ void test_48 (void)
int *p = NULL; /* { dg-message "'p' is NULL" } */
*p = 1; /* { dg-warning "dereference of NULL 'p'" } */
}
+
+/* As test_48, but where the assignment of NULL is not at the start of a BB. */
+
+int test_49 (int i)
+{
+ int *p;
+ int x;
+
+ x = i * 2;
+ p = NULL; /* { dg-message "'p' is NULL" } */
+ *p = 1; /* { dg-warning "dereference of NULL 'p'" } */
+ return x;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/malloc-4.c b/gcc/testsuite/gcc.dg/analyzer/malloc-4.c
index c9c275aa491..908bb28ee50 100644
--- a/gcc/testsuite/gcc.dg/analyzer/malloc-4.c
+++ b/gcc/testsuite/gcc.dg/analyzer/malloc-4.c
@@ -10,11 +10,11 @@ void *hv (struct foo **tm)
*tm = p;
if (!p)
abort ();
- return p; /* { dg-warning "leak of 'tm'" } */
+ return p;
}
void a5 (void)
{
struct bar *qb = NULL;
hv (&qb);
-} /* { dg-warning "leak of '\\(struct foo \\*\\)qb'" } */
+} /* { dg-warning "leak of 'qb'" } */
diff --git a/gcc/testsuite/gcc.dg/analyzer/malloc-in-loop.c b/gcc/testsuite/gcc.dg/analyzer/malloc-in-loop.c
new file mode 100644
index 00000000000..a8c85a9c618
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/malloc-in-loop.c
@@ -0,0 +1,19 @@
+#include <stdlib.h>
+#include "analyzer-decls.h"
+
+extern void foo (int *);
+
+void test (int n)
+{
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+
+ for (int i = 0; i < n; i++)
+ {
+ int *ptr = (int *)malloc (sizeof (int) * i);
+ foo (ptr);
+ free (ptr);
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
+ }
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/malloc-ipa-8-double-free.c b/gcc/testsuite/gcc.dg/analyzer/malloc-ipa-8-double-free.c
index f86e8ac72d7..cdf5ac18324 100644
--- a/gcc/testsuite/gcc.dg/analyzer/malloc-ipa-8-double-free.c
+++ b/gcc/testsuite/gcc.dg/analyzer/malloc-ipa-8-double-free.c
@@ -61,111 +61,133 @@ void test (int i)
| | |
| | (2) calling 'make_boxed_int' from 'test'
|
- +--> 'make_boxed_int': events 3-6
+ +--> 'make_boxed_int': events 3-4
|
| NN | make_boxed_int (int i)
| | ^~~~~~~~~~~~~~
| | |
| | (3) entry to 'make_boxed_int'
- |......
+ | NN | {
+ | NN | boxed_int *result = (boxed_int *)wrapped_malloc (sizeof (boxed_int));
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | |
+ | | (4) calling 'wrapped_malloc' from 'make_boxed_int'
+ |
+ +--> 'wrapped_malloc': events 5-6
+ |
+ | NN | void *wrapped_malloc (size_t size)
+ | | ^~~~~~~~~~~~~~
+ | | |
+ | | (5) entry to 'wrapped_malloc'
+ | NN | {
+ | NN | return malloc (size);
+ | | ~~~~~~~~~~~~~
+ | | |
+ | | (6) allocated here (state of '<unknown>': 'start' -> 'unchecked', NULL origin)
+ |
+ <------+
+ |
+ 'make_boxed_int': events 7-10
+ |
+ | NN | boxed_int *result = (boxed_int *)wrapped_malloc (sizeof (boxed_int));
+ | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | |
+ | | (7) returning to 'make_boxed_int' from 'wrapped_malloc'
| NN | if (!result)
- | | ~
+ | | ~
| | |
- | | (4) following 'false' branch (when 'result' is non-NULL)...
+ | | (8) assuming 'result' is non-NULL (state of 'result': 'unchecked' -> 'nonnull', NULL origin)
+ | | (9) following 'false' branch (when 'result' is non-NULL)...
| NN | abort ();
| NN | result->i = i;
- | | ~~~~~~~~~~~~~
+ | | ~~~~~~~~~~~~~
| | |
- | | (5) ...to here
- | NN | return result;
- | | ~~~~~~
- | | |
- | | (6) state of '<return-value>': 'start' -> 'nonnull' (origin: NULL)
+ | | (10) ...to here
|
<------+
|
- 'test': events 7-8
+ 'test': events 11-12
|
| NN | boxed_int *obj = make_boxed_int (i);
| | ^~~~~~~~~~~~~~~~~~
| | |
- | | (7) returning to 'test' from 'make_boxed_int'
+ | | (11) returning to 'test' from 'make_boxed_int'
| NN |
| NN | free_boxed_int (obj);
| | ~~~~~~~~~~~~~~~~~~~~
| | |
- | | (8) calling 'free_boxed_int' from 'test'
+ | | (12) calling 'free_boxed_int' from 'test'
|
- +--> 'free_boxed_int': events 9-10
+ +--> 'free_boxed_int': events 13-14
|
| NN | free_boxed_int (boxed_int *bi)
| | ^~~~~~~~~~~~~~
| | |
- | | (9) entry to 'free_boxed_int'
+ | | (13) entry to 'free_boxed_int'
| NN | {
| NN | wrapped_free (bi);
| | ~~~~~~~~~~~~~~~~~
| | |
- | | (10) calling 'wrapped_free' from 'free_boxed_int'
+ | | (14) calling 'wrapped_free' from 'free_boxed_int'
|
- +--> 'wrapped_free': events 11-12
+ +--> 'wrapped_free': events 15-16
|
| NN | void wrapped_free (void *ptr)
| | ^~~~~~~~~~~~
| | |
- | | (11) entry to 'wrapped_free'
+ | | (15) entry to 'wrapped_free'
| NN | {
| NN | free (ptr);
| | ~~~~~~~~~~
| | |
- | | (12) first 'free' here (state of 'ptr': 'nonnull' -> 'freed', origin: NULL)
+ | | (16) first 'free' here (state of 'ptr': 'nonnull' -> 'freed', NULL origin)
|
<------+
|
- 'free_boxed_int': event 13
+ 'free_boxed_int': event 17
|
| NN | wrapped_free (bi);
| | ^~~~~~~~~~~~~~~~~
| | |
- | | (13) returning to 'free_boxed_int' from 'wrapped_free'
+ | | (17) returning to 'free_boxed_int' from 'wrapped_free'
|
<------+
|
- 'test': events 14-15
+ 'test': events 18-19
|
| NN | free_boxed_int (obj);
| | ^~~~~~~~~~~~~~~~~~~~
| | |
- | | (14) returning to 'test' from 'free_boxed_int'
+ | | (18) returning to 'test' from 'free_boxed_int'
| NN |
| NN | free_boxed_int (obj);
| | ~~~~~~~~~~~~~~~~~~~~
| | |
- | | (15) passing freed pointer 'obj' in call to 'free_boxed_int' from 'test'
+ | | (19) passing freed pointer 'obj' in call to 'free_boxed_int' from 'test'
|
- +--> 'free_boxed_int': events 16-17
+ +--> 'free_boxed_int': events 20-21
|
| NN | free_boxed_int (boxed_int *bi)
| | ^~~~~~~~~~~~~~
| | |
- | | (16) entry to 'free_boxed_int'
+ | | (20) entry to 'free_boxed_int'
| NN | {
| NN | wrapped_free (bi);
| | ~~~~~~~~~~~~~~~~~
| | |
- | | (17) passing freed pointer 'bi' in call to 'wrapped_free' from 'free_boxed_int'
+ | | (21) passing freed pointer 'bi' in call to 'wrapped_free' from 'free_boxed_int'
|
- +--> 'wrapped_free': events 18-19
+ +--> 'wrapped_free': events 22-23
|
| NN | void wrapped_free (void *ptr)
| | ^~~~~~~~~~~~
| | |
- | | (18) entry to 'wrapped_free'
+ | | (22) entry to 'wrapped_free'
| NN | {
| NN | free (ptr);
| | ~~~~~~~~~~
| | |
- | | (19) second 'free' here; first 'free' was at (12) ('ptr' is in state 'freed')
+ | | (23) second 'free' here; first 'free' was at (16) ('ptr' is in state 'freed')
|
{ dg-end-multiline-output "" } */
diff --git a/gcc/testsuite/gcc.dg/analyzer/malloc-ipa-8-unchecked.c b/gcc/testsuite/gcc.dg/analyzer/malloc-ipa-8-unchecked.c
index a778a29852f..320044753a1 100644
--- a/gcc/testsuite/gcc.dg/analyzer/malloc-ipa-8-unchecked.c
+++ b/gcc/testsuite/gcc.dg/analyzer/malloc-ipa-8-unchecked.c
@@ -1,6 +1,6 @@
/* Example of a multilevel wrapper around malloc, with an unchecked write. */
-/* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fanalyzer-checker=malloc -fdiagnostics-show-caret -fanalyzer-verbose-state-changes" } */
+/* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fanalyzer-checker=malloc -fdiagnostics-show-caret" } */
/* { dg-enable-nn-line-numbers "" } */
#include <stdlib.h>
@@ -49,7 +49,7 @@ make_boxed_int (int i)
| NN | return malloc (size);
| | ~~~~~~~~~~~~~
| | |
- | | (4) this call could return NULL (state of '<return-value>': 'start' -> 'unchecked', origin: NULL)
+ | | (4) this call could return NULL
|
<------+
|
@@ -62,6 +62,6 @@ make_boxed_int (int i)
| NN | result->i = i;
| | ~~~~~~~~~~~~~
| | |
- | | (6) 'result' could be NULL: unchecked value from (4) ('result' is in state 'unchecked')
+ | | (6) 'result' could be NULL: unchecked value from (4)
|
{ dg-end-multiline-output "" } */
diff --git a/gcc/testsuite/gcc.dg/analyzer/malloc-paths-8.c b/gcc/testsuite/gcc.dg/analyzer/malloc-paths-8.c
index 10b97a05402..35c9385b206 100644
--- a/gcc/testsuite/gcc.dg/analyzer/malloc-paths-8.c
+++ b/gcc/testsuite/gcc.dg/analyzer/malloc-paths-8.c
@@ -1,4 +1,5 @@
/* { dg-additional-options "-fanalyzer-transitivity" } */
+/* { dg-require-effective-target alloca } */
#include <stddef.h>
#include <alloca.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/malloc-paths-9.c b/gcc/testsuite/gcc.dg/analyzer/malloc-paths-9.c
index c5ff96e5644..a3cacc07fab 100644
--- a/gcc/testsuite/gcc.dg/analyzer/malloc-paths-9.c
+++ b/gcc/testsuite/gcc.dg/analyzer/malloc-paths-9.c
@@ -112,8 +112,7 @@ int test_3 (int x, int y)
free (ptr); /* No double-'free' warning: we've already attempted
to dereference it above. */
return *ptr; /* { dg-warning "use after 'free' of 'ptr'" "use-after-free" } */
- // TODO: two warnings here: one is from sm-malloc, the other from region model
- /* { dg-warning "leak of 'ptr'" "leak" { target *-*-* } .-2 } */
+ /* { dg-warning "leak of 'ptr'" "leak" { target *-*-* } .-1 } */
}
/* "dereference of possibly-NULL 'ptr'". */
@@ -241,59 +240,3 @@ int test_3 (int x, int y)
| | (7) 'ptr' leaks here; was allocated at (1)
|
{ dg-end-multiline-output "" } */
-
-/* "use after 'free' of 'ptr'". */
-/* { dg-begin-multiline-output "" }
- NN | *ptr = 19;
- | ~~~~~^~~~
- 'test_3': events 1-3
- |
- | NN | if (x)
- | | ^
- | | |
- | | (1) following 'true' branch (when 'x != 0')...
- | NN | free (ptr);
- | | ~~~~~~~~~~
- | | |
- | | (2) ...to here
- | NN |
- | NN | *ptr = 19;
- | | ~~~~~~~~~
- | | |
- | | (3) use after 'free' of 'ptr' here
- |
- { dg-end-multiline-output "" } */
-
-/* "use after 'free' of 'ptr'". */
-/* { dg-begin-multiline-output "" }
- NN | return *ptr;
- | ^~~~
- 'test_3': events 1-5
- |
- | NN | if (x)
- | | ^
- | | |
- | | (1) following 'false' branch (when 'x == 0')...
- |......
- | NN | *ptr = 19;
- | | ~~~~~~~~~
- | | |
- | | (2) ...to here
- |......
- | NN | if (y)
- | | ~
- | | |
- | | (3) following 'true' branch (when 'y != 0')...
- | NN | free (ptr);
- | | ~~~~~~~~~~
- | | |
- | | (4) ...to here
- | NN | to dereference it above
- | NN | return *ptr;
- | | ~~~~
- | | |
- | | (5) use after 'free' of 'ptr' here
- |
- { dg-end-multiline-output "" } */
-/* TODO: this is really a duplicate; can we either eliminate it, or
- improve the path? */
diff --git a/gcc/testsuite/gcc.dg/analyzer/malloc-vs-local-1a.c b/gcc/testsuite/gcc.dg/analyzer/malloc-vs-local-1a.c
index d47dfa8b2c0..4e70694a33d 100644
--- a/gcc/testsuite/gcc.dg/analyzer/malloc-vs-local-1a.c
+++ b/gcc/testsuite/gcc.dg/analyzer/malloc-vs-local-1a.c
@@ -11,7 +11,7 @@ do_stuff (int *p, int n)
int sum = 0;
int i;
for (i = 0; i < n; i++)
- p[i] = i;
+ p[i] = i; /* { dg-warning "dereference of possibly-NULL 'p'" } */
for (i = 0; i < n; i++)
sum += foo (p[i]); /* { dg-bogus "uninitialized" } */
return sum;
@@ -48,10 +48,10 @@ int test_repeated_predicate_1 (int n)
result = do_stuff (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
- // FIXME: why 3 here?
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
- // FIXME: why 3 here?
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "5 processed enodes" } */
+ // FIXME: why 5 here?
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "5 processed enodes" } */
+ // FIXME: why 5 here?
if (n > 10)
free (ptr); /* { dg-bogus "not on the heap" } */
@@ -105,8 +105,8 @@ int test_explicit_flag (int n)
result = do_stuff (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
- // FIXME: why 3 here?
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "5 processed enodes" } */
+ // FIXME: why 5 here?
if (need_to_free)
free (ptr); /* { dg-bogus "not on the heap" } */
@@ -131,8 +131,8 @@ int test_pointer_comparison (int n)
result = do_stuff (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
- // FIXME: why 3 here?
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "5 processed enodes" } */
+ // FIXME: why 5 here?
if (ptr != buf)
free (ptr); /* { dg-bogus "not on the heap" } */
@@ -169,8 +169,8 @@ int test_initial_flag (int n)
result = do_stuff (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "5 processed enodes" } */
- // FIXME: why 5 here?
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "6 processed enodes" } */
+ // FIXME: why 6 here?
if (n > 10)
free (ptr); /* { dg-bogus "not on the heap" } */
diff --git a/gcc/testsuite/gcc.dg/analyzer/malloc-vs-local-2.c b/gcc/testsuite/gcc.dg/analyzer/malloc-vs-local-2.c
index 89bd511549f..9001fe66cd7 100644
--- a/gcc/testsuite/gcc.dg/analyzer/malloc-vs-local-2.c
+++ b/gcc/testsuite/gcc.dg/analyzer/malloc-vs-local-2.c
@@ -31,13 +31,13 @@ int test_repeated_predicate_1 (int n)
int sum = 0;
int i;
for (i = 0; i < n; i++)
- p[i] = i;
+ p[i] = i; /* { dg-warning "dereference of possibly-NULL" } */
for (i = 0; i < n; i++)
sum += foo (p[i]); /* { dg-bogus "uninitialized" } */
result = sum;
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
if (n > 10)
free (ptr); /* { dg-bogus "not on the heap" } */
@@ -65,11 +65,11 @@ int test_repeated_predicate_1a (int n)
int sum = 0;
int i;
for (i = 0; i < n; i++)
- p[i] = i;
+ p[i] = i; /* { dg-warning "dereference of possibly-NULL" } */
result = sum;
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
if (n > 10)
free (ptr); /* { dg-bogus "not on the heap" } */
@@ -126,13 +126,13 @@ int test_explicit_flag (int n)
int sum = 0;
int i;
for (i = 0; i < n; i++)
- p[i] = i;
+ p[i] = i; /* { dg-warning "dereference of possibly-NULL" } */
for (i = 0; i < n; i++)
sum += foo (p[i]); /* { dg-bogus "uninitialized" } */
result = sum;
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
if (need_to_free)
free (ptr); /* { dg-bogus "not on the heap" } */
@@ -160,13 +160,13 @@ int test_pointer_comparison (int n)
int sum = 0;
int i;
for (i = 0; i < n; i++)
- p[i] = i;
+ p[i] = i; /* { dg-warning "dereference of possibly-NULL" } */
for (i = 0; i < n; i++)
sum += foo (p[i]); /* { dg-bogus "uninitialized" } */
result = sum;
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
if (ptr != buf)
free (ptr); /* { dg-bogus "not on the heap" } */
diff --git a/gcc/testsuite/gcc.dg/analyzer/malloc-vs-local-3.c b/gcc/testsuite/gcc.dg/analyzer/malloc-vs-local-3.c
index d20a2753bb8..0196389d3a5 100644
--- a/gcc/testsuite/gcc.dg/analyzer/malloc-vs-local-3.c
+++ b/gcc/testsuite/gcc.dg/analyzer/malloc-vs-local-3.c
@@ -30,16 +30,15 @@ int test_1 (int n)
int sum = 0;
int i;
for (i = 0; i < n; i++)
- p[i] = i;
+ p[i] = i; /* { dg-warning "dereference of possibly-NULL" } */
for (i = 0; i < n; i++)
sum += foo (p[i]); /* { dg-bogus "uninitialized" } */
result = sum;
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
- return result; /* { dg-message "leak of 'p'" } */
- /* FIXME: should this be 'ptr'? */
+ return result; /* { dg-message "leak of 'p'|leak of 'ptr'" } */
}
/* A simpler version of the above. */
diff --git a/gcc/testsuite/gcc.dg/analyzer/memset-1.c b/gcc/testsuite/gcc.dg/analyzer/memset-1.c
new file mode 100644
index 00000000000..830c1105f46
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/memset-1.c
@@ -0,0 +1,100 @@
+#include <string.h>
+#include "analyzer-decls.h"
+
+/* Zero-fill of uninitialized buffer. */
+
+void test_1 (void)
+{
+ char buf[256];
+ memset (buf, 0, 256);
+ __analyzer_eval (buf[42] == 0); /* { dg-warning "TRUE" } */
+}
+
+/* As above, but with __builtin_memset. */
+
+void test_1a (void)
+{
+ char buf[256];
+ __builtin_memset (buf, 0, 256);
+ __analyzer_eval (buf[42] == 0); /* { dg-warning "TRUE" } */
+}
+
+/* Zero-fill of partially initialized buffer. */
+
+void test_2 (void)
+{
+ char buf[256];
+ buf[42] = 'A';
+ __analyzer_eval (buf[42] == 'A'); /* { dg-warning "TRUE" } */
+ memset (buf, 0, 256);
+ __analyzer_eval (buf[42] == '\0'); /* { dg-warning "TRUE" } */
+}
+
+/* A "memset" with known non-zero value. */
+
+void test_3 (int val)
+{
+ char buf[256];
+ memset (buf, 'A', 256);
+ /* We currently merely mark such regions as "unknown", so querying
+ values within them yields UNKNOWN when ideally it would be TRUE. */
+ __analyzer_eval (buf[42] == 'A'); /* { dg-warning "TRUE" "known nonzero" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
+}
+
+/* A "memset" with unknown value. */
+
+void test_4 (int val)
+{
+ char buf[256];
+ memset (buf, val, 256);
+ /* We currently merely mark such regions as "unknown", so querying
+ values within them yields UNKNOWN when ideally it would be TRUE. */
+ __analyzer_eval (buf[42] == (char)val); /* { dg-warning "TRUE" "known nonzero" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
+}
+
+/* A "memset" with unknown num bytes. */
+
+void test_5 (int n)
+{
+ char buf[256];
+ buf[42] = 'A';
+ __analyzer_eval (buf[42] == 'A'); /* { dg-warning "TRUE" } */
+ memset (buf, 0, n);
+
+ /* We can't know if buf[42] was written to or not. */
+ __analyzer_eval (buf[42] == 'A'); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (buf[42] == '\0'); /* { dg-warning "UNKNOWN" } */
+}
+
+/* A "memset" with unknown value, but with zero size. */
+
+static size_t __attribute__((noinline))
+get_zero (void)
+{
+ return 0;
+}
+
+void test_6 (int val)
+{
+ char buf[256];
+ buf[42] = 'A';
+ memset (buf, 'B', get_zero ());
+ __analyzer_eval (buf[42] == 'A'); /* { dg-warning "TRUE" } */
+}
+
+/* A "memset" of known size that's not the full buffer. */
+
+void test_7 (void)
+{
+ char buf[256];
+ buf[128] = 'A';
+ memset (buf, 0, 128);
+ /* We currently merely mark the whole region as "unknown", so querying
+ values within them yields UNKNOWN. */
+ __analyzer_eval (buf[127] == '\0'); /* { dg-warning "TRUE" "known nonzero" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
+ __analyzer_eval (buf[128] == 'A'); /* { dg-warning "TRUE" "known nonzero" { xfail *-*-* } } */
+ /* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-1 } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/paths-3.c b/gcc/testsuite/gcc.dg/analyzer/paths-3.c
index 9bd30301690..b5ab810e536 100644
--- a/gcc/testsuite/gcc.dg/analyzer/paths-3.c
+++ b/gcc/testsuite/gcc.dg/analyzer/paths-3.c
@@ -13,7 +13,7 @@ int test_1 (int a, int b)
else
p = malloc (32);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
if (a > 5)
{
@@ -34,7 +34,7 @@ int test_2 (int a, int b)
else
p = malloc (32);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
if (a > 6) /* different condition */
{
diff --git a/gcc/testsuite/gcc.dg/analyzer/paths-4.c b/gcc/testsuite/gcc.dg/analyzer/paths-4.c
index 2f58763886c..b72e658739e 100644
--- a/gcc/testsuite/gcc.dg/analyzer/paths-4.c
+++ b/gcc/testsuite/gcc.dg/analyzer/paths-4.c
@@ -13,8 +13,8 @@ int test_1 (struct state *s)
__analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
while (1)
{
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enode" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enode" } */
/* TODO: why does the above need an extra stmt to merge state? */
do_stuff (s, s->mode);
}
@@ -25,13 +25,13 @@ int test_2 (struct state *s)
__analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
while (1)
{
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enode" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enode" } */
/* TODO: why does the above need an extra stmt to merge state? */
switch (s->mode)
{
case 0:
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enode" } */
do_stuff (s, 0);
break;
case 1:
diff --git a/gcc/testsuite/gcc.dg/analyzer/paths-6.c b/gcc/testsuite/gcc.dg/analyzer/paths-6.c
index 8220b8eff82..ef1a4e6c04d 100644
--- a/gcc/testsuite/gcc.dg/analyzer/paths-6.c
+++ b/gcc/testsuite/gcc.dg/analyzer/paths-6.c
@@ -89,7 +89,7 @@ void test_3 (int i)
break;
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enode" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
__analyzer_eval (f == 3); /* { dg-warning "TRUE" } */
__analyzer_eval (g == 4); /* { dg-warning "TRUE" } */
__analyzer_eval (h == 5); /* { dg-warning "TRUE" } */
@@ -108,7 +108,7 @@ void test_4 (int flag)
q = malloc (256);
p = malloc (256);
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enode" } */
free (p);
free (q);
}
diff --git a/gcc/testsuite/gcc.dg/analyzer/paths-7.c b/gcc/testsuite/gcc.dg/analyzer/paths-7.c
index 243b9635364..8caaee8a3fd 100644
--- a/gcc/testsuite/gcc.dg/analyzer/paths-7.c
+++ b/gcc/testsuite/gcc.dg/analyzer/paths-7.c
@@ -50,8 +50,7 @@ int test_2 (int flag, int *p, int n)
sum += foo (p[i]); /* { dg-bogus "uninitialized" } */
result = sum;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "5 processed enodes" } */
- // FIXME: why 5 here?
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
free (ptr); /* { dg-warning "double-'free' of 'ptr'" } */
return result;
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-simplified.c b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-simplified.c
new file mode 100644
index 00000000000..4a08f0f1f50
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-simplified.c
@@ -0,0 +1,22 @@
+/* { dg-do "compile" } */
+
+/* Minimal replacement of system headers. */
+#define NULL ((void *) 0)
+typedef struct _IO_FILE FILE;
+extern FILE *fopen(const char *__restrict __filename,
+ const char *__restrict __modes);
+extern int fclose (FILE *__stream);
+
+extern void unzRepair(const char* file, const char* fileOut, const char* fileOutTmp)
+{
+ FILE* fpZip = fopen(file, "rb");
+ FILE* fpOut = fopen(fileOut, "wb");
+ FILE* fpOutCD = fopen(fileOutTmp, "wb");
+ if (fpZip != NULL && fpOut != NULL) {
+ fclose(fpOutCD);
+ fclose(fpZip);
+ fclose(fpOut);
+ }
+} /* { dg-warning "leak of FILE 'fpZip'" "leak of fpZip" } */
+ /* { dg-warning "leak of FILE 'fpOut'" "leak of fpOut" { target *-*-* } .-1 } */
+ /* { dg-warning "leak of FILE 'fpOutCD'" "leak of fpOutCD" { target *-*-* } .-2 } */
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools.c b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools.c
new file mode 100644
index 00000000000..88ab5bf8c18
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools.c
@@ -0,0 +1,331 @@
+/* Integration test to ensure we issue FILE * leak diagnostics for
+ this particular non-trivial case.
+ Adapted from zlib/contrib/minizip/mztools.c, with all #includes
+ removed. */
+
+/* { dg-do "compile" } */
+
+/* Minimal replacement of system headers. */
+
+typedef __SIZE_TYPE__ size_t;
+#define NULL ((void *) 0)
+
+typedef struct _IO_FILE FILE;
+extern FILE *fopen(const char *__restrict __filename,
+ const char *__restrict __modes);
+extern size_t fread (void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __stream);
+extern size_t fwrite (const void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __s);
+extern int fclose (FILE *__stream);
+extern int remove (const char *__filename)
+ __attribute__ ((__nothrow__ , __leaf__));
+
+extern void *malloc (size_t __size)
+ __attribute__ ((__nothrow__ , __leaf__))
+ __attribute__ ((__malloc__));
+extern void free (void *__ptr)
+ __attribute__ ((__nothrow__ , __leaf__));
+
+extern size_t strlen (const char *__s)
+ __attribute__ ((__nothrow__ , __leaf__))
+ __attribute__ ((__pure__))
+ __attribute__ ((__nonnull__ (1)));
+
+/* Minimal replacement of zlib headers. */
+
+#define ZEXPORT
+typedef unsigned long uLong; /* 32 bits or more */
+#define Z_OK 0
+#define Z_ERRNO (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_MEM_ERROR (-4)
+
+/*
+ Additional tools for Minizip
+ Code: Xavier Roche '2004
+ License: Same as ZLIB (www.gzip.org)
+*/
+
+/* Code */
+
+#define READ_8(adr) ((unsigned char)*(adr))
+#define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) )
+#define READ_32(adr) ( READ_16(adr) | (READ_16((adr)+2) << 16) )
+
+#define WRITE_8(buff, n) do { \
+ *((unsigned char*)(buff)) = (unsigned char) ((n) & 0xff); \
+} while(0)
+#define WRITE_16(buff, n) do { \
+ WRITE_8((unsigned char*)(buff), n); \
+ WRITE_8(((unsigned char*)(buff)) + 1, (n) >> 8); \
+} while(0)
+#define WRITE_32(buff, n) do { \
+ WRITE_16((unsigned char*)(buff), (n) & 0xffff); \
+ WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \
+} while(0)
+
+extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered)
+const char* file;
+const char* fileOut;
+const char* fileOutTmp;
+uLong* nRecovered;
+uLong* bytesRecovered;
+{
+ int err = Z_OK;
+ FILE* fpZip = fopen(file, "rb");
+ FILE* fpOut = fopen(fileOut, "wb");
+ FILE* fpOutCD = fopen(fileOutTmp, "wb");
+ if (fpZip != NULL && fpOut != NULL) {
+ int entries = 0;
+ uLong totalBytes = 0;
+ char header[30];
+ char filename[1024];
+ char extra[1024];
+ int offset = 0;
+ int offsetCD = 0;
+ while ( fread(header, 1, 30, fpZip) == 30 ) {
+ int currentOffset = offset;
+
+ /* File entry */
+ if (READ_32(header) == 0x04034b50) {
+ unsigned int version = READ_16(header + 4);
+ unsigned int gpflag = READ_16(header + 6);
+ unsigned int method = READ_16(header + 8);
+ unsigned int filetime = READ_16(header + 10);
+ unsigned int filedate = READ_16(header + 12);
+ unsigned int crc = READ_32(header + 14); /* crc */
+ unsigned int cpsize = READ_32(header + 18); /* compressed size */
+ unsigned int uncpsize = READ_32(header + 22); /* uncompressed sz */
+ unsigned int fnsize = READ_16(header + 26); /* file name length */
+ unsigned int extsize = READ_16(header + 28); /* extra field length */
+ filename[0] = extra[0] = '\0';
+
+ /* Header */
+ if (fwrite(header, 1, 30, fpOut) == 30) {
+ offset += 30;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+
+ /* Filename */
+ if (fnsize > 0) {
+ if (fnsize < sizeof(filename)) {
+ if (fread(filename, 1, fnsize, fpZip) == fnsize) {
+ if (fwrite(filename, 1, fnsize, fpOut) == fnsize) {
+ offset += fnsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_STREAM_ERROR;
+ break;
+ }
+
+ /* Extra field */
+ if (extsize > 0) {
+ if (extsize < sizeof(extra)) {
+ if (fread(extra, 1, extsize, fpZip) == extsize) {
+ if (fwrite(extra, 1, extsize, fpOut) == extsize) {
+ offset += extsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+ /* Data */
+ {
+ int dataSize = cpsize;
+ if (dataSize == 0) {
+ dataSize = uncpsize;
+ }
+ if (dataSize > 0) {
+ char* data = malloc(dataSize);
+ if (data != NULL) {
+ if ((int)fread(data, 1, dataSize, fpZip) == dataSize) {
+ if ((int)fwrite(data, 1, dataSize, fpOut) == dataSize) {
+ offset += dataSize;
+ totalBytes += dataSize;
+ } else {
+ err = Z_ERRNO;
+ }
+ } else {
+ err = Z_ERRNO;
+ }
+ free(data);
+ if (err != Z_OK) {
+ break;
+ }
+ } else {
+ err = Z_MEM_ERROR;
+ break;
+ }
+ }
+ }
+
+ /* Central directory entry */
+ {
+ char header[46];
+ char* comment = "";
+ int comsize = (int) strlen(comment);
+ WRITE_32(header, 0x02014b50);
+ WRITE_16(header + 4, version);
+ WRITE_16(header + 6, version);
+ WRITE_16(header + 8, gpflag);
+ WRITE_16(header + 10, method);
+ WRITE_16(header + 12, filetime);
+ WRITE_16(header + 14, filedate);
+ WRITE_32(header + 16, crc);
+ WRITE_32(header + 20, cpsize);
+ WRITE_32(header + 24, uncpsize);
+ WRITE_16(header + 28, fnsize);
+ WRITE_16(header + 30, extsize);
+ WRITE_16(header + 32, comsize);
+ WRITE_16(header + 34, 0); /* disk # */
+ WRITE_16(header + 36, 0); /* int attrb */
+ WRITE_32(header + 38, 0); /* ext attrb */
+ WRITE_32(header + 42, currentOffset);
+ /* Header */
+ if (fwrite(header, 1, 46, fpOutCD) == 46) {
+ offsetCD += 46;
+
+ /* Filename */
+ if (fnsize > 0) {
+ if (fwrite(filename, 1, fnsize, fpOutCD) == fnsize) {
+ offsetCD += fnsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_STREAM_ERROR;
+ break;
+ }
+
+ /* Extra field */
+ if (extsize > 0) {
+ if (fwrite(extra, 1, extsize, fpOutCD) == extsize) {
+ offsetCD += extsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+ /* Comment field */
+ if (comsize > 0) {
+ if ((int)fwrite(comment, 1, comsize, fpOutCD) == comsize) {
+ offsetCD += comsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+ /* Success */
+ entries++;
+
+ } else {
+ break;
+ }
+ }
+
+ /* Final central directory */
+ {
+ int entriesZip = entries;
+ char header[22];
+ char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools";
+ int comsize = (int) strlen(comment);
+ if (entriesZip > 0xffff) {
+ entriesZip = 0xffff;
+ }
+ WRITE_32(header, 0x06054b50);
+ WRITE_16(header + 4, 0); /* disk # */
+ WRITE_16(header + 6, 0); /* disk # */
+ WRITE_16(header + 8, entriesZip); /* hack */
+ WRITE_16(header + 10, entriesZip); /* hack */
+ WRITE_32(header + 12, offsetCD); /* size of CD */
+ WRITE_32(header + 16, offset); /* offset to CD */
+ WRITE_16(header + 20, comsize); /* comment */
+
+ /* Header */
+ if (fwrite(header, 1, 22, fpOutCD) == 22) {
+
+ /* Comment field */
+ if (comsize > 0) {
+ if ((int)fwrite(comment, 1, comsize, fpOutCD) != comsize) {
+ err = Z_ERRNO;
+ }
+ }
+
+ } else {
+ err = Z_ERRNO;
+ }
+ }
+
+ /* Final merge (file + central directory) */
+ fclose(fpOutCD);
+ if (err == Z_OK) {
+ fpOutCD = fopen(fileOutTmp, "rb");
+ if (fpOutCD != NULL) {
+ int nRead;
+ char buffer[8192];
+ while ( (nRead = (int)fread(buffer, 1, sizeof(buffer), fpOutCD)) > 0) {
+ if ((int)fwrite(buffer, 1, nRead, fpOut) != nRead) {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+ fclose(fpOutCD);
+ }
+ }
+
+ /* Close */
+ fclose(fpZip);
+ fclose(fpOut);
+
+ /* Wipe temporary file */
+ (void)remove(fileOutTmp);
+
+ /* Number of recovered entries */
+ if (err == Z_OK) {
+ if (nRecovered != NULL) {
+ *nRecovered = entries;
+ }
+ if (bytesRecovered != NULL) {
+ *bytesRecovered = totalBytes;
+ }
+ }
+ } else {
+ err = Z_STREAM_ERROR;
+ }
+ return err; /* { dg-warning "leak of FILE 'fpZip'" "leak of fpZip" } */
+ /* { dg-warning "leak of FILE 'fpOut'" "leak of fpOut" { target *-*-* } .-1 } */
+ /* { dg-warning "leak of FILE 'fpOutCD'" "leak of fpOutCD" { target *-*-* } .-2 } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93382.c b/gcc/testsuite/gcc.dg/analyzer/pr93382.c
index dae32f5a2bb..210b97d1a47 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93382.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93382.c
@@ -13,8 +13,8 @@ ql (void)
{
int n1[1];
- fread (n1, sizeof (n1[0]), 1, fp); /* { dg-message "'n1' gets an unchecked value here" } */
- idx = n1[0]; /* { dg-message "'idx' has an unchecked value here (from 'n1')" */
+ fread (n1, sizeof (n1[0]), 1, fp); /* { dg-message "'n1' gets an unchecked value here" "" { xfail *-*-* } } */
+ idx = n1[0]; /* { dg-message "'idx' has an unchecked value here \\\(from 'n1'\\\)" "" { xfail *-*-* } } */
}
int arr[10];
@@ -23,5 +23,5 @@ int
pl (void)
{
ql ();
- return arr[idx]; /* { dg-warning "use of tainted value 'idx' in array lookup without bounds checking" } */
+ return arr[idx]; /* { dg-warning "use of tainted value 'idx' in array lookup without bounds checking" "" { xfail *-*-* } } */
}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93546.c b/gcc/testsuite/gcc.dg/analyzer/pr93546.c
index 432a6433be5..66f6805b07a 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93546.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93546.c
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-require-effective-target label_values } */
void
ch (int x1)
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93938.c b/gcc/testsuite/gcc.dg/analyzer/pr93938.c
new file mode 100644
index 00000000000..81d9983083f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93938.c
@@ -0,0 +1,13 @@
+/* Taken from gcc.dg/pr70022.c, adding -O1 to the options
+ (and -fanalyzer, implicitly). */
+
+/* { dg-do compile } */
+/* { dg-options "-w -Wno-psabi -O1" } */
+
+typedef int v4si __attribute__ ((vector_size (16)));
+
+int
+foo (v4si v)
+{
+ return v[~0UL];
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94099.c b/gcc/testsuite/gcc.dg/analyzer/pr94099.c
index a116c49f105..1d7a5d771d6 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr94099.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr94099.c
@@ -21,7 +21,8 @@ pl (void)
for (sc = 0; sc < 1; ++sc)
{
th.gk.hk = 0;
- th.gk.bg[sc] = 0; /* { dg-warning "uninitialized" "uninit-warning-removed" { xfail *-*-* } } */
+ th.gk.bg[sc] = 0; /* { dg-warning "dereference of NULL '0'" } */
+ // TODO: above message could be improved
l3 (&th);
}
}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94399.c b/gcc/testsuite/gcc.dg/analyzer/pr94399.c
new file mode 100644
index 00000000000..e897c04a007
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr94399.c
@@ -0,0 +1,13 @@
+#include <stdlib.h>
+
+#define _cleanup_(f) __attribute__((cleanup(f)))
+
+static inline void freep(void **p) {
+ free(*p);
+}
+
+void test(void) {
+ _cleanup_(freep) void *ptr;
+
+ ptr = malloc(3);
+} /* { dg-bogus "leak" } */
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94447.c b/gcc/testsuite/gcc.dg/analyzer/pr94447.c
index 1aecebba4ef..7c61a203067 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr94447.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr94447.c
@@ -6,5 +6,5 @@ struct foo
int test (void)
{
struct foo f = {};
- return *f.v;
+ return *f.v; /* { dg-warning "dereference of NULL" } */
}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94458.c b/gcc/testsuite/gcc.dg/analyzer/pr94458.c
new file mode 100644
index 00000000000..ad9bfc94ad4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr94458.c
@@ -0,0 +1,23 @@
+#include <stdlib.h>
+
+struct ret
+{
+ int **array;
+};
+
+struct ret *allocate_stuff(void)
+{
+ struct ret *ret;
+
+ ret = calloc(1, sizeof (struct ret));
+ if (!ret) {
+ abort();
+ }
+
+ ret->array = calloc (10, sizeof(int *));
+ if (!ret->array) {
+ abort();
+ }
+
+ return ret;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94640.c b/gcc/testsuite/gcc.dg/analyzer/pr94640.c
new file mode 100644
index 00000000000..9722a179fcd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr94640.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+
+int debug;
+
+int opencfgfile(const char *cfgfile, FILE **fd)
+{
+ if (cfgfile[0] != '\0') {
+
+ if ((*fd = fopen(cfgfile, "r")) != NULL) {
+ if (debug)
+ printf("Config file: --config\n");
+ }
+
+ }
+
+ return 2;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94688.c b/gcc/testsuite/gcc.dg/analyzer/pr94688.c
new file mode 100644
index 00000000000..f553b8cfdad
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr94688.c
@@ -0,0 +1,6 @@
+int a, b;
+void d();
+void c()
+{
+ d((void (*)()) & a + b);
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94689.c b/gcc/testsuite/gcc.dg/analyzer/pr94689.c
new file mode 100644
index 00000000000..09802a7ecf5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr94689.c
@@ -0,0 +1,8 @@
+typedef void (*F) (void);
+void bar (F);
+
+void
+foo (void *a, int b)
+{
+ bar ((F) a + b);
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94839.c b/gcc/testsuite/gcc.dg/analyzer/pr94839.c
new file mode 100644
index 00000000000..46c8bb98bd2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr94839.c
@@ -0,0 +1,20 @@
+struct bitmap
+{
+ int min;
+ int max;
+ int *vec;
+};
+
+int bitmap_create(struct bitmap *bm, int min, int max)
+{
+ int sz;
+
+ sz = (max / sizeof(int)) + 1;
+
+ bm->min = min;
+ bm->max = max;
+ bm->vec = __builtin_calloc(sz, sizeof(int));
+ if (!bm->vec)
+ return (-12);
+ return 0; /* { dg-bogus "leak" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr95026.c b/gcc/testsuite/gcc.dg/analyzer/pr95026.c
new file mode 100644
index 00000000000..1845f15ae59
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr95026.c
@@ -0,0 +1,17 @@
+struct _IO_FILE;
+typedef struct _IO_FILE FILE;
+typedef struct _message
+{
+ FILE *fp;
+} MESSAGE;
+extern FILE *fopen (const char *__restrict __filename,
+ const char *__restrict __modes);
+FILE *f (void);
+int imap_fetch_message (int i, MESSAGE *msg, char *p)
+{
+ if ((msg->fp = i ? 0 : f ()))
+ return 0;
+ if (p)
+ msg->fp = fopen (p, "r");
+ return -1;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr95240.c b/gcc/testsuite/gcc.dg/analyzer/pr95240.c
new file mode 100644
index 00000000000..c84c64de8b8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr95240.c
@@ -0,0 +1,27 @@
+typedef __SIZE_TYPE__ size_t;
+
+extern void *calloc(size_t nmemb, size_t size);
+extern void free(void *ptr);
+
+static char *activeTroubleArray;
+
+int
+initActiveTroubleArray ()
+{
+ activeTroubleArray = calloc (1, 1);
+ return activeTroubleArray ? 0 : 1;
+}
+
+void
+freeActiveTroubleArray ()
+{
+ free (activeTroubleArray);
+}
+
+int main (int argc, char *argv[])
+{
+ initActiveTroubleArray ();
+ freeActiveTroubleArray ();
+
+ return 1;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr96598.c b/gcc/testsuite/gcc.dg/analyzer/pr96598.c
new file mode 100644
index 00000000000..b4354cd3394
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr96598.c
@@ -0,0 +1,26 @@
+/* { dg-additional-options "-O0 -fsanitize=undefined" } */
+
+extern char *foo (char *dest, const char *src)
+ __attribute__ ((__nonnull__ (1, 2)));
+
+unsigned bar(const char *str)
+ __attribute__ ((__nonnull__ ()));
+
+unsigned test(const char *str, unsigned **pv)
+ __attribute__ ((__nonnull__ ()));
+
+unsigned test(const char* str, unsigned **pv)
+{
+ char buffer[130];
+
+ *pv = 0;
+
+ foo(buffer, str);
+ if (bar(buffer))
+ {
+ const char *ptr = 0;
+ foo(buffer, str);
+ return bar(buffer);
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr96611.c b/gcc/testsuite/gcc.dg/analyzer/pr96611.c
new file mode 100644
index 00000000000..4f7502361cb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr96611.c
@@ -0,0 +1,14 @@
+struct s { int a; } *ptr;
+void unknown_int_ptr (int *);
+void unknown_void (void);
+
+void test_1 ()
+{
+ unknown_int_ptr (&ptr->a);
+}
+
+void test_2 ()
+{
+ unknown_void ();
+ unknown_int_ptr (&ptr->a);
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/refcounting-1.c b/gcc/testsuite/gcc.dg/analyzer/refcounting-1.c
new file mode 100644
index 00000000000..4eb3a3e6ff2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/refcounting-1.c
@@ -0,0 +1,31 @@
+#include "analyzer-decls.h"
+
+typedef struct obj {
+ int ob_refcnt;
+} PyObject;
+
+extern void Py_Dealloc (PyObject *op);
+
+#define Py_INCREF(op) \
+ do { \
+ ((PyObject*)(op))->ob_refcnt++; \
+ } while (0)
+
+#define Py_DECREF(op) \
+ do { \
+ if (--((PyObject*)(op))->ob_refcnt == 0) \
+ { \
+ /*Py_Dealloc((PyObject *)(op));*/ \
+ } \
+ } while (0)
+
+void test_1 (PyObject *obj)
+{
+ int orig_refcnt = obj->ob_refcnt;
+ Py_INCREF (obj);
+ Py_INCREF (obj);
+ Py_DECREF (obj);
+ Py_INCREF (obj);
+ __analyzer_eval (obj->ob_refcnt == orig_refcnt + 2); /* { dg-warning "TRUE" } */
+}
+/* TODO: uncomment the Py_Dealloc, which leads to two paths. */
diff --git a/gcc/testsuite/gcc.dg/analyzer/setjmp-1.c b/gcc/testsuite/gcc.dg/analyzer/setjmp-1.c
index c9827fbd298..72da6c4a980 100644
--- a/gcc/testsuite/gcc.dg/analyzer/setjmp-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/setjmp-1.c
@@ -1 +1,2 @@
+/* { dg-require-effective-target indirect_jumps } */
#include "../pr26983.c"
diff --git a/gcc/testsuite/gcc.dg/analyzer/setjmp-2.c b/gcc/testsuite/gcc.dg/analyzer/setjmp-2.c
index beaf43684e0..f5d9c53e239 100644
--- a/gcc/testsuite/gcc.dg/analyzer/setjmp-2.c
+++ b/gcc/testsuite/gcc.dg/analyzer/setjmp-2.c
@@ -1,5 +1,6 @@
/* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
/* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target indirect_jumps } */
#include "test-setjmp.h"
#include <stddef.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/setjmp-3.c b/gcc/testsuite/gcc.dg/analyzer/setjmp-3.c
index 5c1d4060c3b..3e4f870e5e8 100644
--- a/gcc/testsuite/gcc.dg/analyzer/setjmp-3.c
+++ b/gcc/testsuite/gcc.dg/analyzer/setjmp-3.c
@@ -1,5 +1,6 @@
/* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
/* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target indirect_jumps } */
#include <stddef.h>
#include "test-setjmp.h"
diff --git a/gcc/testsuite/gcc.dg/analyzer/setjmp-4.c b/gcc/testsuite/gcc.dg/analyzer/setjmp-4.c
index f216a456b59..b6f7d0e777b 100644
--- a/gcc/testsuite/gcc.dg/analyzer/setjmp-4.c
+++ b/gcc/testsuite/gcc.dg/analyzer/setjmp-4.c
@@ -1,5 +1,6 @@
/* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
/* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target indirect_jumps } */
#include "test-setjmp.h"
#include "analyzer-decls.h"
diff --git a/gcc/testsuite/gcc.dg/analyzer/setjmp-5.c b/gcc/testsuite/gcc.dg/analyzer/setjmp-5.c
index 3ee02980e57..bf5b9bfda81 100644
--- a/gcc/testsuite/gcc.dg/analyzer/setjmp-5.c
+++ b/gcc/testsuite/gcc.dg/analyzer/setjmp-5.c
@@ -1,5 +1,6 @@
/* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
/* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target indirect_jumps } */
#include "test-setjmp.h"
#include <stddef.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/setjmp-6.c b/gcc/testsuite/gcc.dg/analyzer/setjmp-6.c
index 0e0f12f919c..3aa6b23d6b3 100644
--- a/gcc/testsuite/gcc.dg/analyzer/setjmp-6.c
+++ b/gcc/testsuite/gcc.dg/analyzer/setjmp-6.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_jumps } */
+
#include "test-setjmp.h"
#include <stddef.h>
#include <stdlib.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/setjmp-7.c b/gcc/testsuite/gcc.dg/analyzer/setjmp-7.c
index 6cf98247bb6..6a519b7e138 100644
--- a/gcc/testsuite/gcc.dg/analyzer/setjmp-7.c
+++ b/gcc/testsuite/gcc.dg/analyzer/setjmp-7.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_jumps } */
+
#include "test-setjmp.h"
#include <stddef.h>
#include <stdlib.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/setjmp-7a.c b/gcc/testsuite/gcc.dg/analyzer/setjmp-7a.c
index 87d35bc88f3..220f95e0d05 100644
--- a/gcc/testsuite/gcc.dg/analyzer/setjmp-7a.c
+++ b/gcc/testsuite/gcc.dg/analyzer/setjmp-7a.c
@@ -1,5 +1,6 @@
/* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
/* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target indirect_jumps } */
#include "test-setjmp.h"
#include <stdlib.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/setjmp-8.c b/gcc/testsuite/gcc.dg/analyzer/setjmp-8.c
index abbee2d9108..79614d123bd 100644
--- a/gcc/testsuite/gcc.dg/analyzer/setjmp-8.c
+++ b/gcc/testsuite/gcc.dg/analyzer/setjmp-8.c
@@ -1,5 +1,6 @@
/* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
/* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target indirect_jumps } */
#include "test-setjmp.h"
#include <stddef.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/setjmp-9.c b/gcc/testsuite/gcc.dg/analyzer/setjmp-9.c
index cf75d3ad896..c2b00e3b95c 100644
--- a/gcc/testsuite/gcc.dg/analyzer/setjmp-9.c
+++ b/gcc/testsuite/gcc.dg/analyzer/setjmp-9.c
@@ -1,5 +1,6 @@
/* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
/* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target indirect_jumps } */
#include "test-setjmp.h"
#include <stddef.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/setjmp-pr93378.c b/gcc/testsuite/gcc.dg/analyzer/setjmp-pr93378.c
index 73b94d4d36b..6e2468e701a 100644
--- a/gcc/testsuite/gcc.dg/analyzer/setjmp-pr93378.c
+++ b/gcc/testsuite/gcc.dg/analyzer/setjmp-pr93378.c
@@ -1,4 +1,5 @@
/* { dg-additional-options "-O1 -g" } */
+/* { dg-require-effective-target indirect_jumps } */
#include <setjmp.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-1.c b/gcc/testsuite/gcc.dg/analyzer/signal-1.c
index 4dcbcc0fc6b..43f911ba648 100644
--- a/gcc/testsuite/gcc.dg/analyzer/signal-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-1.c
@@ -1,6 +1,7 @@
/* Example of a bad call within a signal handler.
'handler' calls 'custom_logger' which calls 'fprintf', and 'fprintf' is
not allowed from a signal handler. */
+/* { dg-require-effective-target signal } */
#include <stdio.h>
#include <signal.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-2.c b/gcc/testsuite/gcc.dg/analyzer/signal-2.c
index a56acb060ec..d047c677c41 100644
--- a/gcc/testsuite/gcc.dg/analyzer/signal-2.c
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-2.c
@@ -1,6 +1,7 @@
/* Example of a bad call within a signal handler.
'handler' calls 'custom_logger' which calls 'fprintf', and 'fprintf' is
not allowed from a signal handler. */
+/* { dg-require-effective-target signal } */
#include <stdio.h>
#include <signal.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-3.c b/gcc/testsuite/gcc.dg/analyzer/signal-3.c
index 5b308888777..f5072b52f08 100644
--- a/gcc/testsuite/gcc.dg/analyzer/signal-3.c
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-3.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target signal } */
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-4a.c b/gcc/testsuite/gcc.dg/analyzer/signal-4a.c
index 4b68b6d045b..4ee6f0e7d0e 100644
--- a/gcc/testsuite/gcc.dg/analyzer/signal-4a.c
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-4a.c
@@ -2,6 +2,7 @@
/* { dg-options "-fanalyzer -fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
/* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target signal } */
#include <stdio.h>
#include <signal.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-4b.c b/gcc/testsuite/gcc.dg/analyzer/signal-4b.c
index 38d40247357..cb1e7e475ae 100644
--- a/gcc/testsuite/gcc.dg/analyzer/signal-4b.c
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-4b.c
@@ -2,6 +2,7 @@
/* { dg-options "-fanalyzer -fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
/* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target signal } */
#include <stdio.h>
#include <signal.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-5.c b/gcc/testsuite/gcc.dg/analyzer/signal-5.c
index 4e464fffda5..81ac812ebbd 100644
--- a/gcc/testsuite/gcc.dg/analyzer/signal-5.c
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-5.c
@@ -1,4 +1,5 @@
/* Example of other bad calls within a signal handler. */
+/* { dg-require-effective-target signal } */
#include <stdlib.h>
#include <signal.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-6.c b/gcc/testsuite/gcc.dg/analyzer/signal-6.c
index f51845167f5..ea2290c4296 100644
--- a/gcc/testsuite/gcc.dg/analyzer/signal-6.c
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-6.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target signal } */
#include <stdio.h>
#include <signal.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-exit.c b/gcc/testsuite/gcc.dg/analyzer/signal-exit.c
new file mode 100644
index 00000000000..41a819b838c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-exit.c
@@ -0,0 +1,24 @@
+/* Example of a bad call within a signal handler with replacement
+ alternative. 'handler' calls 'exit', and 'exit' is not allowed
+ from a signal handler. But '_exit' is allowed. */
+/* { dg-require-effective-target signal } */
+
+#include <signal.h>
+#include <stdlib.h>
+
+extern void body_of_program(void);
+
+static void handler(int signum)
+{
+ exit(1); /* { dg-warning "call to 'exit' from within signal handler" "warning" } */
+ /* { dg-message "note: '_exit' is a possible signal-safe alternative for 'exit'" "replacement note" { target *-*-* } .-1 } */
+}
+
+int main(int argc, const char *argv)
+{
+ signal(SIGINT, handler); /* { dg-message "registering 'handler' as signal handler" } */
+
+ body_of_program();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/single-field.c b/gcc/testsuite/gcc.dg/analyzer/single-field.c
new file mode 100644
index 00000000000..d54cfb0c4d1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/single-field.c
@@ -0,0 +1,37 @@
+#include <stdlib.h>
+#include "analyzer-decls.h"
+
+struct foo
+{
+ char *ptr;
+};
+
+void test_1 (struct foo f)
+{
+ __analyzer_describe (0, f.ptr); /* { dg-warning "svalue: 'INIT_VAL\\(f.ptr\\)'" } */
+}
+
+static void called_by_test_2 (struct foo f_inner)
+{
+ free (f_inner.ptr);
+ free (f_inner.ptr); /* { dg-warning "double-'free' of 'f_outer.ptr'" } */
+}
+void test_2 (struct foo f_outer)
+{
+ called_by_test_2 (f_outer);
+}
+
+struct nested
+{
+ struct foo f;
+};
+
+static void called_by_test_3 (struct nested n_inner)
+{
+ free (n_inner.f.ptr);
+ free (n_inner.f.ptr); /* { dg-warning "double-'free' of 'n_outer.f.ptr'" } */
+}
+void test_3 (struct nested n_outer)
+{
+ called_by_test_3 (n_outer);
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/stale-frame-1.c b/gcc/testsuite/gcc.dg/analyzer/stale-frame-1.c
new file mode 100644
index 00000000000..04221479bf9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/stale-frame-1.c
@@ -0,0 +1,15 @@
+
+int *global_ptr;
+
+static void __attribute__((noinline))
+called_by_test_1 (void)
+{
+ int i = 42;
+ global_ptr = &i;
+}
+
+int test_1 (void)
+{
+ called_by_test_1 ();
+ return *global_ptr; /* { dg-warning "dereferencing pointer 'global_ptr' to within stale stack frame" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/symbolic-1.c b/gcc/testsuite/gcc.dg/analyzer/symbolic-1.c
new file mode 100644
index 00000000000..9d228e6331c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/symbolic-1.c
@@ -0,0 +1,43 @@
+#include "analyzer-decls.h"
+
+/* The example from store2.h */
+
+void test_1 (char a, char b, char c, char d, char e, char f,
+ int i, int j)
+{
+ char arr[1024];
+ arr[2] = a; /* (1) */
+ arr[3] = b; /* (2) */
+
+ __analyzer_eval (arr[2] == a); /* { dg-warning "TRUE" } */
+ __analyzer_eval (arr[3] == b); /* { dg-warning "TRUE" } */
+ __analyzer_eval (arr[4]); /* { dg-warning "UNKNOWN" } */ // TODO: report uninit
+
+ /* Replace one concrete binding's value with a different value. */
+ arr[3] = c; /* (3) */
+ __analyzer_eval (arr[2] == a); /* { dg-warning "TRUE" } */
+ __analyzer_eval (arr[3] == c); /* { dg-warning "TRUE" } */
+ __analyzer_eval (arr[3] == b); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (arr[4]); /* { dg-warning "UNKNOWN" } */ // TODO: report uninit
+
+ /* Symbolic binding. */
+ arr[i] = d; /* (4) */
+ __analyzer_eval (arr[i] == d); /* { dg-warning "TRUE" } */
+ __analyzer_eval (arr[2] == a); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (arr[3] == c); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (arr[4]); /* { dg-warning "UNKNOWN" } */ /* Don't report uninit. */
+
+ /* Replace symbolic binding with a different one. */
+ arr[j] = e; /* (5) */
+ __analyzer_eval (arr[j] == e); /* { dg-warning "TRUE" } */
+ __analyzer_eval (arr[i] == d); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (arr[4]); /* { dg-warning "UNKNOWN" } */ /* Don't report uninit. */
+
+ /* Add a concrete binding. */
+ arr[3] = f; /* (6) */
+ __analyzer_eval (arr[3] == f); /* { dg-warning "TRUE" } */
+ __analyzer_eval (arr[j] == e); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (arr[4]); /* { dg-warning "UNKNOWN" } */ /* Don't report uninit. */
+}
+
+// TODO: as above, but with int rather than char so there's a cast
diff --git a/gcc/testsuite/gcc.dg/analyzer/symbolic-2.c b/gcc/testsuite/gcc.dg/analyzer/symbolic-2.c
new file mode 100644
index 00000000000..70c00ce3867
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/symbolic-2.c
@@ -0,0 +1,32 @@
+#include "analyzer-decls.h"
+
+struct foo
+{
+ int ival;
+ int iarr[10];
+};
+
+void test_1 (int i, int j)
+{
+ struct foo fooarr[4];
+ fooarr[1].ival = 42;
+ fooarr[1].iarr[3] = 27;
+ fooarr[2].iarr[1] = 17;
+ __analyzer_eval (fooarr[1].ival == 42); /* { dg-warning "TRUE" } */
+ __analyzer_eval (fooarr[1].iarr[3] == 27); /* { dg-warning "TRUE" } */
+ __analyzer_eval (fooarr[2].iarr[1] == 17); /* { dg-warning "TRUE" } */
+
+ /* Symbolic binding. */
+ fooarr[2].iarr[i] = j;
+ __analyzer_eval (fooarr[2].iarr[i] == j); /* { dg-warning "TRUE" } */
+
+ /* We should have lost our knowledge about fooarr[2].
+ It's not clear to me if we should also lose our knowledge about
+ fooarr[1] (for the case where i is negative). For now, we do. */
+ __analyzer_eval (fooarr[1].ival == 42); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (fooarr[1].iarr[3] == 27); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (fooarr[2].iarr[1] == 17); /* { dg-warning "UNKNOWN" } */
+ /* Should also be safe to read from fooarr[2];
+ it isn't known to be uninit anymore. */
+ __analyzer_eval (fooarr[2].iarr[10] == 17); /* { dg-warning "UNKNOWN" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/symbolic-3.c b/gcc/testsuite/gcc.dg/analyzer/symbolic-3.c
new file mode 100644
index 00000000000..da4cdbbc54c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/symbolic-3.c
@@ -0,0 +1,12 @@
+#include "analyzer-decls.h"
+
+int iarr[16];
+
+void test_1 (int i, int j)
+{
+ int init_el_8 = iarr[8];
+ __analyzer_eval (init_el_8 == iarr[8]); /* { dg-warning "TRUE" } */
+
+ iarr[i] = j;
+ __analyzer_eval (init_el_8 == iarr[8]); /* { dg-warning "UNKNOWN" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/symbolic-4.c b/gcc/testsuite/gcc.dg/analyzer/symbolic-4.c
new file mode 100644
index 00000000000..a466f912007
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/symbolic-4.c
@@ -0,0 +1,20 @@
+#include <string.h>
+#include "analyzer-decls.h"
+
+void test_1 (int i, int j, int k)
+{
+ int iarr[16];
+ iarr[i] = j;
+ __analyzer_eval (iarr[i] == j); /* { dg-warning "TRUE" } */
+ __analyzer_eval (iarr[k] == j); /* { dg-warning "UNKNOWN" } */
+
+ memset (iarr, 0, sizeof (iarr));
+ __analyzer_eval (iarr[0] == 0); /* { dg-warning "TRUE" } */
+ __analyzer_eval (iarr[i] == 0); /* { dg-warning "TRUE" } */
+ __analyzer_eval (iarr[i] == j); /* { dg-warning "UNKNOWN" } */
+
+ iarr[i] = j;
+ __analyzer_eval (iarr[i] == j); /* { dg-warning "TRUE" } */
+ __analyzer_eval (iarr[0] == 0); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (iarr[i] == 0); /* { dg-warning "UNKNOWN" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/symbolic-5.c b/gcc/testsuite/gcc.dg/analyzer/symbolic-5.c
new file mode 100644
index 00000000000..3f696503606
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/symbolic-5.c
@@ -0,0 +1,29 @@
+#include "analyzer-decls.h"
+
+int a[1024];
+int b[1024];
+
+extern void escape (void *ptr);
+
+void test_1 (int *p)
+{
+ int c, d;
+ escape (&c);
+ a[16] = 42;
+ b[16] = 17;
+ c = 33;
+ d = 44;
+ __analyzer_eval (a[16] == 42); /* { dg-warning "TRUE" } */
+ __analyzer_eval (b[16] == 17); /* { dg-warning "TRUE" } */
+ __analyzer_eval (c == 33); /* { dg-warning "TRUE" } */
+ __analyzer_eval (d == 44); /* { dg-warning "TRUE" } */
+
+ /* Write through an externally-provided pointer. */
+ *p = 100;
+ /* It could clobber our writes to the global arrays... */
+ __analyzer_eval (a[16] == 42); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (b[16] == 17); /* { dg-warning "UNKNOWN" } */
+ /* ...but can't clobber locals, even ones like "c" that have escaped. */
+ __analyzer_eval (c == 33); /* { dg-warning "TRUE" } */
+ __analyzer_eval (d == 44); /* { dg-warning "TRUE" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/symbolic-6.c b/gcc/testsuite/gcc.dg/analyzer/symbolic-6.c
new file mode 100644
index 00000000000..10d4e972299
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/symbolic-6.c
@@ -0,0 +1,24 @@
+#include "analyzer-decls.h"
+
+int a[1024];
+int b[1024];
+
+extern void escape (void *ptr);
+
+void test_1 (int *p)
+{
+ int c, d;
+ escape (&c);
+
+ *p = 42;
+ __analyzer_eval (*p == 42); /* { dg-warning "TRUE" } */
+
+ /* These writes shouldn't affect *p. */
+ c = 33;
+ d = 44;
+ __analyzer_eval (*p == 42); /* { dg-warning "TRUE" } */
+
+ /* This write could affect *p. */
+ a[16] = 55;
+ __analyzer_eval (*p == 42); /* { dg-warning "UNKNOWN" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/taint-1.c b/gcc/testsuite/gcc.dg/analyzer/taint-1.c
index 549e2660284..cd46dd5fc14 100644
--- a/gcc/testsuite/gcc.dg/analyzer/taint-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/taint-1.c
@@ -14,14 +14,14 @@ char test_1(FILE *f)
{
struct foo tmp;
- if (1 == fread(&tmp, sizeof(tmp), 1, f)) { /* { dg-message "\\(1\\) 'tmp' gets an unchecked value here" "event 1" } */
- /* { dg-message "\\(2\\) following 'true' branch\\.\\.\\." "event 2" { target *-*-* } .-1 } */
+ if (1 == fread(&tmp, sizeof(tmp), 1, f)) { /* { dg-message "\\(\[0-9\]+\\) 'tmp' gets an unchecked value here" "event: tmp gets unchecked value" { xfail *-*-* } } */
+ /* { dg-message "\\(\[0-9\]+\\) following 'true' branch\\.\\.\\." "event: following true branch" { target *-*-* } .-1 } */
/* BUG: the following array lookup trusts that the input data's index is
in the range 0 <= i < 256; otherwise it's accessing the stack */
return tmp.buf[tmp.i]; // { dg-warning "use of tainted value 'tmp.i' in array lookup without bounds checking" "warning" } */
- /* { dg-message "23: \\(3\\) \\.\\.\\.to here" "event 3" { target *-*-* } .-1 } */
- /* { dg-message "23: \\(4\\) 'tmp.i' has an unchecked value here \\(from 'tmp'\\)" "event 4" { target *-*-* } .-2 } */
- /* { dg-message "\\(5\\) use of tainted value 'tmp.i' in array lookup without bounds checking" "event 5" { target *-*-* } .-3 } */
+ /* { dg-message "23: \\(\[0-9\]+\\) \\.\\.\\.to here" "event: to here" { target *-*-* } .-1 } */
+ /* { dg-message "23: \\(\[0-9\]+\\) 'tmp.i' has an unchecked value here \\(from 'tmp'\\)" "event: tmp.i has an unchecked value" { xfail *-*-* } .-2 } */
+ /* { dg-message "\\(\[0-9\]+\\) use of tainted value 'tmp.i' in array lookup without bounds checking" "final event" { target *-*-* } .-3 } */
// TOOD: better messages for state changes
}
@@ -52,9 +52,9 @@ char test_4(FILE *f)
struct foo tmp;
if (1 == fread(&tmp, sizeof(tmp), 1, f)) {
- if (tmp.i >= 0) { /* { dg-message "'tmp.i' has an unchecked value here \\(from 'tmp'\\)" "warning" } */
- /* { dg-message "'tmp.i' has its lower bound checked here" "event" { target *-*-* } .-1 } */
- return tmp.buf[tmp.i]; /* { dg-warning "use of tainted value 'tmp.i' in array lookup without upper-bounds checking" } */
+ if (tmp.i >= 0) { /* { dg-message "'tmp.i' has an unchecked value here \\(from 'tmp'\\)" "event: tmp.i has an unchecked value" { xfail *-*-* } } */
+ /* { dg-message "'tmp.i' has its lower bound checked here" "event: lower bound checked" { target *-*-* } .-1 } */
+ return tmp.buf[tmp.i]; /* { dg-warning "use of tainted value 'tmp.i' in array lookup without upper-bounds checking" "warning" } */
}
}
return 0;
@@ -65,9 +65,9 @@ char test_5(FILE *f)
struct foo tmp;
if (1 == fread(&tmp, sizeof(tmp), 1, f)) {
- if (tmp.i < 256) { /* { dg-message "'tmp.i' has an unchecked value here \\(from 'tmp'\\)" "warning" } */
- /* { dg-message "'tmp.i' has its upper bound checked here" "event" { target *-*-* } .-1 } */
- return tmp.buf[tmp.i]; /* { dg-warning "use of tainted value 'tmp.i' in array lookup without lower-bounds checking" } */
+ if (tmp.i < 256) { /* { dg-message "'tmp.i' has an unchecked value here \\(from 'tmp'\\)" "event: tmp.i has an unchecked value" { xfail *-*-* } } */
+ /* { dg-message "'tmp.i' has its upper bound checked here" "event: upper bound checked" { target *-*-* } .-1 } */
+ return tmp.buf[tmp.i]; /* { dg-warning "use of tainted value 'tmp.i' in array lookup without lower-bounds checking" "warning" } */
}
}
return 0;
diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/loop-inc-ptr-1.c b/gcc/testsuite/gcc.dg/analyzer/torture/loop-inc-ptr-1.c
new file mode 100644
index 00000000000..afb27185f1b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/torture/loop-inc-ptr-1.c
@@ -0,0 +1,15 @@
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+
+#include "../analyzer-decls.h"
+
+void test (int *p)
+{
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+
+ while (*p)
+ {
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enode" } */
+ p++;
+ }
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/loop-inc-ptr-2.c b/gcc/testsuite/gcc.dg/analyzer/torture/loop-inc-ptr-2.c
new file mode 100644
index 00000000000..95d8c53ade1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/torture/loop-inc-ptr-2.c
@@ -0,0 +1,17 @@
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+
+#include "../analyzer-decls.h"
+
+void test (int *p, int val, int count)
+{
+ int n = count;
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+
+ while (n--)
+ {
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enode" } */
+ *p++ = val;
+ }
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/loop-inc-ptr-3.c b/gcc/testsuite/gcc.dg/analyzer/torture/loop-inc-ptr-3.c
new file mode 100644
index 00000000000..1d3576d9308
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/torture/loop-inc-ptr-3.c
@@ -0,0 +1,18 @@
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+
+#include "../analyzer-decls.h"
+
+void test (int *p, int a, int b, int count)
+{
+ int n = count;
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+
+ while (n--)
+ {
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enode" } */
+ *p++ = a;
+ *p++ = b;
+ }
+
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/unknown-fns-2.c b/gcc/testsuite/gcc.dg/analyzer/unknown-fns-2.c
new file mode 100644
index 00000000000..1c4bdd6b51b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/unknown-fns-2.c
@@ -0,0 +1,238 @@
+/* Tests for data model handling of unknown fns. */
+
+#include <stddef.h>
+#include "analyzer-decls.h"
+
+void unknown_fn (void *);
+
+void test_1 (void)
+{
+ int i;
+
+ i = 42;
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+
+ unknown_fn (NULL);
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+
+ unknown_fn (&i);
+ __analyzer_eval (i == 42); /* { dg-warning "UNKNOWN" } */
+
+ i = 17;
+ __analyzer_eval (i == 17); /* { dg-warning "TRUE" } */
+
+ /* Even though we're not passing &i to unknown_fn, it escaped
+ above, so unknown_fn could write to it. */
+ unknown_fn (NULL);
+ __analyzer_eval (i == 17); /* { dg-warning "UNKNOWN" } */
+}
+
+/* As test_1, but with an unknown fn_ptr. */
+
+void test_1a (void (*fn_ptr) (void *))
+{
+ int i;
+
+ i = 42;
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+
+ fn_ptr (NULL);
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+
+ fn_ptr (&i);
+ __analyzer_eval (i == 42); /* { dg-warning "UNKNOWN" } */
+
+ i = 17;
+ __analyzer_eval (i == 17); /* { dg-warning "TRUE" } */
+
+ /* Even though we're not passing &i to unknown_fn, it escaped
+ above, so fn_ptr (NULL) could write to it. */
+ fn_ptr (NULL);
+ __analyzer_eval (i == 17); /* { dg-warning "UNKNOWN" } */
+}
+
+int *global_for_test_2;
+
+void test_2 (void)
+{
+ int i;
+
+ i = 42;
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+
+ global_for_test_2 = &i;
+ unknown_fn (NULL);
+ __analyzer_eval (i == 42); /* { dg-warning "UNKNOWN" } */
+
+ global_for_test_2 = NULL;
+
+ i = 17;
+ __analyzer_eval (i == 17); /* { dg-warning "TRUE" } */
+
+ /* Even though the global no longer points to i, it escaped
+ above, so unknown_fn could write to it. */
+ unknown_fn (NULL);
+ __analyzer_eval (i == 17); /* { dg-warning "UNKNOWN" } */
+}
+
+struct used_by_test_3
+{
+ int *int_ptr;
+};
+
+void test_3 (void)
+{
+ int i;
+
+ struct used_by_test_3 s;
+ s.int_ptr = &i;
+
+ i = 42;
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+
+ unknown_fn (NULL);
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+ __analyzer_eval (s.int_ptr == &i); /* { dg-warning "TRUE" } */
+
+ /* i should escape here. */
+ unknown_fn (&s);
+ __analyzer_eval (i == 42); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (s.int_ptr == &i); /* { dg-warning "UNKNOWN" } */
+
+ s.int_ptr = NULL;
+ __analyzer_eval (s.int_ptr == NULL); /* { dg-warning "TRUE" } */
+
+ i = 17;
+ __analyzer_eval (i == 17); /* { dg-warning "TRUE" } */
+
+ /* Even though nothing we know about points to i, it escaped
+ above, so unknown_fn could write to it. */
+ unknown_fn (NULL);
+ __analyzer_eval (i == 17); /* { dg-warning "UNKNOWN" } */
+}
+
+struct used_by_test_4
+{
+ int *int_ptr;
+};
+
+void test_4 (struct used_by_test_4 *st4_ptr)
+{
+ /* Something unknown called "test_4", and hence *st4_ptr has
+ effectively already escaped. */
+
+ int i = 42;
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+
+ unknown_fn (NULL);
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+
+ /* Given that *st4_ptr has effectively already escaped, calling
+ an unknown fn should invalidate our knowledge of i". */
+ st4_ptr->int_ptr = &i;
+ unknown_fn (NULL);
+ __analyzer_eval (i == 42); /* { dg-warning "UNKNOWN" } */
+
+ /* ...and "&i" should now be treated as having escaped. */
+ i = 17;
+ __analyzer_eval (i == 17); /* { dg-warning "TRUE" } */
+ st4_ptr->int_ptr = NULL;
+ unknown_fn (NULL);
+ __analyzer_eval (i == 17); /* { dg-warning "UNKNOWN" } */
+}
+
+static void __attribute__((noinline))
+known_fn (void *ptr)
+{
+ /* Empty. */
+}
+
+void test_5 (void)
+{
+ int i;
+
+ i = 42;
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+
+ known_fn (&i);
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+
+ i = 17;
+ __analyzer_eval (i == 17); /* { dg-warning "TRUE" } */
+
+ /* Ensure that we don't consider &i to have escaped. */
+ unknown_fn (NULL);
+ __analyzer_eval (i == 17); /* { dg-warning "TRUE" } */
+}
+
+extern int __attribute__ ((__pure__))
+unknown_pure_fn (void *);
+
+void test_6 (void)
+{
+ int i;
+
+ i = 42;
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+
+ unknown_pure_fn (&i);
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+
+ i = 17;
+ __analyzer_eval (i == 17); /* { dg-warning "TRUE" } */
+
+ /* Ensure that we don't consider &i to have escaped. */
+ unknown_fn (NULL);
+ __analyzer_eval (i == 17); /* { dg-warning "TRUE" } */
+}
+
+extern void unknown_const_fn (const void *);
+
+void test_7 (void)
+{
+ int i;
+
+ i = 42;
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+
+ /* &i is passed as a const void *, so i shouldn't be clobbered by
+ the call. */
+ unknown_const_fn (&i);
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+
+ i = 17;
+ __analyzer_eval (i == 17); /* { dg-warning "TRUE" } */
+
+ /* Ensure that we don't consider &i to have escaped. */
+ unknown_fn (NULL);
+ __analyzer_eval (i == 17); /* { dg-warning "TRUE" } */
+}
+
+struct used_by_test_8
+{
+ int *int_ptr;
+};
+
+void test_8 (void)
+{
+ int i;
+
+ i = 42;
+ __analyzer_eval (i == 42); /* { dg-warning "TRUE" } */
+
+ struct used_by_test_8 st8;
+ st8.int_ptr = &i;
+
+ /* Although unknown_const_fn takes a const void *, the
+ int_ptr is a non-const int *, and so &i should be considered
+ writable. */
+ unknown_const_fn (&st8);
+ __analyzer_eval (i == 42); /* { dg-warning "UNKNOWN" } */
+
+ i = 17;
+ __analyzer_eval (i == 17); /* { dg-warning "TRUE" } */
+
+ /* &i should be considered to have escaped. */
+ unknown_fn (NULL);
+ __analyzer_eval (i == 17); /* { dg-warning "UNKNOWN" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/unknown-fns-3.c b/gcc/testsuite/gcc.dg/analyzer/unknown-fns-3.c
new file mode 100644
index 00000000000..095df5e77a7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/unknown-fns-3.c
@@ -0,0 +1,67 @@
+/* Tests for handling constraints on results of unknown fns. */
+
+#include <stddef.h>
+#include "analyzer-decls.h"
+
+void unknown_fn (void *);
+
+void test_1 (void)
+{
+ int i;
+ unknown_fn (&i);
+ if (i)
+ __analyzer_eval (i); /* { dg-warning "TRUE" } */
+ else
+ __analyzer_eval (i); /* { dg-warning "FALSE" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
+
+struct foo
+{
+ int i;
+ int j;
+};
+
+void test_2 (void)
+{
+ struct foo f;
+ unknown_fn (&f);
+ if (f.j)
+ __analyzer_eval (f.j); /* { dg-warning "TRUE" } */
+ else
+ __analyzer_eval (f.j); /* { dg-warning "FALSE" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
+
+void test_3 (int flag)
+{
+ int i;
+ unknown_fn (&i);
+ if (i)
+ {
+ __analyzer_eval (i); /* { dg-warning "TRUE" } */
+ if (flag)
+ __analyzer_eval (flag); /* { dg-warning "TRUE" } */
+ else
+ __analyzer_eval (flag); /* { dg-warning "FALSE" } */
+ }
+ else
+ __analyzer_eval (i); /* { dg-warning "FALSE" } */
+ if (flag)
+ __analyzer_eval (flag); /* { dg-warning "TRUE" } */
+ else
+ __analyzer_eval (flag); /* { dg-warning "FALSE" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
+
+void test_4 (int y)
+{
+ int x;
+ unknown_fn (&x);
+ if (x)
+ {
+ __analyzer_eval (x); /* { dg-warning "TRUE" } */
+ x = 0;
+ }
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/unknown-fns-4.c b/gcc/testsuite/gcc.dg/analyzer/unknown-fns-4.c
new file mode 100644
index 00000000000..3d8f82ee290
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/unknown-fns-4.c
@@ -0,0 +1,15 @@
+#include "analyzer-decls.h"
+
+int get(void);
+void test (void)
+{
+ int got = 0;
+ while (1)
+ {
+ if (get ())
+ got = 1;
+ else
+ if (got)
+ __analyzer_dump_path (); /* { dg-message "path" "" { xfail *-*-* } } */
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/unknown-fns.c b/gcc/testsuite/gcc.dg/analyzer/unknown-fns.c
index 355c8b3d92a..fd1ecbb7005 100644
--- a/gcc/testsuite/gcc.dg/analyzer/unknown-fns.c
+++ b/gcc/testsuite/gcc.dg/analyzer/unknown-fns.c
@@ -76,10 +76,10 @@ void test_4a (void)
node_b.ptr = malloc (sizeof (int));
global_ptr = &node_a;
*node_b.ptr = 42; /* { dg-warning "possibly-NULL" "possibly-NULL" } */
- /* { dg-warning "leak" "leak" { target *-*-* } .-1 } */
- /* FIXME: the above leak report is correct, but is reported at the wrong
- location. */
-} /* { dg-warning "leak" } */
+ /* Although there's a chain of pointers to the allocation, pointed to
+ by global_ptr, the chain goes through the stack frame and thus
+ there's a leak when it is popped. */
+} /* { dg-warning "leak of 'node_b.ptr'" } */
/* With a call to an unknown function. */
diff --git a/gcc/testsuite/gcc.dg/analyzer/use-after-free.c b/gcc/testsuite/gcc.dg/analyzer/use-after-free.c
new file mode 100644
index 00000000000..d7e4bc2c6ca
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/use-after-free.c
@@ -0,0 +1,12 @@
+#include <stdlib.h>
+#include "analyzer-decls.h"
+
+struct link { struct link *next; };
+
+int free_a_list_badly (struct link *n)
+{
+ while (n) {
+ free(n); /* { dg-message "freed here" } */
+ n = n->next; /* { dg-warning "use after 'free' of 'n'" } */
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/vla-1.c b/gcc/testsuite/gcc.dg/analyzer/vla-1.c
new file mode 100644
index 00000000000..0488ff282a4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/vla-1.c
@@ -0,0 +1,13 @@
+#include "analyzer-decls.h"
+
+void test_1 (int n)
+{
+ struct
+ {
+ char a[n], b;
+ } s;
+ s.a[0] = 42;
+ __analyzer_eval (s.a[0] == 42); /* { dg-warning "TRUE" } */
+ s.b = 17;
+ __analyzer_eval (s.b == 17); /* { dg-warning "TRUE" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/zlib-4.c b/gcc/testsuite/gcc.dg/analyzer/zlib-4.c
index 08261442128..ae2f6c9f8ad 100644
--- a/gcc/testsuite/gcc.dg/analyzer/zlib-4.c
+++ b/gcc/testsuite/gcc.dg/analyzer/zlib-4.c
@@ -7,14 +7,18 @@ typedef unsigned long uLong;
#define Z_NULL 0
-void test ()
+int test ()
{
uLong comprLen = 10000*sizeof(int);
uLong uncomprLen = comprLen;
Byte *compr = (Byte*)calloc((uInt)comprLen, 1);
Byte *uncompr = (Byte*)calloc((uInt)uncomprLen, 1);
if (compr == Z_NULL || uncompr == Z_NULL)
- exit (1);
+ {
+ return 1; /* { dg-warning "leak of 'uncompr'" "uncompr leak" } */
+ /* { dg-warning "leak of 'compr'" "compr leak" { target *-*-* } .-1 } */
+ }
strcpy((char*)uncompr, "garbage");
- exit (0);
+ return 0; /* { dg-warning "leak of 'uncompr'" "uncompr leak" } */
+ /* { dg-warning "leak of 'compr'" "compr leak" { target *-*-* } .-1 } */
}
diff --git a/gcc/testsuite/gcc.dg/asan/pr95033.c b/gcc/testsuite/gcc.dg/asan/pr95033.c
new file mode 100644
index 00000000000..1228b7edcdb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/asan/pr95033.c
@@ -0,0 +1,13 @@
+/* PR sanitizer/95033 */
+/* { dg-do compile } */
+/* { dg-options "-fsanitize=address" } */
+
+struct a
+{
+ int b;
+};
+
+struct a c(_Complex d)
+{
+ return *(struct a *)&d;
+}
diff --git a/gcc/testsuite/gcc.dg/asan/pr95051.c b/gcc/testsuite/gcc.dg/asan/pr95051.c
new file mode 100644
index 00000000000..e32c04599a8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/asan/pr95051.c
@@ -0,0 +1,22 @@
+/* PR sanitizer/95051 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct a {
+ struct {
+ struct {
+ int b;
+ } c;
+ };
+};
+struct d {
+ struct {
+ int e;
+ } f;
+}
+
+g(int h) {
+ struct a *i;
+ struct d *j = (struct d*)&h;
+ i->c.b = j->f.e;
+}
diff --git a/gcc/testsuite/gcc.dg/attr-access-none.c b/gcc/testsuite/gcc.dg/attr-access-none.c
new file mode 100644
index 00000000000..d983f2fac06
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/attr-access-none.c
@@ -0,0 +1,38 @@
+/* Test to verify the handling of attribute access (none).
+ { dg-do compile }
+ { dg-options "-O -Wall -ftrack-macro-expansion=0" } */
+
+int __attribute__ ((access (none, 1)))
+fnone_pv1 (void*);
+
+void nowarn_fnone_pv1 (void)
+{
+ int x;
+ fnone_pv1 (&x);
+}
+
+
+int __attribute__ ((access (none, 1)))
+fnone_pcv1 (const void*);
+
+void nowarn_fnone_pcv1 (void)
+{
+ char a[2];
+ fnone_pcv1 (a);
+}
+
+
+int __attribute__ ((access (none, 1, 2)))
+fnone_pcv1_2 (const void*, int); // { dg-message "in a call to function 'fnone_pcv1_2' declared with attribute 'none \\\(1, 2\\\)'" }
+
+void nowarn_fnone_pcv1_2 (void)
+{
+ char a[2];
+ fnone_pcv1_2 (a, 2);
+}
+
+void warn_fnone_pcv1_2 (void)
+{
+ char a[3];
+ fnone_pcv1_2 (a, 4); // { dg-warning "expecting 4 bytes in a region of size 3" }
+}
diff --git a/gcc/testsuite/gcc.dg/attr-access-read-only.c b/gcc/testsuite/gcc.dg/attr-access-read-only.c
index 9acd769621e..71175d05ca5 100644
--- a/gcc/testsuite/gcc.dg/attr-access-read-only.c
+++ b/gcc/testsuite/gcc.dg/attr-access-read-only.c
@@ -11,7 +11,7 @@ int __attribute__ ((access ()))
access___v (void); // { dg-error "wrong number of arguments specified for 'access' attribute" }
int __attribute__ ((access (rdonly)))
-rdonly_spelling (void); // { dg-error "attribute .access. invalid mode 'rdonly'; expected one of 'read_only', 'read_write', or 'write_only'" }
+rdonly_spelling (void); // { dg-error "attribute .access. invalid mode 'rdonly'; expected one of 'read_only', 'read_write', 'write_only', or 'none'" }
int __attribute__ ((access (read_only)))
rdonly_v_all (void); // { dg-error "attribute .access\\(read_only\\). missing an argument" }
diff --git a/gcc/testsuite/gcc.dg/attr-access-read-write.c b/gcc/testsuite/gcc.dg/attr-access-read-write.c
index c97e54bbd60..849d9f1cf67 100644
--- a/gcc/testsuite/gcc.dg/attr-access-read-write.c
+++ b/gcc/testsuite/gcc.dg/attr-access-read-write.c
@@ -10,7 +10,7 @@ int __attribute__ ((access ()))
access___v (void); /* { dg-error "wrong number of arguments specified for 'access' attribute" } */
int __attribute__ ((access (rdwr)))
-rdwr_spelling (void); /* { dg-error "attribute .access. invalid mode 'rdwr'; expected one of 'read_only', 'read_write', or 'write_only'" } */
+rdwr_spelling (void); /* { dg-error "attribute .access. invalid mode 'rdwr'; expected one of 'read_only', 'read_write', 'write_only', or 'none'" } */
int __attribute__ ((access (read_write)))
rdwr_v_all (void); /* { dg-error "attribute .access\\(read_write\\). missing an argument" } */
diff --git a/gcc/testsuite/gcc.dg/attr-access-write-only.c b/gcc/testsuite/gcc.dg/attr-access-write-only.c
index 008f5a36ff4..2718b0db456 100644
--- a/gcc/testsuite/gcc.dg/attr-access-write-only.c
+++ b/gcc/testsuite/gcc.dg/attr-access-write-only.c
@@ -11,7 +11,7 @@ int __attribute__ ((access ()))
access___v (void); // { dg-error "wrong number of arguments specified for 'access' attribute" }
int __attribute__ ((access (wronly)))
-wronly_spelling (void); // { dg-error "attribute .access. invalid mode 'wronly'; expected one of 'read_only', 'read_write', or 'write_only'" }
+wronly_spelling (void); // { dg-error "attribute .access. invalid mode 'wronly'; expected one of 'read_only', 'read_write', 'write_only', or 'none'" }
int __attribute__ ((access (read_only)))
wronly_v_all (void); // { dg-error "attribute .access\\(read_only\\). missing an argument" }
diff --git a/gcc/testsuite/gcc.dg/attr-copy-4.c b/gcc/testsuite/gcc.dg/attr-copy-4.c
index 1350a35ec94..01fae3f78d4 100644
--- a/gcc/testsuite/gcc.dg/attr-copy-4.c
+++ b/gcc/testsuite/gcc.dg/attr-copy-4.c
@@ -21,7 +21,8 @@ Assert (__alignof (struct PackedA) == __alignof (struct PackedB));
struct PackedMember
{
char c;
- ATTR ((copy ((struct PackedB*)0))) double packed_mem;
+ ATTR ((copy ((struct PackedB*)0))) double packed_mem;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
};
Assert (__alignof (struct PackedMember) == 1);
@@ -31,6 +32,7 @@ extern const struct PackedA packed;
struct Unpacked { int i; char c; };
Assert (__alignof (struct Unpacked) > 1);
+/* { dg-error "size of array .* is negative" "" { target default_packed } .-1 } */
/* Verify that copying the packed attribute to the declaration
of an object is ignored with a warning. (There should be
diff --git a/gcc/testsuite/gcc.dg/attr-copy-6.c b/gcc/testsuite/gcc.dg/attr-copy-6.c
index d1a2865ca69..cf578bddb1b 100644
--- a/gcc/testsuite/gcc.dg/attr-copy-6.c
+++ b/gcc/testsuite/gcc.dg/attr-copy-6.c
@@ -2,6 +2,7 @@
{ dg-do compile }
{ dg-skip-if "Attributes not supported" { { hppa*-*-hpux* } && { ! lp64 } } }
{ dg-options "-O2 -Wall" }
+ { dg-require-visibility "hidden" }
{ dg-require-alias "" }
{ dg-require-weak "" } */
diff --git a/gcc/testsuite/gcc.dg/attr-copy-8.c b/gcc/testsuite/gcc.dg/attr-copy-8.c
index c75d9e5c98c..7195f6b19f8 100644
--- a/gcc/testsuite/gcc.dg/attr-copy-8.c
+++ b/gcc/testsuite/gcc.dg/attr-copy-8.c
@@ -21,41 +21,66 @@ extern B *pb;
typedef struct C
{
ATTR (copy ((struct A *)0)) short m_pa_0;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy ((struct A *)(1, 0))) int m_pa_1_0;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy ((struct A *)(0, 1))) long m_pa_0_1;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (*(struct A *)0)) short m_xpa_0;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (*(struct A *)(1, 0))) int m_xpa_1_0;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (*(struct A *)(0, 1))) long m_xpa_0_1;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (((struct A *)0)[0])) short m_arpa_0;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (((struct A *)(1, 0))[0])) int m_arpa_1_0;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (((struct A *)(0, 1))[0])) long m_arpa_0_1;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
/* Also exercise COMPONENT_REF, ARRAY_REF, and INDIRECT_REF. */
ATTR (copy (a)) short m_ra;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (b.a)) int m_rb_a;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (b.pa)) long m_rb_pa;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (&a)) short m_ara;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (&b.a)) int m_arb_a;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (*b.pa)) long m_xb_pa;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (b.pa[0])) long m_arb_pa;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (*pa)) short m_xpa;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (pa[0])) short m_arpa;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (ab[0].a)) int m_arab_a;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (ab[1].pa)) long m_arab_pa;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (*ab[2].pa)) int m_xarab_pa;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (ab[3].pa->bf)) unsigned int m_arab_pa_bf: 1;
ATTR (copy (pb->a)) int m_pb_a;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (pb->pa)) long m_pb_pa;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (*pb->pa)) int m_xpb_pa;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
ATTR (copy (pb->pa->bf)) unsigned int m_pb_pa_bf: 1;
ATTR (aligned (4), copy ((struct A *)(0))) short m_a4_pa_0;
+ /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */
} C;
diff --git a/gcc/testsuite/gcc.dg/autopar/pr68460.c b/gcc/testsuite/gcc.dg/autopar/pr68460.c
index 0c00065afbd..74f852d68a0 100644
--- a/gcc/testsuite/gcc.dg/autopar/pr68460.c
+++ b/gcc/testsuite/gcc.dg/autopar/pr68460.c
@@ -1,4 +1,4 @@
-/* { dg-do "compile" } */
+/* { dg-do compile } */
/* { dg-options "-O -ftree-parallelize-loops=2 -ftree-vectorize -fno-tree-ch -fno-tree-dominator-opts" } */
void abort (void);
diff --git a/gcc/testsuite/gcc.dg/bad-binary-ops.c b/gcc/testsuite/gcc.dg/bad-binary-ops.c
index 46c158e6a5f..45668be0a29 100644
--- a/gcc/testsuite/gcc.dg/bad-binary-ops.c
+++ b/gcc/testsuite/gcc.dg/bad-binary-ops.c
@@ -35,10 +35,10 @@ int test_2 (void)
~~~~~~~~~~~~~~~~
|
struct s
- + some_other_function ());
- ^ ~~~~~~~~~~~~~~~~~~~~~~
- |
- struct t
+ + some_other_function ());
+ ^ ~~~~~~~~~~~~~~~~~~~~~~
+ |
+ struct t
{ dg-end-multiline-output "" } */
}
diff --git a/gcc/testsuite/gcc.dg/builtin-bswap-10.c b/gcc/testsuite/gcc.dg/builtin-bswap-10.c
new file mode 100644
index 00000000000..6c69bcd70d8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtin-bswap-10.c
@@ -0,0 +1,8 @@
+/* { dg-do compile { target { ! int128 } } } */
+/* { dg-options "" } */
+/* { dg-final { scan-assembler "__builtin_" } } */
+
+int foo (int x)
+{
+ return __builtin_bswap128 (x); /* { dg-warning "implicit declaration" } */
+}
diff --git a/gcc/testsuite/gcc.dg/builtin-bswap-11.c b/gcc/testsuite/gcc.dg/builtin-bswap-11.c
new file mode 100644
index 00000000000..3fedcf1bd3c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtin-bswap-11.c
@@ -0,0 +1,51 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int128 } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-options "-Wall" } */
+
+#include <stdint.h>
+
+#define MAKE_FUN(suffix, type) \
+ type my_bswap##suffix(type x) { \
+ type result = 0; \
+ int shift; \
+ for (shift = 0; shift < 8 * sizeof (type); shift += 8) \
+ { \
+ result <<= 8; \
+ result |= (x >> shift) & 0xff; \
+ } \
+ return result; \
+ } \
+
+MAKE_FUN(128, __uint128_t);
+
+extern void abort (void);
+
+typedef union
+{
+ struct { uint64_t lo; uint64_t hi; } s;
+ __uint128_t n;
+} u;
+
+#define NUMS128 \
+ { \
+ { .s = { 0x0000000000000000ULL, 0x1122334455667788ULL } }, \
+ { .s = { 0x1122334455667788ULL, 0xffffffffffffffffULL } }, \
+ { .s = { 0xffffffffffffffffULL, 0x0000000000000000ULL } } \
+ }
+
+u uint128_ts[] = NUMS128;
+
+#define N(table) (sizeof (table) / sizeof (table[0]))
+
+int
+main (void)
+{
+ int i;
+
+ for (i = 0; i < N(uint128_ts); i++)
+ if (__builtin_bswap128 (uint128_ts[i].n) != my_bswap128 (uint128_ts[i].n))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/builtin-bswap-12.c b/gcc/testsuite/gcc.dg/builtin-bswap-12.c
new file mode 100644
index 00000000000..8ff65d85300
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtin-bswap-12.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int128 } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-options "-O" } */
+
+#include <stdint.h>
+
+typedef union
+{
+ struct { uint64_t lo; uint64_t hi; } s;
+ __uint128_t n;
+} u;
+
+int
+main (void)
+{
+ /* Test constant folding. */
+ extern void link_error (void);
+
+ const u U1 = { .s = { 0x1122334455667788ULL, 0xffffffffffffffffULL } };
+ const u U2 = { .s = { 0xffffffffffffffffULL, 0x8877665544332211ULL } };
+
+ if (__builtin_bswap128 (U1.n) != U2.n)
+ link_error ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/builtin-object-size-20.c b/gcc/testsuite/gcc.dg/builtin-object-size-20.c
new file mode 100644
index 00000000000..bed973c2c77
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtin-object-size-20.c
@@ -0,0 +1,315 @@
+/* PR middle-end/92815 - spurious -Wstringop-overflow writing into
+ a flexible array of an extern struct
+ { dg-do compile }
+ { dg-options "-O -Wall -fdump-tree-optimized" } */
+
+#define ASSERT(expr) ((expr) ? (void)0 : fail (__LINE__))
+#define bos0(expr) __builtin_object_size (expr, 1)
+#define bos1(expr) __builtin_object_size (expr, 1)
+#define bos2(expr) __builtin_object_size (expr, 2)
+#define bos3(expr) __builtin_object_size (expr, 3)
+
+typedef __INT16_TYPE__ int16_t;
+typedef __INT32_TYPE__ int32_t;
+typedef __INT64_TYPE__ int64_t;
+typedef __SIZE_TYPE__ size_t;
+
+
+extern void fail (int);
+
+
+/* Verify sizes of a struct with a flexible array member and no padding. */
+
+struct ACX { char n, a[]; };
+
+struct ACX ac0 = { };
+struct ACX ac1 = { 1, { 1 } };
+struct ACX ac2 = { 2, { 1, 2 } };
+struct ACX ac3 = { 3, { 1, 2, 3 } };
+
+extern struct ACX eacx;
+
+void facx (void)
+{
+ ASSERT (bos0 (&ac0) == sizeof ac0);
+ ASSERT (bos0 (&ac1) == 2);
+ ASSERT (bos0 (&ac2) == 3);
+ ASSERT (bos0 (&ac3) == 4);
+ ASSERT (bos0 (&eacx) == (size_t)-1);
+
+ ASSERT (bos1 (&ac0) == sizeof ac0);
+ ASSERT (bos1 (&ac1) == 2);
+ ASSERT (bos1 (&ac2) == 3);
+ ASSERT (bos1 (&ac3) == 4);
+ ASSERT (bos1 (&eacx) == (size_t)-1);
+
+ ASSERT (bos2 (&ac0) == sizeof ac0);
+ ASSERT (bos2 (&ac1) == 2);
+ ASSERT (bos2 (&ac2) == 3);
+ ASSERT (bos2 (&ac3) == 4);
+ ASSERT (bos2 (&eacx) == sizeof eacx);
+
+ ASSERT (bos3 (&ac0) == sizeof ac0);
+ ASSERT (bos3 (&ac1) == 2);
+ ASSERT (bos3 (&ac2) == 3);
+ ASSERT (bos3 (&ac3) == 4);
+ ASSERT (bos3 (&eacx) == sizeof eacx);
+}
+
+
+
+/* Verify sizes of a struct with a flexible array member and 1 byte
+ of tail padding. */
+
+struct AI16CX { int16_t i; char n, a[]; };
+
+struct AI16CX ai16c0 = { 0 };
+struct AI16CX ai16c1 = { 0, 1, { 1 } };
+struct AI16CX ai16c2 = { 0, 2, { 1, 2 } };
+struct AI16CX ai16c3 = { 0, 3, { 1, 2, 3 } };
+struct AI16CX ai16c4 = { 0, 4, { 1, 2, 3, 4 } };
+struct AI16CX ai16c5 = { 0, 5, { 1, 2, 3, 4, 5 } };
+struct AI16CX ai16c6 = { 0, 6, { 1, 2, 3, 4, 5, 6 } };
+struct AI16CX ai16c7 = { 0, 7, { 1, 2, 3, 4, 5, 6, 7 } };
+struct AI16CX ai16c8 = { 0, 8, { 1, 2, 3, 4, 5, 6, 7, 8 } };
+
+extern struct AI16CX eai16cx;
+
+void fai16cx (void)
+{
+ ASSERT (bos0 (&ai16c0) == sizeof ai16c0);
+ ASSERT (bos0 (&ai16c1) == sizeof ai16c1);
+ ASSERT (bos0 (&ai16c2) == sizeof ai16c2 + 1);
+ ASSERT (bos0 (&ai16c3) == sizeof ai16c3 + 2);
+
+ ASSERT (bos0 (&ai16c4) == sizeof ai16c4 + 3);
+ ASSERT (bos0 (&ai16c5) == sizeof ai16c5 + 4);
+ ASSERT (bos0 (&ai16c6) == sizeof ai16c6 + 5);
+ ASSERT (bos0 (&ai16c7) == sizeof ai16c6 + 6);
+ ASSERT (bos0 (&ai16c8) == sizeof ai16c6 + 7);
+
+ ASSERT (bos0 (&eai16cx) == (size_t)-1);
+
+
+ ASSERT (bos1 (&ai16c0) == sizeof ai16c0);
+ ASSERT (bos1 (&ai16c1) == sizeof ai16c1);
+ ASSERT (bos1 (&ai16c2) == sizeof ai16c2 + 1);
+ ASSERT (bos1 (&ai16c3) == sizeof ai16c3 + 2);
+
+ ASSERT (bos1 (&ai16c4) == sizeof ai16c4 + 3);
+ ASSERT (bos1 (&ai16c5) == sizeof ai16c5 + 4);
+ ASSERT (bos1 (&ai16c6) == sizeof ai16c6 + 5);
+ ASSERT (bos1 (&ai16c7) == sizeof ai16c6 + 6);
+ ASSERT (bos1 (&ai16c8) == sizeof ai16c6 + 7);
+
+ ASSERT (bos1 (&eai16cx) == (size_t)-1);
+
+
+ ASSERT (bos2 (&ai16c0) == sizeof ai16c0);
+ ASSERT (bos2 (&ai16c1) == sizeof ai16c1);
+ ASSERT (bos2 (&ai16c2) == sizeof ai16c2 + 1);
+ ASSERT (bos2 (&ai16c3) == sizeof ai16c3 + 2);
+
+ ASSERT (bos2 (&ai16c4) == sizeof ai16c4 + 3);
+ ASSERT (bos2 (&ai16c5) == sizeof ai16c5 + 4);
+ ASSERT (bos2 (&ai16c6) == sizeof ai16c6 + 5);
+ ASSERT (bos2 (&ai16c7) == sizeof ai16c6 + 6);
+ ASSERT (bos2 (&ai16c8) == sizeof ai16c6 + 7);
+
+ ASSERT (bos2 (&eai16cx) == sizeof eai16cx);
+
+
+ ASSERT (bos3 (&ai16c0) == sizeof ai16c0);
+ ASSERT (bos3 (&ai16c1) == sizeof ai16c1);
+ ASSERT (bos3 (&ai16c2) == sizeof ai16c2 + 1);
+ ASSERT (bos3 (&ai16c3) == sizeof ai16c3 + 2);
+
+ ASSERT (bos3 (&ai16c4) == sizeof ai16c4 + 3);
+ ASSERT (bos3 (&ai16c5) == sizeof ai16c5 + 4);
+ ASSERT (bos3 (&ai16c6) == sizeof ai16c6 + 5);
+ ASSERT (bos3 (&ai16c7) == sizeof ai16c6 + 6);
+ ASSERT (bos3 (&ai16c8) == sizeof ai16c6 + 7);
+
+ ASSERT (bos3 (&eai16cx) == sizeof eai16cx);
+}
+
+
+/* Verify sizes of a struct with a flexible array member and 3 bytes
+ of tail padding. */
+
+struct AI32CX { int32_t i; char n, a[]; };
+
+struct AI32CX ai32c0 = { 0 };
+struct AI32CX ai32c1 = { 0, 1, { 1 } };
+struct AI32CX ai32c2 = { 0, 2, { 1, 2 } };
+struct AI32CX ai32c3 = { 0, 3, { 1, 2, 3 } };
+struct AI32CX ai32c4 = { 0, 4, { 1, 2, 3, 4 } };
+struct AI32CX ai32c5 = { 0, 5, { 1, 2, 3, 4, 5 } };
+struct AI32CX ai32c6 = { 0, 6, { 1, 2, 3, 4, 5, 6 } };
+struct AI32CX ai32c7 = { 0, 7, { 1, 2, 3, 4, 5, 6, 7 } };
+struct AI32CX ai32c8 = { 0, 8, { 1, 2, 3, 4, 5, 6, 7, 8 } };
+
+extern struct AI32CX eai32cx;
+
+void fai32cx (void)
+{
+ ASSERT (bos0 (&ai32c0) == sizeof ai32c0);
+ ASSERT (bos0 (&ai32c1) == sizeof ai32c1);
+ ASSERT (bos0 (&ai32c2) == sizeof ai32c2);
+ ASSERT (bos0 (&ai32c3) == sizeof ai32c3);
+
+ ASSERT (bos0 (&ai32c4) == sizeof ai32c4 + 1);
+ ASSERT (bos0 (&ai32c5) == sizeof ai32c5 + 2);
+ ASSERT (bos0 (&ai32c6) == sizeof ai32c6 + 3);
+ ASSERT (bos0 (&ai32c7) == sizeof ai32c6 + 4);
+ ASSERT (bos0 (&ai32c8) == sizeof ai32c6 + 5);
+
+ ASSERT (bos0 (&eai32cx) == (size_t)-1);
+
+
+ ASSERT (bos1 (&ai32c0) == sizeof ai32c0);
+ ASSERT (bos1 (&ai32c1) == sizeof ai32c1);
+ ASSERT (bos1 (&ai32c2) == sizeof ai32c2);
+ ASSERT (bos1 (&ai32c3) == sizeof ai32c3);
+
+ ASSERT (bos1 (&ai32c4) == sizeof ai32c4 + 1);
+ ASSERT (bos1 (&ai32c5) == sizeof ai32c5 + 2);
+ ASSERT (bos1 (&ai32c6) == sizeof ai32c6 + 3);
+ ASSERT (bos1 (&ai32c7) == sizeof ai32c6 + 4);
+ ASSERT (bos1 (&ai32c8) == sizeof ai32c6 + 5);
+
+ ASSERT (bos1 (&eai32cx) == (size_t)-1);
+
+
+ ASSERT (bos2 (&ai32c0) == sizeof ai32c0);
+ ASSERT (bos2 (&ai32c1) == sizeof ai32c1);
+ ASSERT (bos2 (&ai32c2) == sizeof ai32c2);
+ ASSERT (bos2 (&ai32c3) == sizeof ai32c3);
+
+ ASSERT (bos2 (&ai32c4) == sizeof ai32c4 + 1);
+ ASSERT (bos2 (&ai32c5) == sizeof ai32c5 + 2);
+ ASSERT (bos2 (&ai32c6) == sizeof ai32c6 + 3);
+ ASSERT (bos2 (&ai32c7) == sizeof ai32c6 + 4);
+ ASSERT (bos2 (&ai32c8) == sizeof ai32c6 + 5);
+
+ ASSERT (bos2 (&eai32cx) == sizeof eai32cx);
+
+
+ ASSERT (bos3 (&ai32c0) == sizeof ai32c0);
+ ASSERT (bos3 (&ai32c1) == sizeof ai32c1);
+ ASSERT (bos3 (&ai32c2) == sizeof ai32c2);
+ ASSERT (bos3 (&ai32c3) == sizeof ai32c3);
+
+ ASSERT (bos3 (&ai32c4) == sizeof ai32c4 + 1);
+ ASSERT (bos3 (&ai32c5) == sizeof ai32c5 + 2);
+ ASSERT (bos3 (&ai32c6) == sizeof ai32c6 + 3);
+ ASSERT (bos3 (&ai32c7) == sizeof ai32c6 + 4);
+ ASSERT (bos3 (&ai32c8) == sizeof ai32c6 + 5);
+
+ ASSERT (bos3 (&eai32cx) == sizeof eai32cx);
+}
+
+
+/* Verify sizes of a struct with a flexible array member and 7 bytes
+ of tail padding. */
+
+struct AI64CX { int64_t i __attribute__ ((aligned (8))); char n, a[]; };
+
+struct AI64CX ai64c0 = { 0 };
+struct AI64CX ai64c1 = { 0, 1, { 1 } };
+struct AI64CX ai64c2 = { 0, 2, { 1, 2 } };
+struct AI64CX ai64c3 = { 0, 3, { 1, 2, 3 } };
+struct AI64CX ai64c4 = { 0, 4, { 1, 2, 3, 4 } };
+struct AI64CX ai64c5 = { 0, 5, { 1, 2, 3, 4, 5 } };
+struct AI64CX ai64c6 = { 0, 6, { 1, 2, 3, 4, 5, 6 } };
+struct AI64CX ai64c7 = { 0, 7, { 1, 2, 3, 4, 5, 6, 7 } };
+struct AI64CX ai64c8 = { 0, 8, { 1, 2, 3, 4, 5, 6, 7, 8 } };
+struct AI64CX ai64c9 = { 0, 8, { 1, 2, 3, 4, 5, 6, 7, 8, 9 } };
+
+extern struct AI64CX eai64cx;
+
+void fai64cx (void)
+{
+ ASSERT (bos0 (&ai64c0) == sizeof ai64c0);
+ ASSERT (bos0 (&ai64c1) == sizeof ai64c1);
+ ASSERT (bos0 (&ai64c2) == sizeof ai64c2);
+ ASSERT (bos0 (&ai64c3) == sizeof ai64c3);
+ ASSERT (bos0 (&ai64c4) == sizeof ai64c4);
+ ASSERT (bos0 (&ai64c5) == sizeof ai64c5);
+ ASSERT (bos0 (&ai64c6) == sizeof ai64c6);
+ ASSERT (bos0 (&ai64c7) == sizeof ai64c7);
+
+ ASSERT (bos0 (&ai64c8) == sizeof ai64c8 + 1);
+ ASSERT (bos0 (&ai64c9) == sizeof ai64c9 + 2);
+
+ ASSERT (bos0 (&eai64cx) == (size_t)-1);
+
+
+ ASSERT (bos1 (&ai64c0) == sizeof ai64c0);
+ ASSERT (bos1 (&ai64c1) == sizeof ai64c1);
+ ASSERT (bos1 (&ai64c2) == sizeof ai64c2);
+ ASSERT (bos1 (&ai64c3) == sizeof ai64c3);
+ ASSERT (bos1 (&ai64c4) == sizeof ai64c4);
+ ASSERT (bos1 (&ai64c5) == sizeof ai64c5);
+ ASSERT (bos1 (&ai64c6) == sizeof ai64c6);
+ ASSERT (bos1 (&ai64c7) == sizeof ai64c7);
+
+ ASSERT (bos1 (&ai64c8) == sizeof ai64c8 + 1);
+ ASSERT (bos1 (&ai64c9) == sizeof ai64c9 + 2);
+
+ ASSERT (bos1 (&eai64cx) == (size_t)-1);
+
+
+ ASSERT (bos2 (&ai64c0) == sizeof ai64c0);
+ ASSERT (bos2 (&ai64c1) == sizeof ai64c1);
+ ASSERT (bos2 (&ai64c2) == sizeof ai64c2);
+ ASSERT (bos2 (&ai64c3) == sizeof ai64c3);
+ ASSERT (bos2 (&ai64c4) == sizeof ai64c4);
+ ASSERT (bos2 (&ai64c5) == sizeof ai64c5);
+ ASSERT (bos2 (&ai64c6) == sizeof ai64c6);
+ ASSERT (bos2 (&ai64c7) == sizeof ai64c7);
+
+ ASSERT (bos2 (&ai64c8) == sizeof ai64c8 + 1);
+ ASSERT (bos2 (&ai64c9) == sizeof ai64c9 + 2);
+
+ ASSERT (bos2 (&eai64cx) == sizeof eai64cx);
+
+ ASSERT (bos3 (&ai64c0) == sizeof ai64c0);
+ ASSERT (bos3 (&ai64c1) == sizeof ai64c1);
+ ASSERT (bos3 (&ai64c2) == sizeof ai64c2);
+ ASSERT (bos3 (&ai64c3) == sizeof ai64c3);
+ ASSERT (bos3 (&ai64c4) == sizeof ai64c4);
+ ASSERT (bos3 (&ai64c5) == sizeof ai64c5);
+ ASSERT (bos3 (&ai64c6) == sizeof ai64c6);
+ ASSERT (bos3 (&ai64c7) == sizeof ai64c7);
+
+ ASSERT (bos3 (&ai64c8) == sizeof ai64c8 + 1);
+ ASSERT (bos3 (&ai64c9) == sizeof ai64c9 + 2);
+
+ ASSERT (bos3 (&eai64cx) == sizeof eai64cx);
+}
+
+
+/* Also verify sizes of a struct with a zero length array member. */
+
+struct A0C0 { char n, a[0]; };
+
+struct A0C0 a0c0 = { };
+extern struct A0C0 ea0c0;
+
+void fa0c0 (void)
+{
+ ASSERT (bos0 (&a0c0) == sizeof a0c0);
+ ASSERT (bos0 (&ea0c0) == sizeof ea0c0);
+
+ ASSERT (bos1 (&a0c0) == sizeof a0c0);
+ ASSERT (bos1 (&a0c0) == sizeof ea0c0);
+
+ ASSERT (bos2 (&a0c0) == sizeof a0c0);
+ ASSERT (bos2 (&a0c0) == sizeof ea0c0);
+
+ ASSERT (bos3 (&a0c0) == sizeof a0c0);
+ ASSERT (bos3 (&a0c0) == sizeof ea0c0);
+}
+
+/* { dg-final { scan-tree-dump-not "fail" "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/builtin-object-size-21.c b/gcc/testsuite/gcc.dg/builtin-object-size-21.c
new file mode 100644
index 00000000000..7e0f85ffdf3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtin-object-size-21.c
@@ -0,0 +1,52 @@
+/* PR middle-end/92815 - spurious -Wstringop-overflow writing into
+ a flexible array of an extern struct
+ { dg-do compile }
+ { dg-options "-Wall -fdump-tree-optimized" }
+ { dg-require-effective-target large_initializer } */
+
+#define PTRDIFF_MAX __PTRDIFF_MAX__
+
+typedef __SIZE_TYPE__ size_t;
+
+#define bos0(expr) __builtin_object_size (expr, 0)
+#define bos1(expr) __builtin_object_size (expr, 1)
+#define bos2(expr) __builtin_object_size (expr, 2)
+#define bos3(expr) __builtin_object_size (expr, 3)
+
+void fail (const char*, ...);
+
+#define A(x, n01, n23) \
+ ((bos0 (&x) == n01 ? (void)0 : fail (#x, __LINE__, bos0 (&x), n01)), \
+ (bos1 (&x) == n01 ? (void)0 : fail (#x, __LINE__, bos1 (&x), n01)), \
+ (bos2 (&x) == n23 ? (void)0 : fail (#x, __LINE__, bos2 (&x), n23)), \
+ (bos3 (&x) == n23 ? (void)0 : fail (#x, __LINE__, bos3 (&x), n23)))
+
+struct Ax_m3 { char a[PTRDIFF_MAX - 3], ax[]; };
+
+struct Ax_m3 xm3_0 = { { 0 } };
+struct Ax_m3 xm3_1 = { { 0 }, { 1 } };
+struct Ax_m3 xm3_2 = { { 0 }, { 1, 2 } };
+struct Ax_m3 xm3_3 = { { 0 }, { 1, 2, 3 } };
+struct Ax_m3 xm3_4 = { { 0 }, { 1, 2, 3, 3 } }; // { dg-error "too large" }
+
+void test_axm3 (void)
+{
+ A (xm3_0, sizeof xm3_0, sizeof xm3_0);
+ A (xm3_1, sizeof xm3_1 + 1, sizeof xm3_1 + 1);
+ A (xm3_2, sizeof xm3_2 + 2, sizeof xm3_2 + 2);
+ A (xm3_3, (size_t)-1, 0); // expect failure
+ A (xm3_4, (size_t)-1, 0); // expect failure
+}
+
+
+struct Ax_mx { char a[PTRDIFF_MAX], ax[]; };
+struct Ax_mx xmx_0 = { { 0 } };
+struct Ax_mx xmx_1 = { { 0 }, { 1 } }; // { dg-error "too large" }
+extern struct Ax_mx xmx_x;
+
+void test_axmx (void)
+{
+ A (xmx_0, (size_t)-1, 0); // expect failure
+ A (xmx_1, (size_t)-1, 0); // expect failure
+ A (xmx_x, (size_t)-1, 0); // expect failure
+}
diff --git a/gcc/testsuite/gcc.dg/builtin-stringop-chk-4.c b/gcc/testsuite/gcc.dg/builtin-stringop-chk-4.c
index 6e836c5d4d3..2409e597aac 100644
--- a/gcc/testsuite/gcc.dg/builtin-stringop-chk-4.c
+++ b/gcc/testsuite/gcc.dg/builtin-stringop-chk-4.c
@@ -99,7 +99,7 @@ void test_memcpy_range (void *d, const void *s)
memcpy (buf + 5, s, UR (1, 2)); /* { dg-warning "writing between 1 and 2 bytes into a region of size 0 overflows the destination" } */
- memcpy (buf + size_max, s, UR (1, 2)); /* { dg-warning "writing between 1 and 2 bytes into a region of size 0 overflows the destination" "excessive pointer offset" { xfail *-*-* } } */
+ memcpy (buf + size_max, s, UR (1, 2)); /* { dg-warning "writing between 1 and 2 bytes into a region of size 0 overflows the destination" "excessive pointer offset" } */
memcpy (buf, s, UR (ssize_max, size_max)); /* { dg-warning "writing \[0-9\]+ or more bytes into a region of size 5 overflows the destination" } */
memcpy (buf, s, UR (ssize_max + 1, size_max)); /* { dg-warning "specified \(bound|size\) between \[0-9\]+ and \[0-9\]+ exceeds maximum object size" } */
diff --git a/gcc/testsuite/gcc.dg/builtin-stringop-chk-5.c b/gcc/testsuite/gcc.dg/builtin-stringop-chk-5.c
index 87dd6ac4e89..b07629dad11 100644
--- a/gcc/testsuite/gcc.dg/builtin-stringop-chk-5.c
+++ b/gcc/testsuite/gcc.dg/builtin-stringop-chk-5.c
@@ -1,6 +1,6 @@
/* Test exercising -Wstringop-overflow warnings. */
/* { dg-do compile } */
-/* { dg-options "-O2 -Wstringop-overflow=1" } */
+/* { dg-options "-O2 -Wstringop-overflow=1 -Wno-array-bounds" } */
#define offsetof(type, mem) __builtin_offsetof (type, mem)
@@ -120,12 +120,12 @@ void test_memop_warn_alloc (const void *src)
/* Verify the same as above but by writing into the first mmeber
of the first element of the array. */
- memcpy (&a[0].a, src, n); /* { dg-warning "writing between 8 and 32 bytes into a region of size 4 overflows the destination" "memcpy into allocated" { xfail *-*-*} } */
+ memcpy (&a[0].a, src, n); /* { dg-warning "writing between 8 and 32 bytes into a region of size " "memcpy into allocated" } */
escape (a, src);
n = range (12, 32);
- struct B *b = __builtin_malloc (sizeof *b * 2);
+ struct B *b = __builtin_malloc (sizeof (struct B[2]));
memcpy (&b[0], src, n); /* { dg-warning "writing between 12 and 32 bytes into a region of size 8 " "memcpy into allocated" } */
escape (b);
@@ -133,33 +133,33 @@ void test_memop_warn_alloc (const void *src)
/* The following idiom of clearing multiple members of a struct is
used in a few places in the Linux kernel. Verify that a warning
is issued for it when it writes past the end of the array object. */
- memset (&b[0].a.b, 0, offsetfrom (struct B, b, a.b) + 1); /* { dg-warning "writing 8 bytes into a region of size 7" "memcpy into allocated" { xfail *-*-*} } */
+ memset (&b[0].a.b, 0, offsetfrom (struct B, struct B[2], a.b) + 1); /* { dg-warning "writing 8 bytes into a region of size " "memcpy into allocated" } */
escape (b);
- memset (&b->a.b, 0, offsetfrom (struct B, b, a.b) + 1); /* { dg-warning "writing 8 bytes into a region of size 7" "memcpy into allocated" { xfail *-*-*} } */
+ memset (&b->a.b, 0, offsetfrom (struct B, struct B[2], a.b) + 1); /* { dg-warning "writing 8 bytes into a region of size " "memcpy into allocated" } */
escape (b);
- memset (&b[0].c, 0, offsetfrom (struct B, b, c) + 1); /* { dg-warning "writing 7 bytes into a region of size 6" "memcpy into allocated" { xfail *-*-*} } */
+ memset (&b[0].c, 0, offsetfrom (struct B, struct B[2], c) + 1); /* { dg-warning "writing 7 bytes into a region of size " "memcpy into allocated" } */
escape (b);
- memset (&b->c, 0, offsetfrom (struct B, b, c) + 1); /* { dg-warning "writing 7 bytes into a region of size 6" "memcpy into allocated" { xfail *-*-*} } */
+ memset (&b->c, 0, offsetfrom (struct B, struct B[2], c) + 1); /* { dg-warning "writing 7 bytes into a region of size " "memcpy into allocated" } */
escape (b);
- memset (&b[0].d, 0, offsetfrom (struct B, b, d) + 1); /* { dg-warning "writing 6 bytes into a region of size 5" "memcpy into allocated" { xfail *-*-*} } */
+ memset (&b[0].d, 0, offsetfrom (struct B, struct B[2], d) + 1); /* { dg-warning "writing 6 bytes into a region of size " "memcpy into allocated" } */
escape (b);
- memset (&b->d, 0, offsetfrom (struct B, b, d) + 1); /* { dg-warning "writing 6 bytes into a region of size 5" "memcpy into allocated" { xfail *-*-*} } */
+ memset (&b->d, 0, offsetfrom (struct B, struct B[2], d) + 1); /* { dg-warning "writing 6 bytes into a region of size " "memcpy into allocated" } */
escape (b);
/* Same as above but clearing just elements of the second element
of the array. */
- memset (&b[1].a.b, 0, offsetfrom (struct B, b[1], a.b) + 1); /* { dg-warning "writing 4 bytes into a region of size 3" "memcpy into allocated" { xfail *-*-*} } */
+ memset (&b[1].a.b, 0, offsetfrom (struct B, b[1], a.b) + 1); /* { dg-warning "writing 4 bytes into a region of size " "memcpy into allocated" } */
escape (b);
- memset (&b[1].c, 0, offsetfrom (struct B, b[1], c) + 1); /* { dg-warning "writing 3 bytes into a region of size 2" "memcpy into allocated" { xfail *-*-*} } */
+ memset (&b[1].c, 0, offsetfrom (struct B, b[1], c) + 1); /* { dg-warning "writing 3 bytes into a region of size " "memcpy into allocated" } */
escape (b);
- memset (&b[1].d, 0, offsetfrom (struct B, b[1], d) + 1); /* { dg-warning "writing 2 bytes into a region of size 1" "memcpy into allocated" { xfail *-*-*} } */
+ memset (&b[1].d, 0, offsetfrom (struct B, b[1], d) + 1); /* { dg-warning "writing 2 bytes into a region of size 1" "memcpy into allocated" } */
escape (b);
}
diff --git a/gcc/testsuite/gcc.dg/builtin-stringop-chk-8.c b/gcc/testsuite/gcc.dg/builtin-stringop-chk-8.c
index 741c1f88eaa..12d2491b9f5 100644
--- a/gcc/testsuite/gcc.dg/builtin-stringop-chk-8.c
+++ b/gcc/testsuite/gcc.dg/builtin-stringop-chk-8.c
@@ -106,7 +106,7 @@ void test_memop_warn_alloc (void *p)
memcpy (p, &a[0], n); /* { dg-warning "reading between 8 and 32 bytes from a region of size 4" "memcpy from allocated" } */
- memcpy (p, &a[0].a, n); /* { dg-warning "reading between 8 and 32 bytes from a region of size 4" "memcpy from allocated" { xfail *-*-*} } */
+ memcpy (p, &a[0].a, n); /* { dg-warning "reading between 8 and 32 bytes from a region of size " "memcpy from allocated" } */
n = range (12, 32);
diff --git a/gcc/testsuite/gcc.dg/c11-align-9.c b/gcc/testsuite/gcc.dg/c11-align-9.c
index 3c9cf55756e..6a0d4248f1b 100644
--- a/gcc/testsuite/gcc.dg/c11-align-9.c
+++ b/gcc/testsuite/gcc.dg/c11-align-9.c
@@ -2,8 +2,8 @@
are at least some alignment constraints), case of compound literals. */
/* { dg-do compile } */
/* { dg-options "-std=c11 -pedantic-errors" } */
-/* { dg-skip-if "no alignment constraints" { "avr-*-*" } } */
#include <stddef.h>
-max_align_t *p = &(_Alignas (_Alignof (char)) max_align_t) { 1 }; /* { dg-error "reduce alignment" } */
+max_align_t *p = &(_Alignas (_Alignof (char)) max_align_t) { 1 };
+/* { dg-error "reduce alignment" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/c11-bool-limits-1.c b/gcc/testsuite/gcc.dg/c11-bool-limits-1.c
new file mode 100644
index 00000000000..9ca29be4d72
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c11-bool-limits-1.c
@@ -0,0 +1,13 @@
+/* Test limits for _Bool not in <limits.h> in C11. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11" } */
+
+#include <limits.h>
+
+#ifdef BOOL_MAX
+# error "unexpected BOOL_MAX"
+#endif
+
+#ifdef BOOL_WIDTH
+# error "unexpected BOOL_WIDTH"
+#endif
diff --git a/gcc/testsuite/gcc.dg/c2x-bool-limits-1.c b/gcc/testsuite/gcc.dg/c2x-bool-limits-1.c
new file mode 100644
index 00000000000..d32b4ef59ed
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c2x-bool-limits-1.c
@@ -0,0 +1,19 @@
+/* Test limits for _Bool in <limits.h> in C2x. */
+/* { dg-do compile } */
+/* { dg-options "-std=c2x" } */
+
+#include <limits.h>
+
+#ifndef BOOL_MAX
+# error "missing BOOL_MAX"
+#endif
+
+#ifndef BOOL_WIDTH
+# error "missing BOOL_WIDTH"
+#endif
+
+/* In principle _Bool can support values wider than 1 bit, stored via
+ type punning, but this is not supported by GCC. */
+
+_Static_assert (BOOL_MAX == 1, "bad BOOL_MAX");
+_Static_assert (BOOL_WIDTH == 1, "bad BOOL_WIDTH");
diff --git a/gcc/testsuite/gcc.dg/c90-fordecl-1.c b/gcc/testsuite/gcc.dg/c90-fordecl-1.c
index 46ba16abbc3..6a8e061fb40 100644
--- a/gcc/testsuite/gcc.dg/c90-fordecl-1.c
+++ b/gcc/testsuite/gcc.dg/c90-fordecl-1.c
@@ -9,6 +9,6 @@ foo (void)
int j = 0;
for (int i = 1; i <= 10; i++) /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "'for' loop initial declarations are only allowed in C99 or C11 mode" "declaration in for loop" { target *-*-* } .-1 } */
- /* { dg-message "note: use option '-std=c99', '-std=gnu99', '-std=c11' or '-std=gnu11' to compile your code" "note" { target *-*-* } .-2 }} */
+ /* { dg-message "note: use option '-std=c99', '-std=gnu99', '-std=c11' or '-std=gnu11' to compile your code" "note" { target *-*-* } .-2 } */
j += i;
}
diff --git a/gcc/testsuite/gcc.dg/cdce3.c b/gcc/testsuite/gcc.dg/cdce3.c
index 7e85d8aa71d..601ddf055fd 100644
--- a/gcc/testsuite/gcc.dg/cdce3.c
+++ b/gcc/testsuite/gcc.dg/cdce3.c
@@ -1,8 +1,9 @@
/* { dg-do compile } */
/* { dg-require-effective-target hard_float } */
/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -fdump-tree-optimized" } */
-/* { dg-final { scan-tree-dump "cdce3.c:10: \[^\n\r]* function call is shrink-wrapped into error conditions\." "cdce" } } */
+/* { dg-final { scan-tree-dump "cdce3.c:11: \[^\n\r]* function call is shrink-wrapped into error conditions\." "cdce" } } */
/* { dg-final { scan-tree-dump "sqrtf \\(\[^\n\r]*\\); \\\[tail call\\\]" "optimized" } } */
+/* { dg-skip-if "doesn't have a sqrtf insn" { mmix-*-* } } */
float sqrtf (float);
float foo (float x)
diff --git a/gcc/testsuite/gcc.dg/concat2.c b/gcc/testsuite/gcc.dg/concat2.c
index e9fa216d63d..62f45d4880b 100644
--- a/gcc/testsuite/gcc.dg/concat2.c
+++ b/gcc/testsuite/gcc.dg/concat2.c
@@ -11,4 +11,4 @@
#define e4 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3
#define e5 e4 e4 e4 e4 e4 e4 e4 e4 e4 e4
-void foo() { (void)(e5); } /* { dg-error "size of string literal is too large" "" { target { ! size32plus } } } */
+void foo() { (void)(e5); } /* { dg-error "size of string literal is too large" "" { target { ! size20plus } } } */
diff --git a/gcc/testsuite/gcc.dg/const-uniq-1.c b/gcc/testsuite/gcc.dg/const-uniq-1.c
index 0e0718bf505..ba7021b8385 100644
--- a/gcc/testsuite/gcc.dg/const-uniq-1.c
+++ b/gcc/testsuite/gcc.dg/const-uniq-1.c
@@ -20,4 +20,4 @@ int lookup2 (int i)
return a[i+1];
}
-/* { dg-final { scan-tree-dump-times "\[lL\]\\\$?C\\\.*0" 2 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "\[lL\]\\\$?C\[.:\]*0" 2 "gimple" } } */
diff --git a/gcc/testsuite/gcc.dg/cpp/trad/funlike-5.c b/gcc/testsuite/gcc.dg/cpp/trad/funlike-5.c
index f60a6ea7865..b5481bd3a03 100644
--- a/gcc/testsuite/gcc.dg/cpp/trad/funlike-5.c
+++ b/gcc/testsuite/gcc.dg/cpp/trad/funlike-5.c
@@ -1,7 +1,7 @@
/* Test function like macro. */
/* Contributed by Devang Patel <dpatel@apple.com> */
-/* {do-do preprocess } */
+/* { dg-do preprocess } */
/* { dg-options "-traditional-cpp -E -dD" } */
int __srget (char *);
#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-dfp.c b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-dfp.c
index 951380f125f..3e27461222d 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-dfp.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-dfp.c
@@ -1,6 +1,6 @@
/* Verify the DWARF encoding of C99 decimal floating point types. */
-/* { dg-do compile */
+/* { dg-do compile } */
/* { dg-require-effective-target dfp } */
/* { dg-options "-O0 -gdwarf -dA" } */
/* { dg-final { scan-assembler "0x10.*DW_AT_encoding" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-float.c b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-float.c
index a028d1484af..f4883842b84 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-float.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-float.c
@@ -1,6 +1,6 @@
/* Verify the DWARF encoding of C99 floating point types. */
-/* { dg-do compile */
+/* { dg-do compile } */
/* { dg-options "-O0 -gdwarf -dA" } */
/* { dg-final { scan-assembler "0x4.*DW_AT_encoding" } } */
/* { dg-final { scan-assembler "0x4.*DW_AT_byte_size" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr96383-1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr96383-1.c
new file mode 100644
index 00000000000..a9c0efb3fa8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr96383-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-g -gdwarf -dA" } */
+
+extern void foo (int);
+extern void unusedbar (int);
+
+int main()
+{
+ foo (1);
+}
+
+/* We want subprogram DIEs for both foo and main and a DIE for
+ the formal parameter of foo. We do not want a DIE for
+ unusedbar. */
+/* { dg-final { scan-assembler-times "DW_TAG_subprogram" 4 } } */
+/* { dg-final { scan-assembler-times "DW_TAG_formal_parameter" 2 } } */
+/* { dg-final { scan-assembler-not "unusedbar" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr96383-2.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr96383-2.c
new file mode 100644
index 00000000000..c3a710e2f89
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr96383-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-g -O2 -gdwarf -dA" } */
+
+extern void foo (int);
+extern void unusedbar (int);
+
+int main()
+{
+ foo (1);
+}
+
+/* We want subprogram DIEs for both foo and main and a DIE for
+ the formal parameter of foo. We do not want a DIE for
+ unusedbar. */
+/* { dg-final { scan-assembler-times "DW_TAG_subprogram" 4 } } */
+/* { dg-final { scan-assembler-times "DW_TAG_formal_parameter" 2 } } */
+/* { dg-final { scan-assembler-not "unusedbar" } } */
diff --git a/gcc/testsuite/gcc.dg/empty-source-2.c b/gcc/testsuite/gcc.dg/empty-source-2.c
index e0180ec9475..67906f9e8dd 100644
--- a/gcc/testsuite/gcc.dg/empty-source-2.c
+++ b/gcc/testsuite/gcc.dg/empty-source-2.c
@@ -3,4 +3,4 @@
/* { dg-do compile } */
/* { dg-options "-pedantic" } */
-/* { dg-warning "-:ISO C forbids an empty translation unit" "empty" } */
+/* { dg-warning "-:ISO C forbids an empty translation unit" "empty" { target *-*-* } .+1 } */
diff --git a/gcc/testsuite/gcc.dg/empty-source-3.c b/gcc/testsuite/gcc.dg/empty-source-3.c
index f8c58b3ef3f..f2877159fe4 100644
--- a/gcc/testsuite/gcc.dg/empty-source-3.c
+++ b/gcc/testsuite/gcc.dg/empty-source-3.c
@@ -4,4 +4,4 @@
/* { dg-do compile } */
/* { dg-options "-pedantic-errors" } */
-/* { dg-error "-:ISO C forbids an empty translation unit" "empty" } */
+/* { dg-error "-:ISO C forbids an empty translation unit" "empty" { target *-*-* } .+1 } */
diff --git a/gcc/testsuite/gcc.dg/fixits-pr84852-1.c b/gcc/testsuite/gcc.dg/fixits-pr84852-1.c
index 346626b4eb9..0afd9e9fb4d 100644
--- a/gcc/testsuite/gcc.dg/fixits-pr84852-1.c
+++ b/gcc/testsuite/gcc.dg/fixits-pr84852-1.c
@@ -12,7 +12,7 @@
int foo (void) { return strlen(""); }
-/* { dg-warning "incompatible implicit declaration of built-in function 'strlen'" "" { target *-*-* } -812156810 } */
+/* { dg-warning "incompatible implicit declaration of built-in function 'strlen'" "" { target *-*-* } { -812156810 } } */
/* { dg-message "include '<string.h>' or provide a declaration of 'strlen'" "" { target *-*-* } 1 } */
#if 0
{ dg-begin-multiline-output "" }
diff --git a/gcc/testsuite/gcc.dg/fixits-pr84852-2.c b/gcc/testsuite/gcc.dg/fixits-pr84852-2.c
index 9bc70f59b59..ec52eb8c72c 100644
--- a/gcc/testsuite/gcc.dg/fixits-pr84852-2.c
+++ b/gcc/testsuite/gcc.dg/fixits-pr84852-2.c
@@ -12,7 +12,7 @@
int foo (void) { return strlen(""); }
-/* { dg-warning "incompatible implicit declaration of built-in function 'strlen'" "" { target *-*-* } -812156810 } */
+/* { dg-warning "incompatible implicit declaration of built-in function 'strlen'" "" { target *-*-* } { -812156810 } } */
/* { dg-message "include '<string.h>' or provide a declaration of 'strlen'" "" { target *-*-* } 1 } */
#if 0
{ dg-begin-multiline-output "" }
diff --git a/gcc/testsuite/gcc.dg/fold-convmaxconv-1.c b/gcc/testsuite/gcc.dg/fold-convmaxconv-1.c
index 3ffff8bde42..f8157e9257c 100644
--- a/gcc/testsuite/gcc.dg/fold-convmaxconv-1.c
+++ b/gcc/testsuite/gcc.dg/fold-convmaxconv-1.c
@@ -1,9 +1,12 @@
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-optimized" } */
-int foo (short a[], int x)
+typedef int int32_t __attribute__((mode (__SI__)));
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
+
+int32_t foo (short a[], int32_t x)
{
- unsigned int i;
+ uint32_t i;
for (i = 0; i < 1000; i++)
{
x = a[i];
diff --git a/gcc/testsuite/gcc.dg/fold-convminconv-1.c b/gcc/testsuite/gcc.dg/fold-convminconv-1.c
index f4a048e1f45..7070ecf337c 100644
--- a/gcc/testsuite/gcc.dg/fold-convminconv-1.c
+++ b/gcc/testsuite/gcc.dg/fold-convminconv-1.c
@@ -1,9 +1,12 @@
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-optimized" } */
-int foo (unsigned short a[], unsigned int x)
+typedef int int32_t __attribute__((mode (__SI__)));
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
+
+int32_t foo (unsigned short a[], uint32_t x)
{
- unsigned int i;
+ uint32_t i;
for (i = 0; i < 1000; i++)
{
x = a[i];
diff --git a/gcc/testsuite/gcc.dg/fold-parity-1.c b/gcc/testsuite/gcc.dg/fold-parity-1.c
new file mode 100644
index 00000000000..3ba56c7fccb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fold-parity-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+int foo(unsigned int x)
+{
+ return __builtin_popcount(x) & 1;
+}
+
+int fool(unsigned long x)
+{
+ return __builtin_popcountl(x) & 1;
+}
+
+int fooll(unsigned long long x)
+{
+ return __builtin_popcountll(x) & 1;
+}
+
+/* { dg-final { scan-tree-dump-times "__builtin_popcount" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "__builtin_parity" 3 "original" } } */
+
diff --git a/gcc/testsuite/gcc.dg/fold-parity-2.c b/gcc/testsuite/gcc.dg/fold-parity-2.c
new file mode 100644
index 00000000000..8c7acbfd15a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fold-parity-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int foo(unsigned int x)
+{
+ return __builtin_parity(~x);
+}
+
+int fool(unsigned long x)
+{
+ return __builtin_parityl(~x);
+}
+
+int fooll(unsigned long long x)
+{
+ return __builtin_parityll(~x);
+}
+
+/* { dg-final { scan-tree-dump-times "~" 0 "optimized" } } */
+
diff --git a/gcc/testsuite/gcc.dg/fold-parity-3.c b/gcc/testsuite/gcc.dg/fold-parity-3.c
new file mode 100644
index 00000000000..e0355cca4a5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fold-parity-3.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int foo(unsigned int x)
+{
+ return __builtin_parity(x&1);
+}
+
+int fool(unsigned long x)
+{
+ return __builtin_parityl(x&1);
+}
+
+int fooll(unsigned long long x)
+{
+ return __builtin_parityll(x&1);
+}
+
+/* { dg-final { scan-tree-dump-times "__builtin_parity" 0 "optimized" } } */
+
diff --git a/gcc/testsuite/gcc.dg/fold-parity-4.c b/gcc/testsuite/gcc.dg/fold-parity-4.c
new file mode 100644
index 00000000000..5dfedab9180
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fold-parity-4.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int foo(unsigned int x, unsigned int y)
+{
+ return __builtin_parity(x) ^ __builtin_parity(y);
+}
+
+int fool(unsigned long x, unsigned long y)
+{
+ return __builtin_parityl(x) ^ __builtin_parityl(y);
+}
+
+int fooll(unsigned long long x, unsigned long long y)
+{
+ return __builtin_parityll(x) ^ __builtin_parityll(y);
+}
+
+/* { dg-final { scan-tree-dump-times "__builtin_parity" 3 "optimized" } } */
+
diff --git a/gcc/testsuite/gcc.dg/fold-parity-5.c b/gcc/testsuite/gcc.dg/fold-parity-5.c
new file mode 100644
index 00000000000..69d3a6a54ca
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fold-parity-5.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int test_and4(unsigned int a)
+{
+ return __builtin_parity(a&4);
+}
+
+int test_and4l(unsigned long b)
+{
+ return __builtin_parityl(b&4);
+}
+
+int test_and4ll(unsigned long long c)
+{
+ return __builtin_parityll(c&4);
+}
+
+int test_shift(unsigned int d)
+{
+ int bits = 8*sizeof(unsigned int)-1;
+ return __builtin_parity(d<<31);
+}
+
+int test_shiftl(unsigned long e)
+{
+ int bits = 8*sizeof(unsigned long)-1;
+ return __builtin_parityl(e<<bits);
+}
+
+int test_shiftll(unsigned long long f)
+{
+ int bits = 8*sizeof(unsigned long long)-1;
+ return __builtin_parityll(f<<bits);
+}
+
+/* { dg-final { scan-tree-dump-times "parity" 0 "optimized" } } */
+
diff --git a/gcc/testsuite/gcc.dg/fold-popcount-5.c b/gcc/testsuite/gcc.dg/fold-popcount-5.c
new file mode 100644
index 00000000000..943726f0902
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fold-popcount-5.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int test_and4(unsigned int a)
+{
+ return __builtin_popcount(a&4);
+}
+
+int test_and4l(unsigned long b)
+{
+ return __builtin_popcountl(b&4);
+}
+
+int test_and4ll(unsigned long long c)
+{
+ return __builtin_popcountll(c&4);
+}
+
+int test_shift(unsigned int d)
+{
+ int bits = 8*sizeof(unsigned int)-1;
+ return __builtin_popcount(d<<31);
+}
+
+int test_shiftl(unsigned long e)
+{
+ int bits = 8*sizeof(unsigned long)-1;
+ return __builtin_popcountl(e<<bits);
+}
+
+int test_shiftll(unsigned long long f)
+{
+ int bits = 8*sizeof(unsigned long long)-1;
+ return __builtin_popcountll(f<<bits);
+}
+
+/* { dg-final { scan-tree-dump-times "popcount" 0 "optimized" } } */
+
diff --git a/gcc/testsuite/gcc.dg/format/branch-1.c b/gcc/testsuite/gcc.dg/format/branch-1.c
index 1782064645e..4ea39b52b2e 100644
--- a/gcc/testsuite/gcc.dg/format/branch-1.c
+++ b/gcc/testsuite/gcc.dg/format/branch-1.c
@@ -10,7 +10,7 @@ foo (long l, int nfoo)
{
printf ((nfoo > 1) ? "%d foos" : "%d foo", nfoo);
printf ((l > 1) ? "%d foos" /* { dg-warning "23:int" "wrong type in conditional expr" } */
- : "%d foo", l); /* { dg-warning "16:int" "wrong type in conditional expr" } */
+ : "%d foo", l); /* { dg-warning "23:int" "wrong type in conditional expr" } */
printf ((l > 1) ? "%ld foos" : "%d foo", l); /* { dg-warning "36:int" "wrong type in conditional expr" } */
printf ((l > 1) ? "%d foos" : "%ld foo", l); /* { dg-warning "23:int" "wrong type in conditional expr" } */
/* Should allow one case to have extra arguments. */
diff --git a/gcc/testsuite/gcc.dg/format/pr79210.c b/gcc/testsuite/gcc.dg/format/pr79210.c
index 71f5dd6e082..6bdabdf21ec 100644
--- a/gcc/testsuite/gcc.dg/format/pr79210.c
+++ b/gcc/testsuite/gcc.dg/format/pr79210.c
@@ -20,4 +20,4 @@ LPFC_VPORT_ATTR_R(peer_port_login,
"Allow peer ports on the same physical port to login to each "
"other.");
-/* { dg-warning "6: format .%d. expects argument of type .int., but argument 4 has type .unsigned int. " "" { target *-*-* } .-12 } */
+/* { dg-warning "20: format .%d. expects argument of type .int., but argument 4 has type .unsigned int. " "" { target *-*-* } .-12 } */
diff --git a/gcc/testsuite/gcc.dg/gimplefe-44.c b/gcc/testsuite/gcc.dg/gimplefe-44.c
index a9a92b1701e..4580a1d0b85 100644
--- a/gcc/testsuite/gcc.dg/gimplefe-44.c
+++ b/gcc/testsuite/gcc.dg/gimplefe-44.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-fexceptions -fgimple -fdump-tree-eh-eh" } */
+/* { dg-require-effective-target nonlocal_goto } */
void __GIMPLE foo()
{
diff --git a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c
index 099f03fe89d..47b2511508e 100644
--- a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c
+++ b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c
@@ -21,7 +21,7 @@ a24 (int a)
is listed in shared clause */
z[i] = y;
/* { dg-error "'i' not specified" "" { target *-*-* } .-1 } */
- /* { dg-error "enclosing 'parallel'" "" { target *-*-* } omp_parallel } */
+ /* { dg-message "note: enclosing 'parallel'" "" { target *-*-* } omp_parallel } */
/* { dg-error "'y' not specified" "" { target *-*-* } .-3 } */
#pragma omp for firstprivate(y)
for (i = 0; i < 10; i++)
diff --git a/gcc/testsuite/gcc.dg/gomp/gomp.exp b/gcc/testsuite/gcc.dg/gomp/gomp.exp
index 2414c22939a..8a7f18ead46 100644
--- a/gcc/testsuite/gcc.dg/gomp/gomp.exp
+++ b/gcc/testsuite/gcc.dg/gomp/gomp.exp
@@ -31,7 +31,7 @@ dg-init
# Main loop.
dg-runtest [lsort [concat \
[find $srcdir/$subdir *.c] \
- [find $srcdir/c-c++-common/gomp *.c]]] "" "-fopenmp -Wno-hsa"
+ [find $srcdir/c-c++-common/gomp *.c]]] "" "-fopenmp"
# All done.
dg-finish
diff --git a/gcc/testsuite/gcc.dg/gomp/loop-1.c b/gcc/testsuite/gcc.dg/gomp/loop-1.c
index 527d3192923..7ec634664f4 100644
--- a/gcc/testsuite/gcc.dg/gomp/loop-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/loop-1.c
@@ -73,13 +73,13 @@ f1 (int x)
for (i = j; i < 16; i = i + 2)
for (j = 0; j < 16; j++)
;
- #pragma omp for collapse(2) /* { dg-error "initializer expression refers to iteration variable" } */
+ #pragma omp for collapse(2)
for (i = 0; i < 16; i = i + 2)
for (j = i; j < 16; j += 2)
;
#pragma omp for collapse(2)
for (i = 0; i < 16; i = i + 2)
- for (j = i + 3; j < 16; j += 2) /* { dg-error "initializer expression refers to iteration variable" } */
+ for (j = i + 3; j < 16; j += 2)
;
#pragma omp for collapse(2)
for (i = 0; i < 16; i++)
@@ -91,11 +91,11 @@ f1 (int x)
;
#pragma omp for collapse(2)
for (i = 0; i < 16; i++)
- for (j = 0; j < i; j++) /* { dg-error "condition expression refers to iteration variable" } */
+ for (j = 0; j < i; j++)
;
#pragma omp for collapse(2)
for (i = 0; i < 16; i++)
- for (j = 0; j < i + 4; j++) /* { dg-error "condition expression refers to iteration variable" } */
+ for (j = 0; j < i + 4; j++)
;
#pragma omp for collapse(2)
for (i = 0; i < j + 4; i++) /* { dg-error "condition expression refers to iteration variable" } */
@@ -206,13 +206,13 @@ f2 (int x)
for (int i = 0; i < 16; i = i + 2)
for (int j = 0; j < 16; j += 2)
;
- #pragma omp for collapse(2) /* { dg-error "initializer expression refers to iteration variable" } */
+ #pragma omp for collapse(2)
for (int i = 0; i < 16; i = i + 2)
for (int j = i; j < 16; j += 2)
;
#pragma omp for collapse(2)
for (int i = 0; i < 16; i = i + 2)
- for (int j = i + 3; j < 16; j += 2) /* { dg-error "initializer expression refers to iteration variable" } */
+ for (int j = i + 3; j < 16; j += 2)
;
#pragma omp for collapse(2)
for (int i = 0; i < 16; i++)
@@ -224,11 +224,11 @@ f2 (int x)
;
#pragma omp for collapse(2)
for (int i = 0; i < 16; i++)
- for (int j = 0; j < i; j++) /* { dg-error "condition expression refers to iteration variable" } */
+ for (int j = 0; j < i; j++)
;
#pragma omp for collapse(2)
for (int i = 0; i < 16; i++)
- for (int j = 0; j < i + 4; j++) /* { dg-error "condition expression refers to iteration variable" } */
+ for (int j = 0; j < i + 4; j++)
;
#pragma omp for collapse(2)
for (int i = 0; i < 16; i++)
diff --git a/gcc/testsuite/gcc.dg/gomp/loop-2.c b/gcc/testsuite/gcc.dg/gomp/loop-2.c
new file mode 100644
index 00000000000..2917a4a519d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/loop-2.c
@@ -0,0 +1,13 @@
+void
+foo (void)
+{
+ int i = 0;
+ #pragma omp for collapse(2) /* { dg-error "the same loop iteration variables 'i' used in multiple associated loops" } */
+ for (i = 0; i < 16; i++)
+ for (i = 1; i < 32; i++)
+ ;
+ #pragma omp taskloop collapse(2) /* { dg-error "the same loop iteration variables 'j' used in multiple associated loops" } */
+ for (int j = 0; j < 16; j++)
+ for (j = 0; j < 16; j++)
+ ;
+}
diff --git a/gcc/testsuite/gcc.dg/gomp/parallel-2.c b/gcc/testsuite/gcc.dg/gomp/parallel-2.c
index 68e577766b1..b2d653db9e2 100644
--- a/gcc/testsuite/gcc.dg/gomp/parallel-2.c
+++ b/gcc/testsuite/gcc.dg/gomp/parallel-2.c
@@ -4,11 +4,11 @@ void foo()
{
int i;
- #pragma omp parallel default(none) // { dg-error "enclosing" }
+ #pragma omp parallel default(none) // { dg-message "note: enclosing 'parallel'" }
{
#pragma omp parallel
{
- #pragma omp parallel default(none) // { dg-error "enclosing" }
+ #pragma omp parallel default(none) // { dg-message: "note: enclosing 'parallel'" }
{
i++; // { dg-error "not specified" }
}
diff --git a/gcc/testsuite/gcc.dg/gomp/pr44085.c b/gcc/testsuite/gcc.dg/gomp/pr44085.c
index 55462abe504..3f3441bde88 100644
--- a/gcc/testsuite/gcc.dg/gomp/pr44085.c
+++ b/gcc/testsuite/gcc.dg/gomp/pr44085.c
@@ -9,7 +9,7 @@ int thr1, thr2;
void
foo (void)
{
-#pragma omp task untied /* { dg-error "enclosing task" } */
+#pragma omp task untied /* { dg-message "note: enclosing task" } */
{
thr1++; /* { dg-error "used in untied task" } */
thr2 |= 4; /* { dg-error "used in untied task" } */
diff --git a/gcc/testsuite/gcc.dg/gomp/pr95108.c b/gcc/testsuite/gcc.dg/gomp/pr95108.c
new file mode 100644
index 00000000000..b492333686b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr95108.c
@@ -0,0 +1,18 @@
+/* PR middle-end/95108 */
+/* { dg-do compile { target vect_simd_clones } } */
+/* { dg-options "-O2 -fopenmp-simd -w" } */
+
+int *v;
+
+#pragma omp declare simd
+void
+foo (int x)
+{
+ int *a = &x + 1;
+
+ for (;;)
+ {
+ *v = *a;
+ a = v;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/gomp/pr95315-2.c b/gcc/testsuite/gcc.dg/gomp/pr95315-2.c
new file mode 100644
index 00000000000..3a5018a1eee
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr95315-2.c
@@ -0,0 +1,46 @@
+/* PR middle-end/95315 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp --param ggc-min-heapsize=0" } */
+
+typedef float __v4sf __attribute__((vector_size (16)));
+typedef int __v4si __attribute__((vector_size (16)));
+typedef float __v8sf __attribute__((vector_size (32)));
+typedef int __v8si __attribute__((vector_size (32)));
+__v4si f1 (__v4sf, __v4sf, float *);
+__v8si f2 (__v8sf, __v8sf, float *);
+__v4si f3 (__v4si, int, __v4si);
+
+#pragma omp declare variant (f1) match (construct={parallel,for,simd(simdlen(4),notinbranch,uniform(z),aligned(z:4 * sizeof (*z)))})
+#pragma omp declare variant (f2) match (construct={for,simd(uniform(z),simdlen(8),notinbranch)})
+int f4 (float x, float y, float *z);
+
+#pragma omp declare variant (f3) match (construct={simd(simdlen(4),inbranch,linear(y:1))})
+int f5 (int x, int y);
+
+static inline __attribute__((always_inline)) int
+ret_false (void)
+{
+ return 0;
+}
+
+void
+test (int *x, float *y, float *z, float *w)
+{
+ #pragma omp parallel
+ #pragma omp for simd aligned (w:4 * sizeof (float))
+ for (int i = 0; i < 1024; i++)
+ if (ret_false ())
+ x[i] = f4 (y[i], z[i], w);
+ #pragma omp parallel for simd aligned (w:4 * sizeof (float)) simdlen(4)
+ for (int i = 1024; i < 2048; i++)
+ if (ret_false ())
+ x[i] = f4 (y[i], z[i], w);
+ #pragma omp simd aligned (w:4 * sizeof (float))
+ for (int i = 2048; i < 4096; i++)
+ if (ret_false ())
+ x[i] = f4 (y[i], z[i], w);
+ #pragma omp simd
+ for (int i = 4096; i < 8192; i++)
+ if (x[i] > 10 && ret_false ())
+ x[i] = f5 (x[i], i);
+}
diff --git a/gcc/testsuite/gcc.dg/gomp/pr95315.c b/gcc/testsuite/gcc.dg/gomp/pr95315.c
new file mode 100644
index 00000000000..4981e0b8949
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr95315.c
@@ -0,0 +1,5 @@
+/* PR middle-end/95315 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp --param ggc-min-heapsize=0" } */
+
+#include "../../c-c++-common/gomp/declare-variant-5.c"
diff --git a/gcc/testsuite/gcc.dg/gomp/sharing-1.c b/gcc/testsuite/gcc.dg/gomp/sharing-1.c
index 79abb64cdd7..2c6b01779d1 100644
--- a/gcc/testsuite/gcc.dg/gomp/sharing-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/sharing-1.c
@@ -35,7 +35,7 @@ main (void)
*p = 7;
s = 6;
l = 0;
-#pragma omp parallel for /* { dg-error "enclosing 'parallel'" } */ \
+#pragma omp parallel for /* { dg-message "note: enclosing 'parallel'" } */ \
default (none) private (p) shared (s)
for (i = 0; i < 64; i++)
{
diff --git a/gcc/testsuite/gcc.dg/gomp/vla-1.c b/gcc/testsuite/gcc.dg/gomp/vla-1.c
index bb37f33e60f..dd42b9a0752 100644
--- a/gcc/testsuite/gcc.dg/gomp/vla-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/vla-1.c
@@ -4,7 +4,7 @@ void foo(int n)
{
int A[n];
- #pragma omp parallel default(none) // { dg-error "enclosing" }
+ #pragma omp parallel default(none) // { dg-message "note: enclosing 'parallel'" }
{
A[0] = 0; // { dg-error "'A' not specified" }
}
diff --git a/gcc/testsuite/gcc.dg/graphite/scop-4.c b/gcc/testsuite/gcc.dg/graphite/scop-4.c
index eeaa7fa02bc..a691eeaf8f2 100644
--- a/gcc/testsuite/gcc.dg/graphite/scop-4.c
+++ b/gcc/testsuite/gcc.dg/graphite/scop-4.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target size20plus } */
+
void bar ();
int toto()
diff --git a/gcc/testsuite/gcc.dg/guality/pr95343.c b/gcc/testsuite/gcc.dg/guality/pr95343.c
new file mode 100644
index 00000000000..a3e57decda8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr95343.c
@@ -0,0 +1,45 @@
+/* { dg-do run } */
+/* { dg-options "-g -fno-ipa-icf" } */
+
+volatile int v;
+
+int __attribute__((noipa))
+get_val0 (void) {return 0;}
+int __attribute__((noipa))
+get_val2 (void) {return 2;}
+
+struct S
+{
+ int a, b, c;
+};
+
+static int __attribute__((noinline))
+bar (struct S s, int x, int y, int z, int i)
+{
+ int r;
+ v = s.a + s.b; /* { dg-final { gdb-test . "i+1" "3" } } */
+ return r;
+}
+
+static int __attribute__((noinline))
+foo (struct S s, int i)
+{
+ int r;
+ r = bar (s, 3, 4, 5, i);
+ return r;
+}
+
+
+int
+main (void)
+{
+ struct S s;
+ int i;
+ i = get_val2 ();
+ s.a = get_val0 ();
+ s.b = get_val0 ();
+ s.c = get_val0 ();
+ int r = foo (s, i);
+ v = r + i;
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/ia64-sync-5.c b/gcc/testsuite/gcc.dg/ia64-sync-5.c
new file mode 100644
index 00000000000..a3923b06b35
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ia64-sync-5.c
@@ -0,0 +1,83 @@
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+/* { dg-options } */
+/* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
+
+/* Test basic functionality of the intrinsics. */
+
+/* This is a copy of gcc.dg/ia64-sync-3.c, for 8-bit and 16-bit. */
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+
+extern void abort (void);
+extern void *memcpy (void *, const void *, size_t);
+extern int memcmp (const void *, const void *, size_t);
+
+static signed char AC[4];
+static signed char init_qi[4] = { -30,-30,-50,-50 };
+static signed char test_qi[4] = { -115,-115,25,25 };
+
+static void
+do_qi (void)
+{
+ if (__sync_val_compare_and_swap(AC+0, -30, -115) != -30)
+ abort ();
+ if (__sync_val_compare_and_swap(AC+0, -30, -115) != -115)
+ abort ();
+ if (__sync_bool_compare_and_swap(AC+1, -30, -115) != 1)
+ abort ();
+ if (__sync_bool_compare_and_swap(AC+1, -30, -115) != 0)
+ abort ();
+
+ if (__sync_val_compare_and_swap(AC+2, AC[2], 25) != -50)
+ abort ();
+ if (__sync_val_compare_and_swap(AC+2, AC[2], 25) != 25)
+ abort ();
+ if (__sync_bool_compare_and_swap(AC+3, AC[3], 25) != 1)
+ abort ();
+ if (__sync_bool_compare_and_swap(AC+3, AC[3], 25) != 1)
+ abort ();
+}
+
+static short AS[4];
+static short init_hi[4] = { -30,-30,-50,-50 };
+static short test_hi[4] = { -115,-115,25,25 };
+
+static void
+do_hi (void)
+{
+ if (__sync_val_compare_and_swap(AS+0, -30, -115) != -30)
+ abort ();
+ if (__sync_val_compare_and_swap(AS+0, -30, -115) != -115)
+ abort ();
+ if (__sync_bool_compare_and_swap(AS+1, -30, -115) != 1)
+ abort ();
+ if (__sync_bool_compare_and_swap(AS+1, -30, -115) != 0)
+ abort ();
+
+ if (__sync_val_compare_and_swap(AS+2, AS[2], 25) != -50)
+ abort ();
+ if (__sync_val_compare_and_swap(AS+2, AS[2], 25) != 25)
+ abort ();
+ if (__sync_bool_compare_and_swap(AS+3, AS[3], 25) != 1)
+ abort ();
+ if (__sync_bool_compare_and_swap(AS+3, AS[3], 25) != 1)
+ abort ();
+}
+
+int main()
+{
+ memcpy(AC, init_qi, sizeof(init_qi));
+ memcpy(AS, init_hi, sizeof(init_hi));
+
+ do_qi ();
+ do_hi ();
+
+ if (memcmp (AC, test_qi, sizeof(test_qi)))
+ abort ();
+ if (memcmp (AS, test_hi, sizeof(test_hi)))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/independent-cloneids-1.c b/gcc/testsuite/gcc.dg/independent-cloneids-1.c
index 61c12036841..516211a6e86 100644
--- a/gcc/testsuite/gcc.dg/independent-cloneids-1.c
+++ b/gcc/testsuite/gcc.dg/independent-cloneids-1.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone" } */
+/* { dg-skip-if "Odd label definition syntax" { mmix-*-* } } */
extern int printf (const char *, ...);
diff --git a/gcc/testsuite/gcc.dg/intermod-1.c b/gcc/testsuite/gcc.dg/intermod-1.c
index 44a8ce071b5..9f8d19deb6a 100644
--- a/gcc/testsuite/gcc.dg/intermod-1.c
+++ b/gcc/testsuite/gcc.dg/intermod-1.c
@@ -1,5 +1,4 @@
/* { dg-do compile } */
-/* { dg-additional-options "-mlocal-symbol-id=" { target amdgcn-*-* } } */
/* { dg-final { scan-assembler-not {foo[1-9]\.[0-9]} } } */
/* Check that we don't get .0 suffixes on static variables when not using
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-clone-2.c b/gcc/testsuite/gcc.dg/ipa/ipa-clone-2.c
index d513020ee8b..53ae25a1e24 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-clone-2.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-clone-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -fdump-ipa-cp-details -fno-early-inlining --param ipa-cp-max-recursive-depth=8" } */
+/* { dg-options "-O3 -fdump-ipa-cp-details -fno-early-inlining --param ipa-cp-max-recursive-depth=8 --param=ipa-cp-eval-threshold=400" } */
int fn();
diff --git a/gcc/testsuite/gcc.dg/ipa/ipcp-agg-13.c b/gcc/testsuite/gcc.dg/ipa/ipcp-agg-13.c
new file mode 100644
index 00000000000..47e9e530aa9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/ipcp-agg-13.c
@@ -0,0 +1,45 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-cp --param ipa-cp-eval-threshold=1" } */
+
+int data;
+int fn();
+
+int __attribute__((noinline)) f1 (int *p)
+{
+ data = *p;
+ fn ();
+ return 0;
+}
+
+int __attribute__((noinline)) f2 (int *p)
+{
+ *p = *p + 1;
+ f1 (p);
+ return 1;
+}
+
+int __attribute__((noinline)) f3 (int a, int *p)
+{
+ *p = a - 2;
+ f1 (p);
+ return 1;
+}
+
+int f4 ()
+{
+ int i;
+
+ for (i = 0; i < 100; i++)
+ {
+ int v = 2;
+
+ f2 (&v);
+ f3 (6, &v);
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "Aggregate replacements: 0\\\[0]=2" "cp" } } */
+/* { dg-final { scan-ipa-dump "Aggregate replacements: 0\\\[0]=3" "cp" } } */
+/* { dg-final { scan-ipa-dump "Aggregate replacements: 0\\\[0]=4" "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipcp-agg-8.c b/gcc/testsuite/gcc.dg/ipa/ipcp-agg-8.c
index a2a870d2e1a..2d9c82f7310 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipcp-agg-8.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipcp-agg-8.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -fno-ipa-sra -fdump-tree-optimized-slim" } */
+/* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-cp" } */
/* { dg-add-options bind_pic_locally } */
struct S
@@ -48,4 +48,5 @@ entry (int c)
foo (4, i, &s);
}
}
-/* { dg-final { scan-tree-dump "->b;" "optimized" } } */
+/* { dg-final { scan-ipa-dump "Aggregate replacements: 1\\\[32]=64, 1\\\[64]=32" "cp" } } */
+/* { dg-final { scan-ipa-dump "Aggregate replacements: 1\\\[32]=0" "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/pr95113.c b/gcc/testsuite/gcc.dg/ipa/pr95113.c
new file mode 100644
index 00000000000..a8f8c901ebe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/pr95113.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fexceptions -fnon-call-exceptions" } */
+/* { dg-require-effective-target exceptions } */
+
+int a, b;
+
+static inline long int
+foo (long int x, int y)
+{
+ if (y == 0)
+ return 0;
+
+ if (x == -1 && y == -1)
+ return 0;
+
+ return x / y;
+}
+
+static inline int
+bar (int *p)
+{
+ int c = foo (a, 1) + *p;
+ return b;
+}
+
+int
+main ()
+{
+ int d = 0;
+ b = foo (1, 1);
+ bar (&d);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/ipa/pr96040.c b/gcc/testsuite/gcc.dg/ipa/pr96040.c
new file mode 100644
index 00000000000..af7e9c4ed94
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/pr96040.c
@@ -0,0 +1,57 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -std=c99" } */
+
+
+int puts(const char *);
+int snprintf(char *, unsigned long, const char *, ...);
+unsigned long strspn(const char *, const char *);
+
+struct TValue {
+ union {
+ long long i;
+ double n;
+ } value_;
+ unsigned char tt_;
+};
+
+static int tostringbuff (struct TValue *num, char *str) {
+ int len;
+ if (num->tt_ == 3) {
+ len = snprintf(str,50,"%lld",num->value_.i);
+ } else {
+ len = snprintf(str,50,"%.14g",num->value_.n);
+ if (str[strspn(str, "-0123456789")] == '\0') {
+ str[len++] = '.';
+ str[len++] = '0';
+ }
+ }
+ return len;
+}
+
+void unused (int *buff, struct TValue *num) {
+ char junk[50];
+ *buff += tostringbuff(num, junk);
+}
+
+char space[400];
+
+void addnum2buff (int *buff, struct TValue *num) __attribute__((__noinline__));
+void addnum2buff (int *buff, struct TValue *num) {
+ *buff += tostringbuff(num, space);
+}
+
+int __attribute__((noipa)) check_space (char *s)
+{
+ return (s[0] == '1' && s[1] == '.' && s[2] =='0' && s[3] == '\0');
+}
+
+int main(void) {
+ int buff = 0;
+ struct TValue num;
+ num.value_.n = 1.0;
+ num.tt_ = 19;
+ addnum2buff(&buff, &num);
+ if (!check_space(space))
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/ipa/pr96482-2.c b/gcc/testsuite/gcc.dg/ipa/pr96482-2.c
new file mode 100644
index 00000000000..54b71ac4fc0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/pr96482-2.c
@@ -0,0 +1,33 @@
+/* PR ipa/96482 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int i2c_transfer();
+void _dev_err();
+
+struct i2c_msg {
+ char bufaddr;
+ int adapterdev;
+} wdt87xx_i2c_xfer_client;
+
+int wdt87xx_i2c_xfer_client_0, wdt87xx_i2c_xfer_rxdata, wdt87xx_get_string_str_idx;
+
+void
+static wdt87xx_i2c_xfer(void *txdata, unsigned rxlen) {
+ struct i2c_msg msgs[] = {wdt87xx_i2c_xfer_client_0, rxlen,
+ wdt87xx_i2c_xfer_rxdata};
+ int error = i2c_transfer(wdt87xx_i2c_xfer_client, msgs);
+ _dev_err("", __func__, error);
+}
+static void wdt87xx_get_string(unsigned len) {
+ char tx_buf[] = {wdt87xx_get_string_str_idx, 3};
+ int rx_len = len + 2;
+ wdt87xx_i2c_xfer(tx_buf, rx_len);
+}
+
+void
+wdt87xx_ts_probe_tx_buf() {
+ wdt87xx_get_string(34);
+ wdt87xx_get_string(8);
+ wdt87xx_i2c_xfer(wdt87xx_ts_probe_tx_buf, 2);
+}
diff --git a/gcc/testsuite/gcc.dg/ipa/pr96482.c b/gcc/testsuite/gcc.dg/ipa/pr96482.c
new file mode 100644
index 00000000000..68ead798d28
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/pr96482.c
@@ -0,0 +1,44 @@
+/* PR ipa/96482 */
+/* { dg-do run } */
+/* { dg-options "-O2 -flto" } */
+/* { dg-require-effective-target lto } */
+
+int
+__attribute__((noinline))
+foo(int arg)
+{
+ if (arg == 3)
+ return 1;
+ if (arg == 4)
+ return 123;
+
+ __builtin_unreachable ();
+}
+
+int
+__attribute__((noinline))
+baz(int x)
+{
+ if (x != 0)
+ return foo(3); /* called */
+
+ return 1;
+}
+
+int
+__attribute__((noinline))
+bar(int x)
+{
+ if (x == 0)
+ return foo(5); /* not executed */
+
+ return 1;
+}
+
+int main(int argc, char **argv)
+{
+ if (bar(argc) != baz(argc))
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/loop-8.c b/gcc/testsuite/gcc.dg/loop-8.c
index 1eefccc1a3b..af317d80a29 100644
--- a/gcc/testsuite/gcc.dg/loop-8.c
+++ b/gcc/testsuite/gcc.dg/loop-8.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-rtl-loop2_invariant" } */
-/* { dg-skip-if "unexpected IV" { "hppa*-*-* mips*-*-* visium-*-* powerpc*-*-* riscv*-*-*" } } */
+/* { dg-skip-if "unexpected IV" { "hppa*-*-* mips*-*-* visium-*-* powerpc*-*-* riscv*-*-* mmix-*-*" } } */
/* Load immediate on condition is available from z13 on and prevents moving
the load out of the loop, so always run this test with -march=zEC12 that
does not have load immediate on condition. */
diff --git a/gcc/testsuite/gcc.dg/loop-versioning-1.c b/gcc/testsuite/gcc.dg/loop-versioning-1.c
index 17e95fdfbab..2f2c1eeee72 100644
--- a/gcc/testsuite/gcc.dg/loop-versioning-1.c
+++ b/gcc/testsuite/gcc.dg/loop-versioning-1.c
@@ -45,7 +45,11 @@ f6 (double *x, int stepx, unsigned int limit)
*y = 100;
}
+#if __SIZEOF_SIZE_T__ < 4
+double x[1000];
+#else
double x[10000];
+#endif
void
g1 (int stepx, int n)
diff --git a/gcc/testsuite/gcc.dg/loop-versioning-2.c b/gcc/testsuite/gcc.dg/loop-versioning-2.c
index 3d07f83d205..d9a1a99aead 100644
--- a/gcc/testsuite/gcc.dg/loop-versioning-2.c
+++ b/gcc/testsuite/gcc.dg/loop-versioning-2.c
@@ -1,5 +1,5 @@
/* { dg-options "-O3 -fdump-tree-lversion-details" } */
-/* { dg-require-effective-target size32plus } */
+/* { dg-require-effective-target size20plus } */
/* Versioning for step == 1 in these loops would allow loop interchange,
but otherwise isn't worthwhile. At the moment we decide not to version. */
diff --git a/gcc/testsuite/gcc.dg/lto/20081210-1_0.c b/gcc/testsuite/gcc.dg/lto/20081210-1_0.c
index 80a1e9a2c03..8048b26b34e 100644
--- a/gcc/testsuite/gcc.dg/lto/20081210-1_0.c
+++ b/gcc/testsuite/gcc.dg/lto/20081210-1_0.c
@@ -1,10 +1,4 @@
-#if defined(_LP64)
-typedef unsigned long int uintptr_t;
-#elif defined (_WIN64)
-typedef unsigned long long int uintptr_t;
-#else
-typedef unsigned int uintptr_t;
-#endif
+typedef __UINTPTR_TYPE__ uintptr_t;
extern void srand (uintptr_t);
diff --git a/gcc/testsuite/gcc.dg/lto/pr52634_0.c b/gcc/testsuite/gcc.dg/lto/pr52634_0.c
index 5e14ad9a733..ad4728f0339 100644
--- a/gcc/testsuite/gcc.dg/lto/pr52634_0.c
+++ b/gcc/testsuite/gcc.dg/lto/pr52634_0.c
@@ -1,7 +1,7 @@
/* { dg-require-weak "" } */
/* { dg-require-alias "" } */
/* { dg-lto-do link } */
-/* { dg-lto-options {{-flto -r -flto-partition=1to1}} */
+/* { dg-lto-options { { -flto -r -flto-partition=1to1 } } } */
/* { dg-extra-ld-options "-flinker-output=nolto-rel" } */
extern int cfliteValueCallBacks;
void baz (int *);
diff --git a/gcc/testsuite/gcc.dg/lto/pr85870_0.c b/gcc/testsuite/gcc.dg/lto/pr85870_0.c
index b57ac7c0d73..b1b71c63334 100644
--- a/gcc/testsuite/gcc.dg/lto/pr85870_0.c
+++ b/gcc/testsuite/gcc.dg/lto/pr85870_0.c
@@ -3,16 +3,18 @@
/* { dg-lto-options { { -flto -O2 } } } */
/* { dg-extra-ld-options { -r -nostdlib -flinker-output=nolto-rel } } */
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
+
typedef struct abc_s {
char a1;
short a2;
- unsigned int a3;
- unsigned int a4;
+ uint32_t a3;
+ uint32_t a4;
} abc;
typedef struct xyz_s {
- unsigned x1;
- unsigned x2;
+ uint32_t x1;
+ uint32_t x2;
abc *x3;
} xyz;
diff --git a/gcc/testsuite/gcc.dg/lto/pr85870_1.c b/gcc/testsuite/gcc.dg/lto/pr85870_1.c
index cd1cd310164..c035bbb2fbe 100644
--- a/gcc/testsuite/gcc.dg/lto/pr85870_1.c
+++ b/gcc/testsuite/gcc.dg/lto/pr85870_1.c
@@ -1,14 +1,16 @@
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
+
typedef struct abc_s {
char a1;
short a2;
- unsigned int a3;
- unsigned int a4;
+ uint32_t a3;
+ uint32_t a4;
} abc;
typedef struct xyz_s {
- unsigned int x1;
- unsigned int x2;
+ uint32_t x1;
+ uint32_t x2;
abc *x3;
} xyz;
diff --git a/gcc/testsuite/gcc.dg/lto/pr96291.h b/gcc/testsuite/gcc.dg/lto/pr96291.h
new file mode 100644
index 00000000000..70eb3cb71b8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr96291.h
@@ -0,0 +1,4 @@
+void e(void);
+void f(void);
+void a(void *, void *);
+void c(int);
diff --git a/gcc/testsuite/gcc.dg/lto/pr96291_0.c b/gcc/testsuite/gcc.dg/lto/pr96291_0.c
new file mode 100644
index 00000000000..07e63038e03
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr96291_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-do link } */
+
+#include "pr96291.h"
+
+static void * b;
+void c(int d) {
+ f();
+ a(b, b);
+}
+
+void e(void) { c(0); }
diff --git a/gcc/testsuite/gcc.dg/lto/pr96291_1.c b/gcc/testsuite/gcc.dg/lto/pr96291_1.c
new file mode 100644
index 00000000000..44744a94941
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr96291_1.c
@@ -0,0 +1,3 @@
+#include "pr96291.h"
+
+void f(void) { c(0); }
diff --git a/gcc/testsuite/gcc.dg/lto/pr96291_2.c b/gcc/testsuite/gcc.dg/lto/pr96291_2.c
new file mode 100644
index 00000000000..5febffbb00c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr96291_2.c
@@ -0,0 +1,7 @@
+/* { dg-options {-O0} } */
+
+#include "pr96291.h"
+
+void a(void * a1, void * a2) { e(); }
+
+int main(){}
diff --git a/gcc/testsuite/gcc.dg/memchr.c b/gcc/testsuite/gcc.dg/memchr.c
new file mode 100644
index 00000000000..fb21d58b476
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/memchr.c
@@ -0,0 +1,94 @@
+/* PR middle-end/78257 - missing memcmp optimization with constant arrays
+ { dg-do compile }
+ { dg-options "-O -Wall -fdump-tree-optimized" } */
+
+typedef __INT8_TYPE__ int8_t;
+typedef __INT16_TYPE__ int16_t;
+typedef __INT32_TYPE__ int32_t;
+typedef __SIZE_TYPE__ size_t;
+
+extern void* memchr (const void*, int, size_t);
+
+/* Verify that initializers for flexible array members are handled
+ correctly. */
+
+struct SX
+{
+ /* offset */
+ /* 0 */ int32_t n;
+ /* 4 */ int8_t: 1;
+ /* 6 */ int16_t a[];
+};
+
+_Static_assert (__builtin_offsetof (struct SX, a) == 6);
+
+const struct SX sx =
+ {
+ 0x11121314, { 0x2122, 0x3132, 0x4142, 0x5152 }
+ };
+
+const char sx_rep[] =
+ {
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ 0x11, 0x12, 0x13, 0x14, 0, 0, 0x21, 0x22, 0x31, 0x32, 0x41, 0x42, 0x51, 0x52
+#else
+ 0x14, 0x13, 0x12, 0x11, 0, 0, 0x22, 0x21, 0x32, 0x31, 0x42, 0x41, 0x52, 0x51
+#endif
+ };
+
+
+void test_find (void)
+{
+ int n = 0, nb = (const char*)&sx.a[4] - (const char*)&sx;
+ const char *p = (const char*)&sx, *q = sx_rep;
+
+ if (nb != sizeof sx_rep)
+ __builtin_abort ();
+
+ n += p == memchr (p, q[ 0], nb);
+ n += p + 1 == memchr (p, q[ 1], nb);
+ n += p + 2 == memchr (p, q[ 2], nb);
+ n += p + 3 == memchr (p, q[ 3], nb);
+ n += p + 4 == memchr (p, q[ 4], nb);
+ n += p + 4 == memchr (p, q[ 5], nb);
+ n += p + 6 == memchr (p, q[ 6], nb);
+ n += p + 7 == memchr (p, q[ 7], nb);
+ n += p + 8 == memchr (p, q[ 8], nb);
+ n += p + 9 == memchr (p, q[ 9], nb);
+ n += p + 10 == memchr (p, q[10], nb);
+ n += p + 11 == memchr (p, q[11], nb);
+ n += p + 12 == memchr (p, q[12], nb);
+ n += p + 13 == memchr (p, q[13], nb);
+
+ if (n != 14)
+ __builtin_abort ();
+}
+
+void test_not_find (void)
+{
+ int n = 0, nb = (const char*)&sx.a[4] - (const char*)&sx;
+ const char *p = (const char*)&sx, *q = sx_rep;
+
+ if (nb != sizeof sx_rep)
+ __builtin_abort ();
+
+ n += 0 == memchr (p, 0xff, nb);
+ n += 0 == memchr (p + 1, q[ 0], nb - 1);
+ n += 0 == memchr (p + 2, q[ 1], nb - 2);
+ n += 0 == memchr (p + 3, q[ 2], nb - 3);
+ n += 0 == memchr (p + 4, q[ 3], nb - 4);
+ n += 0 == memchr (p + 6, q[ 4], nb - 6);
+ n += 0 == memchr (p + 7, q[ 6], nb - 7);
+ n += 0 == memchr (p + 8, q[ 7], nb - 8);
+ n += 0 == memchr (p + 9, q[ 8], nb - 9);
+ n += 0 == memchr (p + 10, q[ 9], nb - 10);
+ n += 0 == memchr (p + 11, q[10], nb - 11);
+ n += 0 == memchr (p + 12, q[11], nb - 12);
+ n += 0 == memchr (p + 13, q[12], nb - 13);
+ n += 0 == memchr (p + 14, q[13], nb - 14);
+
+ if (n != 14)
+ __builtin_abort ();
+}
+
+/* { dg-final { scan-tree-dump-not "abort" "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/memcmp-2.c b/gcc/testsuite/gcc.dg/memcmp-2.c
new file mode 100644
index 00000000000..ff99c12b0af
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/memcmp-2.c
@@ -0,0 +1,183 @@
+/* PR middle-end/78257 - missing memcmp optimization with constant arrays
+ { dg-do compile }
+ { dg-options "-O -Wall -fdump-tree-optimized" } */
+
+#define assert(e) ((e) ? (void)0 : __builtin_abort ())
+
+typedef __INT32_TYPE__ int32_t;
+
+extern int memcmp (const void*, const void*, __SIZE_TYPE__);
+
+const int32_t i_0 = 0;
+const int32_t j_0 = 0;
+
+void eq_i0_j0 (void)
+{
+ const char *pi = (char*)&i_0, *pj = (char*)&j_0;
+ int n = 0;
+
+ n += 0 == memcmp (pi, pj, sizeof (int32_t));
+ n += 0 == memcmp (pi + 1, pj + 1, sizeof (int32_t) - 1);
+ n += 0 == memcmp (pi + 2, pj + 2, sizeof (int32_t) - 2);
+ n += 0 == memcmp (pi + 3, pj + 3, sizeof (int32_t) - 3);
+ n += 0 == memcmp (pi + 4, pj + 4, sizeof (int32_t) - 4);
+
+ assert (n == 5);
+}
+
+
+const int32_t i1234 = 1234;
+const int32_t j1234 = 1234;
+
+void eq_i1234_j1245 (void)
+{
+ const char *pi = (char*)&i1234, *pj = (char*)&j1234;
+ int n = 0;
+
+ n += 0 == memcmp (pi, pj, sizeof (int32_t));
+ n += 0 == memcmp (pi + 1, pj + 1, sizeof (int32_t) - 1);
+ n += 0 == memcmp (pi + 2, pj + 2, sizeof (int32_t) - 2);
+ n += 0 == memcmp (pi + 3, pj + 3, sizeof (int32_t) - 3);
+ n += 0 == memcmp (pi + 4, pj + 4, sizeof (int32_t) - 4);
+
+ assert (n == 5);
+}
+
+
+const int32_t a1[2] = { 1234 };
+const int32_t b1[2] = { 1234 };
+
+void eq_a1_b1 (void)
+{
+ const char *pi = (char*)&a1, *pj = (char*)&b1;
+ int n = 0, nb = sizeof a1;
+
+ n += 0 == memcmp (pi, pj, nb);
+ n += 0 == memcmp (pi + 1, pj + 1, nb - 1);
+ n += 0 == memcmp (pi + 2, pj + 2, nb - 2);
+ n += 0 == memcmp (pi + 3, pj + 3, nb - 3);
+ n += 0 == memcmp (pi + 4, pj + 4, nb - 4);
+ n += 0 == memcmp (pi + 5, pj + 5, nb - 5);
+ n += 0 == memcmp (pi + 6, pj + 6, nb - 6);
+ n += 0 == memcmp (pi + 7, pj + 7, nb - 7);
+ n += 0 == memcmp (pi + 8, pj + 8, nb - 8);
+
+ assert (n == 9);
+}
+
+const int32_t a2[2] = { 1234 };
+const int32_t b2[2] = { 1234, 0 };
+
+void eq_a2_b2 (void)
+{
+ const char *pi = (char*)&a2, *pj = (char*)&b2;
+ int n = 0, nb = sizeof a2;
+
+ n += 0 == memcmp (pi, pj, nb);
+ n += 0 == memcmp (pi + 1, pj + 1, nb - 1);
+ n += 0 == memcmp (pi + 2, pj + 2, nb - 2);
+ n += 0 == memcmp (pi + 3, pj + 3, nb - 3);
+ n += 0 == memcmp (pi + 4, pj + 4, nb - 4);
+ n += 0 == memcmp (pi + 5, pj + 5, nb - 5);
+ n += 0 == memcmp (pi + 6, pj + 6, nb - 6);
+ n += 0 == memcmp (pi + 7, pj + 7, nb - 7);
+ n += 0 == memcmp (pi + 8, pj + 8, nb - 8);
+
+ assert (n == 9);
+}
+
+
+const int32_t a5[5] = { [3] = 1234, [1] = 0 };
+const int32_t b5[5] = { 0, 0, 0, 1234 };
+
+void eq_a5_b5 (void)
+{
+ int n = 0, b = sizeof a5;
+ const char *pi = (char*)a5, *pj = (char*)b5;
+
+ n += 0 == memcmp (pi, pj, b);
+ n += 0 == memcmp (pi + 1, pj + 1, b - 1);
+ n += 0 == memcmp (pi + 2, pj + 2, b - 2);
+ n += 0 == memcmp (pi + 3, pj + 3, b - 3);
+
+ n += 0 == memcmp (pi + 4, pj + 4, b - 4);
+ n += 0 == memcmp (pi + 5, pj + 5, b - 5);
+ n += 0 == memcmp (pi + 6, pj + 6, b - 6);
+ n += 0 == memcmp (pi + 7, pj + 7, b - 7);
+
+ n += 0 == memcmp (pi + 8, pj + 8, b - 8);
+ n += 0 == memcmp (pi + 9, pj + 9, b - 9);
+ n += 0 == memcmp (pi + 10, pj + 10, b - 10);
+ n += 0 == memcmp (pi + 11, pj + 11, b - 11);
+
+ n += 0 == memcmp (pi + 12, pj + 12, b - 12);
+ n += 0 == memcmp (pi + 13, pj + 13, b - 13);
+ n += 0 == memcmp (pi + 14, pj + 14, b - 14);
+ n += 0 == memcmp (pi + 15, pj + 15, b - 15);
+
+ n += 0 == memcmp (pi + 16, pj + 16, b - 16);
+ n += 0 == memcmp (pi + 17, pj + 17, b - 17);
+ n += 0 == memcmp (pi + 18, pj + 18, b - 18);
+ n += 0 == memcmp (pi + 19, pj + 19, b - 19);
+
+ assert (n == 20);
+}
+
+
+const int32_t a19[19] = { [13] = 13, [8] = 8, [4] = 4, [1] = 1 };
+const int32_t b19[19] = { 0, 1, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 0, 13 };
+
+void eq_a19_b19 (void)
+{
+ int n = 0, b = sizeof a19;
+ const char *pi = (char*)a19, *pj = (char*)b19;
+
+ n += 0 == memcmp (pi, pj, b);
+ n += 0 == memcmp (pi + 1, pj + 1, b - 1);
+ n += 0 == memcmp (pi + 2, pj + 2, b - 2);
+ n += 0 == memcmp (pi + 3, pj + 3, b - 3);
+
+ n += 0 == memcmp (pi + 14, pj + 14, b - 14);
+ n += 0 == memcmp (pi + 15, pj + 15, b - 15);
+ n += 0 == memcmp (pi + 16, pj + 16, b - 16);
+ n += 0 == memcmp (pi + 17, pj + 17, b - 17);
+
+ n += 0 == memcmp (pi + 28, pj + 28, b - 28);
+ n += 0 == memcmp (pi + 29, pj + 29, b - 29);
+ n += 0 == memcmp (pi + 30, pj + 30, b - 30);
+ n += 0 == memcmp (pi + 31, pj + 31, b - 31);
+
+ n += 0 == memcmp (pi + 42, pj + 42, b - 42);
+ n += 0 == memcmp (pi + 43, pj + 43, b - 43);
+ n += 0 == memcmp (pi + 44, pj + 44, b - 44);
+ n += 0 == memcmp (pi + 45, pj + 45, b - 45);
+
+ n += 0 == memcmp (pi + 56, pj + 56, b - 56);
+ n += 0 == memcmp (pi + 57, pj + 57, b - 57);
+ n += 0 == memcmp (pi + 58, pj + 58, b - 58);
+ n += 0 == memcmp (pi + 59, pj + 59, b - 59);
+
+ assert (n == 20);
+}
+
+
+const int32_t A20[20] = { [13] = 14, [8] = 8, [4] = 4, [1] = 1 };
+const int32_t b20[20] = { 0, 1, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 0, 13 };
+
+void gt_A20_b20 (void)
+{
+ int n = memcmp (A20, b20, sizeof A20) > 0;
+ assert (n == 1);
+}
+
+const int32_t a21[21] = { [13] = 12, [8] = 8, [4] = 4, [1] = 1 };
+const int32_t B21[21] = { 0, 1, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 0, 13 };
+
+void lt_a21_B21 (void)
+{
+ int n = memcmp (a21, B21, sizeof a21) < 0;
+ assert (n == 1);
+}
+
+
+/* { dg-final { scan-tree-dump-not "abort" "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/memcmp-3.c b/gcc/testsuite/gcc.dg/memcmp-3.c
new file mode 100644
index 00000000000..b5b8ac1209f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/memcmp-3.c
@@ -0,0 +1,349 @@
+/* PR middle-end/78257 - missing memcmp optimization with constant arrays
+ { dg-do compile }
+ { dg-options "-O -Wall -fdump-tree-optimized" }
+ { dg-skip-if "missing data representation" { "pdp11-*-*" } } */
+
+#define offsetof(T, m) __builtin_offsetof (T, m)
+
+typedef __INT8_TYPE__ int8_t;
+typedef __INT16_TYPE__ int16_t;
+typedef __INT32_TYPE__ int32_t;
+typedef __INT64_TYPE__ int64_t;
+typedef __SIZE_TYPE__ size_t;
+
+extern int memcmp (const void*, const void*, size_t);
+
+const int32_t ia4[4] = { 0x11121314, 0x21222324, 0x31323334, 0x41424344 };
+const int32_t ia4_des[4] =
+ { [2] = 0x31323334, [0] = 0x11121314, 0x21222324, [3] = 0x41424344 };
+const char ia4_rep[] =
+ {
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ "\x11\x12\x13\x14" "\x21\x22\x23\x24"
+ "\x31\x32\x33\x34" "\x41\x42\x43\x44"
+#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ "\x14\x13\x12\x11" "\x24\x23\x22\x21"
+ "\x34\x33\x32\x31" "\x44\x43\x42\x41"
+#endif
+ };
+
+void eq_ia4 (void)
+{
+ int n = 0, b = sizeof ia4;
+ const char *p = (const char*)ia4, *q = ia4_rep;
+
+ n += memcmp (p, q, b);
+ n += memcmp (p + 1, q + 1, b - 1);
+ n += memcmp (p + 2, q + 2, b - 2);
+ n += memcmp (p + 3, q + 3, b - 3);
+ n += memcmp (p + 4, q + 4, b - 4);
+ n += memcmp (p + 5, q + 5, b - 5);
+ n += memcmp (p + 6, q + 6, b - 6);
+ n += memcmp (p + 7, q + 7, b - 7);
+ n += memcmp (p + 8, q + 8, b - 8);
+ n += memcmp (p + 9, q + 9, b - 9);
+ n += memcmp (p + 10, q + 10, b - 10);
+ n += memcmp (p + 11, q + 11, b - 11);
+ n += memcmp (p + 12, q + 12, b - 12);
+ n += memcmp (p + 13, q + 13, b - 13);
+ n += memcmp (p + 14, q + 14, b - 14);
+ n += memcmp (p + 15, q + 15, b - 15);
+ n += memcmp (p + 16, q + 16, b - 16);
+
+ p = (const char*)ia4_des;
+
+ n += memcmp (p, q, b);
+ n += memcmp (p + 1, q + 1, b - 1);
+ n += memcmp (p + 2, q + 2, b - 2);
+ n += memcmp (p + 3, q + 3, b - 3);
+ n += memcmp (p + 4, q + 4, b - 4);
+ n += memcmp (p + 5, q + 5, b - 5);
+ n += memcmp (p + 6, q + 6, b - 6);
+ n += memcmp (p + 7, q + 7, b - 7);
+ n += memcmp (p + 8, q + 8, b - 8);
+ n += memcmp (p + 9, q + 9, b - 9);
+ n += memcmp (p + 10, q + 10, b - 10);
+ n += memcmp (p + 11, q + 11, b - 11);
+ n += memcmp (p + 12, q + 12, b - 12);
+ n += memcmp (p + 13, q + 13, b - 13);
+ n += memcmp (p + 14, q + 14, b - 14);
+ n += memcmp (p + 15, q + 15, b - 15);
+ n += memcmp (p + 16, q + 16, b - 16);
+
+ if (n != 0)
+ __builtin_abort ();
+}
+
+const float fa4[4] = { 1.0, 2.0, 3.0, 4.0 };
+const float fa4_des[4] = { [0] = fa4[0], [1] = 2.0, [2] = fa4[2], [3] = 4.0 };
+
+void eq_fa4 (void)
+{
+ int n = 0, b = sizeof fa4;
+ const char *p = (const char*)fa4, *q = (const char*)fa4_des;
+
+ n += memcmp (p, q, b);
+ n += memcmp (p + 1, q + 1, b - 1);
+ n += memcmp (p + 2, q + 2, b - 2);
+ n += memcmp (p + 3, q + 3, b - 3);
+ n += memcmp (p + 4, q + 4, b - 4);
+ n += memcmp (p + 5, q + 5, b - 5);
+ n += memcmp (p + 6, q + 6, b - 6);
+ n += memcmp (p + 7, q + 7, b - 7);
+ n += memcmp (p + 8, q + 8, b - 8);
+ n += memcmp (p + 9, q + 9, b - 9);
+ n += memcmp (p + 10, q + 10, b - 10);
+ n += memcmp (p + 11, q + 11, b - 11);
+ n += memcmp (p + 12, q + 12, b - 12);
+ n += memcmp (p + 13, q + 13, b - 13);
+ n += memcmp (p + 14, q + 14, b - 14);
+ n += memcmp (p + 15, q + 15, b - 15);
+ n += memcmp (p + 16, q + 16, b - 16);
+
+ if (n != 0)
+ __builtin_abort ();
+}
+
+/* Verify "greater than" comparison with the difference in the last byte. */
+const char ia4_xrep_16[sizeof ia4] =
+ {
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ 0x11, 0x12, 0x13, 0x14, 0x21, 0x22, 0x23, 0x24,
+ 0x31, 0x32, 0x33, 0x34, 0x41, 0x42, 0x43
+#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ 0x14, 0x13, 0x12, 0x11, 0x24, 0x23, 0x22, 0x21,
+ 0x34, 0x33, 0x32, 0x31, 0x44, 0x43, 0x42
+#endif
+ };
+
+void gt_ia4 (void)
+{
+ int n = 0, b = sizeof ia4;
+ const char *p = (const char*)ia4, *q = ia4_xrep_16;
+
+ n += 0 < memcmp (p, q, b);
+ n += 0 < memcmp (p + 1, q + 1, b - 1);
+ n += 0 < memcmp (p + 2, q + 2, b - 2);
+ n += 0 < memcmp (p + 3, q + 3, b - 3);
+ n += 0 < memcmp (p + 4, q + 4, b - 4);
+ n += 0 < memcmp (p + 5, q + 5, b - 5);
+ n += 0 < memcmp (p + 6, q + 6, b - 6);
+ n += 0 < memcmp (p + 7, q + 7, b - 7);
+ n += 0 < memcmp (p + 8, q + 8, b - 8);
+ n += 0 < memcmp (p + 9, q + 9, b - 9);
+ n += 0 < memcmp (p + 10, q + 10, b - 10);
+ n += 0 < memcmp (p + 11, q + 11, b - 11);
+ n += 0 < memcmp (p + 12, q + 12, b - 12);
+ n += 0 < memcmp (p + 13, q + 13, b - 13);
+ n += 0 < memcmp (p + 14, q + 14, b - 14);
+ n += 0 < memcmp (p + 15, q + 15, b - 15);
+
+ if (n != 16)
+ __builtin_abort ();
+}
+
+struct S8_16_32
+{
+ int8_t i8;
+ int16_t i16;
+ int32_t i32;
+};
+
+_Static_assert (sizeof (struct S8_16_32) == 8);
+
+const struct S8_16_32 s8_16_32 = { 1, 0x2122, 0x31323334 };
+const struct S8_16_32 s8_16_32_des =
+ { .i8 = 1, .i16 = 0x2122, .i32 = 0x31323334 };
+
+const char s8_16_32_rep[] =
+ {
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ 1, 0, 0x21, 0x22, 0x31, 0x32, 0x33, 0x34
+#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ 1, 0, 0x22, 0x21, 0x34, 0x33, 0x32, 0x31
+#endif
+ };
+
+void eq_s8_16_32 (void)
+{
+ int n = 0, b = sizeof s8_16_32;
+ const char *p = (char*)&s8_16_32, *q = s8_16_32_rep;
+
+ n += memcmp (p, q, b);
+ n += memcmp (p + 1, q + 1, b - 1);
+ n += memcmp (p + 2, q + 2, b - 2);
+ n += memcmp (p + 3, q + 3, b - 3);
+ n += memcmp (p + 4, q + 4, b - 4);
+ n += memcmp (p + 5, q + 5, b - 5);
+ n += memcmp (p + 6, q + 6, b - 6);
+ n += memcmp (p + 7, q + 7, b - 7);
+
+ p = (char*)&s8_16_32_des;
+
+ n += memcmp (p, q, b);
+ n += memcmp (p + 1, q + 1, b - 1);
+ n += memcmp (p + 2, q + 2, b - 2);
+ n += memcmp (p + 3, q + 3, b - 3);
+ n += memcmp (p + 4, q + 4, b - 4);
+ n += memcmp (p + 5, q + 5, b - 5);
+ n += memcmp (p + 6, q + 6, b - 6);
+ n += memcmp (p + 7, q + 7, b - 7);
+
+ if (n != 0)
+ __builtin_abort ();
+}
+
+
+struct S8_16_32_64
+{
+ /* 0 */ int8_t i8;
+ /* 1 */ int8_t: 1;
+ /* 2 */ int16_t i16;
+ /* 4 */ int32_t: 1;
+ /* 8 */ int32_t i32;
+ /* 12 */ int32_t: 1;
+ /* 16 */ int64_t i64;
+ /* 24 */ int8_t: 0;
+};
+
+_Static_assert (offsetof (struct S8_16_32_64, i16) == 2);
+_Static_assert (offsetof (struct S8_16_32_64, i32) == 8);
+_Static_assert (offsetof (struct S8_16_32_64, i64) == 16);
+_Static_assert (sizeof (struct S8_16_32_64) == 24);
+
+const struct S8_16_32_64 s8_16_32_64 =
+ { 1, 0x2122, 0x31323334, 0x4142434445464748LLU };
+
+const char s8_16_32_64_rep[sizeof s8_16_32_64] =
+ {
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ "\x01" "\x00" "\x21\x22" "\x00\x00\x00\x00" "\x31\x32\x33\x34"
+ "\x00\x00\x00\x00" "\x41\x42\x43\x44\x45\x46\x47\x48"
+#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ "\x01" "\x00" "\x22\x21" "\x00\x00\x00\x00" "\x34\x33\x32\x31"
+ "\x00\x00\x00\x00" "\x48\x47\x46\x45\x44\x43\x42\x41"
+#endif
+ };
+
+const struct S8_16_32_64 s8_16_32_64_des =
+ { .i64 = 0x4142434445464748LLU, .i16 = 0x2122, .i32 = 0x31323334, .i8 = 1 };
+
+
+void eq_8_16_32_64 (void)
+{
+ int n = 0, b = sizeof s8_16_32_64;
+ const char *p = (char*)&s8_16_32_64, *q = s8_16_32_64_rep;
+
+ n += memcmp (p, q, b);
+ n += memcmp (p + 1, q + 1, b - 1);
+ n += memcmp (p + 2, q + 2, b - 2);
+ n += memcmp (p + 3, q + 3, b - 3);
+ n += memcmp (p + 4, q + 4, b - 4);
+ n += memcmp (p + 5, q + 5, b - 5);
+ n += memcmp (p + 6, q + 6, b - 6);
+ n += memcmp (p + 7, q + 7, b - 7);
+ n += memcmp (p + 8, q + 8, b - 8);
+ n += memcmp (p + 9, q + 9, b - 9);
+ n += memcmp (p + 10, q + 10, b - 10);
+ n += memcmp (p + 11, q + 11, b - 11);
+ n += memcmp (p + 12, q + 12, b - 12);
+ n += memcmp (p + 13, q + 13, b - 13);
+ n += memcmp (p + 14, q + 14, b - 14);
+ n += memcmp (p + 15, q + 15, b - 15);
+ n += memcmp (p + 16, q + 16, b - 16);
+ n += memcmp (p + 17, q + 17, b - 17);
+ n += memcmp (p + 18, q + 18, b - 18);
+ n += memcmp (p + 19, q + 19, b - 19);
+ n += memcmp (p + 20, q + 20, b - 20);
+ n += memcmp (p + 21, q + 21, b - 21);
+ n += memcmp (p + 22, q + 22, b - 22);
+ n += memcmp (p + 23, q + 23, b - 23);
+
+ p = (char*)&s8_16_32_64_des;
+
+ n += memcmp (p, q, b);
+ n += memcmp (p + 1, q + 1, b - 1);
+ n += memcmp (p + 2, q + 2, b - 2);
+ n += memcmp (p + 3, q + 3, b - 3);
+ n += memcmp (p + 4, q + 4, b - 4);
+ n += memcmp (p + 5, q + 5, b - 5);
+ n += memcmp (p + 6, q + 6, b - 6);
+ n += memcmp (p + 7, q + 7, b - 7);
+ n += memcmp (p + 8, q + 8, b - 8);
+ n += memcmp (p + 9, q + 9, b - 9);
+ n += memcmp (p + 10, q + 10, b - 10);
+ n += memcmp (p + 11, q + 11, b - 11);
+ n += memcmp (p + 12, q + 12, b - 12);
+ n += memcmp (p + 13, q + 13, b - 13);
+ n += memcmp (p + 14, q + 14, b - 14);
+ n += memcmp (p + 15, q + 15, b - 15);
+ n += memcmp (p + 16, q + 16, b - 16);
+ n += memcmp (p + 17, q + 17, b - 17);
+ n += memcmp (p + 18, q + 18, b - 18);
+ n += memcmp (p + 19, q + 19, b - 19);
+ n += memcmp (p + 20, q + 20, b - 20);
+ n += memcmp (p + 21, q + 21, b - 21);
+ n += memcmp (p + 22, q + 22, b - 22);
+ n += memcmp (p + 23, q + 23, b - 23);
+
+ if (n != 0)
+ __builtin_abort ();
+}
+
+struct S64_x_3
+{
+ int64_t i64a[3];
+};
+
+_Static_assert (sizeof (struct S64_x_3) == 24);
+
+const struct S64_x_3 s64_x_3 =
+ { { 0x0000000021220001LLU, 0x0000000031323334LLU, 0x4142434445464748LLU } };
+
+const char s64_x_3_rep[sizeof s64_x_3] =
+ {
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ "\x00\x00\x00\x00\x21\x22\x00\x01"
+ "\x00\x00\x00\x00\x31\x32\x33\x34"
+ "\x41\x42\x43\x44\x45\x46\x47\x48"
+#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ "\x01\x00\x22\x21\x00\x00\x00\x00"
+ "\x34\x33\x32\x31\x00\x00\x00\x00"
+ "\x48\x47\x46\x45\x44\x43\x42\x41"
+#endif
+ };
+
+void eq_64_x_3 (void)
+{
+ int n = 0, b = sizeof s8_16_32_64;
+ const char *p = (char*)&s8_16_32_64, *q = s64_x_3_rep;
+ n += memcmp (p, q, b);
+ n += memcmp (p + 1, q + 1, b - 1);
+ n += memcmp (p + 2, q + 2, b - 2);
+ n += memcmp (p + 3, q + 3, b - 3);
+ n += memcmp (p + 4, q + 4, b - 4);
+ n += memcmp (p + 5, q + 5, b - 5);
+ n += memcmp (p + 6, q + 6, b - 6);
+ n += memcmp (p + 7, q + 7, b - 7);
+ n += memcmp (p + 8, q + 8, b - 8);
+ n += memcmp (p + 9, q + 9, b - 9);
+ n += memcmp (p + 10, q + 10, b - 10);
+ n += memcmp (p + 11, q + 11, b - 11);
+ n += memcmp (p + 12, q + 12, b - 12);
+ n += memcmp (p + 13, q + 13, b - 13);
+ n += memcmp (p + 14, q + 14, b - 14);
+ n += memcmp (p + 15, q + 15, b - 15);
+ n += memcmp (p + 16, q + 16, b - 16);
+ n += memcmp (p + 17, q + 17, b - 17);
+ n += memcmp (p + 18, q + 18, b - 18);
+ n += memcmp (p + 19, q + 19, b - 19);
+ n += memcmp (p + 20, q + 20, b - 20);
+ n += memcmp (p + 21, q + 21, b - 21);
+ n += memcmp (p + 22, q + 22, b - 22);
+ n += memcmp (p + 23, q + 23, b - 23);
+
+ if (n != 0)
+ __builtin_abort ();
+}
+
+/* { dg-final { scan-tree-dump-not "abort" "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/memcmp-4.c b/gcc/testsuite/gcc.dg/memcmp-4.c
new file mode 100644
index 00000000000..bbac7197501
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/memcmp-4.c
@@ -0,0 +1,81 @@
+/* PR middle-end/78257 - missing memcmp optimization with constant arrays
+ { dg-do compile }
+ { dg-options "-O -Wall -fdump-tree-optimized" } */
+
+typedef __INT8_TYPE__ int8_t;
+typedef __INT16_TYPE__ int16_t;
+typedef __INT32_TYPE__ int32_t;
+typedef __SIZE_TYPE__ size_t;
+
+extern int memcmp (const void*, const void*, size_t);
+
+/* Verify that initializers for flexible array members are handled
+ correctly. */
+
+struct Si16_x
+{
+ int16_t n, a[];
+};
+
+const struct Si16_x si16_4 =
+ {
+ 0x1112, { 0x2122, 0x3132, 0x4142 }
+ };
+
+const char si16_4_rep[] =
+ {
+ 0x12, 0x11, 0x22, 0x21, 0x32, 0x31, 0x42, 0x41
+ };
+
+void eq_si16_x (void)
+{
+ int n = 0, b = sizeof si16_4_rep;
+ const char *p = (const char*)&si16_4, *q = si16_4_rep;
+
+ n += memcmp (p, q, b);
+ n += memcmp (p + 1, q + 1, b - 1);
+ n += memcmp (p + 2, q + 2, b - 2);
+ n += memcmp (p + 3, q + 3, b - 3);
+ n += memcmp (p + 4, q + 4, b - 4);
+ n += memcmp (p + 5, q + 5, b - 5);
+ n += memcmp (p + 6, q + 6, b - 6);
+ n += memcmp (p + 7, q + 7, b - 7);
+ n += memcmp (p + 8, q + 8, b - 8);
+
+ p = (const char*)&si16_4.n;
+
+ n += memcmp (p, q, b);
+ n += memcmp (p + 1, q + 1, b - 1);
+ n += memcmp (p + 2, q + 2, b - 2);
+ n += memcmp (p + 3, q + 3, b - 3);
+ n += memcmp (p + 4, q + 4, b - 4);
+ n += memcmp (p + 5, q + 5, b - 5);
+ n += memcmp (p + 6, q + 6, b - 6);
+ n += memcmp (p + 7, q + 7, b - 7);
+ n += memcmp (p + 8, q + 8, b - 8);
+
+ p = (const char*)si16_4.a;
+ q = si16_4_rep + 2;
+
+ n += memcmp (p, q, b - 2);
+ n += memcmp (p + 1, q + 1, b - 3);
+ n += memcmp (p + 2, q + 2, b - 4);
+ n += memcmp (p + 3, q + 3, b - 5);
+ n += memcmp (p + 4, q + 4, b - 6);
+ n += memcmp (p + 5, q + 5, b - 7);
+ n += memcmp (p + 6, q + 6, b - 8);
+
+ p = (const char*)&si16_4.a[1];
+ q = si16_4_rep + 4;
+
+ n += memcmp (p, q, b - 4);
+ n += memcmp (p + 1, q + 1, b - 5);
+ n += memcmp (p + 2, q + 2, b - 6);
+ n += memcmp (p + 3, q + 3, b - 7);
+ n += memcmp (p + 4, q + 4, b - 8);
+
+ if (n != 0)
+ __builtin_abort ();
+}
+
+/* { dg-final { scan-tree-dump-not "abort" "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/memcmp-pr95189.c b/gcc/testsuite/gcc.dg/memcmp-pr95189.c
new file mode 100644
index 00000000000..d8250ecfc98
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/memcmp-pr95189.c
@@ -0,0 +1,28 @@
+/* PR middle-end/95189 - memcmp being wrongly stripped like strcmp
+ { dg-do run }
+ { dg-options "-O2 -Wall" } */
+
+char a4[] = "\0abc";
+char a8[] = "\0abcdefg";
+char a16[] = "\0abcdefghijklmno";
+
+int cmp4 (void)
+{
+ return __builtin_memcmp (a4, "\0\0\0\0", 4);
+}
+
+int cmp8 (void)
+{
+ return __builtin_memcmp (a8, "\0\0\0\0\0\0\0\0", 8);
+}
+
+int cmp16 (void)
+{
+ return __builtin_memcmp (a16, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16);
+}
+
+int main (void)
+{
+ if (cmp4 () < 1 || cmp8 () < 1 || cmp16 () < 1)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/gcc.dg/missing-header-fixit-3.c b/gcc/testsuite/gcc.dg/missing-header-fixit-3.c
index dd53bf65d3c..8394010c1ac 100644
--- a/gcc/testsuite/gcc.dg/missing-header-fixit-3.c
+++ b/gcc/testsuite/gcc.dg/missing-header-fixit-3.c
@@ -2,7 +2,7 @@
adding them to the top of the file, given that there is no
pre-existing #include. */
-/* { dg-options "-fdiagnostics-show-caret -fdiagnostics-show-line-numbers" } */
+/* { dg-options "-fdiagnostics-show-caret -fdiagnostics-show-line-numbers -Wno-implicit-function-declaration" } */
void test (int i, int j)
{
diff --git a/gcc/testsuite/gcc.dg/missing-header-fixit-4.c b/gcc/testsuite/gcc.dg/missing-header-fixit-4.c
index 942897d8c79..b6680563dc1 100644
--- a/gcc/testsuite/gcc.dg/missing-header-fixit-4.c
+++ b/gcc/testsuite/gcc.dg/missing-header-fixit-4.c
@@ -9,6 +9,10 @@ void test (int i, int j)
{
printf ("%i of %i\n", i, j); /* { dg-line printf } */
/* { dg-warning "implicit declaration of function" "" { target *-*-* } printf } */
+ /* { dg-begin-multiline-output "" }
+ 10 | printf ("%i of %i\n", i, j);
+ | ^~~~~~
+ { dg-end-multiline-output "" } */
/* { dg-warning "incompatible implicit declaration" "" { target *-*-* } printf } */
/* { dg-begin-multiline-output "" }
10 | printf ("%i of %i\n", i, j);
diff --git a/gcc/testsuite/gcc.dg/missing-header-fixit-5.c b/gcc/testsuite/gcc.dg/missing-header-fixit-5.c
new file mode 100644
index 00000000000..916033c689c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/missing-header-fixit-5.c
@@ -0,0 +1,36 @@
+
+/* Forget to include any standard headers, all for built-in functions.
+ Rely on -Wimplicit-function-declaration for fixit hints, not on
+ -Wbuiltin-declaration-mismatch (which misses abs, isdigit, putchar). */
+
+/* { dg-options "-fdiagnostics-show-caret -fdiagnostics-show-line-numbers -Wimplicit-function-declaration -Wno-builtin-declaration-mismatch" } */
+
+int
+foo (char *m, int i)
+{
+ if (isdigit (m[0])) /* { dg-warning "implicit declaration of function" } */
+ /* { dg-begin-multiline-output "" }
+ 11 | if (isdigit (m[0]))
+ | ^~~~~~~
+ +++ |+#include <ctype.h>
+ 1 |
+ { dg-end-multiline-output "" } */
+ {
+ return abs (i); /* { dg-warning "implicit declaration of function" } */
+ /* { dg-begin-multiline-output "" }
+ 19 | return abs (i);
+ | ^~~
+ +++ |+#include <stdlib.h>
+ 1 |
+ { dg-end-multiline-output "" } */
+ }
+ else
+ putchar (m[0]); /* { dg-warning "implicit declaration of function" } */
+ /* { dg-begin-multiline-output "" }
+ 28 | putchar (m[0]);
+ | ^~~~~~~
+ +++ |+#include <stdio.h>
+ 1 |
+ { dg-end-multiline-output "" } */
+ return i;
+}
diff --git a/gcc/testsuite/gcc.dg/no_profile_instrument_function-attr-1.c b/gcc/testsuite/gcc.dg/no_profile_instrument_function-attr-1.c
index 0c7e0961824..909f8a68479 100644
--- a/gcc/testsuite/gcc.dg/no_profile_instrument_function-attr-1.c
+++ b/gcc/testsuite/gcc.dg/no_profile_instrument_function-attr-1.c
@@ -18,7 +18,7 @@ int main ()
return foo ();
}
-/* { dg-final { scan-tree-dump-times "__gcov0\\.main.* = PROF_edge_counter" 1 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "__gcov0\[._\]main.* = PROF_edge_counter" 1 "optimized"} } */
/* { dg-final { scan-tree-dump-times "__gcov_indirect_call_profiler_v" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "__gcov_time_profiler_counter = " 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "__gcov_init" 1 "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c b/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c
index 7b48e763ece..23cc7e6b253 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c
@@ -12,4 +12,5 @@ int main()
int g()
int a[( {int b} )]; /* { dg-error "braced-group within expression allowed only inside a function|declaration for parameter" } */
return 0; /* { dg-error "expected declaration specifiers before" } */
-} /* { dg-error "expected declaration specifiers before|end of input|expected declaration or statement at end of input" } */
+} /* { dg-error "expected declaration" } */
+/* { dg-error "-:expected" "" { target *-*-* } .+1 } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c b/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c
index b9bbb733fae..499b9595f3c 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c
@@ -4,4 +4,5 @@
void foo()
{
({ int i().; }); /* { dg-error "expected" } */
-} /* { dg-error "-:expected" } */
+} /* { dg-error "expected declaration" }
+/* { dg-error "-:expected" "" { target *-*-* } .+1 } */
diff --git a/gcc/testsuite/gcc.dg/parallel-early-constant.c b/gcc/testsuite/gcc.dg/parallel-early-constant.c
new file mode 100644
index 00000000000..fc8c5a986ec
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parallel-early-constant.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-fparallel-jobs=2 --param=balance-partitions=0" } */
+
+#define A "This is a long test that tests the structure initialization"
+#define B A,A
+#define C B,B,B,B
+#define D C,C,C,C
+
+const char *foo1 ()
+{
+ return A;
+}
+
+int foo2 ()
+{
+ return 42;
+}
+
+int main()
+{
+ char *subs[]={ D, D, D, D, D, D, D, D, D, D, D, D, D, D, D};
+}
diff --git a/gcc/testsuite/gcc.dg/parallel-static-1.c b/gcc/testsuite/gcc.dg/parallel-static-1.c
new file mode 100644
index 00000000000..cf1cc7df93d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parallel-static-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fparallel-jobs=2 --param=balance-partitions=0" } */
+
+static int global_var;
+
+int foo1(void)
+{
+ global_var = 1;
+}
+
+int foo2(void)
+{
+ global_var = 2;
+}
+
+int main ()
+{
+ foo1 ();
+ foo2 ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/parallel-static-2.c b/gcc/testsuite/gcc.dg/parallel-static-2.c
new file mode 100644
index 00000000000..44f5b0d5a02
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parallel-static-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fparallel-jobs=2 --param=balance-partitions=0" } */
+
+int foo1(void)
+{
+ static int var;
+ var = 1;
+}
+
+int foo2(void)
+{
+ static int var;
+ var = 2;
+}
+
+int main ()
+{
+ foo1 ();
+ foo2 ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/parallel-static-clash-1.c b/gcc/testsuite/gcc.dg/parallel-static-clash-1.c
new file mode 100644
index 00000000000..37a01e28b1b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parallel-static-clash-1.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-options "-fparallel-jobs=2 --param=balance-partitions=0 --param=promote-statics=1" } */
+/* { dg-additional-sources "parallel-static-clash-aux.c" } */
+
+int file2_c ();
+
+static int __attribute__ ((noinline))
+private ()
+{
+ return 42;
+}
+
+int
+file1_c ()
+{
+ return private ();
+}
+
+int
+main ()
+{
+ return file1_c () + file2_c ();
+}
diff --git a/gcc/testsuite/gcc.dg/parallel-static-clash-aux.c b/gcc/testsuite/gcc.dg/parallel-static-clash-aux.c
new file mode 100644
index 00000000000..aac473933a9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parallel-static-clash-aux.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fparallel-jobs=2 --param=balance-partitions=0" } */
+
+static int __attribute__ ((noinline))
+private ()
+{
+ return -42;
+}
+
+int
+file2_c ()
+{
+ return private ();
+}
diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-expressions-1.c b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-expressions-1.c
index 03b78042107..d7691e4be51 100644
--- a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-expressions-1.c
+++ b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-expressions-1.c
@@ -540,15 +540,15 @@ void test_builtin_types_compatible_p (unsigned long i)
__emit_expression_range (0,
f (i) + __builtin_types_compatible_p (long, int)); /* { dg-warning "range" } */
/* { dg-begin-multiline-output "" }
- f (i) + __builtin_types_compatible_p (long, int));
- ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ f (i) + __builtin_types_compatible_p (long, int));
+ ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{ dg-end-multiline-output "" } */
__emit_expression_range (0,
__builtin_types_compatible_p (long, int) + f (i)); /* { dg-warning "range" } */
/* { dg-begin-multiline-output "" }
- __builtin_types_compatible_p (long, int) + f (i));
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
+ __builtin_types_compatible_p (long, int) + f (i));
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
{ dg-end-multiline-output "" } */
}
@@ -671,8 +671,8 @@ void test_multiple_ordinary_maps (void)
/* { dg-begin-multiline-output "" }
__emit_expression_range (0, foo (0,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"));
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"));
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{ dg-end-multiline-output "" } */
/* Another expression that transitions between ordinary maps; this
@@ -685,8 +685,8 @@ void test_multiple_ordinary_maps (void)
/* { dg-begin-multiline-output "" }
__emit_expression_range (0, foo (0, "01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 0));
- ~~
+ 0));
+ ~~
{ dg-end-multiline-output "" } */
}
diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-1.c b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-1.c
index ac4fa1b52bd..4cba87be2ae 100644
--- a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-1.c
+++ b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-1.c
@@ -335,11 +335,11 @@ pr87652 (const char *stem, int counter)
/* { dg-error "unable to read substring location: unable to read source line" "" { target c } 329 } */
/* { dg-error "unable to read substring location: failed to get ordinary maps" "" { target c++ } 329 } */
/* { dg-begin-multiline-output "" }
- __emit_string_literal_range(__FILE__":%5d: " format, \
+ __emit_string_literal_range(__FILE__":%5d: " format, \
^~~~~~~~
{ dg-end-multiline-output "" { target c } } */
/* { dg-begin-multiline-output "" }
- __emit_string_literal_range(__FILE__":%5d: " format, \
+ __emit_string_literal_range(__FILE__":%5d: " format, \
^
{ dg-end-multiline-output "" { target c++ } } */
diff --git a/gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c
index 1a80a668a0f..a3ac12d3b46 100644
--- a/gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c
+++ b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c
@@ -13,7 +13,7 @@ int
fn_1 (int flag)
{
int x = 4, y = 5;
- if (flag) x = 3; y = 2; /* { dg-message "-:disabled from this point" } */
+ if (flag) x = 3; y = 2; /* { dg-message "-:disabled from this point" "adding '-flarge-source-files'" } */
return x * y;
}
diff --git a/gcc/testsuite/gcc.dg/pr20245-1.c b/gcc/testsuite/gcc.dg/pr20245-1.c
index b5767d88b7b..ac880740662 100644
--- a/gcc/testsuite/gcc.dg/pr20245-1.c
+++ b/gcc/testsuite/gcc.dg/pr20245-1.c
@@ -2,4 +2,5 @@
/* { dg-do compile } */
/* { dg-options "" } */
-void foo() x; /* { dg-error "-:expected" } */
+void foo() x; /* { dg-error "expected" } */
+/* { dg-error "-:expected" "" { target *-*-* } .+1 } */
diff --git a/gcc/testsuite/gcc.dg/pr26570.c b/gcc/testsuite/gcc.dg/pr26570.c
index d29bc358533..89cf16c80a5 100644
--- a/gcc/testsuite/gcc.dg/pr26570.c
+++ b/gcc/testsuite/gcc.dg/pr26570.c
@@ -7,3 +7,5 @@ unsigned test (unsigned a, unsigned b)
return a / b;
} /* { dg-missed "\[^\n\]*execution counts estimated" } */
/* { dg-prune-output "function body not available" } */
+/* Ignore inlinable warning on AIX. */
+/* { dg-prune-output "function not inlinable" } */
diff --git a/gcc/testsuite/gcc.dg/pr28419.c b/gcc/testsuite/gcc.dg/pr28419.c
index 9974864034b..d418a165b1e 100644
--- a/gcc/testsuite/gcc.dg/pr28419.c
+++ b/gcc/testsuite/gcc.dg/pr28419.c
@@ -1,4 +1,4 @@
/* { dg-do compile } */
void foo()
const char* p = __FUNCTION__; /* { dg-error "" } */
-/* { dg-error "-:expected" "" } */
+/* { dg-error "-:expected" "" { target *-*-* } .+1 } */
diff --git a/gcc/testsuite/gcc.dg/pr30957-1.c b/gcc/testsuite/gcc.dg/pr30957-1.c
index 6a0ed2045c1..564410913ab 100644
--- a/gcc/testsuite/gcc.dg/pr30957-1.c
+++ b/gcc/testsuite/gcc.dg/pr30957-1.c
@@ -1,4 +1,4 @@
-/* { dg-do run } */
+/* { dg-do run { xfail { mmix-*-* } } } */
/* We don't (and don't want to) perform this optimisation on soft-float targets,
where each addition is a library call. /
/* { dg-require-effective-target hard_float } */
@@ -33,4 +33,4 @@ main ()
exit (0);
}
-/* { dg-final { scan-rtl-dump "Expanding Accumulator" "loop2_unroll" } } */
+/* { dg-final { scan-rtl-dump "Expanding Accumulator" "loop2_unroll" { xfail mmix-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/pr31866.c b/gcc/testsuite/gcc.dg/pr31866.c
index 4081c0e6ad9..d6a2ab05690 100644
--- a/gcc/testsuite/gcc.dg/pr31866.c
+++ b/gcc/testsuite/gcc.dg/pr31866.c
@@ -1,5 +1,5 @@
/* PR tree-optimization/31866 */
-/* { dg-do compile { target alpha*-*-* cris-*-* crisv32-*-* i?86-*-* mmix-*-* powerpc*-*-* rs6000-*-* x86_64-*-* } } */
+/* { dg-do compile { target alpha*-*-* cris-*-* i?86-*-* mmix-*-* powerpc*-*-* rs6000-*-* x86_64-*-* } } */
/* { dg-options "-O2" } */
#if defined (__alpha__)
diff --git a/gcc/testsuite/gcc.dg/pr32069.c b/gcc/testsuite/gcc.dg/pr32069.c
index 2ec37c675ed..87a3f187e16 100644
--- a/gcc/testsuite/gcc.dg/pr32069.c
+++ b/gcc/testsuite/gcc.dg/pr32069.c
@@ -1,4 +1,4 @@
-/* { dg-do-compile } */
+/* { dg-do compile } */
/* { dg-options "-O0 -fsplit-wide-types" } */
long long int segfault (long long int a, long long int b)
diff --git a/gcc/testsuite/gcc.dg/pr35445.c b/gcc/testsuite/gcc.dg/pr35445.c
index cef309f41ce..56ca6e2580a 100644
--- a/gcc/testsuite/gcc.dg/pr35445.c
+++ b/gcc/testsuite/gcc.dg/pr35445.c
@@ -1,5 +1,5 @@
/* PR c/35445 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
extern int i;
extern int i; /* { dg-message "was here" } */
diff --git a/gcc/testsuite/gcc.dg/pr36227.c b/gcc/testsuite/gcc.dg/pr36227.c
index 27fe0015505..ba0d7224939 100644
--- a/gcc/testsuite/gcc.dg/pr36227.c
+++ b/gcc/testsuite/gcc.dg/pr36227.c
@@ -1,14 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -Wstrict-overflow=3" } */
-#if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__)
-typedef unsigned long long ptrcast;
-#elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__)
-typedef unsigned long ptrcast;
-#elif (__SIZEOF_INT__ == __SIZEOF_POINTER__)
-typedef unsigned int ptrcast;
-#else
-#error Add target support here
-#endif
+typedef __UINTPTR_TYPE__ ptrcast;
volatile unsigned long *
sat_add(volatile unsigned long *ptr, unsigned long i, volatile unsigned long *end)
diff --git a/gcc/testsuite/gcc.dg/pr40172-3.c b/gcc/testsuite/gcc.dg/pr40172-3.c
index c44707c9e67..583aab0f712 100644
--- a/gcc/testsuite/gcc.dg/pr40172-3.c
+++ b/gcc/testsuite/gcc.dg/pr40172-3.c
@@ -1,5 +1,5 @@
/* PR middle-end/40172 */
-/* { dg-do compile */
+/* { dg-do compile } */
/* { dg-xfail-if "" { "*-*-*" } } */
/* { dg-options "-Wall -W -Werror -Wlogical-op" } */
diff --git a/gcc/testsuite/gcc.dg/pr42611.c b/gcc/testsuite/gcc.dg/pr42611.c
index 0426ce2d5bc..f502feac337 100644
--- a/gcc/testsuite/gcc.dg/pr42611.c
+++ b/gcc/testsuite/gcc.dg/pr42611.c
@@ -3,7 +3,8 @@
/* { dg-options "" } */
#define L \
- (sizeof (__SIZE_TYPE__) == 1 ? __SCHAR_MAX__ \
+ (sizeof (__SIZE_TYPE__) == sizeof (void *) ? __INTPTR_MAX__ \
+ : sizeof (__SIZE_TYPE__) == 1 ? __SCHAR_MAX__ \
: sizeof (__SIZE_TYPE__) == sizeof (short) ? __SHRT_MAX__ \
: sizeof (__SIZE_TYPE__) == sizeof (int) ? __INT_MAX__ \
: sizeof (__SIZE_TYPE__) == sizeof (long) ? __LONG_MAX__ \
diff --git a/gcc/testsuite/gcc.dg/pr44194-1.c b/gcc/testsuite/gcc.dg/pr44194-1.c
index 20b74a5aa12..a38270b7923 100644
--- a/gcc/testsuite/gcc.dg/pr44194-1.c
+++ b/gcc/testsuite/gcc.dg/pr44194-1.c
@@ -1,4 +1,5 @@
/* { dg-do compile { target { { { { { { { { { { i?86-*-* x86_64-*-* } && x32 } || lp64 } && { ! s390*-*-* } } && { ! hppa*64*-*-* } } && { ! alpha*-*-* } } && { { ! powerpc*-*-linux* } || powerpc_elfv2 } } && { ! nvptx-*-* } } } } } } */
+/* { dg-skip-if "returns that struct in memory" { mmix-*-* } } */
/* { dg-options "-O2 -fdump-rtl-dse1 -fdump-rtl-final" } */
/* Restrict to 64-bit targets since 32-bit targets usually return small
diff --git a/gcc/testsuite/gcc.dg/pr46647.c b/gcc/testsuite/gcc.dg/pr46647.c
index d7ada9650dc..7eefc6e336a 100644
--- a/gcc/testsuite/gcc.dg/pr46647.c
+++ b/gcc/testsuite/gcc.dg/pr46647.c
@@ -25,5 +25,5 @@ func3 (void)
return 0;
}
-/* The xfail for avr, cris-* and crisv32-* is due to PR53535. */
-/* { dg-final { scan-tree-dump-not "memset" "optimized" { xfail avr-*-* cris-*-* crisv32-*-* } } } */
+/* The xfail for avr and cris-* is due to PR53535. */
+/* { dg-final { scan-tree-dump-not "memset" "optimized" { xfail avr-*-* cris-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/pr51628-17.c b/gcc/testsuite/gcc.dg/pr51628-17.c
index 0be95b2294e..42dc9d745dc 100644
--- a/gcc/testsuite/gcc.dg/pr51628-17.c
+++ b/gcc/testsuite/gcc.dg/pr51628-17.c
@@ -7,4 +7,4 @@ struct A {
} __attribute__ ((packed));
long* f8 (struct A *p) { return &p->i; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/pr51628-19.c b/gcc/testsuite/gcc.dg/pr51628-19.c
index 7ff03e85cea..91ff39abc88 100644
--- a/gcc/testsuite/gcc.dg/pr51628-19.c
+++ b/gcc/testsuite/gcc.dg/pr51628-19.c
@@ -16,11 +16,11 @@ bar (int n, int k, void *ptr)
int *p0, *p1;
p0 = p->x;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
foo (p0);
p1 = &p->x[1];
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
foo (p1);
return &p->x[1];
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/gcc.dg/pr51628-20.c b/gcc/testsuite/gcc.dg/pr51628-20.c
index bcdbff1e554..2249d85098b 100644
--- a/gcc/testsuite/gcc.dg/pr51628-20.c
+++ b/gcc/testsuite/gcc.dg/pr51628-20.c
@@ -8,4 +8,4 @@ struct C { struct B b; } __attribute__ ((packed));
extern struct C *p;
long* g8 (void) { return p; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/pr51628-21.c b/gcc/testsuite/gcc.dg/pr51628-21.c
index 0c7fab75d8a..f1adbe64002 100644
--- a/gcc/testsuite/gcc.dg/pr51628-21.c
+++ b/gcc/testsuite/gcc.dg/pr51628-21.c
@@ -8,4 +8,4 @@ struct C { struct B b; } __attribute__ ((packed));
extern struct C p[];
long* g8 (void) { return p; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/pr51628-22.c b/gcc/testsuite/gcc.dg/pr51628-22.c
index 1bd5d791639..25ac36cf0a2 100644
--- a/gcc/testsuite/gcc.dg/pr51628-22.c
+++ b/gcc/testsuite/gcc.dg/pr51628-22.c
@@ -6,4 +6,4 @@ struct B { int i; };
struct C { struct B b; } __attribute__ ((packed));
int* g4 (struct C *p) { return &p->b; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/pr51628-24.c b/gcc/testsuite/gcc.dg/pr51628-24.c
index 3ad99cd2f16..1e454a1dc0e 100644
--- a/gcc/testsuite/gcc.dg/pr51628-24.c
+++ b/gcc/testsuite/gcc.dg/pr51628-24.c
@@ -7,4 +7,4 @@ struct A {
} __attribute__ ((packed));
short* f2 (struct A *p) { return &p->i; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/pr51628-25.c b/gcc/testsuite/gcc.dg/pr51628-25.c
index 94a3a8fbaf2..f00d9b1bcac 100644
--- a/gcc/testsuite/gcc.dg/pr51628-25.c
+++ b/gcc/testsuite/gcc.dg/pr51628-25.c
@@ -6,4 +6,4 @@ struct B { int i; };
struct C { struct B b; } __attribute__ ((packed));
long* g8 (struct C *p) { return p; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/pr51628-34.c b/gcc/testsuite/gcc.dg/pr51628-34.c
index 51d4b26a114..0f6ae34fb96 100644
--- a/gcc/testsuite/gcc.dg/pr51628-34.c
+++ b/gcc/testsuite/gcc.dg/pr51628-34.c
@@ -9,9 +9,9 @@ baz (int x, struct S *p)
{
return (x
? &p->a
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
: &p->b);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
short *
@@ -19,7 +19,7 @@ qux (int x, struct S *p)
{
return (short *) (x
? &p->a
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
: &p->b);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
}
diff --git a/gcc/testsuite/gcc.dg/pr53037-1.c b/gcc/testsuite/gcc.dg/pr53037-1.c
index 3ea5ae6a34e..3f2269699e4 100644
--- a/gcc/testsuite/gcc.dg/pr53037-1.c
+++ b/gcc/testsuite/gcc.dg/pr53037-1.c
@@ -40,7 +40,7 @@ struct foo5
{
int i1;
int x __attribute__((warn_if_not_aligned(16))); /* { dg-warning "'x' offset 4 in 'struct foo5' isn't aligned to 16" } */
-}; /* { dg-warning "alignment 4 of 'struct foo5' is less than 16" } */
+}; /* { dg-warning {alignment [0-9]+ of 'struct foo5' is less than 16} } */
struct foo6
{
@@ -73,7 +73,7 @@ union bar3
{
int i1;
int x __attribute__((warn_if_not_aligned(16)));
-}; /* { dg-warning "alignment 4 of 'union bar3' is less than 16" } */
+}; /* { dg-warning {alignment [0-9]+ of 'union bar3' is less than 16} } */
union bar4
{
diff --git a/gcc/testsuite/gcc.dg/pr59924.c b/gcc/testsuite/gcc.dg/pr59924.c
index 1d8d52fb079..9063a239434 100644
--- a/gcc/testsuite/gcc.dg/pr59924.c
+++ b/gcc/testsuite/gcc.dg/pr59924.c
@@ -21,7 +21,7 @@ foo (struct S * x, int y, int z, int w)
}
if (y != 0 || z != 0)
{
- double g = x->b + (double) e * (double) y; /* { dg-warning "may be used uninitialized in this function" } */
+ double g = x->b + (double) e * (double) y; /* { dg-warning "may be used uninitialized" } */
bar (g * g);
}
}
diff --git a/gcc/testsuite/gcc.dg/pr59963-2.c b/gcc/testsuite/gcc.dg/pr59963-2.c
index f54a3126960..9344566fc87 100644
--- a/gcc/testsuite/gcc.dg/pr59963-2.c
+++ b/gcc/testsuite/gcc.dg/pr59963-2.c
@@ -32,6 +32,6 @@ foo (int i)
-7, /* { dg-warning "15:-Wsign-conversion" } */
-8); /* { dg-warning "16:-Wsign-conversion" } */
bazu (i, i); /* { dg-warning "9:conversion" } */
- bazi (0x8, 0x80000000); /* { dg-warning "14:-Wsign-conversion" "first" { xfail int16 } } */
+ bazi (0x8, 0x80000000); /* { dg-warning "14:-Wsign-conversion" "first" { target { ! int16 } } } */
/* { dg-warning "overflow in conversion from" "second" { target int16 } .-1 } */
}
diff --git a/gcc/testsuite/gcc.dg/pr68317.c b/gcc/testsuite/gcc.dg/pr68317.c
index 9ba6fb075e6..891d12954ba 100644
--- a/gcc/testsuite/gcc.dg/pr68317.c
+++ b/gcc/testsuite/gcc.dg/pr68317.c
@@ -1,15 +1,17 @@
/* { dg-do compile } */
/* { dg-options "-O2" } */
-void bar (int);
+typedef int int32_t __attribute__((mode (__SI__)));
+
+void bar (int32_t);
void
foo ()
{
- int index = 0;
+ int32_t index = 0;
- for (index; index <= 10; index--)
+ for (index; index <= 10; index--) // expected warning here
/* Result of the following multiply will overflow
- when converted to signed int. */
+ when converted to signed int32_t. */
bar ((0xcafe + index) * 0xdead); /* { dg-warning "iteration \[0-9\]+ invokes undefined behavior" } */
}
diff --git a/gcc/testsuite/gcc.dg/pr71581.c b/gcc/testsuite/gcc.dg/pr71581.c
index d82eb1ed5c9..dd71dde9eac 100644
--- a/gcc/testsuite/gcc.dg/pr71581.c
+++ b/gcc/testsuite/gcc.dg/pr71581.c
@@ -6,19 +6,19 @@ _Complex float
f1 (void)
{
float x;
- return x; /* { dg-warning "is used uninitialized in this function" } */
+ return x; /* { dg-warning "is used uninitialized" } */
}
_Complex double
f2 (void)
{
double x;
- return x; /* { dg-warning "is used uninitialized in this function" } */
+ return x; /* { dg-warning "is used uninitialized" } */
}
_Complex int
f3 (void)
{
int x;
- return x; /* { dg-warning "is used uninitialized in this function" } */
+ return x; /* { dg-warning "is used uninitialized" } */
}
diff --git a/gcc/testsuite/gcc.dg/pr78973.c b/gcc/testsuite/gcc.dg/pr78973.c
index d0ecba49810..6f4f6437926 100644
--- a/gcc/testsuite/gcc.dg/pr78973.c
+++ b/gcc/testsuite/gcc.dg/pr78973.c
@@ -9,7 +9,7 @@
static void f (void *p, int n)
{
if (n <= 4)
- __builtin_memset (p, 0, n); /* { dg-warning "exceeds maximum object size" "pr79073" { xfail ilp32 } } */
+ __builtin_memset (p, 0, n); /* { dg-warning "exceeds maximum object size" "pr79073" { xfail { ilp32 || { int16 && { ! msp430_large } } } } } */
}
void g (void *d, unsigned n)
diff --git a/gcc/testsuite/gcc.dg/pr84131.c b/gcc/testsuite/gcc.dg/pr84131.c
index 0ba96516fe3..ced2e5d9329 100644
--- a/gcc/testsuite/gcc.dg/pr84131.c
+++ b/gcc/testsuite/gcc.dg/pr84131.c
@@ -1,7 +1,8 @@
/* PR 94131 - ICE on printf with a VLA string and -fno-tree-ccp
-fno-tree-forwprop
{ dg-do compile }
- { dg-options "-O1 -fno-tree-ccp -fno-tree-forwprop" } */
+ { dg-options "-O1 -fno-tree-ccp -fno-tree-forwprop" }
+ { dg-require-effective-target alloca } */
void rv1 (int n)
{
diff --git a/gcc/testsuite/gcc.dg/pr85859.c b/gcc/testsuite/gcc.dg/pr85859.c
index b1476ba3806..7a57a09682c 100644
--- a/gcc/testsuite/gcc.dg/pr85859.c
+++ b/gcc/testsuite/gcc.dg/pr85859.c
@@ -15,6 +15,6 @@ int
main (void)
{
b = (unsigned char) __builtin_parity (d);
- e ? foo (0) : (long) &c;
+ e ? foo (0) : (__INTPTR_TYPE__) &c;
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/pr86179.c b/gcc/testsuite/gcc.dg/pr86179.c
index 6a90f09e6e8..f3dd3675c06 100644
--- a/gcc/testsuite/gcc.dg/pr86179.c
+++ b/gcc/testsuite/gcc.dg/pr86179.c
@@ -1,14 +1,17 @@
/* { dg-do compile } */
/* { dg-options "-O3" } */
-void c(int *d, char *g)
+typedef int int32_t __attribute__((mode (__SI__)));
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
+
+void c(int32_t *d, char *g)
{
char *a, *b, *e;
int f;
for (; f; f -= 8) {
- *d++ = *e++ | (unsigned)*g++ << 8 | (unsigned)*b++ << 16 |
- (unsigned)*a++ << 24;
- *d++ = *e++ | (unsigned)*g++ << 8 | (unsigned)*b++ << 16 |
- (unsigned)*a++ << 24;
+ *d++ = *e++ | (uint32_t)*g++ << 8 | (uint32_t)*b++ << 16 |
+ (uint32_t)*a++ << 24;
+ *d++ = *e++ | (uint32_t)*g++ << 8 | (uint32_t)*b++ << 16 |
+ (uint32_t)*a++ << 24;
}
}
diff --git a/gcc/testsuite/gcc.dg/pr87347.c b/gcc/testsuite/gcc.dg/pr87347.c
index d0bdf2a9fec..2077964e9d3 100644
--- a/gcc/testsuite/gcc.dg/pr87347.c
+++ b/gcc/testsuite/gcc.dg/pr87347.c
@@ -1,4 +1,4 @@
-/* {dg-do compile} */
+/* { dg-do compile } */
/* { dg-options "-Wabsolute-value" } */
int a;
diff --git a/gcc/testsuite/gcc.dg/pr87485.c b/gcc/testsuite/gcc.dg/pr87485.c
index 7e0917358f2..17d1c24c4f7 100644
--- a/gcc/testsuite/gcc.dg/pr87485.c
+++ b/gcc/testsuite/gcc.dg/pr87485.c
@@ -2,6 +2,7 @@
/* { dg-do compile { target int128 } } */
/* { dg-options "-O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-types -fno-tree-ccp -fno-tree-sra" } */
/* { dg-additional-options "-fstack-protector-strong" { target fstack_protector } } */
+/* { dg-require-effective-target scheduling } */
int *a;
diff --git a/gcc/testsuite/gcc.dg/pr88660.c b/gcc/testsuite/gcc.dg/pr88660.c
index 09a2d3270bd..c1d0985bb81 100644
--- a/gcc/testsuite/gcc.dg/pr88660.c
+++ b/gcc/testsuite/gcc.dg/pr88660.c
@@ -1,4 +1,4 @@
-/* { dg-do-compile } */
+/* { dg-do compile } */
/* { dg-options "-O -Wunused-but-set-variable" } */
int main(void)
diff --git a/gcc/testsuite/gcc.dg/pr88928.c b/gcc/testsuite/gcc.dg/pr88928.c
index c0a1f766cb0..0b6c1d70f05 100644
--- a/gcc/testsuite/gcc.dg/pr88928.c
+++ b/gcc/testsuite/gcc.dg/pr88928.c
@@ -3,4 +3,4 @@
struct a { } __attribute__((__packed__));
void c (struct a **);
void d (const struct a *b) { c ((struct a **) b); }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/pr89410-1.c b/gcc/testsuite/gcc.dg/pr89410-1.c
index 73dc6d4de3f..7423c496001 100644
--- a/gcc/testsuite/gcc.dg/pr89410-1.c
+++ b/gcc/testsuite/gcc.dg/pr89410-1.c
@@ -5,5 +5,5 @@ int main(void)
/* This is 0xffffffff. */
#line 4294967295
#warning msg
- /* { dg-warning "msg" "" { target *-*-* } -1 } */
+ /* { dg-warning "msg" "" { target *-*-* } { -1 } } */
}
diff --git a/gcc/testsuite/gcc.dg/pr89410-2.c b/gcc/testsuite/gcc.dg/pr89410-2.c
index 76e781b09df..3cc6d6d063e 100644
--- a/gcc/testsuite/gcc.dg/pr89410-2.c
+++ b/gcc/testsuite/gcc.dg/pr89410-2.c
@@ -9,5 +9,5 @@ int main(void)
#line 9223372036854775807
^~~~~~~~~~~~~~~~~~~
{ dg-end-multiline-output "" } */
- /* { dg-warning "msg" "" { target *-*-* } -1 } */
+ /* { dg-warning "msg" "" { target *-*-* } { -1 } } */
}
diff --git a/gcc/testsuite/gcc.dg/pr89689.c b/gcc/testsuite/gcc.dg/pr89689.c
index ee81274d3c4..778643ab7a3 100644
--- a/gcc/testsuite/gcc.dg/pr89689.c
+++ b/gcc/testsuite/gcc.dg/pr89689.c
@@ -1,4 +1,4 @@
-/* { dg-do-compile } */
+/* { dg-do compile } */
/* { dg-options "-O2 -Warray-bounds" } */
#include <string.h>
diff --git a/gcc/testsuite/gcc.dg/pr93986.c b/gcc/testsuite/gcc.dg/pr93986.c
index bdbc192a01d..0d533f4dbc2 100644
--- a/gcc/testsuite/gcc.dg/pr93986.c
+++ b/gcc/testsuite/gcc.dg/pr93986.c
@@ -1,6 +1,7 @@
/* PR tree-optimization/93986 - ICE in decompose, at wide-int.h:984
{ dg-do compile }
- { dg-options "-O1 -foptimize-strlen -ftree-slp-vectorize" } */
+ { dg-options "-O1 -foptimize-strlen -ftree-slp-vectorize" }
+ { dg-require-effective-target alloca } */
int dd (void);
diff --git a/gcc/testsuite/gcc.dg/pr94600-1.c b/gcc/testsuite/gcc.dg/pr94600-1.c
new file mode 100644
index 00000000000..b5913a0939c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr94600-1.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-options "-fdump-rtl-final -O2" } */
+
+/* Assignments to a whole struct of suitable size (32 bytes) must not be
+ picked apart into field accesses. */
+
+typedef struct {
+ unsigned int f0 : 4;
+ unsigned int f1 : 11;
+ unsigned int f2 : 10;
+ unsigned int f3 : 7;
+} t0;
+
+static t0 a0[] = {
+ { .f0 = 7, .f1 = 99, .f3 = 1, },
+ { .f0 = 7, .f1 = 251, .f3 = 1, },
+ { .f0 = 8, .f1 = 127, .f3 = 5, },
+ { .f0 = 5, .f1 = 1, .f3 = 1, },
+ { .f0 = 5, .f1 = 1, .f3 = 1, },
+ { .f0 = 5, .f1 = 1, .f3 = 1, },
+};
+
+void
+foo(void)
+{
+ __SIZE_TYPE__ i;
+ __SIZE_TYPE__ base = 0x000a0000;
+ for (i = 0; i < (sizeof (a0) / sizeof ((a0)[0])); i++) {
+ *(volatile t0 *) (base + 44 + i * 4) = a0[i];
+ }
+}
+
+/* The only volatile accesses should be the obvious writes. */
+/* { dg-final { scan-rtl-dump-times {\(mem/v} 6 "final" } } */
+/* { dg-final { scan-rtl-dump-times {\(set \(mem/v} 6 "final" } } */
diff --git a/gcc/testsuite/gcc.dg/pr94600-2.c b/gcc/testsuite/gcc.dg/pr94600-2.c
new file mode 100644
index 00000000000..cb96cc98a2d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr94600-2.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-options "-fdump-rtl-final -O2" } */
+
+/* Unrolled version of pr94600-1.c. */
+
+typedef struct {
+ unsigned int f0 : 4;
+ unsigned int f1 : 11;
+ unsigned int f2 : 10;
+ unsigned int f3 : 7;
+} t0;
+
+void
+bar(void)
+{
+ t0 a00 = { .f0 = 7, .f1 = 99, .f3 = 1, };
+ t0 a01 = { .f0 = 7, .f1 = 251, .f3 = 1, };
+ t0 a02 = { .f0 = 8, .f1 = 127, .f3 = 5, };
+ t0 a03 = { .f0 = 5, .f1 = 1, .f3 = 1, };
+ t0 a04 = { .f0 = 5, .f1 = 1, .f3 = 1, };
+ t0 a05 = { .f0 = 5, .f1 = 1, .f3 = 1, };
+ __SIZE_TYPE__ base = 0x000a0000;
+
+ *(volatile t0 *) ((base) + 44 + (0) * 4) = a00;
+ *(volatile t0 *) ((base) + 44 + (1) * 4) = a01;
+ *(volatile t0 *) ((base) + 44 + (2) * 4) = a02;
+ *(volatile t0 *) ((base) + 44 + (3) * 4) = a03;
+ *(volatile t0 *) ((base) + 44 + (4) * 4) = a04;
+ *(volatile t0 *) ((base) + 44 + (5) * 4) = a05;
+}
+
+/* { dg-final { scan-rtl-dump-times {\(mem/v} 6 "final" } } */
+/* { dg-final { scan-rtl-dump-times {\(set \(mem/v} 6 "final" } } */
diff --git a/gcc/testsuite/gcc.dg/pr94600-3.c b/gcc/testsuite/gcc.dg/pr94600-3.c
new file mode 100644
index 00000000000..7537f6cb797
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr94600-3.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-options "-fdump-rtl-final -O2 -fno-unroll-loops" } */
+
+/* Same-address version of pr94600-1.c. */
+
+typedef struct {
+ unsigned int f0 : 4;
+ unsigned int f1 : 11;
+ unsigned int f2 : 10;
+ unsigned int f3 : 7;
+} t0;
+
+static t0 a0[] = {
+ { .f0 = 7, .f1 = 99, .f3 = 1, },
+ { .f0 = 7, .f1 = 251, .f3 = 1, },
+ { .f0 = 8, .f1 = 127, .f3 = 5, },
+ { .f0 = 5, .f1 = 1, .f3 = 1, },
+ { .f0 = 5, .f1 = 1, .f3 = 1, },
+ { .f0 = 5, .f1 = 1, .f3 = 1, },
+};
+
+void
+foo(void)
+{
+ __SIZE_TYPE__ i;
+ __SIZE_TYPE__ base = 0x000a0000;
+ for (i = 0; i < (sizeof (a0) / sizeof ((a0)[0])); i++) {
+ *(volatile t0 *) (base + 44) = a0[i];
+ }
+}
+
+/* The loop isn't unrolled. */
+/* { dg-final { scan-rtl-dump-times {\(mem/v} 1 "final" } } */
+/* { dg-final { scan-rtl-dump-times {\(set \(mem/v} 1 "final" } } */
diff --git a/gcc/testsuite/gcc.dg/pr94600-4.c b/gcc/testsuite/gcc.dg/pr94600-4.c
new file mode 100644
index 00000000000..c2901abb327
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr94600-4.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-options "-fdump-rtl-final -O2" } */
+
+/* Unrolled version of pr94600-2.c. */
+
+typedef struct {
+ unsigned int f0 : 4;
+ unsigned int f1 : 11;
+ unsigned int f2 : 10;
+ unsigned int f3 : 7;
+} t0;
+
+void
+bar(void)
+{
+ t0 a00 = { .f0 = 7, .f1 = 99, .f3 = 1, };
+ t0 a01 = { .f0 = 7, .f1 = 251, .f3 = 1, };
+ t0 a02 = { .f0 = 8, .f1 = 127, .f3 = 5, };
+ t0 a03 = { .f0 = 5, .f1 = 1, .f3 = 1, };
+ t0 a04 = { .f0 = 5, .f1 = 1, .f3 = 1, };
+ t0 a05 = { .f0 = 5, .f1 = 1, .f3 = 1, };
+ __SIZE_TYPE__ base = 0x000a0000;
+
+ *(volatile t0 *) ((base) + 44) = a00;
+ *(volatile t0 *) ((base) + 44) = a01;
+ *(volatile t0 *) ((base) + 44) = a02;
+ *(volatile t0 *) ((base) + 44) = a03;
+ *(volatile t0 *) ((base) + 44) = a04;
+ *(volatile t0 *) ((base) + 44) = a05;
+}
+
+/* { dg-final { scan-rtl-dump-times {\(mem/v} 6 "final" } } */
+/* { dg-final { scan-rtl-dump-times {\(set \(mem/v} 6 "final" } } */
diff --git a/gcc/testsuite/gcc.dg/pr94600-5.c b/gcc/testsuite/gcc.dg/pr94600-5.c
new file mode 100644
index 00000000000..3be0249273e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr94600-5.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-options "-fdump-rtl-final -O2 -fno-unroll-loops" } */
+
+/* Target-as-parameter version of pr94600-1.c. */
+
+typedef struct {
+ unsigned int f0 : 4;
+ unsigned int f1 : 11;
+ unsigned int f2 : 10;
+ unsigned int f3 : 7;
+} t0 __attribute__((__aligned__(4)));
+
+static t0 a0[] = {
+ { .f0 = 7, .f1 = 99, .f3 = 1, },
+ { .f0 = 7, .f1 = 251, .f3 = 1, },
+ { .f0 = 8, .f1 = 127, .f3 = 5, },
+ { .f0 = 5, .f1 = 1, .f3 = 1, },
+ { .f0 = 5, .f1 = 1, .f3 = 1, },
+ { .f0 = 5, .f1 = 1, .f3 = 1, },
+};
+
+void
+foo(volatile t0 *b)
+{
+ __SIZE_TYPE__ i;
+ for (i = 0; i < (sizeof (a0) / sizeof ((a0)[0])); i++) {
+ b[i+11] = a0[i];
+ }
+}
+
+/* The loop isn't unrolled. */
+/* { dg-final { scan-rtl-dump-times {\(mem/v} 1 "final" } } */
+/* { dg-final { scan-rtl-dump-times {\(set \(mem/v} 1 "final" } } */
diff --git a/gcc/testsuite/gcc.dg/pr94600-6.c b/gcc/testsuite/gcc.dg/pr94600-6.c
new file mode 100644
index 00000000000..c247afef11a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr94600-6.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-options "-fdump-rtl-final -O2" } */
+
+/* Target-as-parameter version of pr94600-2.c. */
+
+typedef struct {
+ unsigned int f0 : 4;
+ unsigned int f1 : 11;
+ unsigned int f2 : 10;
+ unsigned int f3 : 7;
+} t0 __attribute__((__aligned__(4)));
+
+void
+bar(volatile t0 *b)
+{
+ t0 a00 = { .f0 = 7, .f1 = 99, .f3 = 1, };
+ t0 a01 = { .f0 = 7, .f1 = 251, .f3 = 1, };
+ t0 a02 = { .f0 = 8, .f1 = 127, .f3 = 5, };
+ t0 a03 = { .f0 = 5, .f1 = 1, .f3 = 1, };
+ t0 a04 = { .f0 = 5, .f1 = 1, .f3 = 1, };
+ t0 a05 = { .f0 = 5, .f1 = 1, .f3 = 1, };
+
+ b[11+0] = a00;
+ b[11+1] = a01;
+ b[11+2] = a02;
+ b[11+3] = a03;
+ b[11+4] = a04;
+ b[11+5] = a05;
+}
+
+/* { dg-final { scan-rtl-dump-times {\(mem/v} 6 "final" } } */
+/* { dg-final { scan-rtl-dump-times {\(set \(mem/v} 6 "final" } } */
diff --git a/gcc/testsuite/gcc.dg/pr94600-7.c b/gcc/testsuite/gcc.dg/pr94600-7.c
new file mode 100644
index 00000000000..81c5231e44c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr94600-7.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-options "-fdump-rtl-final -O2 -fno-unroll-loops" } */
+
+/* Target-as-parameter version of pr94600-3.c. */
+
+typedef struct {
+ unsigned int f0 : 4;
+ unsigned int f1 : 11;
+ unsigned int f2 : 10;
+ unsigned int f3 : 7;
+} t0 __attribute__((__aligned__(4)));
+
+static t0 a0[] = {
+ { .f0 = 7, .f1 = 99, .f3 = 1, },
+ { .f0 = 7, .f1 = 251, .f3 = 1, },
+ { .f0 = 8, .f1 = 127, .f3 = 5, },
+ { .f0 = 5, .f1 = 1, .f3 = 1, },
+ { .f0 = 5, .f1 = 1, .f3 = 1, },
+ { .f0 = 5, .f1 = 1, .f3 = 1, },
+};
+
+void
+foo(volatile t0 *b)
+{
+ __SIZE_TYPE__ i;
+ for (i = 0; i < (sizeof (a0) / sizeof ((a0)[0])); i++) {
+ b[11] = a0[i];
+ }
+}
+
+/* { dg-final { scan-rtl-dump-times {\(mem/v} 1 "final" } } */
+/* { dg-final { scan-rtl-dump-times {\(set \(mem/v} 1 "final" } } */
diff --git a/gcc/testsuite/gcc.dg/pr94600-8.c b/gcc/testsuite/gcc.dg/pr94600-8.c
new file mode 100644
index 00000000000..201b2add4d9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr94600-8.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-options "-fdump-rtl-final -O2" } */
+
+/* Unrolled version of pr94600-2.c. */
+
+typedef struct {
+ unsigned int f0 : 4;
+ unsigned int f1 : 11;
+ unsigned int f2 : 10;
+ unsigned int f3 : 7;
+} t0 __attribute__((__aligned__(4)));
+
+void
+bar(volatile t0 *b)
+{
+ t0 a00 = { .f0 = 7, .f1 = 99, .f3 = 1, };
+ t0 a01 = { .f0 = 7, .f1 = 251, .f3 = 1, };
+ t0 a02 = { .f0 = 8, .f1 = 127, .f3 = 5, };
+ t0 a03 = { .f0 = 5, .f1 = 1, .f3 = 1, };
+ t0 a04 = { .f0 = 5, .f1 = 1, .f3 = 1, };
+ t0 a05 = { .f0 = 5, .f1 = 1, .f3 = 1, };
+
+ b[11] = a00;
+ b[11] = a01;
+ b[11] = a02;
+ b[11] = a03;
+ b[11] = a04;
+ b[11] = a05;
+}
+
+/* { dg-final { scan-rtl-dump-times {\(mem/v} 6 "final" } } */
+/* { dg-final { scan-rtl-dump-times {\(set \(mem/v} 6 "final" } } */
diff --git a/gcc/testsuite/gcc.dg/pr94873.c b/gcc/testsuite/gcc.dg/pr94873.c
new file mode 100644
index 00000000000..36152176fbf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr94873.c
@@ -0,0 +1,27 @@
+/* PR rtl-optimization/94873 */
+/* { dg-do run { target int128 } } */
+/* { dg-options "-O -fno-merge-constants -fno-split-wide-types -fno-tree-fre" } */
+
+__attribute__((noipa)) void
+foo (const char *p, int q)
+{
+ if (p[0] != '%' || p[1] != '0' || p[2] != '2' || p[3] != 'x' || p[4] != '\0')
+ __builtin_abort ();
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ if ((unsigned char) q != 0x95)
+ __builtin_abort ();
+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ if ((unsigned char) q != 0)
+ __builtin_abort ();
+#endif
+}
+
+int
+main ()
+{
+ union U { __int128 a; char b[sizeof (__int128)]; };
+ char x = ((union U){ .a = 0xF4409395252B9560ULL}).b[1];
+ for (unsigned i = 0; i < sizeof (x); i++)
+ foo ("%02x", i[(volatile unsigned char *) &x]);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr94963.c b/gcc/testsuite/gcc.dg/pr94963.c
new file mode 100644
index 00000000000..aca9e161301
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr94963.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+typedef struct
+{
+ int p1;
+ int p2;
+ int p3;
+} P;
+struct S
+{
+ int field;
+};
+extern int v2;
+extern void foo (struct S *map);
+static struct S var;
+const P *pv;
+int ps;
+void
+f (void)
+{
+ if (pv != 0)
+ for (const P *ph = pv; ph < &pv[ps]; ++ph)
+ switch (ph->p1)
+ {
+ case 1:
+ v2 = ph->p2;
+ break;
+ case 2:
+ var.field = ph->p3;
+ break;
+ }
+ if (var.field != 0) /* { dg-bogus "uninitialized" } */
+ foo (&var);
+}
diff --git a/gcc/testsuite/gcc.dg/pr94968.c b/gcc/testsuite/gcc.dg/pr94968.c
new file mode 100644
index 00000000000..e8b282139c4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr94968.c
@@ -0,0 +1,8 @@
+/* PR c/94968 */
+/* { dg-do compile } */
+
+int
+foo (void)
+{
+ __builtin_speculation_safe_value (1, x); /* { dg-error "undeclared" } */
+} /* { dg-message "each undeclared identifier is reported only once" "" { target *-*-* } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/pr95052.c b/gcc/testsuite/gcc.dg/pr95052.c
new file mode 100644
index 00000000000..2ed1a037bce
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr95052.c
@@ -0,0 +1,12 @@
+/* PR middle-end/95052 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fconserve-stack" } */
+
+void bar (char *);
+
+void
+foo (void)
+{
+ char buf[70] = "";
+ bar (buf);
+}
diff --git a/gcc/testsuite/gcc.dg/pr95118.c b/gcc/testsuite/gcc.dg/pr95118.c
new file mode 100644
index 00000000000..69bc47fd7aa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr95118.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fre" } */
+
+void a();
+void b() {
+ union {
+ int c[4];
+ long double d;
+ } e = {{0, 0, 4}};
+ a(e.d);
+}
diff --git a/gcc/testsuite/gcc.dg/pr95133.c b/gcc/testsuite/gcc.dg/pr95133.c
new file mode 100644
index 00000000000..5e233595edb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr95133.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-require-effective-target label_values } */
+
+extern int a[16];
+void f (int *ip, int x)
+{
+ int *xp = a;
+ for (int i=0; i<8; ++i)
+ {
+ base: if (x) return;
+ }
+ *xp++ = *ip;
+ goto *(&&base + *ip);
+}
diff --git a/gcc/testsuite/gcc.dg/pr95141.c b/gcc/testsuite/gcc.dg/pr95141.c
new file mode 100644
index 00000000000..b6cbba2f908
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr95141.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+
+#include <stdint.h>
+
+uint64_t test(uint8_t IA1)
+{
+ return (uint8_t)(IA1 & 158) & 1UL; /* { dg-bogus "integer overflow" } */
+}
diff --git a/gcc/testsuite/gcc.dg/pr95171.c b/gcc/testsuite/gcc.dg/pr95171.c
new file mode 100644
index 00000000000..af9bde7bc6a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr95171.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-fexceptions -ffinite-math-only -fnon-call-exceptions" } */
+
+inline double __attribute__ ((always_inline))
+w9 (int q2)
+{
+ return __builtin_fabs (__builtin_nan ("")) > 0.0 ? 1.0 : q2 / 1.0;
+}
+
+double __attribute__ ((optimize ("-fipa-cp")))
+o7 (int iz)
+{
+ int rj[1];
+
+ (void) rj;
+
+ return w9 (iz);
+}
diff --git a/gcc/testsuite/gcc.dg/pr95580.c b/gcc/testsuite/gcc.dg/pr95580.c
new file mode 100644
index 00000000000..330a3137f1e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr95580.c
@@ -0,0 +1,16 @@
+/* PR c/95580 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -W -fno-tree-dce" } */
+
+void bar (void);
+
+void
+foo (int x)
+{
+ if (x == 0)
+ {
+ void *p = __builtin_malloc (4);
+ ((char *)p)[1] ^= 1; /* { dg-warning "may be used uninitialized" } */
+ }
+ bar ();
+}
diff --git a/gcc/testsuite/gcc.dg/pr95694.c b/gcc/testsuite/gcc.dg/pr95694.c
new file mode 100644
index 00000000000..6f5e1900a02
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr95694.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/68835 */
+/* { dg-do run { target int128 } } */
+/* { dg-options "-fno-tree-forwprop -fno-tree-ccp -O1 -fno-tree-dominator-opts -fno-tree-fre" } */
+
+__attribute__((noinline, noclone)) unsigned __int128
+foo (void)
+{
+ unsigned __int128 x = (unsigned __int128) 0xffffffffffffffffULL;
+ struct { unsigned __int128 a : 65; } w;
+ w.a = x;
+ w.a += x;
+ return w.a;
+}
+
+int
+main ()
+{
+ unsigned __int128 x = foo ();
+ if ((unsigned long long) x != 0xfffffffffffffffeULL
+ || (unsigned long long) (x >> 64) != 1)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr95713.c b/gcc/testsuite/gcc.dg/pr95713.c
new file mode 100644
index 00000000000..b167842b963
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr95713.c
@@ -0,0 +1,15 @@
+/* PR target/95713 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wno-psabi -w" } */
+/* { dg-additional-options "-mavx512bw" { target i?86-*-* x86_64-*-* } } */
+
+typedef int v2si __attribute__((vector_size (8)));
+typedef short int v2hi __attribute__((vector_size (4)));
+void foo (v2hi);
+
+void
+bar (v2si x)
+{
+ v2hi a = (v2hi) { (short) x[0], (short) x[1] };
+ foo (4 > a);
+}
diff --git a/gcc/testsuite/gcc.dg/pr95770.c b/gcc/testsuite/gcc.dg/pr95770.c
new file mode 100644
index 00000000000..06714ea1fa5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr95770.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+float *a;
+void b(float c, float d)
+{
+ a[0] = a[1] = 0.5f * (c - 2 + d);
+ a[2] = a[3] = 0.5f * (c + 2 + d);
+}
diff --git a/gcc/testsuite/gcc.dg/pr95854.c b/gcc/testsuite/gcc.dg/pr95854.c
new file mode 100644
index 00000000000..db45d6aaf42
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr95854.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-vect-cost-model -fno-tree-scev-cprop -ftracer" } */
+/* { dg-additional-options "-march=armv8.5-a+sve2" { target aarch64*-*-* } } */
+
+extern void abort (void);
+int c, d;
+int main()
+{
+ int e[] = {4, 4, 4, 4, 4, 4, 4, 4, 4};
+ d = 8;
+ for (; d; d--)
+ for (int a = 0; a <= 8; a++)
+ {
+ c = e[1];
+ e[d] = 0;
+ }
+ if (c != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr95857.c b/gcc/testsuite/gcc.dg/pr95857.c
new file mode 100644
index 00000000000..afd6f46ea38
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr95857.c
@@ -0,0 +1,38 @@
+/* PR tree-optimization/95857 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target label_values } */
+
+struct E { int e; };
+int bar (void), baz (void);
+void qux (void *);
+
+void
+foo (int x)
+{
+ struct E a = { 0 };
+ struct E i = { 0 };
+ qux (&&lab2);
+ if (baz ())
+ i.e = 1;
+ else
+ a.e = -2;
+ switch (a.e)
+ {
+ case -2:
+ lab1:
+ switch (i.e)
+ {
+ case -3:
+ case 2:
+ if (i.e-- != 2)
+ __builtin_unreachable ();
+ lab2:
+ baz ();
+ goto lab1;
+ case 0:
+ bar ();
+ }
+ break;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/pr96335.c b/gcc/testsuite/gcc.dg/pr96335.c
new file mode 100644
index 00000000000..ab243b3d129
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr96335.c
@@ -0,0 +1,12 @@
+/* PR middle-end/96335 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void bar (int, void *) __attribute__((__access__(__read_only__, 2)));
+
+void
+foo (void *x)
+{
+ void (*fn) () = bar;
+ fn (0, x);
+}
diff --git a/gcc/testsuite/gcc.dg/pr96370.c b/gcc/testsuite/gcc.dg/pr96370.c
new file mode 100644
index 00000000000..b939b2141d6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr96370.c
@@ -0,0 +1,8 @@
+/* { dg-do compile { target dfp } } */
+/* { dg-options "-O2 -ffast-math" } */
+
+void c(_Decimal128);
+void a(_Decimal128 b)
+{
+ c(-b * b);
+}
diff --git a/gcc/testsuite/gcc.dg/pr96377-1.c b/gcc/testsuite/gcc.dg/pr96377-1.c
new file mode 100644
index 00000000000..75b0c9618ef
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr96377-1.c
@@ -0,0 +1,32 @@
+/* { dg-options "-fno-lax-vector-conversions -Wno-psabi" } */
+/* { dg-message "use '-flax-vector-conversions' to permit conversions" "" { target *-*-* } 0 } */
+
+typedef int v4si __attribute__((vector_size(16)));
+typedef short v8hi __attribute__((vector_size(16)));
+
+struct s { v8hi x; v4si y; };
+union u1 { v8hi x; v4si y; };
+union u2 { v4si s; v8hi y; };
+
+void
+foo (v4si i, v8hi h)
+{
+ struct s x1 = { i, i }; // { dg-error "incompatible types when initializing type '__vector" }
+ struct s x2 = { h, h }; // { dg-error "incompatible types" }
+ struct s x3 = { i, h }; // { dg-error "incompatible types" }
+ struct s x4 = { h, i };
+
+ union u1 y1 = { i }; // { dg-error "incompatible types" }
+ union u1 y2 = { h };
+ union u2 y3 = { i };
+ union u2 y4 = { h }; // { dg-error "incompatible types" }
+
+ v4si z1[] = { i, i };
+ v4si z2[] = { i, h }; // { dg-error "incompatible types" }
+ v4si z3[] = { h, i }; // { dg-error "incompatible types" }
+ v4si z4[] = { h, h }; // { dg-error "incompatible types" }
+ v8hi z5[] = { i, i }; // { dg-error "incompatible types" }
+ v8hi z6[] = { i, h }; // { dg-error "incompatible types" }
+ v8hi z7[] = { h, i }; // { dg-error "incompatible types" }
+ v8hi z8[] = { h, h };
+}
diff --git a/gcc/testsuite/gcc.dg/pr96377-2.c b/gcc/testsuite/gcc.dg/pr96377-2.c
new file mode 100644
index 00000000000..83550401156
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr96377-2.c
@@ -0,0 +1,31 @@
+/* { dg-options "-flax-vector-conversions -Wno-psabi" } */
+
+typedef int v4si __attribute__((vector_size(16)));
+typedef short v8hi __attribute__((vector_size(16)));
+
+struct s { v8hi x; v4si y; };
+union u1 { v8hi x; v4si y; };
+union u2 { v4si s; v8hi y; };
+
+void
+foo (v4si i, v8hi h)
+{
+ struct s x1 = { i, i };
+ struct s x2 = { h, h };
+ struct s x3 = { i, h };
+ struct s x4 = { h, i };
+
+ union u1 y1 = { i };
+ union u1 y2 = { h };
+ union u2 y3 = { i };
+ union u2 y4 = { h };
+
+ v4si z1[] = { i, i };
+ v4si z2[] = { i, h };
+ v4si z3[] = { h, i };
+ v4si z4[] = { h, h };
+ v8hi z5[] = { i, i };
+ v8hi z6[] = { i, h };
+ v8hi z7[] = { h, i };
+ v8hi z8[] = { h, h };
+}
diff --git a/gcc/testsuite/gcc.dg/pr96377-3.c b/gcc/testsuite/gcc.dg/pr96377-3.c
new file mode 100644
index 00000000000..66dce01f277
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr96377-3.c
@@ -0,0 +1,33 @@
+/* { dg-do compile { target aarch64*-*-* } } */
+/* { dg-options "-fno-lax-vector-conversions" } */
+/* { dg-message "use '-flax-vector-conversions' to permit conversions" "" { target *-*-* } 0 } */
+
+typedef int v4si __attribute__((vector_size(16)));
+typedef short v8hi __attribute__((vector_size(16)));
+
+struct s { v8hi x; v4si y; };
+union u1 { v8hi x; v4si y; };
+union u2 { v4si s; v8hi y; };
+
+void
+foo (__Int32x4_t i, __Int16x8_t h)
+{
+ struct s x1 = { i, i }; // { dg-error "incompatible types when initializing type '__vector" }
+ struct s x2 = { h, h }; // { dg-error "incompatible types" }
+ struct s x3 = { i, h }; // { dg-error "incompatible types" }
+ struct s x4 = { h, i };
+
+ union u1 y1 = { i }; // { dg-error "incompatible types" }
+ union u1 y2 = { h };
+ union u2 y3 = { i };
+ union u2 y4 = { h }; // { dg-error "incompatible types" }
+
+ v4si z1[] = { i, i };
+ v4si z2[] = { i, h }; // { dg-error "incompatible types" }
+ v4si z3[] = { h, i }; // { dg-error "incompatible types" }
+ v4si z4[] = { h, h }; // { dg-error "incompatible types" }
+ v8hi z5[] = { i, i }; // { dg-error "incompatible types" }
+ v8hi z6[] = { i, h }; // { dg-error "incompatible types" }
+ v8hi z7[] = { h, i }; // { dg-error "incompatible types" }
+ v8hi z8[] = { h, h };
+}
diff --git a/gcc/testsuite/gcc.dg/pr96377-4.c b/gcc/testsuite/gcc.dg/pr96377-4.c
new file mode 100644
index 00000000000..f7aaf490031
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr96377-4.c
@@ -0,0 +1,32 @@
+/* { dg-do compile { target aarch64*-*-* } } */
+/* { dg-options "-flax-vector-conversions" } */
+
+typedef int v4si __attribute__((vector_size(16)));
+typedef short v8hi __attribute__((vector_size(16)));
+
+struct s { v8hi x; v4si y; };
+union u1 { v8hi x; v4si y; };
+union u2 { v4si s; v8hi y; };
+
+void
+foo (__Int32x4_t i, __Int16x8_t h)
+{
+ struct s x1 = { i, i };
+ struct s x2 = { h, h };
+ struct s x3 = { i, h };
+ struct s x4 = { h, i };
+
+ union u1 y1 = { i };
+ union u1 y2 = { h };
+ union u2 y3 = { i };
+ union u2 y4 = { h };
+
+ v4si z1[] = { i, i };
+ v4si z2[] = { i, h };
+ v4si z3[] = { h, i };
+ v4si z4[] = { h, h };
+ v8hi z5[] = { i, i };
+ v8hi z6[] = { i, h };
+ v8hi z7[] = { h, i };
+ v8hi z8[] = { h, h };
+}
diff --git a/gcc/testsuite/gcc.dg/pr96377-5.c b/gcc/testsuite/gcc.dg/pr96377-5.c
new file mode 100644
index 00000000000..3d0c24befa6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr96377-5.c
@@ -0,0 +1,33 @@
+/* { dg-do compile { target aarch64*-*-* } } */
+/* { dg-options "-fno-lax-vector-conversions" } */
+/* { dg-message "use '-flax-vector-conversions' to permit conversions" "" { target *-*-* } 0 } */
+
+typedef int v4si __attribute__((vector_size(16)));
+typedef short v8hi __attribute__((vector_size(16)));
+
+struct s { __Int16x8_t x; __Int32x4_t y; };
+union u1 { __Int16x8_t x; __Int32x4_t y; };
+union u2 { __Int32x4_t s; __Int16x8_t y; };
+
+void
+foo (v4si i, v8hi h)
+{
+ struct s x1 = { i, i }; // { dg-error "incompatible types when initializing type '__Int16x8_t" }
+ struct s x2 = { h, h }; // { dg-error "incompatible types" }
+ struct s x3 = { i, h }; // { dg-error "incompatible types" }
+ struct s x4 = { h, i };
+
+ union u1 y1 = { i }; // { dg-error "incompatible types" }
+ union u1 y2 = { h };
+ union u2 y3 = { i };
+ union u2 y4 = { h }; // { dg-error "incompatible types" }
+
+ v4si z1[] = { i, i };
+ v4si z2[] = { i, h }; // { dg-error "incompatible types" }
+ v4si z3[] = { h, i }; // { dg-error "incompatible types" }
+ v4si z4[] = { h, h }; // { dg-error "incompatible types" }
+ v8hi z5[] = { i, i }; // { dg-error "incompatible types" }
+ v8hi z6[] = { i, h }; // { dg-error "incompatible types" }
+ v8hi z7[] = { h, i }; // { dg-error "incompatible types" }
+ v8hi z8[] = { h, h };
+}
diff --git a/gcc/testsuite/gcc.dg/pr96377-6.c b/gcc/testsuite/gcc.dg/pr96377-6.c
new file mode 100644
index 00000000000..165327fa292
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr96377-6.c
@@ -0,0 +1,32 @@
+/* { dg-do compile { target aarch64*-*-* } } */
+/* { dg-options "-flax-vector-conversions" } */
+
+typedef int v4si __attribute__((vector_size(16)));
+typedef short v8hi __attribute__((vector_size(16)));
+
+struct s { __Int16x8_t x; __Int32x4_t y; };
+union u1 { __Int16x8_t x; __Int32x4_t y; };
+union u2 { __Int32x4_t s; __Int16x8_t y; };
+
+void
+foo (v4si i, v8hi h)
+{
+ struct s x1 = { i, i };
+ struct s x2 = { h, h };
+ struct s x3 = { i, h };
+ struct s x4 = { h, i };
+
+ union u1 y1 = { i };
+ union u1 y2 = { h };
+ union u2 y3 = { i };
+ union u2 y4 = { h };
+
+ v4si z1[] = { i, i };
+ v4si z2[] = { i, h };
+ v4si z3[] = { h, i };
+ v4si z4[] = { h, h };
+ v8hi z5[] = { i, i };
+ v8hi z6[] = { i, h };
+ v8hi z7[] = { h, i };
+ v8hi z8[] = { h, h };
+}
diff --git a/gcc/testsuite/gcc.dg/pr96514.c b/gcc/testsuite/gcc.dg/pr96514.c
new file mode 100644
index 00000000000..891b4da2b1e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr96514.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+int __attribute__ ((pure, returns_twice))
+r0 (void);
+
+void
+vy (int t7)
+{
+ while (t7 == 0)
+ r0 ();
+}
+
+void
+qw (int t7)
+{
+ vy (t7);
+
+ if (0)
+ r0 ();
+}
+
+void __attribute__ ((simd))
+un (int t7)
+{
+ qw (t7);
+ qw (t7);
+}
diff --git a/gcc/testsuite/gcc.dg/pr96558.c b/gcc/testsuite/gcc.dg/pr96558.c
new file mode 100644
index 00000000000..2f5739e9e6e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr96558.c
@@ -0,0 +1,32 @@
+/* PR target/96558 */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-O2 -fno-expensive-optimizations -fno-gcse" } */
+
+int ky;
+long int h1;
+__int128 f1;
+
+int
+sd (void);
+
+int __attribute__ ((simd))
+i8 (void)
+{
+ __int128 vh;
+
+ if (sd () == 0)
+ h1 = 0;
+
+ do
+ {
+ long int lf = (long int) f1 ? h1 : 0;
+
+ ky += lf;
+ vh = lf | f1;
+ f1 = 1;
+ }
+ while (vh < (f1 ^ 2));
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/redecl-4.c b/gcc/testsuite/gcc.dg/redecl-4.c
index 8f124886da8..2c214bb02c7 100644
--- a/gcc/testsuite/gcc.dg/redecl-4.c
+++ b/gcc/testsuite/gcc.dg/redecl-4.c
@@ -15,7 +15,7 @@ f (void)
/* Should get format warnings even though the built-in declaration
isn't "visible". */
printf (
- "%s", 1); /* { dg-warning "8:format" } */
+ "%s", 1); /* { dg-warning "15:format" } */
/* The type of strcmp here should have no prototype. */
if (0)
strcmp (1);
diff --git a/gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c b/gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c
index fffb4d7011a..28d898bba92 100644
--- a/gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c
+++ b/gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c
@@ -1,2 +1,2 @@
void __RTL test (void)
-{ /* { dg-error "-:no closing brace" } */
+{ /* { dg-error "-:no closing brace" "" { target *-*-* } .+1 } */
diff --git a/gcc/testsuite/gcc.dg/sibcall-10.c b/gcc/testsuite/gcc.dg/sibcall-10.c
index 3d58036b468..4ac2ee45fbf 100644
--- a/gcc/testsuite/gcc.dg/sibcall-10.c
+++ b/gcc/testsuite/gcc.dg/sibcall-10.c
@@ -5,7 +5,7 @@
Copyright (C) 2002 Free Software Foundation Inc.
Contributed by Hans-Peter Nilsson <hp@bitrange.com> */
-/* { dg-do run { xfail { { amdgcn*-*-* cris-*-* crisv32-*-* csky-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* msp430*-*-* nds32*-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */
+/* { dg-do run { xfail { { amdgcn*-*-* cris-*-* csky-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* msp430*-*-* nds32*-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */
/* -mlongcall disables sibcall patterns. */
/* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */
/* -msave-restore disables sibcall patterns. */
diff --git a/gcc/testsuite/gcc.dg/sibcall-3.c b/gcc/testsuite/gcc.dg/sibcall-3.c
index eafe8dd8456..9962b641298 100644
--- a/gcc/testsuite/gcc.dg/sibcall-3.c
+++ b/gcc/testsuite/gcc.dg/sibcall-3.c
@@ -5,7 +5,7 @@
Copyright (C) 2002 Free Software Foundation Inc.
Contributed by Hans-Peter Nilsson <hp@bitrange.com> */
-/* { dg-do run { xfail { { cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* msp430*-*-* nds32*-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */
+/* { dg-do run { xfail { { cris-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* msp430*-*-* nds32*-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */
/* -mlongcall disables sibcall patterns. */
/* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */
/* { dg-options "-O2 -foptimize-sibling-calls" } */
diff --git a/gcc/testsuite/gcc.dg/sibcall-4.c b/gcc/testsuite/gcc.dg/sibcall-4.c
index 1e039c66854..9ba1d16d489 100644
--- a/gcc/testsuite/gcc.dg/sibcall-4.c
+++ b/gcc/testsuite/gcc.dg/sibcall-4.c
@@ -5,7 +5,7 @@
Copyright (C) 2002 Free Software Foundation Inc.
Contributed by Hans-Peter Nilsson <hp@bitrange.com> */
-/* { dg-do run { xfail { { cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* msp430*-*-* nds32*-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */
+/* { dg-do run { xfail { { cris-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* msp430*-*-* nds32*-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */
/* -mlongcall disables sibcall patterns. */
/* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */
/* { dg-options "-O2 -foptimize-sibling-calls" } */
diff --git a/gcc/testsuite/gcc.dg/sibcall-9.c b/gcc/testsuite/gcc.dg/sibcall-9.c
index 6df671da39d..c06acdbea35 100644
--- a/gcc/testsuite/gcc.dg/sibcall-9.c
+++ b/gcc/testsuite/gcc.dg/sibcall-9.c
@@ -5,7 +5,7 @@
Copyright (C) 2002 Free Software Foundation Inc.
Contributed by Hans-Peter Nilsson <hp@bitrange.com> */
-/* { dg-do run { xfail { { amdgcn*-*-* cris-*-* crisv32-*-* csky-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* msp430*-*-* nds32*-*-* nvptx-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */
+/* { dg-do run { xfail { { amdgcn*-*-* cris-*-* csky-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* msp430*-*-* nds32*-*-* nvptx-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */
/* -mlongcall disables sibcall patterns. */
/* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */
/* -msave-restore disables sibcall patterns. */
diff --git a/gcc/testsuite/gcc.dg/sinatan-2.c b/gcc/testsuite/gcc.dg/sinatan-2.c
index 07a1e1e0c19..8e7ea3c90fc 100644
--- a/gcc/testsuite/gcc.dg/sinatan-2.c
+++ b/gcc/testsuite/gcc.dg/sinatan-2.c
@@ -48,12 +48,12 @@ cosatanl_ (long double x)
}
/* There must be no calls to sin, cos, or atan */
-/* {dg-final { scan-tree-dump-not "sin " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "cos " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "atan " "optimized" }} */
-/* {dg-final { scan-tree-dump-not "sinf " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "cosf " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "atanf " "optimized" }} */
-/* {dg-final { scan-tree-dump-not "sinl " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "cosl " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "atanl " "optimized" }} */
+/* { dg-final { scan-tree-dump-not "sin " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "cos " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "atan " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "sinf " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "cosf " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "atanf " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "sinl " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "cosl " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "atanl " "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/sinhatanh-1.c b/gcc/testsuite/gcc.dg/sinhatanh-1.c
index a76e6833101..e3a818be5b1 100644
--- a/gcc/testsuite/gcc.dg/sinhatanh-1.c
+++ b/gcc/testsuite/gcc.dg/sinhatanh-1.c
@@ -51,12 +51,12 @@ coshatanhl_ (long double x)
}
/* There must be no calls to sinh, cosh, or atanh */
-/* {dg-final { scan-tree-dump-not "sinh " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "cosh " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "atanh " "optimized" }} */
-/* {dg-final { scan-tree-dump-not "sinfh " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "cosfh " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "atanfh " "optimized" }} */
-/* {dg-final { scan-tree-dump-not "sinlh " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "coslh " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "atanlh " "optimized" }} */
+/* { dg-final { scan-tree-dump-not "sinh " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "cosh " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "atanh " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "sinfh " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "cosfh " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "atanfh " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "sinlh " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "coslh " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "atanlh " "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/sinhovercosh-1.c b/gcc/testsuite/gcc.dg/sinhovercosh-1.c
index 7e510727af8..d41093fa6de 100644
--- a/gcc/testsuite/gcc.dg/sinhovercosh-1.c
+++ b/gcc/testsuite/gcc.dg/sinhovercosh-1.c
@@ -33,13 +33,13 @@ sinhlovercoshl_ (long double x)
}
/* There must be no calls to sinh, cosh, or atanh */
-/* {dg-final { scan-tree-dump-not "sinh " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "cosh " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "sinfh " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "cosfh " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "sinlh " "optimized" } } */
-/* {dg-final { scan-tree-dump-not "coslh " "optimized" } } */
-/* {dg-final { scan-tree-dump-times "tanh " "1" "optimized" }} */
-/* {dg-final { scan-tree-dump-times "tanhl " "1" "optimized" }} */
-/* {dg-final { scan-tree-dump-times "tanhf " "1" "optimized" }} */
+/* { dg-final { scan-tree-dump-not "sinh " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "cosh " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "sinfh " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "cosfh " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "sinlh " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "coslh " "optimized" } } */
+/* { dg-final { scan-tree-dump-times "tanh " "1" "optimized" } } */
+/* { dg-final { scan-tree-dump-times "tanhl " "1" "optimized" } } */
+/* { dg-final { scan-tree-dump-times "tanhf " "1" "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/spellcheck-inttypes.c b/gcc/testsuite/gcc.dg/spellcheck-inttypes.c
new file mode 100644
index 00000000000..1146a7cff5b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/spellcheck-inttypes.c
@@ -0,0 +1,82 @@
+/* { dg-options "-std=c99" } */
+/* Prevent AIX from implicitly including inttypes.h. */
+#ifdef _AIX
+#define _H_INTTYPES_TYPE_TS
+#endif
+#include <stdio.h>
+#include <stdint.h>
+/* Missing <inttypes.h>. */
+
+int8_t i8;
+int16_t i16;
+int32_t i32;
+int64_t i64;
+
+intptr_t ip;
+uintptr_t up;
+
+/* As an identifier. */
+const char *hex8_fmt = PRIx8; /* { dg-error "'PRIx8' undeclared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIx8' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+const char *hex16_fmt = PRIx16; /* { dg-error "'PRIx16' undeclared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIx16' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+const char *hex32_fmt = PRIx32; /* { dg-error "'PRIx32' undeclared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIx32' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+const char *hex64_fmt = PRIx64; /* { dg-error "'PRIx64' undeclared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIx64' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+const char *hexptr_fmt = PRIxPTR; /* { dg-error "'PRIxPTR' undeclared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIxPTR' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+
+/* As a part of a string-literal. */
+const char *dec8msg_fmt = "Provide %" PRId8 "\n"; /* { dg-error "expected" "expected string-literal" { target *-*-* } } */
+/* { dg-message "'PRId8' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+const char *dec16msg_fmt = "Provide %" PRId16 "\n"; /* { dg-error "expected" "expected string-literal" { target *-*-* } } */
+/* { dg-message "'PRId16' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+const char *dec32msg_fmt = "Provide %" PRId32 "\n"; /* { dg-error "expected" "expected string-literal" { target *-*-* } } */
+/* { dg-message "'PRId32' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+const char *dec64msg_fmt = "Provide %" PRId64 "\n"; /* { dg-error "expected" "expected string-literal" { target *-*-* } } */
+/* { dg-message "'PRId64' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+const char *decptrmsg_fmt = "Provide %" PRIdPTR "\n"; /* { dg-error "expected" "expected string-literal" { target *-*-* } } */
+/* { dg-message "'PRIdPTR' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+
+void test_printf (void)
+{
+ printf ("some format strings %s, %s, %s, %s, %s, %s\n",
+ PRId8, /* { dg-error "'PRId8' undeclared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRId8' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+ PRIi16, /* { dg-error "'PRIi16' undeclared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIi16' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+ PRIo32, /* { dg-error "'PRIo32' undeclared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIo32' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+ PRIu64, /* { dg-error "'PRIu64' undeclared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIu64' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+ PRIoPTR); /* { dg-error "'PRIoPTR' undeclared" "undeclared identifier" { target *-*-* } } */
+/* { dg-message "'PRIoPTR' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+
+ printf ("%" PRIo8 "\n", i8); /* { dg-error "expected" } */
+/* { dg-message "'PRIo8' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+ printf ("%" PRIo16 "\n", i16); /* { dg-error "expected" } */
+/* { dg-message "'PRIo16' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+ printf ("%" PRIo32 "\n", i32); /* { dg-error "expected" } */
+/* { dg-message "'PRIo32' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+ printf ("%" PRIo64 "\n", i64); /* { dg-error "expected" } */
+/* { dg-message "'PRIo64' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+ printf ("%" PRIoPTR "\n", ip); /* { dg-error "expected" } */
+/* { dg-message "'PRIoPTR' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+}
+
+void test_scanf (void)
+{
+ scanf ("%" SCNu8 "\n", &i8); /* { dg-error "expected" } */
+/* { dg-message "'SCNu8' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+ scanf ("%" SCNu16 "\n", &i16); /* { dg-error "expected" } */
+/* { dg-message "'SCNu16' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+ scanf ("%" SCNu32 "\n", &i32); /* { dg-error "expected" } */
+/* { dg-message "'SCNu32' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+ scanf ("%" SCNu64 "\n", &i64); /* { dg-error "expected" } */
+/* { dg-message "'SCNu64' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+ scanf ("%" SCNuPTR "\n", &ip); /* { dg-error "expected" } */
+/* { dg-message "'SCNuPTR' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+ scanf ("%" SCNxPTR "\n", &up); /* { dg-error "expected" } */
+/* { dg-message "'SCNxPTR' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?" "replacement note" { target *-*-* } .-1 } */
+}
diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-22.c b/gcc/testsuite/gcc.dg/spellcheck-options-22.c
new file mode 100644
index 00000000000..b0ddae2e78e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/spellcheck-options-22.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-ipa-ynline" } */
+/* { dg-error "unrecognized command-line option '-fdump-ipa-ynline'; did you mean '-fdump-ipa-inline'?" "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/spellcheck-stdbool.c b/gcc/testsuite/gcc.dg/spellcheck-stdbool.c
new file mode 100644
index 00000000000..01f12da35cf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/spellcheck-stdbool.c
@@ -0,0 +1,17 @@
+/* { dg-options "-std=c99" } */
+/* Missing <stdbool.h>. */
+
+bool b; /* { dg-error "unknown type name 'bool'" } */
+/* { dg-message "'bool' is defined in header '<stdbool.h>'; did you forget to '#include <stdbool.h>'?" "" { target *-*-* } .-1 } */
+
+int test_true (void)
+{
+ return true; /* { dg-error "'true' undeclared" } */
+ /* { dg-message "'true' is defined in header '<stdbool.h>'; did you forget to '#include <stdbool.h>'?" "" { target *-*-* } .-1 } */
+}
+
+int test_false (void)
+{
+ return false; /* { dg-error "'false' undeclared" } */
+ /* { dg-message "'false' is defined in header '<stdbool.h>'; did you forget to '#include <stdbool.h>'?" "" { target *-*-* } .-1 } */
+}
diff --git a/gcc/testsuite/gcc.dg/spellcheck-stdint.c b/gcc/testsuite/gcc.dg/spellcheck-stdint.c
new file mode 100644
index 00000000000..852c86954b6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/spellcheck-stdint.c
@@ -0,0 +1,62 @@
+/* { dg-options "-std=gnu99" } */
+/* Missing <stdint.h>. */
+
+char c = INT8_MAX; // { dg-error "'INT8_MAX' undeclared" }
+// { dg-message "'INT8_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+
+short s = INT16_MAX; // { dg-error "'INT16_MAX' undeclared" }
+// { dg-message "'INT16_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+
+int i = INT32_MAX; // { dg-error "'INT32_MAX' undeclared" }
+// { dg-message "'INT32_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+
+long l = INT64_MAX; // { dg-error "'INT64_MAX' undeclared" }
+// { dg-message "'INT64_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+
+intptr_t test_intptr (void) // { dg-error "unknown type name 'intptr_t'" }
+// { dg-message "'intptr_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+{
+ return INTPTR_MAX; // { dg-error "'INTPTR_MAX' undeclared" }
+// { dg-message "'INTPTR_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+}
+
+uintptr_t test_uintptr (void) // { dg-error "unknown type name 'uintptr_t'" }
+// { dg-message "'uintptr_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+{
+ return UINTPTR_MAX; // { dg-error "'UINTPTR_MAX' undeclared" }
+// { dg-message "'UINTPTR_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+}
+
+int8_t i8; // { dg-error "unknown type name 'int8_t'" }
+// { dg-message "'int8_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+int16_t i16; // { dg-error "unknown type name 'int16_t'" }
+// { dg-message "'int16_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+int32_t i32; // { dg-error "unknown type name 'int32_t'" }
+// { dg-message "'int32_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+int64_t i64; // { dg-error "unknown type name 'int64_t'" }
+// { dg-message "'int64_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+
+void test_uint_t (void)
+{
+ char bu8[(unsigned int)UINT8_MAX]; // { dg-error "'UINT8_MAX' undeclared" }
+ // { dg-message "'UINT8_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+ char bu16[(unsigned int)UINT16_MAX]; // { dg-error "'UINT16_MAX' undeclared" }
+ // { dg-message "'UINT16_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+ char bu32[(unsigned int)UINT32_MAX]; // { dg-error "'UINT32_MAX' undeclared" }
+ // { dg-message "'UINT32_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+ char bu64[(unsigned int)UINT64_MAX]; // { dg-error "'UINT64_MAX' undeclared" }
+ // { dg-message "'UINT64_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-1 }
+
+ char ui8 = (uint8_t) 8; // { dg-error "'uint8_t' undeclared" }
+ // { dg-error "expected" "" { target *-*-* } .-1 }
+ // { dg-message "'uint8_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-2 }
+ short ui16 = (uint16_t) 16; // { dg-error "'uint16_t' undeclared" }
+ // { dg-error "expected" "" { target *-*-* } .-1 }
+ // { dg-message "'uint16_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-2 }
+ int ui32 = (uint32_t) 32; // { dg-error "'uint32_t' undeclared" }
+ // { dg-error "expected" "" { target *-*-* } .-1 }
+ // { dg-message "'uint32_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-2 }
+ long ui64 = (uint64_t) 64; // { dg-error "'uint64_t' undeclared" }
+ // { dg-error "expected" "" { target *-*-* } .-1 }
+ // { dg-message "'uint64_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?" "" { target *-*-* } .-2 }
+}
diff --git a/gcc/testsuite/gcc.dg/sso-11.c b/gcc/testsuite/gcc.dg/sso-11.c
new file mode 100644
index 00000000000..6b50a254858
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/sso-11.c
@@ -0,0 +1,36 @@
+/* Test support of scalar_storage_order attribute */
+
+/* { dg-do compile } */
+
+struct __attribute__((scalar_storage_order("big-endian"))) S1
+{
+ int i;
+};
+
+struct __attribute__((scalar_storage_order("little-endian"))) S2
+{
+ int i;
+};
+
+extern int foo (void *);
+
+int incompatible_call (int which, struct S1 *s1, struct S2 *s2)
+{
+ if (which == 1) return foo (s1); else foo (s2); /* { dg-warning "incompatible scalar storage order" } */
+}
+
+void incompatible_assign (struct S1 *s1, struct S2 *s2)
+{
+ void *p1, *p2;
+ p1 = s1, p2 = s2; /* { dg-warning "incompatible scalar storage order" } */
+}
+
+void incompatible_init (struct S1 *s1, struct S2 *s2)
+{
+ void *p1 = s1, *p2 = s2; /* { dg-warning "incompatible scalar storage order" } */
+}
+
+void *incompatible_return (int which, struct S1 *s1, struct S2 *s2)
+{
+ if (which == 1) return s1; else return s2; /* { dg-warning "incompatible scalar storage order" } */
+}
diff --git a/gcc/testsuite/gcc.dg/sso/memcpy-1.c b/gcc/testsuite/gcc.dg/sso/memcpy-1.c
new file mode 100644
index 00000000000..b4e1c8786d9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/sso/memcpy-1.c
@@ -0,0 +1,59 @@
+/* { dg-do run } */
+
+typedef unsigned char uint8_t;
+typedef unsigned int uint32_t;
+
+#define __big_endian__ scalar_storage_order("big-endian")
+#define __little_endian__ scalar_storage_order("little-endian")
+
+typedef union
+{
+ uint32_t val;
+ uint8_t v[4];
+} __attribute__((__big_endian__)) upal_u32be_t;
+
+typedef union
+{
+ uint32_t val;
+ uint8_t v[4];
+} __attribute__((__little_endian__)) upal_u32le_t;
+
+static inline uint32_t native_to_big_endian(uint32_t t)
+{
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ return t;
+#else
+ return __builtin_bswap32(t);
+#endif
+}
+static inline uint32_t native_to_little_endian(uint32_t t)
+{
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ return __builtin_bswap32(t);
+#else
+ return t;
+#endif
+}
+#define test(p, p1, i) do { if (p[i] != p1[i]) __builtin_abort (); } while (0)
+
+#define tests(p, p1) do { test(p, p1, 0); test(p, p1, 1); \
+ test(p, p1, 2); test(p, p1, 3); } while (0)
+
+int main(void)
+{
+ const uint32_t u = 0x12345678;
+
+ upal_u32be_t tempb;
+ __builtin_memcpy (&tempb, &u, sizeof(uint32_t));
+ uint32_t bu = tempb.val;
+ uint32_t b1u = native_to_big_endian(u);
+ tests (((uint8_t*)&bu), ((uint8_t*)&b1u));
+
+ upal_u32le_t templ;
+ __builtin_memcpy (&templ, &u, sizeof(uint32_t));
+ uint32_t lu = templ.val;
+ uint32_t l1u = native_to_little_endian(u);
+ tests (((uint8_t*)&lu), ((uint8_t*)&l1u));
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/sso/sso.exp b/gcc/testsuite/gcc.dg/sso/sso.exp
index a017f3e786a..80f534be922 100644
--- a/gcc/testsuite/gcc.dg/sso/sso.exp
+++ b/gcc/testsuite/gcc.dg/sso/sso.exp
@@ -27,12 +27,12 @@ torture-init
dg-init
set SSO_TORTURE_OPTIONS [list \
- { -O0 } \
- { -O1 -fno-inline } \
- { -O2 } \
- { -O3 -finline-functions } \
- { -Os } \
- { -Og -g } ]
+ { -Wno-scalar-storage-order -O0 } \
+ { -Wno-scalar-storage-order -O1 -fno-inline } \
+ { -Wno-scalar-storage-order -O2 } \
+ { -Wno-scalar-storage-order -O3 -finline-functions } \
+ { -Wno-scalar-storage-order -Os } \
+ { -Wno-scalar-storage-order -Og -g } ]
set-torture-options $SSO_TORTURE_OPTIONS
diff --git a/gcc/testsuite/gcc.dg/strlenopt-55.c b/gcc/testsuite/gcc.dg/strlenopt-55.c
index ea6fb22a2ed..ca89ecd3c53 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-55.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-55.c
@@ -3,7 +3,8 @@
Verify that strlen() of braced initialized array is folded
{ dg-do compile }
- { dg-options "-O1 -Wall -fdump-tree-gimple -fdump-tree-optimized" } */
+ { dg-options "-O1 -Wall -fdump-tree-gimple -fdump-tree-optimized" }
+ { dg-require-effective-target large_initializer } */
#include "strlenopt.h"
diff --git a/gcc/testsuite/gcc.dg/strlenopt-74.c b/gcc/testsuite/gcc.dg/strlenopt-74.c
index 0a9ac6c1da2..19e9a608583 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-74.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-74.c
@@ -75,7 +75,7 @@ VERIFY (i0 ? (a8 + 2) : (b8 + 2), 7, 6);
VERIFY (i0 ? (a8 + 0) : (c4 + 0), 9, 4);
VERIFY (i0 ? (a8 + 0) : (c4 + 1), 9, 3);
VERIFY (i0 ? (a8 + 0) : (c4 + 3), 9, 1);
-VERIFY (i0 ? (a8 + 0) : (c4 + 4), 9, 0);
+VERIFY (i0 ? (a8 + 0) : (c4 + 4), 8, 0);
VERIFY (i0 ? (a8 + 1) : (c4 + 0), 8, 4);
VERIFY (i0 ? (a8 + 1) : (c4 + 1), 8, 3);
VERIFY (i0 ? (a8 + 1) : (c4 + 2), 8, 2);
diff --git a/gcc/testsuite/gcc.dg/strlenopt-83.c b/gcc/testsuite/gcc.dg/strlenopt-83.c
index 5baafea5c32..baa80cf9643 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-83.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-83.c
@@ -1,7 +1,8 @@
/* PR tree-optimization/83821 - local aggregate initialization defeats
strlen optimization
{ dg-do compile }
- { dg-options "-O2 -Wall -fdump-tree-optimized" } */
+ { dg-options "-O2 -Wall -fdump-tree-optimized" }
+ { dg-require-effective-target alloca } */
#include "strlenopt.h"
char *p_p2, *p_p5, *p_p9, *p_p14;
diff --git a/gcc/testsuite/gcc.dg/strlenopt-84.c b/gcc/testsuite/gcc.dg/strlenopt-84.c
index d6102b6e6f5..0c9da3c1b59 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-84.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-84.c
@@ -3,7 +3,8 @@
Verify that stores that overwrite an interior nul are correctly
reflected in strlen results.
{ dg-do run }
- { dg-options "-O2 -Wall" } */
+ { dg-options "-O2 -Wall" }
+ { dg-require-effective-target alloca } */
#define false (0 == 1)
#define true (0 == 0)
diff --git a/gcc/testsuite/gcc.dg/strlenopt-91.c b/gcc/testsuite/gcc.dg/strlenopt-91.c
index 2381d03e44a..a30556128ed 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-91.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-91.c
@@ -1,7 +1,8 @@
/* PR tree-optimization/92412 - excessive errno aliasing assumption defeats
optimization
{ dg-do compile }
- { dg-options "-O2 -Wall -fdump-tree-optimized" } */
+ { dg-options "-O2 -Wall -fdump-tree-optimized" }
+ { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.dg/strncmp-3.c b/gcc/testsuite/gcc.dg/strncmp-3.c
new file mode 100644
index 00000000000..0e8101cd61b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strncmp-3.c
@@ -0,0 +1,57 @@
+/* PR middle-end/95189 - memcmp being wrongly stripped like strcmp
+ { dg-do run }
+ { dg-options "-O2 -Wall" } */
+
+#define AB_D "ab\0d"
+#define ABCDEF_H "abcdef\0h"
+#define ABCDEFGHIJKLMN_P "abcdefghijklmn\0p"
+
+char ab_d[] = AB_D;
+char abcdef_h[] = ABCDEF_H;
+
+extern int strncmp (const char*, const char*, __SIZE_TYPE__);
+
+__attribute__((noipa)) void sink (const void *p, ...) { (void)&p; }
+
+#define strncmp(a, b, n) (sink (a, b), strncmp (a, b, n))
+
+int main (void)
+{
+ int zero = 0;
+
+ zero += strncmp (ab_d, AB_D, 1);
+ zero += strncmp (ab_d, AB_D, 2);
+ zero += strncmp (ab_d, AB_D, 3);
+ zero += strncmp (ab_d, AB_D, 4);
+ zero += strncmp (ab_d, AB_D, 5);
+
+ zero += strncmp (ab_d, ABCDEF_H, 1);
+ zero += strncmp (ab_d, ABCDEF_H, 2);
+
+ zero += strncmp (abcdef_h, AB_D, 2);
+
+ zero += strncmp (abcdef_h, ABCDEF_H, 2);
+ zero += strncmp (abcdef_h, ABCDEF_H, 3);
+ zero += strncmp (abcdef_h, ABCDEF_H, 4);
+ zero += strncmp (abcdef_h, ABCDEF_H, 5);
+ zero += strncmp (abcdef_h, ABCDEF_H, 6);
+ zero += strncmp (abcdef_h, ABCDEF_H, 7);
+ zero += strncmp (abcdef_h, ABCDEF_H, 8);
+ zero += strncmp (abcdef_h, ABCDEF_H, 9);
+
+ if (zero != 0)
+ __builtin_abort ();
+
+ int neg = 0;
+
+ neg -= strncmp (ab_d, ABCDEF_H, 3) < 0;
+ neg -= strncmp (ab_d, ABCDEF_H, 4) < 0;
+ neg -= strncmp (ab_d, ABCDEF_H, 5) < 0;
+ neg -= strncmp (ab_d, ABCDEF_H, 6) < 0;
+ neg -= strncmp (ab_d, ABCDEF_H, 7) < 0;
+ neg -= strncmp (ab_d, ABCDEF_H, 8) < 0;
+ neg -= strncmp (ab_d, ABCDEF_H, 9) < 0;
+
+ if (neg != -7)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/gcc.dg/tanhbysinh.c b/gcc/testsuite/gcc.dg/tanhbysinh.c
new file mode 100644
index 00000000000..fde72c2f93b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tanhbysinh.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast -fdump-tree-optimized" } */
+
+extern float sinhf (float);
+extern float tanhf (float);
+extern double sinh (double);
+extern double tanh (double);
+extern long double sinhl (long double);
+extern long double tanhl (long double);
+
+double __attribute__ ((noinline))
+tanhbysinh_ (double x)
+{
+ return tanh (x) / sinh (x);
+}
+
+float __attribute__ ((noinline))
+tanhbysinhf_ (float x)
+{
+ return tanhf (x) / sinhf (x);
+}
+
+long double __attribute__ ((noinline))
+tanhbysinhl_ (long double x)
+{
+ return tanhl (x) / sinhl (x);
+}
+
+
+/* There must be no calls to sinh or atanh */
+/* There must be calls to cosh */
+/* {dg-final { scan-tree-dump-not "sinh " "optimized" } } */
+/* {dg-final { scan-tree-dump-not "tanh " "optimized" }} */
+/* {dg-final { scan-tree-dump-not "sinhf " "optimized" } } */
+/* {dg-final { scan-tree-dump-not "tanhf " "optimized" }} */
+/* {dg-final { scan-tree-dump-not "sinhl " "optimized" } } */
+/* {dg-final { scan-tree-dump-not "tanhl " "optimized" }} */
+/* { dg-final { scan-tree-dump "cosh " "optimized" } } */
+/* { dg-final { scan-tree-dump "coshf " "optimized" } } */
+/* { dg-final { scan-tree-dump "coshl " "optimized" } } */ \ No newline at end of file
diff --git a/gcc/testsuite/gcc.dg/tls/opt-9.c b/gcc/testsuite/gcc.dg/tls/opt-9.c
index 49aa9085fdd..ff1ffc08541 100644
--- a/gcc/testsuite/gcc.dg/tls/opt-9.c
+++ b/gcc/testsuite/gcc.dg/tls/opt-9.c
@@ -1,5 +1,5 @@
/* PR 21412 */
-/* { dg-do compile */
+/* { dg-do compile } */
/* { dg-require-effective-target fpic } */
/* { dg-options "-O2 -fPIC" } */
/* { dg-require-effective-target tls } */
diff --git a/gcc/testsuite/gcc.dg/tm/pr95569.c b/gcc/testsuite/gcc.dg/tm/pr95569.c
new file mode 100644
index 00000000000..f0b0d6f4c24
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tm/pr95569.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O0" } */
+/* { dg-do compile { target aarch64*-*-* } } */
+
+typedef int __attribute__ ((vector_size (16))) vectype;
+vectype v;
+
+void
+foo (int c)
+{
+ vectype *p = __builtin_malloc (sizeof (vectype));
+ __transaction_atomic
+ {
+ *p = v;
+ if (c)
+ __transaction_cancel;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/20181024-1.c b/gcc/testsuite/gcc.dg/torture/20181024-1.c
index a3cce24b873..9cc97a9033b 100644
--- a/gcc/testsuite/gcc.dg/torture/20181024-1.c
+++ b/gcc/testsuite/gcc.dg/torture/20181024-1.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target size32plus } */
/* { dg-additional-options "-march=core-avx2" { target { x86_64-*-* i?86-*-* } } } */
+/* { dg-require-effective-target size32plus } */
typedef enum {
C = 0, N, S, E, W, T, B, NE, NW, SE, SW, NT, NB, ST, SB, ET, EB, WT, WB, FLAGS, N_CELL_ENTRIES} CELL_ENTRIES;
diff --git a/gcc/testsuite/gcc.dg/torture/20200727-0.c b/gcc/testsuite/gcc.dg/torture/20200727-0.c
new file mode 100644
index 00000000000..ab915687b30
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/20200727-0.c
@@ -0,0 +1,82 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-g" } */
+
+typedef long unsigned int size_t;
+typedef signed int __int32_t;
+typedef __int32_t int32_t;
+typedef long int ptrdiff_t;
+typedef enum {
+ BT_UNKNOWN = 0, BT_INTEGER, BT_LOGICAL, BT_REAL, BT_COMPLEX, BT_DERIVED, BT_CHARACTER, BT_CLASS, BT_PROCEDURE, BT_HOLLERITH, BT_VOID, BT_ASSUMED, BT_UNION, BT_BOZ } bt;
+typedef int32_t GFC_INTEGER_4;
+typedef ptrdiff_t index_type;
+typedef size_t gfc_charlen_type;
+typedef struct descriptor_dimension {
+ index_type _stride;
+ index_type lower_bound;
+ } descriptor_dimension;
+typedef struct {
+ descriptor_dimension dim[15];
+ } gfc_full_array_i4;
+typedef void (*formatted_dtio)(void *, GFC_INTEGER_4 *, char *, gfc_full_array_i4 *, GFC_INTEGER_4 *, char *, gfc_charlen_type, gfc_charlen_type);
+typedef enum { DECIMAL_POINT, DECIMAL_COMMA, DECIMAL_UNSPECIFIED } unit_decimal;
+typedef struct st_parameter_dt {
+ union {
+ struct {
+ struct gfc_unit *current_unit;
+ unsigned namelist_mode : 1;
+ unsigned unit_is_internal : 1;
+ formatted_dtio fdtio_ptr;
+ } p;
+ } u;
+ } st_parameter_dt;
+typedef struct gfc_unit {
+ int unit_number;
+ unit_decimal decimal_status;
+ int (*next_char_fn_ptr) (st_parameter_dt *);
+ void (*push_char_fn_ptr) (st_parameter_dt *, int);
+ } gfc_unit;
+void read_real (st_parameter_dt *dtp)
+{
+ int c;
+ int seen_dp;
+ seen_dp = 0;
+ for (;;)
+ {
+ c = ((dtp)->u.p.current_unit->next_char_fn_ptr (dtp));
+ if (c == ',' && dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA)
+ c = '.';
+ switch (c) {
+ case '.':
+ if (seen_dp) goto bad_real;
+ seen_dp = 1;
+ ((dtp)->u.p.current_unit->push_char_fn_ptr (dtp, c));
+ goto real_loop;
+ case 'E':
+ case 'e':
+ case 'D':
+ case 'd':
+ case 'Q':
+ case 'q':
+ goto exp1;
+ case '+':
+ case '-':
+ ((dtp)->u.p.current_unit->push_char_fn_ptr (dtp, 'e'));
+ goto got_repeat;
+ }
+ }
+got_repeat:
+real_loop:
+ for (;;)
+ {
+ c = ((dtp)->u.p.current_unit->next_char_fn_ptr (dtp));
+ switch (c) {
+ case '.':
+ if (seen_dp) goto bad_real;
+ seen_dp = 1;
+ ((dtp)->u.p.current_unit->push_char_fn_ptr (dtp, c));
+ }
+ }
+exp1:
+bad_real:
+ return;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/builtins-1.c b/gcc/testsuite/gcc.dg/torture/builtins-1.c
index 6a48753188c..e076d850def 100644
--- a/gcc/testsuite/gcc.dg/torture/builtins-1.c
+++ b/gcc/testsuite/gcc.dg/torture/builtins-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-fdump-rtl-expand-all" */
+/* { dg-options "-fdump-rtl-expand-all" } */
int isdigit(int c)
{
return c >= 0;
diff --git a/gcc/testsuite/gcc.dg/torture/cris-asm-mof-1.c b/gcc/testsuite/gcc.dg/torture/cris-asm-mof-1.c
index 5ebde5ed544..77cee9f4278 100644
--- a/gcc/testsuite/gcc.dg/torture/cris-asm-mof-1.c
+++ b/gcc/testsuite/gcc.dg/torture/cris-asm-mof-1.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target cris-*-* crisv32-*-* } } */
+/* { dg-do compile { target cris-*-* } } */
/* { dg-skip-if "" { cris*-*-* } { "-march*" } { "" } } */
/* { dg-options "-O2 -march=v10" } */
/* { dg-final { scan-assembler "in-asm: .mof" } } */
diff --git a/gcc/testsuite/gcc.dg/torture/cris-volatile-1.c b/gcc/testsuite/gcc.dg/torture/cris-volatile-1.c
index 6b19852c274..7f613c4dc77 100644
--- a/gcc/testsuite/gcc.dg/torture/cris-volatile-1.c
+++ b/gcc/testsuite/gcc.dg/torture/cris-volatile-1.c
@@ -2,7 +2,7 @@
Check that size-optimizations for move insns (specifically peephole
optimizations) aren't applied to volatile objects in the CRIS port.
Origin: Hans-Peter Nilsson. */
-/* { dg-do compile { target cris-*-* crisv32-*-* } } */
+/* { dg-do compile { target cris-*-* } } */
/* { dg-final { scan-assembler-not {movu\...\[} } } */
/* { dg-final { scan-assembler-not {move\.[^d].\[} } } */
/* { dg-final { scan-assembler-not {and\.[^d].\[} } } */
diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-3.c b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-3.c
index 707d539335f..10702302bf8 100644
--- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-3.c
+++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-3.c
@@ -4,6 +4,7 @@
/* { dg-require-effective-target int128 } */
/* { dg-require-effective-target fenv } */
/* { dg-options "-frounding-math" } */
+/* { dg-xfail-run-if "see PR80556 c63" { x86_64-*-darwin* i68?-*-darwin* } { "*" } { "" } } */
#include <fenv.h>
#include <stdlib.h>
diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-4.c b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-4.c
index 09600f90903..3facf32fb8b 100644
--- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-4.c
+++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-4.c
@@ -4,6 +4,7 @@
/* { dg-require-effective-target int128 } */
/* { dg-require-effective-target fenv } */
/* { dg-options "-frounding-math" } */
+/* { dg-xfail-run-if "see PR80556 c63" { x86_64-*-darwin* i68?-*-darwin* } { "*" } { "" } } */
#include <fenv.h>
#include <stdlib.h>
diff --git a/gcc/testsuite/gcc.dg/torture/pr38948.c b/gcc/testsuite/gcc.dg/torture/pr38948.c
index 90906eebf22..22cef3b356d 100644
--- a/gcc/testsuite/gcc.dg/torture/pr38948.c
+++ b/gcc/testsuite/gcc.dg/torture/pr38948.c
@@ -1,5 +1,4 @@
/* { dg-options "-fno-tree-sra" } */
-/* { dg-options "-fno-tree-sra -march=v32" { target cris-*-* } } */
typedef unsigned char byte;
typedef unsigned int uint;
typedef int bool;
diff --git a/gcc/testsuite/gcc.dg/torture/pr39074-2.c b/gcc/testsuite/gcc.dg/torture/pr39074-2.c
index 0693f2d6fce..7286a4f5b30 100644
--- a/gcc/testsuite/gcc.dg/torture/pr39074-2.c
+++ b/gcc/testsuite/gcc.dg/torture/pr39074-2.c
@@ -30,5 +30,5 @@ int main()
return 0;
}
-/* { dg-final { scan-tree-dump "y.._. = { i }" "alias" } } */
-/* { dg-final { scan-tree-dump "y.._., points-to NULL, points-to vars: { D..... }" "alias" } } */
+/* { dg-final { scan-tree-dump "y.\?.._. = { i }" "alias" } } */
+/* { dg-final { scan-tree-dump "y.\?.._., points-to NULL, points-to vars: { D..... }" "alias" } } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr39074.c b/gcc/testsuite/gcc.dg/torture/pr39074.c
index 54c444e19a4..40ecdb9c6fb 100644
--- a/gcc/testsuite/gcc.dg/torture/pr39074.c
+++ b/gcc/testsuite/gcc.dg/torture/pr39074.c
@@ -29,5 +29,5 @@ int main()
return 0;
}
-/* { dg-final { scan-tree-dump "y.._. = { i }" "alias" } } */
-/* { dg-final { scan-tree-dump "y.._., points-to NULL, points-to vars: { D..... }" "alias" } } */
+/* { dg-final { scan-tree-dump "y.\?.._. = { i }" "alias" } } */
+/* { dg-final { scan-tree-dump "y.\?.._., points-to NULL, points-to vars: { D..... }" "alias" } } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr51106-1.c b/gcc/testsuite/gcc.dg/torture/pr51106-1.c
index 5501b546fe0..a2bf08e74e0 100644
--- a/gcc/testsuite/gcc.dg/torture/pr51106-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr51106-1.c
@@ -1,5 +1,5 @@
/* PR target/51106 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
/* { dg-skip-if "RTL error" { "*-*-*" } { "-fno-fat-lto-objects" } { "" } } */
int
diff --git a/gcc/testsuite/gcc.dg/torture/pr51106-2.c b/gcc/testsuite/gcc.dg/torture/pr51106-2.c
index 2dbb832b7cc..65180f87ee8 100644
--- a/gcc/testsuite/gcc.dg/torture/pr51106-2.c
+++ b/gcc/testsuite/gcc.dg/torture/pr51106-2.c
@@ -1,5 +1,5 @@
/* PR target/51106 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
/* { dg-skip-if "RTL error" { "*-*-*" } { "-fno-fat-lto-objects" } { "" } } */
/* { dg-skip-if "" { powerpc-ibm-aix* } } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr57359-1.c b/gcc/testsuite/gcc.dg/torture/pr57359-1.c
new file mode 100644
index 00000000000..f5a406a34d6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr57359-1.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+
+extern void abort();
+
+typedef int A;
+typedef float B;
+
+void __attribute__((noinline,noclone))
+foo(A *p, B *q, long unk)
+{
+ for (long i = 0; i < unk; ++i) {
+ *p = 1;
+ q[i] = 42;
+ }
+}
+
+int main(void)
+{
+ union { A x; B f; } u;
+ foo(&u.x, &u.f, 1);
+ if (u.f != 42) abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr57359-2.c b/gcc/testsuite/gcc.dg/torture/pr57359-2.c
new file mode 100644
index 00000000000..ce7d9890af4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr57359-2.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-additional-options "-fstrict-aliasing" } */
+
+extern void abort();
+
+typedef int A;
+typedef float B;
+
+void __attribute__((noipa))
+foo(A * p, B *r, long unk, long oh)
+{
+ for (long i = 0; i < unk; ++i) {
+ *p = 1;
+ *r = 2;
+ if (oh & i)
+ break;
+ *r = 3;
+ *p = 4;
+ }
+}
+
+int main(void)
+{
+ union { A x; B f; } u;
+ foo(&u.x, &u.f, 1, 1);
+ if (u.x != 4) abort();
+ foo(&u.x, &u.f, 2, 1);
+ if (u.f != 2) abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr59330.c b/gcc/testsuite/gcc.dg/torture/pr59330.c
index 74b832ea314..536171e0f18 100644
--- a/gcc/testsuite/gcc.dg/torture/pr59330.c
+++ b/gcc/testsuite/gcc.dg/torture/pr59330.c
@@ -1,4 +1,5 @@
/* { dg-do run } */
+/* { dg-skip-if "free inseparable from malloc when wrapped" { mmix-knuth-mmixware } } */
void free(void *ptr)
{
diff --git a/gcc/testsuite/gcc.dg/torture/pr71598-2.c b/gcc/testsuite/gcc.dg/torture/pr71598-2.c
index 44b23f56663..8b57a50cb47 100644
--- a/gcc/testsuite/gcc.dg/torture/pr71598-2.c
+++ b/gcc/testsuite/gcc.dg/torture/pr71598-2.c
@@ -1,6 +1,7 @@
/* { dg-do run } */
/* { dg-prune-output "use of enum values across objects may fail" } */
/* { dg-additional-options "-fshort-enums" } */
+/* { dg-skip-if "" short_eq_int } */
enum e1 { c1 = -__INT_MAX__ };
diff --git a/gcc/testsuite/gcc.dg/torture/pr80281.c b/gcc/testsuite/gcc.dg/torture/pr80281.c
index bff4f6e60a8..1198e231303 100644
--- a/gcc/testsuite/gcc.dg/torture/pr80281.c
+++ b/gcc/testsuite/gcc.dg/torture/pr80281.c
@@ -1,4 +1,4 @@
-/* { dg-run } */
+/* { dg-do run } */
/* { dg-require-effective-target int32plus } */
int
diff --git a/gcc/testsuite/gcc.dg/torture/pr86034.c b/gcc/testsuite/gcc.dg/torture/pr86034.c
index d83ea394ce9..30912cab095 100644
--- a/gcc/testsuite/gcc.dg/torture/pr86034.c
+++ b/gcc/testsuite/gcc.dg/torture/pr86034.c
@@ -3,15 +3,17 @@
/* { dg-do run } */
+typedef int int32_t __attribute__((mode (__SI__)));
+
struct A
{
- int b;
- __INT32_TYPE__ c:24;
- int d:10;
- int e;
+ int32_t b;
+ int32_t c:24;
+ int32_t d:10;
+ int32_t e;
} f;
-int g;
+int32_t g;
void h ()
{
diff --git a/gcc/testsuite/gcc.dg/torture/pr92088-1.c b/gcc/testsuite/gcc.dg/torture/pr92088-1.c
index b56f8ad665e..488bdcbcce6 100644
--- a/gcc/testsuite/gcc.dg/torture/pr92088-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr92088-1.c
@@ -1,4 +1,5 @@
/* { dg-do run } */
+/* { dg-require-effective-target alloca } */
int __attribute__((noipa))
g (char *p)
diff --git a/gcc/testsuite/gcc.dg/torture/pr92088-2.c b/gcc/testsuite/gcc.dg/torture/pr92088-2.c
index a20a01cd1ce..6c9e5048d28 100644
--- a/gcc/testsuite/gcc.dg/torture/pr92088-2.c
+++ b/gcc/testsuite/gcc.dg/torture/pr92088-2.c
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-require-effective-target alloca } */
void foo(int n)
{
diff --git a/gcc/testsuite/gcc.dg/torture/pr92252.c b/gcc/testsuite/gcc.dg/torture/pr92252.c
index eea60a044f7..dd8a813c031 100644
--- a/gcc/testsuite/gcc.dg/torture/pr92252.c
+++ b/gcc/testsuite/gcc.dg/torture/pr92252.c
@@ -1,4 +1,4 @@
-/* { do-do compile } */
+/* { dg-do compile } */
/* { dg-additional-options "-ftree-vectorize" } */
long int ar;
diff --git a/gcc/testsuite/gcc.dg/torture/pr93124.c b/gcc/testsuite/gcc.dg/torture/pr93124.c
index 16bc8b54f14..0d361d8c7cf 100644
--- a/gcc/testsuite/gcc.dg/torture/pr93124.c
+++ b/gcc/testsuite/gcc.dg/torture/pr93124.c
@@ -1,4 +1,5 @@
/* { dg-additional-options "-fno-rerun-cse-after-loop -fno-guess-branch-probability -fno-tree-fre" } */
+/* { dg-require-effective-target alloca } */
int x;
diff --git a/gcc/testsuite/gcc.dg/torture/pr94479.c b/gcc/testsuite/gcc.dg/torture/pr94479.c
index 53285bb4f38..3e4058279aa 100644
--- a/gcc/testsuite/gcc.dg/torture/pr94479.c
+++ b/gcc/testsuite/gcc.dg/torture/pr94479.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-require-stack-check "specific" } */
/* { dg-additional-options "-fstack-check -w" } */
+/* { dg-require-effective-target alloca } */
int a;
struct b {
diff --git a/gcc/testsuite/gcc.dg/torture/pr94947-1.c b/gcc/testsuite/gcc.dg/torture/pr94947-1.c
new file mode 100644
index 00000000000..ab8b488c6fc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr94947-1.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-additional-sources "pr94947-2.c" } */
+/* { dg-additional-options "-fipa-pta -flto-partition=1to1" } */
+
+extern void abort ();
+extern void baz ();
+extern void (*baz_call)();
+static int *p;
+
+static void foo ()
+{
+ if (*p != 1)
+ abort ();
+}
+
+int main()
+{
+ int x = 1;
+ p = &x;
+ baz_call = foo;
+ baz ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr94947-2.c b/gcc/testsuite/gcc.dg/torture/pr94947-2.c
new file mode 100644
index 00000000000..670dd61c1e9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr94947-2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+void (*baz_call)();
+void baz ()
+{
+ baz_call ();
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr94988.c b/gcc/testsuite/gcc.dg/torture/pr94988.c
new file mode 100644
index 00000000000..dd523b81d99
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr94988.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+
+short *b;
+
+void __attribute__((noipa))
+bar (short x, int j)
+{
+ for (int i = 0; i < j; ++i)
+ *b++ = x;
+}
+
+int
+main()
+{
+ b = (short *)&b;
+ bar (0, 1);
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ if ((short)(__UINTPTR_TYPE__)b != 0)
+ __builtin_abort ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr95025.c b/gcc/testsuite/gcc.dg/torture/pr95025.c
new file mode 100644
index 00000000000..5834dc04887
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr95025.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+static int a;
+short b;
+int *c;
+void d() {
+ for (;; a -= 1)
+ for (; b; b += 1) {
+ *c ^= 5;
+ if (a)
+ return;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr95045.c b/gcc/testsuite/gcc.dg/torture/pr95045.c
new file mode 100644
index 00000000000..9f591beb6be
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr95045.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+
+int a, c, f;
+long b;
+char d;
+int e[3];
+int g[9][3][2];
+int main()
+{
+ {
+h:
+ for (f = 0; f <= 5; f++) {
+ b = 3;
+ for (; b >= 0; b--) {
+ e[2] = d = 0;
+ for (; d <= 3; d++) {
+ g[8][2][0] = e[1] = c = 0;
+ for (; c <= 1; c++)
+ e[c + 1] = g[d + 5][2][c] = 4;
+ }
+ if (a)
+ goto h;
+ }
+ }
+ }
+ if (e[2] != 4)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr95049.c b/gcc/testsuite/gcc.dg/torture/pr95049.c
new file mode 100644
index 00000000000..164bfdbdcfc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr95049.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+void a()
+{
+ for (int b; b; b = !b)
+ ;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr95172.c b/gcc/testsuite/gcc.dg/torture/pr95172.c
new file mode 100644
index 00000000000..b39de69f08e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr95172.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+
+int a, d;
+int *b = &a;
+short c;
+int main()
+{
+ for (; c <= 4; c--) {
+ for (; d;)
+ ;
+ a = 1;
+ *b = 0;
+ }
+ if (a != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr95248.c b/gcc/testsuite/gcc.dg/torture/pr95248.c
new file mode 100644
index 00000000000..f0efcc12b51
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr95248.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int32plus } */
+
+int var_2 = -2013646301;
+int var_3 = -1126567434;
+unsigned int var_12 = 1;
+unsigned int var_19;
+unsigned int arr_25 [24] [21] [15] [17] [15] ;
+
+void __attribute__((noipa)) test()
+{
+ for (int a = 0; a < 3; a = 42)
+ for (int b = 0; b < 20; b++)
+ for (int c = 0; c < 4; c = 4)
+ for (int d = 0; d < 6; d += 4)
+ for (int e = 0; e < 4; e += 2) {
+ arr_25[a][b][c][d][e] = var_2 || var_3;
+ var_19 = var_12;
+ }
+}
+
+int main()
+{
+ test();
+ if (var_19 != 1)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr95283.c b/gcc/testsuite/gcc.dg/torture/pr95283.c
new file mode 100644
index 00000000000..950d3b07ead
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr95283.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+
+short c;
+_Bool d;
+unsigned e, f;
+char g, h;
+extern _Bool i[];
+void j()
+{
+ for (char a = 0; a < 100; a++)
+ for (char b = 0; b < 20; b += 2)
+ {
+ if (e)
+ d = f = 0;
+ else
+ g = i[8] = 0;
+ h = c;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr95295-1.c b/gcc/testsuite/gcc.dg/torture/pr95295-1.c
new file mode 100644
index 00000000000..76a19f3d17b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr95295-1.c
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+/* { dg-additional-sources "pr95295-2.c" } */
+
+extern int var_4, a;
+extern unsigned var_9;
+extern short arr_272[];
+void test()
+{
+ for (int b = 0; b < 9; b++)
+ for (int c = 0; c < 9; c += 4)
+ {
+ arr_272[c] = var_9 ? var_4 : 0;
+ a = 0;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr95295-2.c b/gcc/testsuite/gcc.dg/torture/pr95295-2.c
new file mode 100644
index 00000000000..80caeb8740d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr95295-2.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+
+int a;
+int var_4 = 1;
+unsigned var_9 = 8;
+short arr_272[20];
+void test();
+int main()
+{
+ test();
+ if (arr_272[4] != 1)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr95295-3.c b/gcc/testsuite/gcc.dg/torture/pr95295-3.c
new file mode 100644
index 00000000000..a506af9a63f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr95295-3.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+extern short var_15, var_20;
+extern int var_18, var_21, var_23;
+extern _Bool arr_2[];
+extern long arr_3[];
+void test()
+{
+ var_20 = 1;
+ for (int a = 0; a < 12; a += 2)
+ for (short b = 0; b < 8; b += 2) {
+ arr_2[b] = var_21 = var_18 ? var_15 : 0;
+ arr_3[b] = 8569;
+ }
+ var_23 = -1096835496;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr95761.c b/gcc/testsuite/gcc.dg/torture/pr95761.c
new file mode 100644
index 00000000000..65ee0fc1c11
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr95761.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+typedef int a[10];
+typedef struct {
+ a b;
+ a c;
+ a d;
+ a e;
+} f;
+f g;
+int *j;
+void k() {
+ for (;;) {
+ a l;
+ j[0] = g.b[0];
+ int *h = g.d;
+ int i = 0;
+ for (; i < 10; i++)
+ h[i] = l[0] - g.e[0];
+ h = g.e;
+ i = 0;
+ for (; i < 10; i++)
+ h[i] = l[1] + g.e[i];
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr96130.c b/gcc/testsuite/gcc.dg/torture/pr96130.c
new file mode 100644
index 00000000000..f722b9ad2a9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr96130.c
@@ -0,0 +1,26 @@
+/* PR ipa/96130 */
+/* { dg-do compile } */
+
+struct S { unsigned j : 3; };
+int k, l, m;
+
+void
+foo (struct S x)
+{
+ while (l != 5)
+ switch (x.j)
+ {
+ case 1:
+ case 3:
+ case 4:
+ case 6:
+ case 2:
+ case 5:
+ l = m;
+ case 7:
+ case 0:
+ k = 0;
+ default:
+ break;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr96133.c b/gcc/testsuite/gcc.dg/torture/pr96133.c
new file mode 100644
index 00000000000..ac31a7141c4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr96133.c
@@ -0,0 +1,16 @@
+/* { dg-do run } */
+
+typedef int T;
+static const T a[2][3] __attribute__((aligned(2*sizeof(T)))) = { { 1, 2, 3 }, { 4, 5, 6 } };
+typedef T v2 __attribute__((vector_size(2*sizeof(T))));
+
+int
+main()
+{
+ const T *p = &a[0][2];
+ v2 x = *(const v2 *)p;
+ T z = x[1];
+ if (z != 4)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr96349.c b/gcc/testsuite/gcc.dg/torture/pr96349.c
new file mode 100644
index 00000000000..4ce39498213
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr96349.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+void __attribute__ ((returns_twice))
+gr (void);
+
+void
+ib (void);
+
+void
+zg (void);
+
+void
+yw (int uz)
+{
+ gr ();
+
+ for (;;)
+ if (uz != 0)
+ {
+ uz = 0;
+ ib ();
+ }
+ else
+ zg ();
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr96491.c b/gcc/testsuite/gcc.dg/torture/pr96491.c
new file mode 100644
index 00000000000..784559f4754
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr96491.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+int rj;
+
+void __attribute__ ((returns_twice))
+da (void)
+{
+ rj = 1;
+}
+
+void
+c5 (void)
+{
+ for (;;)
+ ++rj;
+}
+
+void
+ls (int kz)
+{
+ if (kz == 0)
+ {
+ rj = 0;
+ c5 ();
+ }
+
+ da ();
+ c5 ();
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pta-callused-1.c b/gcc/testsuite/gcc.dg/torture/pta-callused-1.c
index b35959c6351..0ca6ac91119 100644
--- a/gcc/testsuite/gcc.dg/torture/pta-callused-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pta-callused-1.c
@@ -21,4 +21,4 @@ int main()
return 0;
}
-/* { dg-final { scan-tree-dump "p.._. = { i j }" "alias" } } */
+/* { dg-final { scan-tree-dump "p.\?.._. = { i j }" "alias" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c b/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c
index 450308d6407..511b61067c0 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c
@@ -3,6 +3,12 @@
/* { dg-require-effective-target freorder } */
/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps -fdump-tree-optimized" } */
+#ifdef FOR_AUTOFDO_TESTING
+#define MAXITER 1000000
+#else
+#define MAXITER 10000
+#endif
+
#define SIZE 10000
const char *sarr[SIZE];
@@ -32,7 +38,7 @@ main (int argc, char *argv[])
int i;
buf_hot = "hello";
buf_cold = "world";
- for (i = 0; i < 1000000; i++)
+ for (i = 0; i < MAXITER; i++)
foo (argc);
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-1.c b/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-1.c
index a13b08cd60e..b57d30f9163 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-1.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-1.c
@@ -3,6 +3,12 @@
/* { dg-require-profiling "-fprofile-generate" } */
/* { dg-options "-O2 -flto -DDOJOB=1 -fdump-ipa-profile_estimate" } */
+#ifdef FOR_AUTOFDO_TESTING
+#define MAXITER 350000000
+#else
+#define MAXITER 3500000
+#endif
+
#include <stdio.h>
typedef int (*fptr) (int);
@@ -22,7 +28,7 @@ main()
x = one (3);
- for (i = 0; i < 350000000; i++)
+ for (i = 0; i < MAXITER; i++)
{
x = (*p) (3);
p = table[x];
diff --git a/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-2.c b/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-2.c
index 9b996fcf0ed..6b5ae93214a 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-2.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-2.c
@@ -3,6 +3,12 @@
/* { dg-require-profiling "-fprofile-generate" } */
/* { dg-options "-O2 -flto -DDOJOB=1 -fdump-ipa-profile_estimate" } */
+#ifdef FOR_AUTOFDO_TESTING
+#define MAXITER 350000000
+#else
+#define MAXITER 3500000
+#endif
+
#include <stdio.h>
typedef int (*fptr) (int);
@@ -21,7 +27,7 @@ int foo ()
x = one (3);
- for (i = 0; i < 350000000; i++)
+ for (i = 0; i < MAXITER; i++)
{
x = (*p) (3);
p = table[x];
diff --git a/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-malloc.c b/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-malloc.c
new file mode 100644
index 00000000000..454e224c95f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-malloc.c
@@ -0,0 +1,49 @@
+/* { dg-options "-O2 -ldl" } */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdint.h>
+#include <dlfcn.h>
+
+int global;
+int global2;
+
+void report1 (size_t size)
+{
+ global++;
+}
+
+void report2 (size_t size)
+{
+ global2++;
+}
+
+typedef void (*tp) (size_t);
+static tp fns[] = {report1, report2};
+
+void* malloc(size_t size)
+{
+ static void* (*real_malloc)(size_t) = NULL;
+ if (!real_malloc)
+ real_malloc = dlsym(RTLD_NEXT, "malloc");
+
+ void *p = real_malloc (size);
+ fns[size % 2] (size);
+ // fprintf(stderr, "malloc(%d) = %p\n", size, p);
+ return p;
+}
+
+void *calloc (size_t n, size_t size)
+{
+ void *ptr = malloc (n * size);
+ __builtin_memset (ptr, 0, n * size);
+ return ptr;
+}
+
+void *ptr;
+
+int main()
+{
+ ptr = malloc (16);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-topn.c b/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-topn.c
index 063996c71df..9a1a0be51b2 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-topn.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-topn.c
@@ -1,6 +1,12 @@
/* { dg-require-profiling "-fprofile-generate" } */
/* { dg-options "-O2 -fdump-ipa-profile_estimate" } */
+#ifdef FOR_AUTOFDO_TESTING
+#define MAXITER 350000000
+#else
+#define MAXITER 3500000
+#endif
+
#include <stdio.h>
typedef int (*fptr) (int);
@@ -26,7 +32,7 @@ main()
one (3);
- for (i = 0; i < 350000000; i++)
+ for (i = 0; i < MAXITER; i++)
{
x = (*p) (3);
p = table[x];
diff --git a/gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c b/gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c
index 89ecc1c4693..2087d0d2059 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c
@@ -3,6 +3,12 @@
/* { dg-require-effective-target freorder } */
/* { dg-options "-O2 -fno-profile-reorder-functions -freorder-blocks-and-partition -save-temps" } */
+#ifdef FOR_AUTOFDO_TESTING
+#define MAXITER 1000000
+#else
+#define MAXITER 10000
+#endif
+
#define SIZE 10000
#define NOINLINE __attribute__((noinline)) __attribute__ ((noclone))
@@ -24,7 +30,7 @@ main (int argc, char *argv[])
int i;
buf_hot = "hello";
buf_cold = "world";
- for (i = 0; i < 1000000; i++)
+ for (i = 0; i < MAXITER; i++)
foo (argc);
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c b/gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c
index b856457b559..b02526beaea 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c
@@ -4,6 +4,12 @@
/* { dg-require-effective-target freorder } */
/* { dg-options "-O2 -fno-profile-reorder-functions -freorder-blocks-and-partition -save-temps" } */
+#ifdef FOR_AUTOFDO_TESTING
+#define MAXITER 1000000
+#else
+#define MAXITER 10000
+#endif
+
#define SIZE 10000
#define NOINLINE __attribute__((noinline)) __attribute__ ((noclone))
@@ -20,7 +26,7 @@ main (int argc, char *argv[])
int i;
buf_hot = "hello";
buf_cold = "world";
- for (i = 0; i < 1000000; i++)
+ for (i = 0; i < MAXITER; i++)
foo (argc);
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c b/gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c
index 8d85cf39f6c..da064070653 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c
@@ -4,6 +4,12 @@
/* { dg-require-effective-target freorder } */
/* { dg-options "-O2 -fno-profile-reorder-functions -freorder-blocks-and-partition -save-temps" } */
+#ifdef FOR_AUTOFDO_TESTING
+#define MAXITER 1000000
+#else
+#define MAXITER 10000
+#endif
+
#define SIZE 10000
#define NOINLINE __attribute__((noinline)) __attribute__ ((noclone))
@@ -24,7 +30,7 @@ main (int argc, char *argv[])
int i;
buf_hot = "hello";
buf_cold = "world";
- for (i = 0; i < 1000000; i++)
+ for (i = 0; i < MAXITER; i++)
foo (argc);
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
index 3e07a359b55..b7d50ecd6d6 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
@@ -33,4 +33,4 @@ void test55 (int x, int y)
that the && should be emitted (based on BRANCH_COST). Fix this
by teaching dom to look through && and register all components
as true. */
-/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "alpha*-*-* arm*-*-* aarch64*-*-* powerpc*-*-* cris-*-* crisv32-*-* hppa*-*-* i?86-*-* mmix-*-* mips*-*-* m68k*-*-* moxie-*-* nds32*-*-* s390*-*-* sh*-*-* sparc*-*-* visium-*-* x86_64-*-* riscv*-*-* or1k*-*-* msp430-*-* pru*-*-*" } } } } */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "alpha*-*-* arm*-*-* aarch64*-*-* powerpc*-*-* cris-*-* hppa*-*-* i?86-*-* mmix-*-* mips*-*-* m68k*-*-* moxie-*-* nds32*-*-* s390*-*-* sh*-*-* sparc*-*-* visium-*-* x86_64-*-* riscv*-*-* or1k*-*-* msp430-*-* pru*-*-*" } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/andnot-2.c b/gcc/testsuite/gcc.dg/tree-ssa/andnot-2.c
new file mode 100644
index 00000000000..e0955ce3ffd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/andnot-2.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-forwprop3-raw -w -Wno-psabi" } */
+
+typedef long vec __attribute__((vector_size(16)));
+vec f(vec x){
+ vec y = x < 10;
+ return y & (y == 0);
+}
+
+/* { dg-final { scan-tree-dump-not "_expr" "forwprop3" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-22.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-22.c
index 6fd1bca3c7b..685a4fd8c89 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-22.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-22.c
@@ -1,7 +1,8 @@
/* PR tree-optimization/91567 - Spurious -Wformat-overflow warnings building
glibc (32-bit only)
{ dg-do compile }
- { dg-options "-O2 -Wall -ftrack-macro-expansion=0" } */
+ { dg-options "-O2 -Wall -ftrack-macro-expansion=0" }
+ { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c
index 39d89dbb117..999f55e3691 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c
@@ -360,35 +360,35 @@ NOIPA void test_too_large (char *d, int x, __builtin_va_list va)
const size_t imax_p1 = imax + 1;
__builtin_snprintf (d, imax, "%c", x);
- __builtin_snprintf (d, imax_p1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */
- /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */
+ __builtin_snprintf (d, imax_p1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large } } } */
+ /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || { { ilp32 } || { int16 && { ! msp430_large } } } } } .-1 } */
__builtin_vsnprintf (d, imax, "%c", va);
- __builtin_vsnprintf (d, imax_p1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */
- /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */
+ __builtin_vsnprintf (d, imax_p1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large } } } */
+ /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || { { ilp32 } || { int16 && { ! msp430_large } } } } } .-1 } */
__builtin___snprintf_chk (d, imax, 0, imax, "%c", x);
- __builtin___snprintf_chk (d, imax_p1, 0, imax_p1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */
- /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */
+ __builtin___snprintf_chk (d, imax_p1, 0, imax_p1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large } } } */
+ /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || { { ilp32 } || { int16 && { ! msp430_large } } } } } .-1 } */
__builtin___vsnprintf_chk (d, imax, 0, imax, "%c", va);
- __builtin___vsnprintf_chk (d, imax_p1, 0, imax_p1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */
- /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */
+ __builtin___vsnprintf_chk (d, imax_p1, 0, imax_p1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large } } } */
+ /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || { { ilp32 } || { int16 && { ! msp430_large } } } } } .-1 } */
const size_t ptrmax = __PTRDIFF_MAX__;
const size_t ptrmax_m1 = ptrmax - 1;
- __builtin_snprintf (d, ptrmax_m1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */
- __builtin_snprintf (d, ptrmax, " %c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */
+ __builtin_snprintf (d, ptrmax_m1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large } } } */
+ __builtin_snprintf (d, ptrmax, " %c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large } } } */
- __builtin_vsnprintf (d, ptrmax_m1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */
- __builtin_vsnprintf (d, ptrmax, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */
+ __builtin_vsnprintf (d, ptrmax_m1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large } } } */
+ __builtin_vsnprintf (d, ptrmax, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large } } } */
- __builtin___snprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */
- __builtin___snprintf_chk (d, ptrmax, 0, ptrmax, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */
+ __builtin___snprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large } } } */
+ __builtin___snprintf_chk (d, ptrmax, 0, ptrmax, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large } } } */
- __builtin___vsnprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */
- __builtin___vsnprintf_chk (d, ptrmax, 0, ptrmax, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */
+ __builtin___vsnprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large } } } */
+ __builtin___vsnprintf_chk (d, ptrmax, 0, ptrmax, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large } } } */
}
/* Exercise ordinary sprintf with malloc. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/dse-points-to.c b/gcc/testsuite/gcc.dg/tree-ssa/dse-points-to.c
index 8003556474d..762d6720143 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/dse-points-to.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/dse-points-to.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fno-tree-ccp -fno-tree-forwprop -fno-tree-fre -fno-tree-vrp" } */
-/* { dg-additional-options "-fdump-tree-dse1-details" } */
+/* { dg-options "-O2 -fno-tree-ccp -fno-tree-forwprop -fno-tree-fre -fno-tree-vrp -fdump-tree-dse1-details" } */
int
f ()
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-36.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-36.c
index 9de73ff947f..f3871bf45e8 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-36.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-36.c
@@ -21,4 +21,5 @@ main ()
return 0;
}
-/* { dg-final { scan-tree-dump "if \\(b.0_\[0-9\]+ != 0\\)" "cddce1" } } */
+/* { dg-final { scan-tree-dump "if \\(b.0_\[0-9\]+ != 0\\)" "cddce1" { target { ! mmix-knuth-mmixware } } } } */
+/* { dg-final { scan-tree-dump "if \\(b::1_\[0-9\]+ != 0\\)" "cddce1" { target { mmix-knuth-mmixware } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c
index 3f502430333..24b1767975b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c
@@ -25,3 +25,6 @@ void f(void)
value-numbering, removing the load altogether.
??? We now do this after CPP re-writes a into SSA form. */
/* { dg-final { scan-tree-dump-times "VIEW_CONVERT_EXPR" 1 "ccp1" } } */
+
+/* The invalid access above may also trigger -Wuninitialized.
+ { dg-prune-output "-Wuninitialized" } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c b/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c
index a8a9de4ef55..ed94f6b3f0d 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized -fno-strict-aliasing" } */
/* Test with fixed address */
-static int *foo = (int *) (unsigned long) 0x7800000;
+static int *foo = (int *) (unsigned long) __INTPTR_MAX__;
int func(void) __attribute__ ((noinline));
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
index 39ee4dea883..a531b7584a6 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
@@ -46,7 +46,7 @@ int xxx(void)
/* CRIS and MSP430 keep the address in a register. */
/* m68k sometimes puts the address in a register, depending on CPU and PIC. */
-/* { dg-final { scan-assembler-times "foo" 5 { xfail hppa*-*-* ia64*-*-* sh*-*-* cris-*-* crisv32-*-* fido-*-* m68k-*-* i?86-*-mingw* i?86-*-cygwin* x86_64-*-mingw* visium-*-* nvptx*-*-* pdp11*-*-* msp430-*-* amdgcn*-*-* } } } */
+/* { dg-final { scan-assembler-times "foo" 5 { xfail hppa*-*-* ia64*-*-* sh*-*-* cris-*-* fido-*-* m68k-*-* i?86-*-mingw* i?86-*-cygwin* x86_64-*-mingw* visium-*-* nvptx*-*-* pdp11*-*-* msp430-*-* amdgcn*-*-* } } } */
/* { dg-final { scan-assembler-times "foo,%r" 5 { target hppa*-*-* } } } */
/* { dg-final { scan-assembler-times "= foo" 5 { target ia64*-*-* } } } */
/* { dg-final { scan-assembler-times "call\[ \t\]*_foo" 5 { target i?86-*-mingw* i?86-*-cygwin* } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c
index 8f5a9a03970..621f48f7d6e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c
@@ -3,16 +3,18 @@
/* { dg-require-effective-target size20plus } */
/* { dg-skip-if "too big data segment" { visium-*-* } } */
+typedef int int32_t __attribute__((mode (__SI__)));
+
#define M 256
int a[M][M], b[M][M];
-int __attribute__((noinline))
+int32_t __attribute__((noinline))
double_reduc (int n)
{
- int sum = 0;
+ int32_t sum = 0;
for (int j = 0; j < n; j++)
{
for (int i = 0; i < n; i++)
- sum = sum + a[i][j]*b[i][j];
+ sum = sum + (int32_t)a[i][j]*(int32_t)b[i][j];
}
return sum;
}
@@ -34,7 +36,7 @@ int main (void)
for (int i = 0; i < M; ++i)
init (i);
- int sum = double_reduc (M);
+ int32_t sum = double_reduc (M);
if (sum != 1065369600)
abort ();
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-21.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-21.c
new file mode 100644
index 00000000000..9f3d5695728
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-21.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-phiopt4-details" } */
+
+int f(unsigned s)
+{
+ int i;
+ for (i = 0; i < s; ++i)
+ ;
+
+ return i;
+}
+
+/* { dg-final { scan-tree-dump "converted to straightline code" "phiopt4" } } */
+/* Make sure we fold the detected MAX<s, 0>. */
+/* { dg-final { scan-tree-dump-not "MAX" "phiopt4" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/popcount4ll.c b/gcc/testsuite/gcc.dg/tree-ssa/popcount4ll.c
index 191d957c688..c1588be68e4 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/popcount4ll.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/popcount4ll.c
@@ -1,4 +1,4 @@
-/* { dg-do compile } */
+/* { dg-do compile { target { lp64 } } } */
/* { dg-require-effective-target popcountll } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/popcount5ll.c b/gcc/testsuite/gcc.dg/tree-ssa/popcount5ll.c
index 831d5e1722a..edb191bf894 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/popcount5ll.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/popcount5ll.c
@@ -1,5 +1,5 @@
/* PR tree-optimization/94800 */
-/* { dg-do compile } */
+/* { dg-do compile { target { lp64 } } } */
/* { dg-require-effective-target popcountll } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr79448-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr79448-2.c
index f75f523a2e0..91954d9a870 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr79448-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr79448-2.c
@@ -14,7 +14,7 @@ gettext (char*);
char*
fill (char *buf, size_t len, int count)
{
- if (snprintf (buf, len, "%s: %d", gettext ("count"), count) >= len) /* { dg-bogus "directive output of 2 bytes causes result to exceed .INT_MAX." */
+ if (snprintf (buf, len, "%s: %d", gettext ("count"), count) >= len) /* { dg-bogus "directive output of 2 bytes causes result to exceed .INT_MAX." } */
return 0;
return buf;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr79448.c b/gcc/testsuite/gcc.dg/tree-ssa/pr79448.c
index c346c9ef08a..504875a7945 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr79448.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr79448.c
@@ -14,7 +14,7 @@ gettext (char*);
char*
fill (char *buf, size_t len, int count)
{
- if (snprintf (buf, len, "%s: %d", gettext ("count"), count) >= len) /* { dg-bogus "directive output of 2 bytes causes result to exceed .INT_MAX." */
+ if (snprintf (buf, len, "%s: %d", gettext ("count"), count) >= len) /* { dg-bogus "directive output of 2 bytes causes result to exceed .INT_MAX." } */
return 0;
return buf;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr83403-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr83403-1.c
new file mode 100644
index 00000000000..748375b03af
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr83403-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -funroll-loops -fdump-tree-lim2-details" } */
+
+#define TYPE unsigned int
+
+#include "pr83403.h"
+
+/* { dg-final { scan-tree-dump-times "Executing store motion of" 10 "lim2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr83403-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr83403-2.c
new file mode 100644
index 00000000000..ca2e6bbd61c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr83403-2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -funroll-loops -fdump-tree-lim2-details" } */
+
+#define TYPE int
+
+#include "pr83403.h"
+
+/* { dg-final { scan-tree-dump-times "Executing store motion of" 10 "lim2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr83403.h b/gcc/testsuite/gcc.dg/tree-ssa/pr83403.h
new file mode 100644
index 00000000000..0da8a835b5f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr83403.h
@@ -0,0 +1,30 @@
+__attribute__ ((noinline)) void
+calculate (const double *__restrict__ A, const double *__restrict__ B,
+ double *__restrict__ C)
+{
+ TYPE m = 0;
+ TYPE n = 0;
+ TYPE k = 0;
+
+ A = (const double *) __builtin_assume_aligned (A, 16);
+ B = (const double *) __builtin_assume_aligned (B, 16);
+ C = (double *) __builtin_assume_aligned (C, 16);
+
+ for (n = 0; n < 9; n++)
+ {
+ for (m = 0; m < 10; m++)
+ {
+ C[(n * 10) + m] = 0.0;
+ }
+
+ for (k = 0; k < 17; k++)
+ {
+#pragma simd
+ for (m = 0; m < 10; m++)
+ {
+ C[(n * 10) + m] += A[(k * 20) + m] * B[(n * 20) + k];
+ }
+ }
+ }
+}
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr84436-3.c b/gcc/testsuite/gcc.dg/tree-ssa/pr84436-3.c
index 87937f30ab1..48740dd5a24 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr84436-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr84436-3.c
@@ -20,5 +20,5 @@ void f() {
h(g);
}
-/* { dg-final { scan-tree-dump-times ".* \\+ 4294967247" 1 "switchconv" } } */
+/* { dg-final { scan-tree-dump-times ".* \\+ (?:4294967247|65487)" 1 "switchconv" } } */
/* { dg-final { scan-tree-dump-not "switch" "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr84648.c b/gcc/testsuite/gcc.dg/tree-ssa/pr84648.c
index 6ff5a07cd20..7832ffa398b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr84648.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr84648.c
@@ -1,8 +1,10 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-cddce1-details" } */
+typedef unsigned uint32_t __attribute__((mode (__SI__)));
+
int main() {
- for (unsigned i = 0; i < (1u << 31); ++i) {
+ for (uint32_t i = 0; i < (1UL << 31); ++i) {
}
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr89430-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr89430-1.c
index ce242ba569b..8ee1850ac63 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr89430-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr89430-1.c
@@ -9,4 +9,4 @@ unsigned test(unsigned k, unsigned b) {
return a[0]+a[1];
}
-/* { dg-final { scan-tree-dump "Conditional store replacement" "cselim" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "Conditional store replacement" "cselim" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr89430-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr89430-2.c
index 90ae36bfce2..9b96875ac7a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr89430-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr89430-2.c
@@ -11,4 +11,4 @@ unsigned test(unsigned k, unsigned b) {
return a[0]+a[1];
}
-/* { dg-final { scan-tree-dump "Conditional store replacement" "cselim" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "Conditional store replacement" "cselim" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr89430-5.c b/gcc/testsuite/gcc.dg/tree-ssa/pr89430-5.c
index c633cbe947d..b2d04119381 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr89430-5.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr89430-5.c
@@ -13,4 +13,4 @@ int test(int b, int k) {
return a.data[0] + a.data[1];
}
-/* { dg-final { scan-tree-dump "Conditional store replacement" "cselim" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "Conditional store replacement" "cselim" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr89430-6.c b/gcc/testsuite/gcc.dg/tree-ssa/pr89430-6.c
index 7cad563128d..8d3c4f7cc6a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr89430-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr89430-6.c
@@ -16,4 +16,4 @@ int test(int b, int k) {
return a.data[0].x + a.data[1].x;
}
-/* { dg-final { scan-tree-dump "Conditional store replacement" "cselim" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "Conditional store replacement" "cselim" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr89430-7-comp-ref.c b/gcc/testsuite/gcc.dg/tree-ssa/pr89430-7-comp-ref.c
new file mode 100644
index 00000000000..c35a2afc70b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr89430-7-comp-ref.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-cselim-details" } */
+
+typedef union {
+ int i;
+ float f;
+} U;
+
+int foo(U *u, int b, int i)
+{
+ u->i = 0;
+ if (b)
+ u->i = i;
+ return u->i;
+}
+
+/* { dg-final { scan-tree-dump "Conditional store replacement" "cselim" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr89430-8-mem-ref-size.c b/gcc/testsuite/gcc.dg/tree-ssa/pr89430-8-mem-ref-size.c
new file mode 100644
index 00000000000..f9e66aefb13
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr89430-8-mem-ref-size.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-cselim-details" } */
+
+int *t;
+
+int f1 (int tt)
+{
+ int *t1 = t;
+ *t1 = -5;
+ if (*t1 < tt)
+ *((unsigned *) t1) = 5;
+ return *t1;
+}
+
+/* { dg-final { scan-tree-dump "Conditional store replacement" "cselim" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr92163.c b/gcc/testsuite/gcc.dg/tree-ssa/pr92163.c
index 227c09255e4..4dfc7357e0e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr92163.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr92163.c
@@ -1,4 +1,4 @@
-/* { dg-do "compile" } */
+/* { dg-do compile } */
/* { dg-require-effective-target fopenacc } */
/* { dg-options "-O2 -fexceptions -fnon-call-exceptions -fopenacc" } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr93121-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr93121-1.c
new file mode 100644
index 00000000000..4bf40c195da
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr93121-1.c
@@ -0,0 +1,56 @@
+/* PR libstdc++/93121 */
+/* { dg-do compile { target { ilp32 || lp64 } } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+union U { int a[3]; short c[6]; struct S { int d; int a : 2; int f : 1; int b : 24; int c : 5; int e; } b; };
+const union U u = { .b = { 0x7efa3412, 3, 0, 0x50eca8, 0xb, 0x1eeffeed } };
+const union U v = { .b = { 0x7efa3412, 1, 1, 0x7feedb, 0x5, 0x1eeffeed } };
+union W { struct T { long long int a, b : 11, c : 3, d : 37, e : 1, f : 10, g : 2, h; } a; int b[6]; short c[12]; long long d[3]; };
+const union W w = { .a = { 0x0feedbacdeadbeefLL, -1011, 2, -0xbacdeadbeLL, -1, 721, 1, 0x0feedbacdeadbeefLL } };
+int a, b, c, d, e, f, g, h, i, j, k, l;
+long long m;
+
+void
+foo ()
+{
+ a = u.a[1];
+ b = v.a[1];
+ c = u.c[2];
+ d = u.c[3];
+ e = v.c[2];
+ f = v.c[3];
+ g = w.b[2];
+ h = w.b[3];
+ i = w.c[4];
+ j = w.c[5];
+ k = w.c[6];
+ l = w.c[7];
+ m = w.d[1];
+}
+
+/* { dg-final { scan-tree-dump-times "a = 1518822723;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "b = 738162397;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "c = 25923;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "d = 23175;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "e = 30429;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "f = 11263;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "g = 1418761229;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "h = 1830622408;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "i = -27635;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "j = 21648;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "k = 5320;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "l = 27933;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "m = 7862463375103529997;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "a = -904030965;" 1 "optimized" { target be } } } */
+/* { dg-final { scan-tree-dump-times "b = 1878907749;" 1 "optimized" { target be } } } */
+/* { dg-final { scan-tree-dump-times "c = -13795;" 1 "optimized" { target be } } } */
+/* { dg-final { scan-tree-dump-times "d = -27381;" 1 "optimized" { target be } } } */
+/* { dg-final { scan-tree-dump-times "e = 28669;" 1 "optimized" { target be } } } */
+/* { dg-final { scan-tree-dump-times "f = -9371;" 1 "optimized" { target be } } } */
+/* { dg-final { scan-tree-dump-times "g = -2119529884;" 1 "optimized" { target be } } } */
+/* { dg-final { scan-tree-dump-times "h = 709385029;" 1 "optimized" { target be } } } */
+/* { dg-final { scan-tree-dump-times "i = -32342;" 1 "optimized" { target be } } } */
+/* { dg-final { scan-tree-dump-times "j = -30108;" 1 "optimized" { target be } } } */
+/* { dg-final { scan-tree-dump-times "k = 10824;" 1 "optimized" { target be } } } */
+/* { dg-final { scan-tree-dump-times "l = 23365;" 1 "optimized" { target be } } } */
+/* { dg-final { scan-tree-dump-times "m = -9103311533965288635;" 1 "optimized" { target be } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr93121-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr93121-2.c
new file mode 100644
index 00000000000..323dca62f95
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr93121-2.c
@@ -0,0 +1,22 @@
+/* PR libstdc++/93121 */
+/* { dg-do compile { target { ilp32 || lp64 } } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+union U { int a[3]; struct S { int d; int a : 3; int b : 24; int c : 5; int e; } b; };
+const union U u = { .a = { 0x7efa3412, 0x5a876543, 0x1eeffeed } };
+int a, b, c;
+
+void
+foo ()
+{
+ a = u.b.a;
+ b = u.b.b;
+ c = u.b.c;
+}
+
+/* { dg-final { scan-tree-dump-times "a = 3;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "b = 5303464;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "c = 11;" 1 "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump-times "a = 2;" 1 "optimized" { target be } } } */
+/* { dg-final { scan-tree-dump-times "b = -2868438;" 1 "optimized" { target be } } } */
+/* { dg-final { scan-tree-dump-times "c = 3;" 1 "optimized" { target be } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr94703.c b/gcc/testsuite/gcc.dg/tree-ssa/pr94703.c
new file mode 100644
index 00000000000..8c863c0e202
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr94703.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target non_strict_align } */
+/* { dg-options "-O -fdump-tree-ssa" } */
+
+unsigned int set_lowpart (unsigned int const *X)
+{
+ unsigned int r = 0;
+ __builtin_memcpy(&r,X,sizeof (unsigned int) / 2);
+ return r;
+}
+
+/* { dg-final { scan-tree-dump "No longer having address taken: r" "ssa" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr94783.c b/gcc/testsuite/gcc.dg/tree-ssa/pr94783.c
new file mode 100644
index 00000000000..c52f657520e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr94783.c
@@ -0,0 +1,12 @@
+/* PR tree-optimization/94783 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump "ABS_EXPR" "optimized" } } */
+/* { dg-final { scan-tree-dump-not " >> 31" "optimized" } } */
+
+int
+foo (int v)
+{
+ int mask = v >> (__SIZEOF_INT__ * __CHAR_BIT__ - 1);
+ return (v + mask) ^ mask;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr94786.c b/gcc/testsuite/gcc.dg/tree-ssa/pr94786.c
new file mode 100644
index 00000000000..beb88daa651
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr94786.c
@@ -0,0 +1,66 @@
+/* PR tree-optimization/94786 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-times "MIN_EXPR <" 4 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "MAX_EXPR <" 4 "optimized" } } */
+
+static inline unsigned
+umax1 (unsigned a, unsigned b)
+{
+ return a ^ ((a ^ b) & -(a < b));
+}
+
+static inline unsigned
+umin1 (unsigned a, unsigned b)
+{
+ return a ^ ((a ^ b) & -(a > b));
+}
+
+static inline int
+smax1 (int a, int b)
+{
+ return a ^ ((a ^ b) & -(a < b));
+}
+
+static inline int
+smin1 (int a, int b)
+{
+ return a ^ ((a ^ b) & -(a > b));
+}
+
+static inline unsigned long long
+umax2 (unsigned long long a, unsigned long long b)
+{
+ return a ^ ((a ^ b) & -(a <= b));
+}
+
+static inline unsigned long long
+umin2 (unsigned long long a, unsigned long long b)
+{
+ return a ^ ((a ^ b) & -(a >= b));
+}
+
+static inline long long
+smax2 (long long a, long long b)
+{
+ return a ^ ((a ^ b) & -(a <= b));
+}
+
+static inline long long
+smin2 (long long a, long long b)
+{
+ return a ^ ((a ^ b) & -(a >= b));
+}
+
+void
+test (unsigned *x, int *y, unsigned long long *z, long long *w)
+{
+ x[2] = umax1 (x[0], x[1]);
+ x[5] = umin1 (x[2], x[3]);
+ y[2] = smax1 (y[0], y[1]);
+ y[5] = smin1 (y[2], y[3]);
+ z[2] = umax2 (z[0], z[1]);
+ z[5] = umin2 (z[2], z[3]);
+ w[2] = smax2 (w[0], w[1]);
+ w[5] = smin2 (w[2], w[3]);
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr94880.c b/gcc/testsuite/gcc.dg/tree-ssa/pr94880.c
new file mode 100644
index 00000000000..f7216618147
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr94880.c
@@ -0,0 +1,29 @@
+/* PR tree-optimization/94786 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-times "= ~\[xy\]_" 4 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " & \[xy\]_" 4 "optimized" } } */
+
+unsigned
+foo_u(unsigned x, unsigned y)
+{
+ return (x | y) - y;
+}
+
+int
+foo_i(int x, int y)
+{
+ return (x | y) - y;
+}
+
+unsigned long long
+foo_ull(unsigned long long x, unsigned long long y)
+{
+ return (x | y) - y;
+}
+
+long long
+foo_ll(long long x, long long y)
+{
+ return (x | y) - y;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr94882-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr94882-1.c
new file mode 100644
index 00000000000..976b8e5bbdc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr94882-1.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-not "x_\[0-9]+\\\(D\\\) & y_\[0-9]+\\\(D\\\);" "optimized" } } */
+/* { dg-final { scan-tree-dump-not "x_\[0-9]+\\\(D\\\) \\| y_\[0-9]+\\\(D\\\);" "optimized" } } */
+/* { dg-final { scan-tree-dump-times "x_\[0-9]+\\\(D\\\) \\^ y_\[0-9]+\\\(D\\\);" 4 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "~_\[0-9]\+" 4 "optimized" } } */
+
+int
+a (int x, int y)
+{
+ int t = x & y;
+ int tt = x | y;
+ t = t - tt;
+ return t + -1;
+}
+
+int
+b (int x, int y)
+{
+ int t = x & y;
+ int tt = x | y;
+ t = t - 1;
+ return t - tt;
+}
+
+int
+c (int x, int y)
+{
+ int t = x & y;
+ int tt = x | y;
+ tt = tt + 1;
+ return t - tt;
+}
+
+int
+d (int x, int y)
+{
+ int t = x & y;
+ int tt = x | y;
+ tt = tt + 1;
+ return t - tt;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr94882-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr94882-2.c
new file mode 100644
index 00000000000..7f533b6d468
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr94882-2.c
@@ -0,0 +1,78 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-not "x_\[0-9]+\\\(D\\\) & y_\[0-9]+\\\(D\\\);" "optimized" } } */
+/* { dg-final { scan-tree-dump-not "x_\[0-9]+\\\(D\\\) \\| y_\[0-9]+\\\(D\\\);" "optimized" } } */
+/* { dg-final { scan-tree-dump-times "x_\[0-9]+\\\(D\\\) \\^ y_\[0-9]+\\\(D\\\);" 8 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "~_\[0-9]\+" 8 "optimized" } } */
+
+int
+a (int x, int y)
+{
+ unsigned t = x & y;
+ unsigned tt = x | y;
+ t = t - tt;
+ return t + -1;
+}
+
+int
+a1 (int x, int y)
+{
+ int t = x & y;
+ int tt = x | y;
+ unsigned t1 = t - tt;
+ return t1 + -1;
+}
+
+int
+b (int x, int y)
+{
+ unsigned t = x & y;
+ unsigned tt = x | y;
+ t = t - 1;
+ return t - tt;
+}
+
+int
+b1 (int x, int y)
+{
+ int t = x & y;
+ int tt = x | y;
+ unsigned t1 = t - 1;
+ return t1 - tt;
+}
+
+int
+c (int x, int y)
+{
+ unsigned t = x & y;
+ unsigned tt = x | y;
+ tt = tt + 1;
+ return t - tt;
+}
+
+int
+c1 (int x, int y)
+{
+ int t = x & y;
+ int tt = x | y;
+ unsigned tt1 = tt + 1;
+ return t - tt1;
+}
+
+int
+d (int x, int y)
+{
+ unsigned t = x & y;
+ unsigned tt = x | y;
+ tt = tt + 1;
+ return t - tt;
+}
+
+int
+d1 (int x, int y)
+{
+ int t = x & y;
+ int tt = x | y;
+ unsigned tt1 = tt + 1;
+ return t - tt1;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr94882-3.c b/gcc/testsuite/gcc.dg/tree-ssa/pr94882-3.c
new file mode 100644
index 00000000000..979162f6a5a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr94882-3.c
@@ -0,0 +1,79 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-not "x_\[0-9]+\\\(D\\\) & y_\[0-9]+\\\(D\\\);" "optimized" } } */
+/* { dg-final { scan-tree-dump-not "x_\[0-9]+\\\(D\\\) \\| y_\[0-9]+\\\(D\\\);" "optimized" } } */
+/* { dg-final { scan-tree-dump-times "x_\[0-9]+\\\(D\\\) \\^ y_\[0-9]+\\\(D\\\);" 4 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "_\[0-9] \\^ _\[0-9]" 4 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "~_\[0-9]\+" 8 "optimized" } } */
+
+signed char
+a (short x, short y)
+{
+ unsigned char t = (unsigned char) (x & y);
+ unsigned char tt = (unsigned char) (x | y);
+ t = t - tt;
+ return (signed char) (t + -1);
+}
+
+unsigned char
+a1 (signed char x, signed char y)
+{
+ short t = (short) (x & y);
+ short tt = (short) (x | y);
+ unsigned char t1 = (unsigned char) (t - tt);
+ return t1 + -1;
+}
+
+signed char
+b (short x, short y)
+{
+ unsigned char t = (unsigned char) (x & y);
+ signed char tt = (signed char) (x | y);
+ t = t - 1;
+ return ((signed char) t - tt);
+}
+
+short
+b1 (short x, short y)
+{
+ int t = (int) (x & y);
+ int tt = (int) (x | y);
+ short t1 = (short) (t - 1);
+ return (short) (t1 - tt);
+}
+
+signed char
+c (unsigned x, unsigned y)
+{
+ unsigned char t = (unsigned char) (x & y);
+ signed char tt = (signed char) (x | y);
+ tt = tt + 1;
+ return (signed char) (t - tt);
+}
+
+unsigned char
+c1 (signed char x, signed char y)
+{
+ unsigned char t = (unsigned char) (x & y);
+ short tt = (short) (x | y);
+ unsigned char tt1 = (unsigned char) (tt + 1);
+ return t - tt1;
+}
+
+signed char
+d (unsigned char x, unsigned char y)
+{
+ int t = (int) (x & y);
+ int tt = (int) (x | y);
+ tt = tt + 1;
+ return (signed char) (t - tt);
+}
+
+unsigned char
+d1 (int x, int y)
+{
+ signed char t = (signed char) (x & y);
+ signed char tt = (signed char) (x | y);
+ unsigned char tt1 = (unsigned char) (tt + 1);
+ return (unsigned char) (t - tt1);
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr94882.c b/gcc/testsuite/gcc.dg/tree-ssa/pr94882.c
new file mode 100644
index 00000000000..e7a55308e85
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr94882.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-not "x_\[0-9]+\\\(D\\\) & y_\[0-9]+\\\(D\\\);" "optimized" } } */
+/* { dg-final { scan-tree-dump-not "x_\[0-9]+\\\(D\\\) \\| y_\[0-9]+\\\(D\\\);" "optimized" } } */
+/* { dg-final { scan-tree-dump-times "x_\[0-9]+\\\(D\\\) \\^ y_\[0-9]+\\\(D\\\);" 5 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "~_\[0-9]\+" 5 "optimized" } } */
+
+int
+a (int x, int y)
+{
+ return (x & y) - (x | y) - 1;
+}
+
+int
+b (int x, int y)
+{
+ return (x & y) - 1 - (x | y);
+}
+
+int
+c (int x, int y)
+{
+ return (x & y) - ((x | y) + 1);
+}
+
+int
+d (int x, int y)
+{
+ return (x & y) - (1 + (x | y));
+}
+
+int
+e (int x, int y)
+{
+ return (unsigned) ((x & y) - (x | y)) + -1u;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr94913.c b/gcc/testsuite/gcc.dg/tree-ssa/pr94913.c
new file mode 100644
index 00000000000..6b71f98b013
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr94913.c
@@ -0,0 +1,33 @@
+/* PR tree-optimization/94913 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump " (?:b_\[0-9]+\\\(D\\\) >= a|a_\[0-9]+\\\(D\\\) <= b)_\[0-9]+\\\(D\\\);" "optimized" } } */
+/* { dg-final { scan-tree-dump " (?:c_\[0-9]+\\\(D\\\) > d|d_\[0-9]+\\\(D\\\) < c)_\[0-9]+\\\(D\\\);" "optimized" } } */
+/* { dg-final { scan-tree-dump " (?:f_\[0-9]+\\\(D\\\) >= e|e_\[0-9]+\\\(D\\\) <= f)_\[0-9]+\\\(D\\\);" "optimized" } } */
+/* { dg-final { scan-tree-dump " (?:g_\[0-9]+\\\(D\\\) > h|h_\[0-9]+\\\(D\\\) < g)_\[0-9]+\\\(D\\\);" "optimized" } } */
+
+int
+foo (unsigned a, unsigned b)
+{
+ return (a - b - 1) >= a;
+}
+
+int
+bar (unsigned c, unsigned d)
+{
+ return (c - d - 1) < c;
+}
+
+int
+baz (unsigned e, unsigned f)
+{
+ unsigned t = e - f;
+ return (t - 1) >= e;
+}
+
+int
+qux (unsigned g, unsigned h)
+{
+ unsigned t = g - h;
+ return (t - 1) < g;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr94921.c b/gcc/testsuite/gcc.dg/tree-ssa/pr94921.c
new file mode 100644
index 00000000000..2c752caae07
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr94921.c
@@ -0,0 +1,18 @@
+/* PR tree-optimization/94921 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump " \[ab]_\[0-9]+\\\(D\\\) \\+ \[ab]_\[0-9]+\\\(D\\\);" "optimized" } } */
+/* { dg-final { scan-tree-dump " c_\[0-9]+\\\(D\\\) - d_\[0-9]+\\\(D\\\);" "optimized" } } */
+/* { dg-final { scan-tree-dump-not " ~\[abcd]\?_\[0-9]\+" "optimized" } } */
+
+int
+foo (int a, int b)
+{
+ return ~(~a - b);
+}
+
+int
+bar (int c, int d)
+{
+ return ~(~c + d);
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr94969.c b/gcc/testsuite/gcc.dg/tree-ssa/pr94969.c
new file mode 100644
index 00000000000..f15046122ff
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr94969.c
@@ -0,0 +1,28 @@
+/* PR tree-optimization/52267 */
+/* { dg-do run } */
+/* { dg-options "-O3 -fdump-tree-ldist-details" } */
+
+int a = 0, b = 0, c = 0;
+struct S {
+ signed m : 7;
+ signed e : 2;
+};
+struct S f[2] = {{0, 0}, {0, 0}};
+struct S g = {0, 0};
+
+void __attribute__((noinline))
+k()
+{
+ for (; c <= 1; c++) {
+ f[b] = g;
+ f[b].e ^= 1;
+ }
+}
+int main()
+{
+ k();
+ if (f[b].e != 1)
+ __builtin_abort ();
+}
+
+/* { dg-final { scan-tree-dump-not "Loop 1 distributed: split to 3 loops" "ldist" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr95433-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr95433-2.c
new file mode 100644
index 00000000000..c830a3d195f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr95433-2.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fwrapv -fdump-tree-gimple" } */
+
+typedef __INT32_TYPE__ int32_t;
+typedef unsigned __INT32_TYPE__ uint32_t;
+
+int e(int32_t x){return 3*x==5;}
+int f(int32_t x){return 3*x==-5;}
+int g(int32_t x){return -3*x==5;}
+int h(int32_t x){return 7*x==3;}
+int i(uint32_t x){return 7*x==3;}
+
+/* { dg-final { scan-tree-dump-times "== 1431655767" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "== -1431655767" 2 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "== 613566757" 2 "gimple" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr95433.c b/gcc/testsuite/gcc.dg/tree-ssa/pr95433.c
new file mode 100644
index 00000000000..4e161ee26cc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr95433.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+int f(int x){return x*7==17;}
+int g(int x){return x*3==15;}
+
+/* { dg-final { scan-tree-dump "return 0;" "optimized" } } */
+/* { dg-final { scan-tree-dump "== 5;" "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr95527.c b/gcc/testsuite/gcc.dg/tree-ssa/pr95527.c
new file mode 100644
index 00000000000..afd763cb245
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr95527.c
@@ -0,0 +1,172 @@
+/* PR tree-optimization/95527 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-times "return 0;" 4 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "return 18;" 4 "optimized" } } */
+
+/* { dg-final { scan-tree-dump-times "a_\[0-9]*\\\(D\\\) == 0" 1 "optimized" } } */
+
+int
+f1 (int a)
+{
+ return __builtin_ffs (a) == 0;
+}
+
+/* { dg-final { scan-tree-dump-times "b_\[0-9]*\\\(D\\\) != 0" 1 "optimized" } } */
+
+int
+f2 (int b)
+{
+ return __builtin_ffs (b) != 0;
+}
+
+int
+f3 (int x)
+{
+ return __builtin_ffs (x) == -1;
+}
+
+int
+f4 (int x)
+{
+ return 17 + (__builtin_ffs (x) != -1);
+}
+
+int
+f5 (int x)
+{
+ return __builtin_ffs (x) == __SIZEOF_INT__ * __CHAR_BIT__ + 1;
+}
+
+int
+f6 (int x)
+{
+ return 17 + (__builtin_ffs (x) != __SIZEOF_INT__ * __CHAR_BIT__ + 1);
+}
+
+/* { dg-final { scan-tree-dump-times "c_\[0-9]*\\\(D\\\) & 63" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "== 32" 1 "optimized" } } */
+
+int
+f7 (int c)
+{
+ return __builtin_ffs (c) == 6;
+}
+
+/* { dg-final { scan-tree-dump-times "d_\[0-9]*\\\(D\\\) & 16383" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "!= 8192" 1 "optimized" } } */
+
+int
+f8 (int d)
+{
+ return __builtin_ffs (d) != 14;
+}
+
+/* { dg-final { scan-tree-dump-times "e_\[0-9]*\\\(D\\\) == -9223372036854775808" 1 "optimized" { target lp64 } } } */
+/* { dg-final { scan-tree-dump-times "e_\[0-9]*\\\(D\\\) == -2147483648" 1 "optimized" { target ilp32 } } } */
+
+int
+f9 (long int e)
+{
+ return __builtin_ffsl (e) == __SIZEOF_LONG__ * __CHAR_BIT__;
+}
+
+/* { dg-final { scan-tree-dump-times "f_\[0-9]*\\\(D\\\) != -9223372036854775808" 1 "optimized" } } */
+
+int
+f10 (long long int f)
+{
+ return __builtin_ffsll (f) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__;
+}
+
+/* { dg-final { scan-tree-dump-times "g_\[0-9]*\\\(D\\\) != 0" 1 "optimized" } } */
+
+int
+f11 (long long int g)
+{
+ return __builtin_ffsll (g) > 0;
+}
+
+/* { dg-final { scan-tree-dump-times "h_\[0-9]*\\\(D\\\) == 0" 1 "optimized" } } */
+
+int
+f12 (int h)
+{
+ return __builtin_ffs (h) <= 0;
+}
+
+int
+f13 (int x)
+{
+ return 17 + (__builtin_ffs (x) > -1);
+}
+
+int
+f14 (int x)
+{
+ return __builtin_ffs (x) <= -1;
+}
+
+int
+f15 (int x)
+{
+ return __builtin_ffs (x) > __SIZEOF_INT__ * __CHAR_BIT__;
+}
+
+int
+f16 (int x)
+{
+ return 17 + (__builtin_ffs (x) <= __SIZEOF_INT__ * __CHAR_BIT__);
+}
+
+/* { dg-final { scan-tree-dump-times "i_\[0-9]*\\\(D\\\) & 63" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "i_\[0-9]*\\\(D\\\) != 0" 1 "optimized" } } */
+
+int
+f17 (int i)
+{
+ return __builtin_ffs (i) > 6;
+}
+
+/* { dg-final { scan-tree-dump-times "j_\[0-9]*\\\(D\\\) & 4095" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "j_\[0-9]*\\\(D\\\) == 0" 1 "optimized" } } */
+
+int
+f18 (int j)
+{
+ return __builtin_ffs (j) <= 12;
+}
+
+/* { dg-final { scan-tree-dump-times "k_\[0-9]*\\\(D\\\) == -2147483648" 1 "optimized" { target int32 } } } */
+
+int
+f19 (int k)
+{
+ return __builtin_ffs (k) > __SIZEOF_INT__ * __CHAR_BIT__ - 1;
+}
+
+/* { dg-final { scan-tree-dump-times "l_\[0-9]*\\\(D\\\) != -2147483648" 1 "optimized" { target int32 } } } */
+
+int
+f20 (int l)
+{
+ return __builtin_ffs (l) <= __SIZEOF_INT__ * __CHAR_BIT__ - 1;
+}
+
+/* { dg-final { scan-tree-dump-times "m_\[0-9]*\\\(D\\\) & 1073741823" 1 "optimized" { target int32 } } } */
+/* { dg-final { scan-tree-dump-times "m_\[0-9]*\\\(D\\\) != 0" 1 "optimized" } } */
+
+int
+f21 (int m)
+{
+ return __builtin_ffs (m) > __SIZEOF_INT__ * __CHAR_BIT__ - 2;
+}
+
+/* { dg-final { scan-tree-dump-times "n_\[0-9]*\\\(D\\\) & 1073741823" 1 "optimized" { target int32 } } } */
+/* { dg-final { scan-tree-dump-times "n_\[0-9]*\\\(D\\\) == 0" 1 "optimized" } } */
+
+int
+f22 (int n)
+{
+ return __builtin_ffs (n) <= __SIZEOF_INT__ * __CHAR_BIT__ - 2;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr95649.c b/gcc/testsuite/gcc.dg/tree-ssa/pr95649.c
new file mode 100644
index 00000000000..cc9b7640c19
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr95649.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-scev-cprop" } */
+
+char b (void);
+char *d;
+int e;
+int f;
+void
+g (char *h)
+{
+ while (d)
+ {
+ long i = b ();
+ if (h + i > d)
+ break;
+ if (f > 0 || e)
+ do
+ *h++ = *h;
+ while (--i);
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr95699.c b/gcc/testsuite/gcc.dg/tree-ssa/pr95699.c
new file mode 100644
index 00000000000..43a2307aae6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr95699.c
@@ -0,0 +1,39 @@
+/* PR tree-optimization/95699 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump "MAX_EXPR <\[^>\n\r]*9223372036854775807\[^>\n\r]*>" "optimized" } } */
+/* { dg-final { scan-tree-dump "MAX_EXPR <\[^>\n\r]*9223372036854775808\[^>\n\r]*>" "optimized" } } */
+/* { dg-final { scan-tree-dump "MIN_EXPR <\[^>\n\r]*9223372036854775807\[^>\n\r]*>" "optimized" } } */
+/* { dg-final { scan-tree-dump "MIN_EXPR <\[^>\n\r]*9223372036854775808\[^>\n\r]*>" "optimized" } } */
+
+unsigned long long
+f1 (unsigned long long x)
+{
+ if (x < 0x7fffffffffffffffULL)
+ x = 0x7fffffffffffffffULL;
+ return x;
+}
+
+unsigned long long
+f2 (unsigned long long x)
+{
+ if (x < 0x8000000000000000ULL)
+ x = 0x8000000000000000ULL;
+ return x;
+}
+
+unsigned long long
+f3 (unsigned long long x)
+{
+ if (x >= 0x7fffffffffffffffULL)
+ x = 0x7fffffffffffffffULL;
+ return x;
+}
+
+unsigned long long
+f4 (unsigned long long x)
+{
+ if (x >= 0x8000000000000000ULL)
+ x = 0x8000000000000000ULL;
+ return x;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr95804.c b/gcc/testsuite/gcc.dg/tree-ssa/pr95804.c
new file mode 100644
index 00000000000..83c0ab45cf5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr95804.c
@@ -0,0 +1,18 @@
+/* PR tree-optimization/95804 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+int a, b, c, d, e, f;
+void g() {
+ short *h = (short*)&d;
+ char *i = (char*)&b;
+ for (; e; e++) {
+ for (; f; f++) {
+ b = 3;
+ if ((c = 8) >= *i)
+ a = 5 ? *h : 0;
+ h = (short*)g;
+ }
+ i = (char*)&c;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr95906.c b/gcc/testsuite/gcc.dg/tree-ssa/pr95906.c
new file mode 100644
index 00000000000..3d820a58e93
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr95906.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-forwprop3-raw -w -Wno-psabi" } */
+
+// FIXME: this should further optimize to a MAX_EXPR
+typedef signed char v16i8 __attribute__((vector_size(16)));
+v16i8 f(v16i8 a, v16i8 b)
+{
+ v16i8 cmp = (a > b);
+ return (cmp & a) | (~cmp & b);
+}
+
+/* { dg-final { scan-tree-dump-not "bit_(and|ior)_expr" "forwprop3" } } */
+/* { dg-final { scan-tree-dump-times "vec_cond_expr" 1 "forwprop3" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr96480.c b/gcc/testsuite/gcc.dg/tree-ssa/pr96480.c
new file mode 100644
index 00000000000..f2a91ef9909
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr96480.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/96480 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump " = _\[0-9]* <= 3;" "optimized" } } */
+
+int v[4];
+
+int
+foo (int x)
+{
+ int *p;
+ if (x == 0)
+ p = &v[0];
+ else if (x == 1)
+ p = &v[1];
+ else if (x == 2)
+ p = &v[2];
+ else if (x == 3)
+ p = &v[3];
+ else
+ p = &v[4];
+ return p != &v[4];
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-20.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-20.c
index 3d2ea6b6c75..a7d57f12600 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-20.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-20.c
@@ -15,5 +15,5 @@ int main(void)
printf ("%d %d\n", e, f);
}
-/* { dg-final { scan-tree-dump-times "\[ab\].._. \\\+ \[ab\].._." 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\[ab\].\?.._. \\\+ \[ab\].\?.._." 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times " \\\+ " 2 "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-28.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-28.c
index 2e999860148..ee6804ec679 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-28.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-28.c
@@ -1,4 +1,4 @@
-/* { dg-do run} */
+/* { dg-do run } */
/* { dg-options "-O2" } */
#define LENGTH 4
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/scev-8.c b/gcc/testsuite/gcc.dg/tree-ssa/scev-8.c
index 666dd30bfbe..a5b2ff71958 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/scev-8.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/scev-8.c
@@ -3,6 +3,12 @@
int *a;
+#if __SIZEOF_INT__ == __SIZEOF_SHORT__
+typedef char small_t;
+#else
+typedef short small_t;
+#endif
+
int
foo1 (long long s, long long l)
{
@@ -10,7 +16,7 @@ foo1 (long long s, long long l)
for (i = s; i < l; i++)
{
- a[(short)i] = 0;
+ a[(small_t)i] = 0;
}
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/split-path-12.c b/gcc/testsuite/gcc.dg/tree-ssa/split-path-12.c
new file mode 100644
index 00000000000..19a130d9bf1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/split-path-12.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fsplit-paths -fdump-tree-split-paths-details " } */
+
+double
+foo(double *d1, double *d2, double *d3, int num, double *ip)
+{
+ double dmax[3];
+
+ for (int i = 0; i < num; i++) {
+ dmax[0] = d1[i] < dmax[0] ? dmax[0] : d1[i];
+ dmax[1] = d2[i] < dmax[1] ? dmax[1] : d2[i];
+ dmax[2] = d3[i] < dmax[2] ? dmax[2] : d3[i];
+ ip[i] = dmax[2];
+ }
+
+ return dmax[0] + dmax[1] + dmax[2];
+}
+
+/* { dg-final { scan-tree-dump "appears to be optimized to a join point for if-convertable half-diamond" "split-paths" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/split-path-7.c b/gcc/testsuite/gcc.dg/tree-ssa/split-path-7.c
index 3d6186b34d9..a5df75c9b72 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/split-path-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/split-path-7.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fsplit-paths -fno-tree-cselim -fdump-tree-split-paths-details -w" } */
+/* { dg-options "-O2 -fsplit-paths -fno-tree-cselim -fno-tree-sink -fdump-tree-split-paths-details -w" } */
struct _reent
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-2.c
index e4daa9d4ff3..a879d305971 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-2.c
@@ -27,4 +27,4 @@ foo ()
but the loop reads only one element at a time, and DOM cannot resolve these.
The same happens on powerpc depending on the SIMD support available. */
-/* { dg-final { scan-tree-dump "return 28;" "optimized" { xfail { { alpha*-*-* hppa*64*-*-* nvptx*-*-* } || { { { lp64 && { powerpc*-*-* sparc*-*-* riscv*-*-* } } || aarch64_sve } || { arm*-*-* && { ! arm_neon } } } } } } } */
+/* { dg-final { scan-tree-dump "return 28;" "optimized" { xfail { { alpha*-*-* hppa*64*-*-* nvptx*-*-* mmix-knuth-mmixware } || { { { lp64 && { powerpc*-*-* sparc*-*-* riscv*-*-* } } || aarch64_sve } || { arm*-*-* && { ! arm_neon } } } } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c
index c456d734fa7..95c936cbf71 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c
@@ -300,10 +300,10 @@ f2 (struct C *x)
else
{
o = f2 (x);
-#if __SIZEOF_POINTER__ == __SIZEOF_LONG__
+#if __SIZEOF_POINTER__ == __SIZEOF_LONG__ && !__MSP430X_LARGE__
if (((unsigned long) o > (unsigned long) -4000L))
-#elif __SIZEOF_POINTER__ == __SIZEOF_INT__
- if (((__UINTPTR_TYPE__) o > (__UINTPTR_TYPE__) -4000U))
+#else
+ if (((__UINTPTR_TYPE__) o > (__UINTPTR_TYPE__) -4000UL))
#endif
{
e = 5;
@@ -388,10 +388,10 @@ f2 (struct C *x)
break;
case 19:
o = f2 (x);
-#if __SIZEOF_POINTER__ == __SIZEOF_LONG__
+#if __SIZEOF_POINTER__ == __SIZEOF_LONG__ && !__MSP430X_LARGE__
if (((unsigned long) o > (unsigned long) -4000L))
-#elif __SIZEOF_POINTER__ == __SIZEOF_INT__
- if (((__UINTPTR_TYPE__) o > (__UINTPTR_TYPE__) -4000U))
+#else
+ if (((__UINTPTR_TYPE__) o > (__UINTPTR_TYPE__) -4000UL))
#endif
{
e = 6;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c
index 8abc28baccb..271e666f265 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c
@@ -31,12 +31,14 @@ constraint_equal (struct constraint a, struct constraint b)
}
/* Most targets should be using this test. */
-/* { dg-final { scan-tree-dump-times "Deleted dead store: x = " 1 "dse1" { target { ! tic6x-*-* } } } } */
-/* { dg-final { scan-tree-dump-times "Deleted dead store: y = " 1 "dse1" { target { ! tic6x-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Deleted dead store: x = " 1 "dse1" { target { ! { tic6x-*-* mmix-knuth-mmixware } } } } } */
+/* { dg-final { scan-tree-dump-times "Deleted dead store: y = " 1 "dse1" { target { ! { tic6x-*-* mmix-knuth-mmixware } } } } } */
/* The c6x port generates significantly different gimple which
changes the SRA and DSE decisions. Verify we remove all
- dead stores. */
+ dead stores. Similarly for mmix. */
/* { dg-final { scan-tree-dump-times "Deleted dead store: \[ax\].. = " 2 "dse1" { target tic6x-*-* } } } */
/* { dg-final { scan-tree-dump-times "Deleted dead store: \[by\].. = " 2 "dse1" { target tic6x-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Deleted dead store: x::. = " 1 "dse1" { target mmix-knuth-mmixware } } } */
+/* { dg-final { scan-tree-dump-times "Deleted dead store: y::. = " 1 "dse1" { target mmix-knuth-mmixware } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-30.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-30.c
index 1d1fe82fda0..9f56b392cdd 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-30.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-30.c
@@ -8,9 +8,8 @@ void test_bcopy (const void *s)
{
char d[33];
- /* Bcopy is transformed into memmove and those calls are expanded
- inline in EVRP, before DSE runs, so this test doesn't actually
- verify that DSE does its job. */
+ /* Bcopy is transformed into memmove before DSE runs, so this test
+ doesn't actually verify that DSE does its job. */
__builtin_bcopy (s, d, sizeof d);
__builtin_bcopy (s, d, sizeof d);
@@ -28,4 +27,17 @@ void test_bzero (void)
}
/* { dg-final { scan-tree-dump-times "builtin_memset" 1 "dse1" } } */
-/* { dg-final { scan-tree-dump-not "builtin_(bcopy|bzero|memcpy|memmove)" "dse1" } } */
+
+/* Merging the evrp folder into substitute_and_fold_engine shuffled
+ the order of gimple_fold a bit, so evrp is no longer folding the
+ memmove inline. This folding is instead done by forwprop. Thus, I
+ have remmoved the |memmove in the test below as this is not done
+ until after dse.
+
+ What happened was that the propagator engine only called gimple
+ fold if replace_uses_in() was successful. On the other hand, EVRP
+ called gimple fold regardless.
+
+ If we really care about previous behavior, we could put a call to
+ gimple ::fold_stmt into evrp_folder::fold_stmt(). */
+/* { dg-final { scan-tree-dump-not "builtin_(bcopy|bzero|memcpy)" "dse1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-14.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-14.c
new file mode 100644
index 00000000000..3eb5be8b23f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-14.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-lim-details" } */
+
+extern void abort();
+
+typedef int A;
+typedef float B;
+
+void __attribute__((noinline,noclone))
+foo(A * p, B *r, long unk, long oh)
+{
+ for (long i = 0; i < unk; ++i) {
+ *p = 1;
+ *r = 2;
+ if (oh & i)
+ break;
+ *r = 3;
+ *p = 4;
+ }
+}
+
+int main(void)
+{
+ union { A x; B f; } u;
+ foo(&u.x, &u.f, 1, 1);
+ if (u.x != 4) abort();
+ foo(&u.x, &u.f, 2, 1);
+ if (u.f != 2) abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "Executing store motion of \\*p" "lim2" } } */
+/* { dg-final { scan-tree-dump "Executing store motion of \\*r" "lim2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-17.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-17.c
index 09313716598..a06f339f0bb 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-17.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-17.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+/* { dg-options "-O2 -fdump-tree-pre-stats -fno-tree-cselim" } */
typedef union {
int i;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-13.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-13.c
new file mode 100644
index 00000000000..a65ba35d4ba
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-13.c
@@ -0,0 +1,25 @@
+/* PR33315 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-sink" } */
+
+int num;
+int a[20];
+
+void test ()
+{
+ int i;
+ int *ptr;
+ ptr = & a[0];
+ i = num;
+ if ( i == 1) *(ptr+0) = 0;
+ if ( i != 1) *(ptr+0) = 0;
+ if ( i == 2) *(ptr+1) = 0;
+ if ( i != 2) *(ptr+1) = 0;
+ if ( i == 3) *(ptr+2) = 0;
+ if ( i != 3) *(ptr+2) = 0;
+}
+
+/* We should sink/merge all stores and end up with a single BB. */
+
+/* { dg-final { scan-tree-dump-times "MEM\[^\n\r\]* = 0;" 3 "sink" } } */
+/* { dg-final { scan-tree-dump-times "<bb " 1 "sink" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-14.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-14.c
new file mode 100644
index 00000000000..771cd4420c4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-14.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-sink" } */
+
+int x;
+void foo (int b)
+{
+ if (b)
+ x = b;
+ else
+ x = 2;
+}
+
+/* We should have sunk the store and inserted a PHI to merge the
+ stored values. */
+
+/* { dg-final { scan-tree-dump-times " = PHI" 1 "sink" } } */
+/* { dg-final { scan-tree-dump-times "x = " 1 "sink" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/upcast-1.c b/gcc/testsuite/gcc.dg/tree-ssa/upcast-1.c
index 7838817f2f5..4520aba1359 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/upcast-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/upcast-1.c
@@ -1,4 +1,4 @@
-/* { do-go compile } */
+/* { dg-do compile } */
/* { dg-options "-fdump-tree-gimple" } */
typedef struct { int i; } Foo;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vector-4.c b/gcc/testsuite/gcc.dg/tree-ssa/vector-4.c
index 17c56e91ad7..00ddd2995be 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/vector-4.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vector-4.c
@@ -11,5 +11,6 @@ v4si vs (v4si a, v4si b)
/* The compound literal should be placed directly in the vec_perm. */
/* Test is xfailed on 32-bit hppa*-*-* because target-callee-copies. */
-/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR <a, b, { 0, 4, 1, 5 }>;" 1 "gimple" { xfail { hppa*-*-* && { ! lp64 } } } } } */
+/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR <a, b, { 0, 4, 1, 5 }>;" 1 "gimple" { target { ! mmix-knuth-mmixware } xfail { hppa*-*-* && { ! lp64 } } } } } */
+/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR <a::., b::., { 0, 4, 1, 5 }>;" 1 "gimple" { target mmix-knuth-mmixware } } } */
diff --git a/gcc/testsuite/gcc.dg/two-types-6.c b/gcc/testsuite/gcc.dg/two-types-6.c
index ca3bfa997a7..a0a79316f01 100644
--- a/gcc/testsuite/gcc.dg/two-types-6.c
+++ b/gcc/testsuite/gcc.dg/two-types-6.c
@@ -2,6 +2,6 @@
/* { dg-options "-std=gnu89" } // suppress default -pedantic-errors */
struct s {
- struct f {} /* dg-warning "does not declare anything" } */
+ struct f {}
struct g {} x; /* { dg-error "expected ';', identifier or " } */
};
diff --git a/gcc/testsuite/gcc.dg/ubsan/c-shift-1.c b/gcc/testsuite/gcc.dg/ubsan/c-shift-1.c
index 61b90105364..9d561016f95 100644
--- a/gcc/testsuite/gcc.dg/ubsan/c-shift-1.c
+++ b/gcc/testsuite/gcc.dg/ubsan/c-shift-1.c
@@ -1,4 +1,4 @@
-/* { dg-do compile} */
+/* { dg-do compile } */
/* { dg-options "-fsanitize=shift -w" } */
/* { dg-shouldfail "ubsan" } */
diff --git a/gcc/testsuite/gcc.dg/ubsan/pr81981.c b/gcc/testsuite/gcc.dg/ubsan/pr81981.c
index b2636d4c934..8a6597c84c8 100644
--- a/gcc/testsuite/gcc.dg/ubsan/pr81981.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr81981.c
@@ -16,6 +16,6 @@ foo (int i)
u[0] = i;
}
- v = u[0]; /* { dg-warning "may be used uninitialized in this function" } */
- return t[0]; /* { dg-warning "may be used uninitialized in this function" } */
+ v = u[0]; /* { dg-warning "may be used uninitialized" } */
+ return t[0]; /* { dg-warning "may be used uninitialized" } */
}
diff --git a/gcc/testsuite/gcc.dg/ubsan/pr89284.c b/gcc/testsuite/gcc.dg/ubsan/pr89284.c
index 0d73e8fa4a1..965225c6702 100644
--- a/gcc/testsuite/gcc.dg/ubsan/pr89284.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr89284.c
@@ -8,7 +8,7 @@ int
foo (void)
{
struct A a;
- if (a.i) /* { dg-warning "'a.i' is used uninitialized in this function" } */
+ if (a.i) /* { dg-warning "'a.i' is used uninitialized" } */
return 1;
return 0;
}
@@ -17,7 +17,7 @@ int
bar (void)
{
struct A a;
- if (a.a) /* { dg-warning "'a.a' is used uninitialized in this function" } */
+ if (a.a) /* { dg-warning "'a.a' is used uninitialized" } */
return 1;
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/ubsan/pr95810.c b/gcc/testsuite/gcc.dg/ubsan/pr95810.c
new file mode 100644
index 00000000000..535ace69089
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ubsan/pr95810.c
@@ -0,0 +1,13 @@
+/* PR middle-end/95810 */
+/* { dg-do run } */
+/* { dg-options "-fsanitize=undefined -fno-sanitize-recover=undefined" } */
+
+int
+main ()
+{
+ int x = -__INT_MAX__ - 1;
+ x = (x <= 0 ? x : -x);
+ if (x != -__INT_MAX__ - 1)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/unclosed-init.c b/gcc/testsuite/gcc.dg/unclosed-init.c
index 3deb88e777c..0a0ca218404 100644
--- a/gcc/testsuite/gcc.dg/unclosed-init.c
+++ b/gcc/testsuite/gcc.dg/unclosed-init.c
@@ -1,3 +1,3 @@
int unclosed[] = { /* { dg-message "18: to match this '.'" } */
42
- /* { dg-error "-: expected '.' at end of input" } */
+ /* { dg-error "-: expected '.' at end of input" "" { target *-*-* } .+1 } */
diff --git a/gcc/testsuite/gcc.dg/uninit-15.c b/gcc/testsuite/gcc.dg/uninit-15.c
index 67aac41d49e..8ee10c27aba 100644
--- a/gcc/testsuite/gcc.dg/uninit-15.c
+++ b/gcc/testsuite/gcc.dg/uninit-15.c
@@ -10,7 +10,7 @@
inline int
foo (int i)
{
- if (i) /* { dg-warning "used uninitialized in this function" "" } */
+ if (i) /* { dg-warning "used uninitialized" } */
return 1;
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/uninit-32.c b/gcc/testsuite/gcc.dg/uninit-32.c
new file mode 100644
index 00000000000..cf9efa0f064
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-32.c
@@ -0,0 +1,313 @@
+/* PR middle-end/10138 - warn for uninitialized arrays passed as const*
+ arguments
+ { dg-do compile }
+ { dg-options "-O -Wall" }
+ { dg-require-effective-target alloca } */
+
+typedef __SIZE_TYPE__ size_t;
+
+void* alloca (size_t);
+void* malloc (size_t);
+void* realloc (void*, size_t);
+
+void fpi (int*);
+void fpci (const int*);
+void fpcv (const void*);
+
+
+void nowarn_scalar_fpi (void)
+{
+ int x;
+ fpi (&x);
+}
+
+void nowarn_scalar_plus_cst_fpi (void)
+{
+ int x;
+ // This deserves a warning other than -Wuninitialized.
+ fpi (&x + 1);
+}
+
+void nowarn_scalar_plus_var_fpi (int i)
+{
+ int x;
+ // Same as above, this deserves a warning other than -Wuninitialized.
+ fpi (&x + i);
+}
+
+void nowarn_array_assign_fpci (void)
+{
+ int a[2];
+ a[0] = 0;
+ fpci (a);
+}
+
+void nowarn_array_assign_plus_cst_fpci (void)
+{
+ int a[4];
+ a[1] = 0;
+ a[2] = 1;
+ fpci (a + 1);
+}
+
+void nowarn_array_init_fpci (void)
+{
+ int a[4] = { 0 };
+ fpci (a);
+}
+
+void nowarn_array_compound_fpi (void)
+{
+ fpi ((int[2]){ 1 });
+}
+
+void nowarn_array_compound_fpci (void)
+{
+ fpci ((int[3]){ 1 });
+}
+
+void warn_array_fpci (void)
+{
+ int a[4]; // { dg-message "declared here" }"
+ fpci (a); // { dg-warning "\\\[-Wmaybe-uninitialized" }
+}
+
+void warn_array_plus_cst_fpci (void)
+{
+ int a[4];
+ fpci (a + 1); // { dg-warning "\\\[-Wmaybe-uninitialized" }
+}
+
+void warn_array_plus_var_fpci (int i)
+{
+ int a[4];
+ fpci (a + i); // { dg-warning "\\\[-Wmaybe-uninitialized" }
+}
+
+void nowarn_array_end_fpci (void)
+{
+ int a[4];
+ /* This should be diagnosed by a warning other than -Wuninitialized
+ because the just-past-the-end pointer cannot be dereferenced and
+ the function doesn't take any other pointer to tell where the start
+ of the array is. -Wuninitialized isn't appropriate because there
+ is nothing to initialize at that offset. */
+ fpci (a + 4);
+}
+
+void warn_matrix_fpcv (void)
+{
+ int a[2][2];
+ fpci (a[1]); // { dg-warning "\\\[-Wmaybe-uninitialized" }
+}
+
+void warn_scalar_fpcv (void)
+{
+ int i;
+ fpci (&i); // { dg-warning "\\\[-Wmaybe-uninitialized" }
+}
+
+void warn_scalar_plus_cst_fpcv (void)
+{
+ int x;
+ /* Same as above, this deserves a warning other than -Wuninitialized
+ for passing the function a past-the-end pointer with no other
+ argument. */
+ fpci (&x + 1);
+}
+
+void warn_scalar_plus_var_fpcv (int i)
+{
+ int x;
+ fpci (&x + i); // { dg-warning "\\\[-Wmaybe-uninitialized" }
+}
+
+void nowarn_struct_assign_fpci (void)
+{
+ struct { int a, b; } s;
+ s.a = 0;
+ fpci (&s.a);
+}
+
+void warn_struct_assign_fpci (void)
+{
+ struct { int a, b; } s;
+ s.a = 0;
+ fpci (&s.b); // { dg-warning "\\\[-Wmaybe-uninitialized" }
+}
+
+void nowarn_struct_init_fpci (void)
+{
+ struct { int a, b; } s = { 0 };
+ fpci (&s.a);
+ fpci (&s.b);
+}
+
+void nowarn_struct_compound_fpci (void)
+{
+ struct S { int a, b; };
+ fpci (&(struct S){ }.a);
+ fpci (&(struct S){ }.b);
+}
+
+/* Verify that passing a just-past-the-end pointer to a const pointer
+ argument to a function that takes another argument is not diagnosed
+ since the two arguments together could outline a range. */
+void nowarn_fp_p (void)
+{
+ extern void fpi_pci (int*, const int*);
+
+ {
+ int i;
+ fpi_pci (&i, &i + 1);
+ }
+ {
+ int j;
+ fpi_pci (&j + 1, &j + 1);
+ }
+
+ extern void fpc_pcc (char*, const char*);
+
+ {
+ char a[2];
+ fpc_pcc (a, a + 2);
+ }
+ {
+ char a[3];
+ fpc_pcc (a, a + 3);
+ }
+
+ extern void fpcc_pcc (const char*, const char*);
+
+ {
+ char a[4];
+ fpcc_pcc (a + 4, a + 4);
+ }
+}
+
+
+/* Verify passing addresses of empty uninitialized objects doesn't
+ trigger a warning. */
+void nowarn_fpcEmpty (void)
+{
+ struct Empty { };
+ extern void fpcEmpty (const struct Empty*);
+
+ /* Since Empty has no members warning for it isn't really necessary.
+ See also PR 38908. */
+ struct Empty s;
+ fpcEmpty (&s);
+}
+
+
+/* Verify passing addresses of uninitialized objects to functions
+ declared without a proptotype doesn't trigger a warning. */
+void nowarn_noproto (void)
+{
+ extern void fnoproto ();
+ int i, a[2];
+
+ fnoproto (&i, a, a + 2);
+}
+
+
+/* Verify passing addresses of uninitialized objects to variadic
+ functions doesn't trigger a warning. */
+void nowarn_vararg (void)
+{
+ extern void fvararg (int, ...);
+
+ int i, a[2];
+
+ fvararg (0, &i, a, a + 2);
+}
+
+
+void nowarn_alloca_assign_fpci (unsigned n)
+{
+ int *p = (int*)alloca (n);
+ p[0] = 0;
+ fpci (p);
+}
+
+void nowarn_alloca_assign_plus_cst_fpci (unsigned n)
+{
+ int *p = (int*)alloca (n);
+ p[1] = 0;
+ p[2] = 1;
+ fpci (p + 1);
+}
+
+void warn_alloca_fpci (unsigned n)
+{
+ int *p = (int*)alloca (n);
+ fpci (p); // { dg-warning "\\\[-Wmaybe-uninitialized" }
+}
+
+void warn_alloca_assign_plus_cst_fpci (unsigned n)
+{
+ int *p = (int*)alloca (n);
+ p[1] = 0;
+ p[2] = 1;
+ fpci (p + 3); // { dg-warning "\\\[-Wmaybe-uninitialized" }
+}
+
+
+void nowarn_vla_assign_fpci (unsigned n)
+{
+ int a[n];
+ a[0] = 0;
+ fpci (a);
+}
+
+void nowarn_vla_assign_plus_cst_fpci (unsigned n)
+{
+ int vla[n];
+ vla[1] = 0;
+ vla[2] = 1;
+ fpci (vla + 1);
+}
+
+void warn_vla_fpci (unsigned n)
+{
+ int vla[n]; // { dg-message "declared here" "pr?????" { xfail *-*-* } }"
+ fpci (vla); // { dg-warning "\\\[-Wmaybe-uninitialized" }
+}
+
+void warn_vla_assign_plus_cst_fpci (unsigned n)
+{
+ int vla[n]; // { dg-message "declared here" "pr?????" { xfail *-*-* } }"
+ vla[1] = 0;
+ vla[2] = 1;
+ fpci (vla + 3); // { dg-warning "\\\[-Wmaybe-uninitialized" }
+}
+
+
+void nowarn_malloc_assign_fpci (unsigned n)
+{
+ int *p = (int*)malloc (n);
+ p[0] = 0;
+ fpci (p);
+}
+
+void nowarn_malloc_assign_plus_cst_fpci (unsigned n)
+{
+ int *p = (int*)malloc (n);
+ p[1] = 0;
+ p[2] = 1;
+ fpci (p + 1);
+}
+
+void warn_malloc_fpci (unsigned n)
+{
+ int *p = (int*)malloc (n);
+ fpci (p); // { dg-warning "\\\[-Wmaybe-uninitialized" }
+}
+
+void warn_malloc_assign_plus_cst_fpci (unsigned n)
+{
+ int *p = (int*)malloc (n); // { dg-message "allocated here" "pr?????" { xfail *-*-* } }"
+ p[1] = 0;
+ p[2] = 1;
+ fpci (p + 3); // { dg-warning "\\\[-Wmaybe-uninitialized" }
+}
diff --git a/gcc/testsuite/gcc.dg/uninit-33.c b/gcc/testsuite/gcc.dg/uninit-33.c
new file mode 100644
index 00000000000..a45f18dd6ce
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-33.c
@@ -0,0 +1,145 @@
+/* PR middle-end/10138 - warn for uninitialized arrays passed as const*
+ arguments
+ Verify that passing pointers to uninitialized objects to arguments
+ to functions declared with attribute access is diagnosed where expected.
+ { dg-do compile }
+ { dg-options "-O -Wall" } */
+
+#define RO(...) __attribute__ ((access (read_only, __VA_ARGS__)))
+#define RW(...) __attribute__ ((access (read_write, __VA_ARGS__)))
+#define WO(...) __attribute__ ((access (write_only, __VA_ARGS__)))
+
+RO (1) void fpri (int*); // { dg-message "in a call to 'fpri' declared with attribute 'access \\\(read_only, 1\\\)' here" }
+
+RO (1) void fpcri (const int*);
+
+RO (1, 2) void fpcri1_2 (const int*, int);
+
+
+void warn_scalar_fpri (void)
+{
+ int i; // { dg-message "declared here" }
+ fpri (&i); // { dg-warning "'i' is used uninitialized" }
+}
+
+void nowarn_scalar_plus_fpri (void)
+{
+ int i;
+ /* This gets a -Wstringop-overflow for reading past the end but not
+ -Wuninitialized because there's nothing to initialize there. */
+ fpri (&i + 1); // { dg-warning "\\\[-Wstringop-overflow" }
+}
+
+void nowarn_array_assign_fpcri (void)
+{
+ int a[2];
+ a[0] = 0;
+ fpcri (a);
+}
+
+void nowarn_array_init_fpcri (void)
+{
+ int a[4] = { 0 };
+ fpcri (a);
+}
+
+void nowarn_array_compound_fpri (void)
+{
+ fpri ((int[2]){ 0 });
+}
+
+void nowarn_array_compound_fpcri (void)
+{
+ fpcri ((int[3]){ 1 });
+}
+
+void warn_scalar_fpcri (void)
+{
+ int i;
+ fpcri (&i); // { dg-warning "\\\[-Wuninitialized" }
+}
+
+void warn_array_fpcri (void)
+{
+ int a[4];
+ fpcri (a); // { dg-warning "\\\[-Wuninitialized" }
+}
+
+void warn_array_plus_cst_fpcri (void)
+{
+ int a[4];
+ fpcri (a + 1); // { dg-warning "\\\[-Wuninitialized" }
+}
+
+void warn_array_plus_var_fpcri (int i)
+{
+ int a[4];
+ fpcri (a + i); // { dg-warning "\\\[-Wuninitialized" }
+}
+
+void nowarn_struct_assign_fpcri (void)
+{
+ struct { int a, b; } s;
+ s.a = 0;
+ fpcri (&s.a);
+}
+
+void warn_struct_assign_fpcri (void)
+{
+ struct { int a, b; } s;
+ s.a = 0;
+ fpcri (&s.b); // { dg-warning "\\\[-Wuninitialized" }
+}
+
+void nowarn_struct_init_fpcri (void)
+{
+ struct { int a, b; } s = { 0 };
+ fpcri (&s.a);
+ fpcri (&s.b);
+}
+
+void nowarn_struct_compound_fpcri (void)
+{
+ struct S { int a, b; };
+ fpcri (&(struct S){ }.a);
+ fpcri (&(struct S){ }.b);
+}
+
+
+void nowarn_scalar_fpcri1_2 (void)
+{
+ int i;
+ fpcri1_2 (&i, 0);
+}
+
+void nowarn_array_assign_fpcri1_2 (void)
+{
+ int a[2];
+ a[0] = 0;
+ fpcri1_2 (a, 1);
+}
+
+void nowarn_array_assign_fpcri1_2_plus_cst (void)
+{
+ int a[3];
+ a[1] = 0;
+ fpcri1_2 (a + 1, 1);
+}
+
+void nowarn_array_init_fpcri1_2 (void)
+{
+ int a[4] = { 0 };
+ fpcri1_2 (a, 2);
+}
+
+void warn_array_fpcri1_2_rd1 (void)
+{
+ int a[4];
+ fpcri1_2 (a, 1); // { dg-warning "\\\[-Wuninitialized" }
+}
+
+void warn_array_fpcri1_2_rd2 (void)
+{
+ int a[4];
+ fpcri1_2 (a, 2); // { dg-warning "\\\[-Wuninitialized" }
+}
diff --git a/gcc/testsuite/gcc.dg/uninit-34.c b/gcc/testsuite/gcc.dg/uninit-34.c
new file mode 100644
index 00000000000..9de618347eb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-34.c
@@ -0,0 +1,58 @@
+/* PR middle-end/10138 - warn for uninitialized arrays passed as const*
+ arguments
+ Verify that passing pointers to uninitialized objects to arguments
+ to functions declared with attribute access is diagnosed where expected.
+ { dg-do compile }
+ { dg-options "-O -Wall" } */
+
+#define RW(...) __attribute__ ((access (read_write, __VA_ARGS__)))
+
+RW (1) RW (3) void
+f4pi (int*, int*, int*, int*); // { dg-message "in a call to 'f4pi' declared with attribute 'access \\\(read_write, \[13\]\\\)'" }
+
+
+void nowarn_scalar (void)
+{
+ int i1 = 0, i2, i3 = 1, i4;
+ f4pi (&i1, &i2, &i3, &i4);
+}
+
+void warn_scalar_1 (void)
+{
+ int i1; // { dg-message "declared here" }
+ int i2, i3 = 1, i4;
+
+ f4pi (&i1, &i2, &i3, &i4); // { dg-warning "'i1' may be used uninitialized" }
+}
+
+void warn_scalar_2 (void)
+{
+ int j1 = 0, j2, j4;
+ int j3;
+
+ f4pi (&j1, &j2, &j3, &j4); // { dg-warning "'j3' may be used uninitialized" }
+}
+
+
+void nowarn_array_init (void)
+{
+ int a1[4] = { 0 }, a2[5], a3[6] = { 0 }, a4[7];
+
+ f4pi (a1, a2, a3, a4);
+}
+
+void warn_array_1 (void)
+{
+ int a1[4]; // { dg-message "'a1' declared here" }
+ int a2[5], a3[6] = { 0 }, a4[7];
+
+ f4pi (a1, a2, a3, a4); // { dg-warning "'a1' may be used uninitialized" }
+}
+
+void warn_array_2 (void)
+{
+ int a1[4] = { 0 }, a2[5], a4[7];
+ int a3[6]; // { dg-message "'a3' declared here" }
+
+ f4pi (a1, a2, a3, a4); // { dg-warning "'a3' may be used uninitialized" }
+}
diff --git a/gcc/testsuite/gcc.dg/uninit-36.c b/gcc/testsuite/gcc.dg/uninit-36.c
new file mode 100644
index 00000000000..f6307ce5913
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-36.c
@@ -0,0 +1,238 @@
+/* PR middle-end/10138 - warn for uninitialized arrays passed as const*
+ arguments
+ Verify that passing pointers to uninitialized objects to const
+ arguments to built-ins is diagnosed where expected.
+ { dg-do compile }
+ { dg-options "-O -Wall" }
+ { dg-require-effective-target alloca } */
+
+typedef __SIZE_TYPE__ size_t;
+
+void* alloca (size_t);
+void* malloc (size_t);
+void* realloc (void*, size_t);
+
+void* memcpy (void*, const void*, size_t);
+char* strcpy (char*, const char*);
+size_t strlen (const char*);
+
+void sink (void*);
+
+void nowarn_array_memcpy (void *d, unsigned n)
+{
+ int a[2];
+ /* Diagnose this? */
+ memcpy (d, a, n /* Non-constant to avoid folding into MEM_REF. */);
+}
+
+void nowarn_array_plus_cst_memcpy (void *d, unsigned n)
+{
+ int a[3];
+ /* Diagnose this? */
+ memcpy (d, a + 1, n);
+}
+
+void nowarn_array_plus_var_memcpy (void *d, unsigned n, int i)
+{
+ int a[4];
+ /* Diagnose this? */
+ memcpy (d, a + i, n);
+}
+
+void nowarn_array_assign_memcpy (char *d, unsigned n)
+{
+ int a[3];
+ a[1] = 3;
+ memcpy (d, a, n);
+}
+
+void nowarn_array_init_memcpy (char *d, unsigned n)
+{
+ int a[4] = { 0 };
+ memcpy (d, a, n);
+}
+
+void nowarn_array_compound_memcpy (void *d, unsigned n)
+{
+ memcpy (d, (int[2]){ 0 }, n);
+}
+
+void nowarn_struct_assign_memcpy (void *d, unsigned n)
+{
+ struct S { int a, b, c, d; } s;
+ s.b = 1;
+ s.d = 2;
+ memcpy (d, &s, n);
+}
+
+
+void nowarn_array_init_strcpy (char *d[], unsigned n)
+{
+ char a[8] = "012";
+
+ strcpy (d[0], a);
+ strcpy (d[1], a + 1);
+ strcpy (d[1], a + 2);
+ strcpy (d[1], a + 3);
+ strcpy (d[1], a + 4);
+ strcpy (d[1], a + 5);
+ strcpy (d[1], a + 6);
+ strcpy (d[1], a + 7);
+}
+
+
+void nowarn_array_assign_strcpy (char *d[], unsigned n)
+{
+ char a[8];
+ a[0] = '0';
+ a[1] = '1';
+ a[2] = '2';
+ a[3] = '\0';
+
+ strcpy (d[0], a);
+ strcpy (d[1], a + 1);
+ strcpy (d[1], a + 2);
+ strcpy (d[1], a + 3);
+}
+
+void warn_array_plus_cst_strcpy (char *d, unsigned n)
+{
+ char a[8];
+ a[0] = '1';
+ a[1] = '2';
+ a[2] = '3';
+ a[3] = '\0';
+
+ strcpy (d, a + 4); // { dg-warning "\\\[-Wuninitialized" }
+ strcpy (d, a + 5); // { dg-warning "\\\[-Wuninitialized" }
+ strcpy (d, a + 6); // { dg-warning "\\\[-Wuninitialized" }
+ strcpy (d, a + 7); // { dg-warning "\\\[-Wuninitialized" }
+}
+
+void nowarn_array_plus_var_strcpy (char *d, int i)
+{
+ char a[8];
+ a[0] = '1';
+ a[1] = '2';
+ a[2] = '3';
+ a[3] = '\0';
+
+ strcpy (d, a + i);
+}
+
+
+size_t nowarn_array_assign_strlen (const char *s)
+{
+ char a[8];
+ a[0] = s[0];
+ a[1] = s[1];
+ a[2] = s[2];
+ a[3] = s[3];
+
+ size_t n = 0;
+
+ n += strlen (a);
+ n += strlen (a + 1);
+ n += strlen (a + 2);
+ n += strlen (a + 3);
+ return n;
+}
+
+size_t warn_array_plus_cst_strlen (const char *s)
+{
+ char a[8];
+ a[0] = s[0];
+ a[1] = s[1];
+ a[2] = s[2];
+ a[3] = s[3];
+
+ return strlen (a + 4); // { dg-warning "\\\[-Wuninitialized" }
+}
+
+size_t nowarn_array_plus_var_strlen (const char *s, int i)
+{
+ char a[8];
+ a[0] = s[0];
+ a[1] = s[1];
+ a[2] = s[2];
+ a[3] = s[3];
+
+ return strlen (a + i);
+}
+
+
+size_t nowarn_alloca_assign_strlen (int i)
+{
+ char *p = (char*)alloca (8);
+ p[i] = '\0';
+ return strlen (p);
+}
+
+size_t nowarn_alloca_escape_strlen (int i)
+{
+ char *p = (char*)alloca (8);
+ sink (p);
+ return strlen (p);
+}
+
+size_t warn_alloca_strlen (void)
+{
+ char *p = (char*)alloca (8);
+ return strlen (p); // { dg-warning "\\\[-Wuninitialized" }
+}
+
+
+size_t nowarn_malloc_assign_strlen (int i)
+{
+ char *p = (char*)malloc (8);
+ p[i] = '\0';
+ return strlen (p);
+}
+
+size_t nowarn_malloc_escape_strlen (int i)
+{
+ char *p = (char*)malloc (8);
+ sink (p);
+ return strlen (p);
+}
+
+size_t warn_malloc_strlen (void)
+{
+ char *p = (char*)malloc (8);
+ return strlen (p); // { dg-warning "\\\[-Wuninitialized" }
+}
+
+
+size_t nowarn_realloc_strlen (void *p)
+{
+ char *q = (char*)realloc (p, 8);
+ return strlen (q);
+}
+
+
+size_t nowarn_vla_assign_strlen (int n, int i)
+{
+ char vla[n];
+ vla[i] = '\0';
+ return strlen (vla);
+}
+
+size_t nowarn_vla_strcpy_strlen (int n, const char *s, int i)
+{
+ char vla[n];
+ strcpy (vla, s);
+ return strlen (vla + i);
+}
+
+size_t nowarn_vla_escape_strlen (int n, int i)
+{
+ char vla[n];
+ sink (vla);
+ return strlen (vla);
+}
+
+size_t warn_vla_strlen (unsigned n)
+{
+ char vla[n];
+ return strlen (vla); // { dg-warning "\\\[-Wuninitialized" }
+}
diff --git a/gcc/testsuite/gcc.dg/uninit-B-O0.c b/gcc/testsuite/gcc.dg/uninit-B-O0.c
index 5557ace6f8d..b01e4fa945a 100644
--- a/gcc/testsuite/gcc.dg/uninit-B-O0.c
+++ b/gcc/testsuite/gcc.dg/uninit-B-O0.c
@@ -9,7 +9,7 @@ void
baz (void)
{
int i;
- if (i) /* { dg-warning "'i' is used uninitialized in this function" } */
+ if (i) /* { dg-warning "'i' is used uninitialized" } */
bar (i);
foo (&i);
}
diff --git a/gcc/testsuite/gcc.dg/uninit-I-O0.c b/gcc/testsuite/gcc.dg/uninit-I-O0.c
index 761f65b485b..e4b68ba47b1 100644
--- a/gcc/testsuite/gcc.dg/uninit-I-O0.c
+++ b/gcc/testsuite/gcc.dg/uninit-I-O0.c
@@ -4,5 +4,5 @@
int sys_msgctl (void)
{
struct { int mode; } setbuf;
- return setbuf.mode; /* { dg-warning "'setbuf\.mode' is used uninitialized in this function" } */
+ return setbuf.mode; /* { dg-warning "'setbuf\.mode' is used uninitialized" } */
}
diff --git a/gcc/testsuite/gcc.dg/uninit-pr19430-O0.c b/gcc/testsuite/gcc.dg/uninit-pr19430-O0.c
index 832aeb30bec..e9e264deb5a 100644
--- a/gcc/testsuite/gcc.dg/uninit-pr19430-O0.c
+++ b/gcc/testsuite/gcc.dg/uninit-pr19430-O0.c
@@ -6,7 +6,7 @@ extern void baz (int *);
int
foo (int i)
{
- int j; /* { dg-warning "'j' may be used uninitialized in this function" "uninitialized" { xfail *-*-* } } */
+ int j; /* { dg-warning "'j' may be used uninitialized" "uninitialized" { xfail *-*-* } } */
if (bar (i)) {
baz (&j);
@@ -18,7 +18,7 @@ foo (int i)
int foo2( void ) {
int rc;
- return rc; /* { dg-warning "'rc' is used uninitialized in this function" } */
+ return rc; /* { dg-warning "'rc' is used uninitialized" } */
*&rc = 0;
}
@@ -27,16 +27,16 @@ void frob(int *pi);
int main(void)
{
- int i;
- printf("i = %d\n", i); /* { dg-warning "'i' is used uninitialized in this function" } */
+ int i;
+ printf("i = %d\n", i); /* { dg-warning "'i' is used uninitialized" } */
frob(&i);
return 0;
}
void foo3(int*);
-void bar3(void) {
- int x;
- if(x) /* { dg-warning "'x' is used uninitialized in this function" } */
- foo3(&x);
+void bar3(void) {
+ int x;
+ if(x) /* { dg-warning "'x' is used uninitialized" } */
+ foo3(&x);
}
diff --git a/gcc/testsuite/gcc.dg/uninit-pr19430.c b/gcc/testsuite/gcc.dg/uninit-pr19430.c
index e00f3138045..417cdc63314 100644
--- a/gcc/testsuite/gcc.dg/uninit-pr19430.c
+++ b/gcc/testsuite/gcc.dg/uninit-pr19430.c
@@ -5,9 +5,9 @@ extern void baz (int *);
int
foo (int i)
{
- int j; /* { dg-warning "'j' may be used uninitialized in this function" "uninitialized" { xfail *-*-* } } */
+ int j; /* { dg-warning "'j' may be used uninitialized" "uninitialized" { xfail *-*-* } } */
- if (bar (i)) {
+ if (bar (i)) {
baz (&j);
} else {
}
@@ -19,7 +19,7 @@ foo (int i)
int foo2( void ) {
int rc;
- return rc; /* { dg-warning "'rc' is used uninitialized in this function" } */
+ return rc; /* { dg-warning "'rc' is used uninitialized" } */
*&rc = 0;
}
@@ -28,16 +28,16 @@ void frob(int *pi);
int main(void)
{
- int i;
- printf("i = %d\n", i); /* { dg-warning "'i' is used uninitialized in this function" } */
+ int i;
+ printf("i = %d\n", i); /* { dg-warning "'i' is used uninitialized" } */
frob(&i);
return 0;
}
void foo3(int*);
-void bar3(void) {
- int x;
- if(x) /* { dg-warning "'x' is used uninitialized in this function" "uninitialized" } */
- foo3(&x);
+void bar3(void) {
+ int x;
+ if(x) /* { dg-warning "'x' is used uninitialized" "uninitialized" } */
+ foo3(&x);
}
diff --git a/gcc/testsuite/gcc.dg/uninit-pr95136.c b/gcc/testsuite/gcc.dg/uninit-pr95136.c
new file mode 100644
index 00000000000..47d16c5bbba
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-pr95136.c
@@ -0,0 +1,63 @@
+/* PR middle-end/95136 - missing -Wuninitialized on an array access with
+ a variable offset
+ { dg-do compile }
+ { dg-options "-O -Wall" } */
+
+#define NOIPA __attribute__ ((noipa))
+
+NOIPA int a1_addr_varidx_plus_cst (int i)
+{
+ int a[4]; // { dg-message "'a' declared here" }
+ int *p = &a[i + 1];
+ return *p; // { dg-warning "'a|a\\\[<unknown>]' is used uninitialized" }
+}
+
+NOIPA int a1_plus_addr_varidx_cst (int i)
+{
+ int a[4]; // { dg-message "'a' declared here" }
+ int *p = &a[i] + 1;
+ return *p; // { dg-warning "'a' is used uninitialized" }
+}
+
+NOIPA int a1_plus_addr_cstidx_var (int i)
+{
+ int a[4]; // { dg-message "'a' declared here" }
+ int *p = &a[1] + i;
+ return *p; // { dg-warning "'a' is used uninitialized" }
+}
+
+NOIPA int a1_plus_addr_varidx_var (int i, int j)
+{
+ int a[4]; // { dg-message "'a' declared here" }
+ int *p = &a[i] + j;
+ return *p; // { dg-warning "'a' is used uninitialized" }
+}
+
+
+NOIPA int a2_addr_varidx_plus_cst (int i, int j)
+{
+ int a[4][4]; // { dg-message "'a' declared here" }
+ int *p = &a[i + 1][j + 1];
+ return *p; // { dg-warning "'a|a\\\[<unknown>]\\\[<unknown>]' is used uninitialized" }
+}
+
+NOIPA int a2_plus_addr_varidx_cst (int i, int j)
+{
+ int a[4][4]; // { dg-message "'a' declared here" }
+ int *p = &a[i][j] + 1;
+ return *p; // { dg-warning "'a' is used uninitialized" }
+}
+
+NOIPA int a2_plus_addr_cstidx_var (int i)
+{
+ int a[4][4]; // { dg-message "'a' declared here" }
+ int *p = &a[1][1] + i;
+ return *p; // { dg-warning "'a' is used uninitialized" }
+}
+
+NOIPA int a2_plus_addr_varidx_var (int i, int j, int k)
+{
+ int a[4][4]; // { dg-message "'a' declared here" }
+ int *p = &a[i][j] + k;
+ return *p; // { dg-warning "'a' is used uninitialized" }
+}
diff --git a/gcc/testsuite/gcc.dg/var-expand3.c b/gcc/testsuite/gcc.dg/var-expand3.c
index dce6ec11c82..b81cef04538 100644
--- a/gcc/testsuite/gcc.dg/var-expand3.c
+++ b/gcc/testsuite/gcc.dg/var-expand3.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target { powerpc*-*-* && vmx_hw } } }} */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
/* { dg-options "-O2 -funroll-loops -ffast-math -fvariable-expansion-in-unroller -maltivec -fdump-rtl-loop2_unroll" } */
#include "altivec.h"
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-10.c b/gcc/testsuite/gcc.dg/vect/bb-slp-10.c
index 1f9b917dcd2..ad6f878e407 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-10.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-10.c
@@ -49,6 +49,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump "bad data alignment in basic block" "slp2" { target { ! vect_element_align } } } } */
+/* { dg-final { scan-tree-dump "unsupported unaligned access" "slp2" { target { ! vect_element_align } } } } */
/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" { target vect_element_align } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-22.c b/gcc/testsuite/gcc.dg/vect/bb-slp-22.c
index 6dc2375f5d1..b5316514f42 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-22.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-22.c
@@ -63,6 +63,5 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" { target { ! {vect_int_mult } } } } } */
-/* { dg-final { scan-tree-dump-times "basic block vectorized" 2 "slp2" { target vect_int_mult } } } */
-
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 2 "slp2" } } */
+/* { dg-final { scan-tree-dump "vectorizing SLP node starting from: _\[0-9\]+ = _\[0-9\]+ \\\* a0" "slp2" { target vect_int_mult } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-34.c b/gcc/testsuite/gcc.dg/vect/bb-slp-34.c
index ffd6ce25f64..c51c7706adc 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-34.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-34.c
@@ -32,5 +32,4 @@ int main()
return 0;
}
-/* ??? XFAILed because we access "excess" elements with the permutation. */
-/* { dg-final { scan-tree-dump "basic block vectorized" "slp2" { target vect_perm xfail { ! { aarch64*-*-* arm*-*-* } } } } } */
+/* { dg-final { scan-tree-dump "basic block vectorized" "slp2" { target vect_perm } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-44.c b/gcc/testsuite/gcc.dg/vect/bb-slp-44.c
new file mode 100644
index 00000000000..dfa0a5eaaab
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-44.c
@@ -0,0 +1,41 @@
+/* { dg-do run } */
+
+typedef struct {
+ unsigned long a;
+ unsigned long b;
+ unsigned long c;
+} data_o;
+typedef struct {
+ unsigned long c;
+ unsigned long gap1;
+ unsigned long b;
+ unsigned long gap2;
+ unsigned long a;
+ unsigned long x;
+} data_i;
+
+volatile unsigned long gx;
+void __attribute__((noipa))
+bar(unsigned long x)
+{
+ gx = x;
+}
+
+void __attribute__((noipa))
+foo(data_o *o, data_i *i)
+{
+ o->a = i->a;
+ o->b = i->b;
+ o->c = i->c;
+ bar (i->x);
+}
+
+int main()
+{
+ unsigned long data[9];
+ if ((__UINTPTR_TYPE__)data & 15 != 0)
+ foo ((data_o *)&data[6], (data_i *)data);
+ else
+ foo ((data_o *)data, (data_i *)&data[3]);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr68892.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr68892.c
index 216883fc0c4..8cd3a6a1274 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-pr68892.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr68892.c
@@ -13,7 +13,8 @@ void foo(void)
b[3] = a[3][0];
}
-/* ??? The profitability check is not reached because we give up on the
- gaps we access earlier. */
+/* ??? Due to the gaps we fall back to scalar loads which makes the
+ vectorization profitable. */
/* { dg-final { scan-tree-dump "not profitable" "slp2" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Basic block will be vectorized" 0 "slp2" } } */
+/* { dg-final { scan-tree-dump-times "BB vectorization with gaps at the end of a load is not supported" 1 "slp2" } } */
+/* { dg-final { scan-tree-dump-times "Basic block will be vectorized" 1 "slp2" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c
index e02502a3fc1..f5dc5340792 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c
@@ -19,7 +19,9 @@ void foo ()
}
/* We may not vectorize the store to x[] as it accesses c out-of bounds
- but we do want to vectorize the other two store groups. */
+ but we do want to vectorize the other two store groups. But we may
+ end up using scalar loads to vectorize the last group. */
/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" } } */
-/* { dg-final { scan-tree-dump-times "x\\\[\[0-1\]\\\] = " 2 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "BB vectorization with gaps at the end of a load is not supported" 1 "slp2" } } */
+/* { dg-final { scan-tree-dump-times " = c\\\[4\\\];" 1 "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr95271.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr95271.c
new file mode 100644
index 00000000000..f6e266cce5c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr95271.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-additional-options "-march=cooperlake" { target x86_64-*-* i?86-*-* } } */
+
+#include <stdint.h>
+
+int a;
+struct b c;
+int64_t d;
+struct b {
+ uint64_t address;
+ uint64_t e;
+};
+void f()
+{
+ d = (int64_t)(&a)[0] << 56 | (int64_t)((unsigned char *)&a)[1] << 48 |
+ (int64_t)((unsigned char *)&a)[2] << 40 |
+ (int64_t)((unsigned char *)&a)[3] << 32 |
+ (int64_t)((unsigned char *)&a)[4] << 24 | ((unsigned char *)&a)[5] << 16 |
+ ((unsigned char *)&a)[6] << 8 | ((unsigned char *)&a)[7];
+ c.address = c.e = d;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr95335.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr95335.c
new file mode 100644
index 00000000000..42a70222e12
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr95335.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+float *a;
+float b;
+void
+fn1(float p1[][3])
+{
+ float c, d, e, f;
+ f = a[1] * a[1] * d;
+ b = a[1] * a[2] * d;
+ p1[1][1] = f + c;
+ p1[1][2] = b + e;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr95839-2.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr95839-2.c
new file mode 100644
index 00000000000..49e75d8c95c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr95839-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+/* { dg-additional-options "-w -Wno-psabi" } */
+
+typedef double __attribute__((vector_size(16))) v2df;
+
+v2df f(v2df a, v2df b)
+{
+ return (v2df){a[0] + b[0], a[1] + b[1]};
+}
+
+v2df g(v2df a, v2df b)
+{
+ return (v2df){a[0] + b[1], a[1] + b[0]};
+}
+
+/* Verify we manage to vectorize this with using the original vectors
+ and do not end up with any vector CTORs. */
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 2 "slp2" } } */
+/* { dg-final { scan-tree-dump-not "vect_cst" "slp2" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr95839.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr95839.c
new file mode 100644
index 00000000000..0bfba01452d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr95839.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-additional-options "-w -Wno-psabi" } */
+
+typedef float __attribute__((vector_size(16))) v4f32;
+
+v4f32 f(v4f32 a, v4f32 b)
+{
+ /* Check that we vectorize this CTOR without any loads. */
+ return (v4f32){a[0] + b[0], a[1] + b[1], a[2] + b[2], a[3] + b[3]};
+}
+
+/* { dg-final { scan-tree-dump "basic block vectorized" "slp2" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr95866.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr95866.c
new file mode 100644
index 00000000000..5de46719101
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr95866.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
+
+int x[4];
+int j[4];
+void foo()
+{
+ x[0] = (x[0] << j[0]) + j[0];
+ x[1] = (x[1] << j[0]) + j[1];
+ x[2] = (x[2] << j[0]) + j[2];
+ x[3] = (x[3] << j[0]) + j[3];
+}
+
+/* The scalar shift argument should be extracted from the available vector. */
+/* { dg-final { scan-tree-dump "BIT_FIELD_REF" "slp2" } } */
+/* { dg-final { scan-tree-dump "basic block vectorized" "slp2" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c
index 9cf614165bb..9a75b987d6d 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c
@@ -20,6 +20,6 @@ void dacP98FillRGBMap (unsigned char *pBuffer)
}
}
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { target vect_interleave
-} } } */
-
+/* Even with SSE2 we should only generate one IV for the induction. */
+/* { dg-final { scan-tree-dump-times "# vect_vec_iv" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-slp-2.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-slp-2.c
new file mode 100644
index 00000000000..1b7ac34ccaa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-slp-2.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fdump-tree-slp-details" } */
+
+int a[4], b[4];
+void foo()
+{
+ a[0] = b[0] / 7;
+ a[1] = b[1] / 7;
+ a[2] = b[2] / 7;
+ a[3] = b[3] / 7;
+}
+
+/* We should cost the original division stmt, not the scalar pattern stmts. */
+/* { dg-final { scan-tree-dump-times " / 7 1 times scalar_stmt costs" 4 "slp2" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr71264.c b/gcc/testsuite/gcc.dg/vect/pr71264.c
index 72d90086ec5..5f6407a2411 100644
--- a/gcc/testsuite/gcc.dg/vect/pr71264.c
+++ b/gcc/testsuite/gcc.dg/vect/pr71264.c
@@ -19,5 +19,5 @@ void test(uint8_t *ptr, uint8_t *mask)
}
}
-/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" {
-xfail sparc*-*-* } } } */
+/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" { xfail sparc*-*-* } } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/pr95272.c b/gcc/testsuite/gcc.dg/vect/pr95272.c
new file mode 100644
index 00000000000..47698ff3e56
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr95272.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+enum { a = 5, b };
+typedef struct {
+ int c[b];
+} d;
+extern d e[];
+int f;
+int g[6];
+void h() {
+ int i;
+ for (; f; f++) {
+ i = 0;
+ for (; i < b; i++)
+ if (e[f].c[i])
+ g[i] = e[f].c[i];
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/vect/pr95495.c b/gcc/testsuite/gcc.dg/vect/pr95495.c
new file mode 100644
index 00000000000..a961aef59fc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr95495.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+typedef struct {
+ int a;
+ int b;
+} c;
+int d, f, g;
+c e[4];
+void
+h()
+{
+ for (; f; f++) {
+ g += e[f].a >> 1 | e[f].a & 1;
+ d += e[f].b >> 1 | e[f].b & 1;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/vect/pr95539.c b/gcc/testsuite/gcc.dg/vect/pr95539.c
new file mode 100644
index 00000000000..de3b393879e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr95539.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+typedef unsigned short uint16_t;
+typedef short __v8hi __attribute__ ((__vector_size__ (16)));
+typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__))
+_mm_set_epi16 (short __q7, short __q6, short __q5, short __q4,
+ short __q3, short __q2, short __q1, short __q0)
+{
+ return __extension__ (__m128i)(__v8hi){
+ __q0, __q1, __q2, __q3, __q4, __q5, __q6, __q7 };
+}
+void gcm_HashMult_hw(__m128i *x, const unsigned char *buf, unsigned int count)
+{
+ unsigned i;
+ __m128i bin __attribute__((aligned(16)));
+ for (i = 0; i < count; i++, buf += 16)
+ {
+ bin = _mm_set_epi16(((uint16_t)buf[0] << 8) | buf[1],
+ ((uint16_t)buf[2] << 8) | buf[3],
+ ((uint16_t)buf[4] << 8) | buf[5],
+ ((uint16_t)buf[6] << 8) | buf[7],
+ ((uint16_t)buf[8] << 8) | buf[9],
+ ((uint16_t)buf[10] << 8) | buf[11],
+ ((uint16_t)buf[12] << 8) | buf[13],
+ ((uint16_t)buf[14] << 8) | buf[15]);
+ *(x++) = bin;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/vect/pr95570.c b/gcc/testsuite/gcc.dg/vect/pr95570.c
new file mode 100644
index 00000000000..b9362614004
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr95570.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-march=armv8.2-a+sve -msve-vector-bits=256 -mstrict-align -fwrapv" { target aarch64*-*-* } } */
+
+int x[8][32];
+
+void
+foo (int start)
+{
+ for (int i = start; i < start + 16; i++)
+ x[start][i] = i;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/pr95856.c b/gcc/testsuite/gcc.dg/vect/pr95856.c
new file mode 100644
index 00000000000..19a86a62d95
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr95856.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+typedef struct {
+ float xmin, xmax;
+} rctf;
+
+typedef struct {
+ rctf tot;
+} View2D;
+
+View2D graph_main_area_draw_v2d;
+
+void get_graph_keyframe_extents();
+
+void
+graph_main_area_draw() {
+ get_graph_keyframe_extents();
+ graph_main_area_draw_v2d.tot.xmin -= 10.0f;
+ graph_main_area_draw_v2d.tot.xmax += 10.0f;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/pr95897.c b/gcc/testsuite/gcc.dg/vect/pr95897.c
new file mode 100644
index 00000000000..a17b72dd040
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr95897.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+double foo (double x, int n)
+{
+ double s = 0.;
+ for (int i = 0; i < n; ++i)
+ {
+ s += x;
+ s += x;
+ s += x;
+ }
+ return s;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/pr95916.c b/gcc/testsuite/gcc.dg/vect/pr95916.c
new file mode 100644
index 00000000000..61b8ca3fa0c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr95916.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-O3" } */
+
+extern short var_3, var_8;
+extern int var_5;
+extern char var_10;
+extern int arr_99[][16];
+void test()
+{
+ for (; 0 < var_10;)
+ for (long a = var_8;; a++)
+ arr_99[4][a] = var_3 << var_5;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/slp-45.c b/gcc/testsuite/gcc.dg/vect/slp-45.c
index d83472ca095..1e35d354203 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-45.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-45.c
@@ -77,5 +77,4 @@ int main()
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 13 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { ! vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 13 "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-46.c b/gcc/testsuite/gcc.dg/vect/slp-46.c
new file mode 100644
index 00000000000..17dfa285ec1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-46.c
@@ -0,0 +1,96 @@
+/* { dg-require-effective-target vect_double } */
+
+#include "tree-vect.h"
+
+double x[1024], y[1024];
+
+void __attribute__((noipa)) foo()
+{
+ for (int i = 0; i < 512; ++i)
+ {
+ x[2*i] = y[i];
+ x[2*i+1] = y[i];
+ }
+}
+
+void __attribute__((noipa)) bar()
+{
+ for (int i = 0; i < 512; ++i)
+ {
+ x[2*i] = y[2*i];
+ x[2*i+1] = y[2*i];
+ }
+}
+
+void __attribute__((noipa)) baz()
+{
+ for (int i = 0; i < 512; ++i)
+ {
+ x[2*i] = y[511-i];
+ x[2*i+1] = y[511-i];
+ }
+}
+
+void __attribute__((noipa)) boo()
+{
+ for (int i = 0; i < 512; ++i)
+ {
+ x[2*i] = y[2*(511-i)];
+ x[2*i+1] = y[2*(511-i)];
+ }
+}
+
+int
+main ()
+{
+ check_vect ();
+
+ for (int i = 0; i < 1024; ++i)
+ {
+ x[i] = 0;
+ y[i] = i;
+ __asm__ volatile ("");
+ }
+
+ foo ();
+ for (int i = 0; i < 1024; ++i)
+ if (x[i] != y[i/2])
+ abort ();
+
+ for (int i = 0; i < 1024; ++i)
+ {
+ x[i] = 0;
+ __asm__ volatile ("");
+ }
+
+ bar ();
+ for (int i = 0; i < 1024; ++i)
+ if (x[i] != y[2*(i/2)])
+ abort ();
+
+ for (int i = 0; i < 1024; ++i)
+ {
+ x[i] = 0;
+ __asm__ volatile ("");
+ }
+
+ baz ();
+ for (int i = 0; i < 1024; ++i)
+ if (x[i] != y[511 - i/2])
+ abort ();
+
+ for (int i = 0; i < 1024; ++i)
+ {
+ x[i] = 0;
+ __asm__ volatile ("");
+ }
+
+ boo ();
+ for (int i = 0; i < 1024; ++i)
+ if (x[i] != y[2*(511 - i/2)])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-47.c b/gcc/testsuite/gcc.dg/vect/slp-47.c
new file mode 100644
index 00000000000..7b2ddf664df
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-47.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+
+int x[1024], y[1024];
+
+void __attribute__((noipa)) foo()
+{
+ for (int i = 0; i < 512; ++i)
+ {
+ x[2*i] = y[1023 - (2*i)];
+ x[2*i+1] = y[1023 - (2*i+1)];
+ }
+}
+
+void __attribute__((noipa)) bar()
+{
+ for (int i = 0; i < 512; ++i)
+ {
+ x[2*i] = y[1023 - (2*i+1)];
+ x[2*i+1] = y[1023 - (2*i)];
+ }
+}
+
+int
+main ()
+{
+ check_vect ();
+
+ for (int i = 0; i < 1024; ++i)
+ {
+ x[i] = 0;
+ y[i] = i;
+ __asm__ volatile ("");
+ }
+
+ foo ();
+ for (int i = 0; i < 1024; ++i)
+ if (x[i] != y[1023 - i])
+ abort ();
+
+ for (int i = 0; i < 1024; ++i)
+ {
+ x[i] = 0;
+ __asm__ volatile ("");
+ }
+
+ bar ();
+ for (int i = 0; i < 1024; ++i)
+ if (x[i] != y[1023 - i^1])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-48.c b/gcc/testsuite/gcc.dg/vect/slp-48.c
new file mode 100644
index 00000000000..0b327aede8e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-48.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+
+int x[1024], y[1024];
+
+void __attribute__((noipa)) foo()
+{
+ for (int i = 0; i < 512; ++i)
+ {
+ x[1023 - (2*i+1)] = y[2*i];
+ x[1023 - (2*i)] = y[2*i+1];
+ }
+}
+
+void __attribute__((noipa)) bar()
+{
+ for (int i = 0; i < 512; ++i)
+ {
+ x[1023 - (2*i+1)] = y[2*i+1];
+ x[1023 - (2*i)] = y[2*i];
+ }
+}
+
+int
+main ()
+{
+ check_vect ();
+
+ for (int i = 0; i < 1024; ++i)
+ {
+ x[i] = 0;
+ y[i] = i;
+ __asm__ volatile ("");
+ }
+
+ foo ();
+ for (int i = 0; i < 1024; ++i)
+ if (x[i] != y[1023 - i^1])
+ abort ();
+
+ for (int i = 0; i < 1024; ++i)
+ {
+ x[i] = 0;
+ __asm__ volatile ("");
+ }
+
+ bar ();
+ for (int i = 0; i < 1024; ++i)
+ if (x[i] != y[1023 - i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-109.c b/gcc/testsuite/gcc.dg/vect/vect-109.c
index ac5d0827899..fe7ea6c420f 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-109.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-109.c
@@ -77,6 +77,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_element_align } } } */
-/* { dg-final { scan-tree-dump-times "not vectorized: unsupported unaligned store" 2 "vect" { xfail vect_element_align } } } */
+/* { dg-final { scan-tree-dump-times "unsupported unaligned access" 2 "vect" { xfail vect_element_align } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align xfail { ! vect_unaligned_possible } } } } */
diff --git a/gcc/testsuite/gcc.dg/weak/typeof-2.c b/gcc/testsuite/gcc.dg/weak/typeof-2.c
index 51995ca52fa..afce17f53cb 100644
--- a/gcc/testsuite/gcc.dg/weak/typeof-2.c
+++ b/gcc/testsuite/gcc.dg/weak/typeof-2.c
@@ -42,7 +42,6 @@ int bar3 (int x)
// { dg-final { if [string match s390*-*-* $target_triplet ] {return} } }
// Likewise for CRIS targets.
// { dg-final { if [string match cris-*-* $target_triplet ] {return} } }
-// { dg-final { if [string match crisv32-*-* $target_triplet ] {return} } }
// Likewise for m68k targets.
// { dg-final { if [string match fido-*-* $target_triplet ] {return} } }
// { dg-final { if [string match m68k-*-* $target_triplet ] {return} } }
diff --git a/gcc/testsuite/gcc.misc-tests/arm-isr.c b/gcc/testsuite/gcc.misc-tests/arm-isr.c
index 737f9ffb643..9eff52c7914 100644
--- a/gcc/testsuite/gcc.misc-tests/arm-isr.c
+++ b/gcc/testsuite/gcc.misc-tests/arm-isr.c
@@ -1,3 +1,5 @@
+/* { dg-options "-mgeneral-regs-only" } */
+
extern void abort ();
extern void exit (int);
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-pr94029.c b/gcc/testsuite/gcc.misc-tests/gcov-pr94029.c
index 84d9b9b2749..82b378a84fa 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov-pr94029.c
+++ b/gcc/testsuite/gcc.misc-tests/gcov-pr94029.c
@@ -11,4 +11,4 @@ int main()
return 0;
}
-/* { dg-final { run-gcov remove-gcda gcov-pr94029.c } } */
+/* { dg-final { run-gcov gcov-pr94029.c } } */
diff --git a/gcc/testsuite/gcc.misc-tests/outputs-0.c b/gcc/testsuite/gcc.misc-tests/outputs-0.c
new file mode 100644
index 00000000000..ca2ac4aff42
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/outputs-0.c
@@ -0,0 +1 @@
+int main () {}
diff --git a/gcc/testsuite/gcc.misc-tests/outputs-1.c b/gcc/testsuite/gcc.misc-tests/outputs-1.c
new file mode 100644
index 00000000000..35f19cfbc78
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/outputs-1.c
@@ -0,0 +1,4 @@
+extern void f();
+int main() {
+ f();
+}
diff --git a/gcc/testsuite/gcc.misc-tests/outputs-2.c b/gcc/testsuite/gcc.misc-tests/outputs-2.c
new file mode 100644
index 00000000000..109733d7527
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/outputs-2.c
@@ -0,0 +1,2 @@
+void f() {
+}
diff --git a/gcc/testsuite/gcc.misc-tests/outputs.exp b/gcc/testsuite/gcc.misc-tests/outputs.exp
new file mode 100644
index 00000000000..1e3cd4122a6
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/outputs.exp
@@ -0,0 +1,804 @@
+# Copyright (C) 2005-2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# This file contains a set of test that check that options intended to
+# control the location and name of GCC outputs behave as expected.
+
+load_lib gcc-defs.exp
+
+set b "outputs"
+
+# These tests don't run runtest_file_p consistently if it
+# doesn't return the same values, so disable parallelization
+# of this *.exp file. The first parallel runtest to reach
+# this will run all the tests serially.
+if {![gcc_parallel_test_run_p $b] || [is_remote host]} {
+ return
+}
+gcc_parallel_test_enable 0
+
+# Check for -gsplit-dwarf support. We don't check for .dwo files
+# without it. Test it along with -g, so that we don't even bother
+# with debug info if -gsplit-dwarf is not supported. This avoids
+# having to deal with .dSYM directories, as long as -gsplit-dwarf is
+# not supported on platforms that use .dSYM directories.
+set gsplit_dwarf "-g -gsplit-dwarf"
+if ![check_no_compiler_messages gsplitdwarf object {
+ void foo (void) { }
+} "$gsplit_dwarf"] {
+ set gsplit_dwarf ""
+}
+set gspd [expr { "$gsplit_dwarf" != "" }]
+
+# Check for -flto support. We explicitly test the result to skip
+# tests that use -flto.
+set skip_lto ![check_effective_target_lto]
+if !$skip_lto {
+ set ltop [check_linker_plugin_available]
+}
+
+# Prepare additional options to be used for linking.
+# We do not compile to an executable, because that requires naming an output.
+set link_options ""
+set dest [target_info name]
+foreach i { ldflags libs ldscript } {
+ if {[board_info $dest exists $i]} {
+ set opts [board_info $dest $i]
+ set nopts [gcc_adjust_linker_flags_list $opts]
+ foreach opt $nopts {
+ append link_options " additional_flags=$opt"
+ }
+ }
+}
+if {[board_info $dest exists output_format]} {
+ append link_options " additional_flags=-Wl,-oformat,[board_info $dest output_format]"
+}
+
+# For the test named TEST, run the compiler with SOURCES and OPTS, and
+# look in DIRS for OUTPUTS. SOURCES is a list of suffixes for source
+# files starting with $b in $srcdir/$subdir, OPTS is a string with
+# options to be passed to the compiler, DIRS and OUTPUTS are lists.
+# DIRS is a list of output directories, children before parent, and
+# for each element of DIRS, there should be a corresponding sublist in
+# OUTPUTS. If OUTPUTS has an additional trailing sublist, that's the
+# output list for the current directory.
+
+# Each element of the sublists in OUTPUT is a condition, a file name
+# or glob pattern to be checked for. A condition must start with !,
+# and it applies until the next condition, or through to the end of
+# the sublist. (Use "!0" to disable an earlier condition, use "!!$X"
+# to test for a nonzero X.) If the condition evaluates to false,
+# files covered by it are ignored. Conditions may reference global
+# variables that are imported as such in the block that handles
+# conditions: look for "global gspd ltop" below.
+
+# A name starting with '"' or '$' undergoes expr expansion. If it
+# expands to an empty string, it is ignored. Global variables
+# referenced in such exprs must be imported as such in the block that
+# handles expansion: look for "global aout" below.
+
+# A name starting with a dash or a period is taken as a suffix for
+# global "$b"; with a double dash, or a dash followed by a period, the
+# first dash is replaced with "$b-$b"; names starting with "a--" or
+# "a-." have "$b" inserted after the first dash. The glob pattern may
+# expand to more than one file, but then the test will pass for any
+# number of matches, i.e., it would be safe to use for a.{out,exe} (if
+# it weren't for
+# https://core.tcl-lang.org/tcl/tktview?name=5bbd044812), but .{i,s,o}
+# and .[iso] will pass even if only the .o is present.
+proc outest { test sources opts dirs outputs } {
+ global b srcdir subdir
+ set src {}
+ foreach s $sources {
+ lappend src $srcdir/$subdir/$b$s
+ }
+ foreach f [glob -nocomplain -path $b -- *] {
+ file delete $f
+ }
+ foreach d $dirs {
+ file mkdir $d
+ foreach f [glob -nocomplain -path $d -- *] {
+ file delete $d$f
+ }
+ }
+ set options ""
+ foreach opt [split $opts " "] {
+ append options " additional_flags=$opt"
+ }
+ # Add linker flags if we're linking
+ if {![string match "* -\[ESc\] *" " $opts "]} {
+ global link_options
+ append options "$link_options"
+ }
+ set gcc_output [gcc_target_compile $src "" none "$options"]
+ set outs {}
+ foreach d $dirs olist $outputs {
+ set cond 1
+ foreach og $olist {
+ if { [string index $og 0] == "!" } {
+ global gspd ltop
+ set cond [expr $og]
+ continue
+ }
+ if { !$cond } { continue }
+
+ if { [string match "\[\$\"\]" [string index $og 0]] } {
+ global aout
+ eval set o $og
+ if { "$o" == "" } { continue }
+ } elseif { [string index $og 0] == "-" } then {
+ if { [string index $og 1] == "-" \
+ || [string index $og 1] == "." } then {
+ set o "$b-$b[string range $og 1 end]"
+ } else {
+ set o "$b$og"
+ }
+ } elseif { [string index $og 0] == "." } then {
+ set o "$b$og"
+ } elseif { [string range $og 0 2] == "a--" } then {
+ set o "a-$b-[string range $og 3 end]"
+ } elseif { [string range $og 0 2] == "a-." } then {
+ set o "a-$b.[string range $og 3 end]"
+ } else {
+ set o "$og"
+ }
+ if { [file exists $d$o] } then {
+ pass "$test: $d$o"
+ file delete $d$o
+ } else {
+ set ogl [glob -nocomplain -path $d -- $o]
+ if { $ogl != {} } {
+ pass "$test: $d$o"
+ file delete $ogl
+ } else {
+ fail "$test: $d$o"
+ }
+ }
+ }
+ foreach ol [glob -nocomplain -path $d$b -- *] {
+ lappend outs $ol
+ }
+ foreach ol [glob -nocomplain -path $d -- a{-,.}*] {
+ lappend outs $ol
+ }
+ }
+
+ set outb {}
+ foreach f $outs {
+ file delete $f
+ # collect2 may create <execname>.cdtor* files in -save-temps link tests,
+ # ??? without regard to aux output naming conventions.
+ if ![string match "*.cdtor.*" $f] then {
+ lappend outb $f
+ }
+ }
+ foreach d $dirs {
+ file delete -force $d
+ }
+
+ if { [llength $outb] == 0 } then {
+ pass "$test: extra"
+ } else {
+ fail "$test: extra\n$outb"
+ }
+
+ if { [string equal "$gcc_output" ""] } then {
+ pass "$test: std out"
+ } else {
+ fail "$test: std out\n$gcc_output"
+ }
+
+}
+
+set sing {-0.c}
+set mult {-1.c -2.c}
+
+# Find out the default linker output. We only check for a.out and
+# e.exe; gcc.c, the lto-wrapper and whatnot may have to change if
+# prefixes other than a. might be used. Our tests may have to be
+# adjusted then. Also, there may not be a default. Some linkers
+# error out if -o is not specified.
+proc default_link_name { sources } {
+ global b
+ global srcdir
+ global subdir
+ set src {}
+ foreach s $sources {
+ lappend src $srcdir/$subdir/$b$s
+ }
+
+ set maybe { a.out a.exe }
+ foreach f $maybe {
+ file delete $f
+ }
+
+ global link_options
+ set gcc_output [gcc_target_compile $src "" none "$link_options"]
+
+ foreach f $maybe {
+ if { [file exists $f] } then {
+ file delete $f
+ return $f
+ }
+ }
+
+ return "";
+}
+
+set aout [default_link_name $sing]
+
+# If there is no default linker output, arrange for -o a.out to be
+# specified where we would normally leave it for the linker to use its
+# default.
+if { "$aout" != "" } then {
+ set oaout ""
+} else {
+ set aout a.out
+ set oaout "-o $aout"
+}
+
+# Driver-chosen outputs.
+outest "$b asm default 1" $sing "-S" {} {{-0.s}}
+outest "$b asm default 2" $mult "-S" {} {{-1.s -2.s}}
+
+outest "$b obj default 1" $sing "-c" {} {{-0.o}}
+outest "$b obj default 2" $mult "-c" {} {{-1.o -2.o}}
+
+outest "$b exe default 1" $sing "$oaout" {} {{$aout}}
+outest "$b exe default 2" $mult "$oaout" {} {{$aout}}
+
+# Driver-chosen aux outputs.
+outest "$b asm savetmp 1" $sing "-S -save-temps" {} {{-0.i -0.s}}
+outest "$b asm savetmp 2" $mult "-S -save-temps" {} {{-1.i -1.s -2.i -2.s}}
+outest "$b obj savetmp unnamed1" $sing "-c -save-temps" {} {{-0.i -0.s -0.o}}
+outest "$b obj savetmp unnamed2" $mult "-c -save-temps" {} {{-1.i -1.s -1.o -2.i -2.s -2.o}}
+
+# Aux outputs computed within the driver, based on output name (and
+# input).
+outest "$b cpp savetmp named0" $sing "-E -o $b-0.i -save-temps" {} {{-0.i}}
+outest "$b asm savetmp named0" $sing "-S -o $b-0.s -save-temps" {} {{-0.i -0.s}}
+outest "$b obj savetmp named0" $sing "-c -o $b-0.o -save-temps" {} {{-0.i -0.s -0.o}}
+outest "$b cpp savetmp namedb" $sing "-E -o $b.i -save-temps" {} {{.i}}
+outest "$b asm savetmp namedb" $sing "-S -o $b.s -save-temps" {} {{.i .s}}
+outest "$b obj savetmp namedb" $sing "-c -o $b.o -save-temps" {} {{.i .s .o}}
+
+# When linking, the executable name gets prepended to aux output
+# basenames, except when executable and single input share the same
+# basename.
+outest "$b exe savetmp unnamed1" $sing "-save-temps $oaout" {} {{a--0.i a--0.s a--0.o $aout}}
+outest "$b exe savetmp unnamed2" $mult "-save-temps $oaout" {} {{a--1.i a--1.s a--1.o a--2.i a--2.s a--2.o $aout}}
+outest "$b exe savetmp named0" $sing "-o $b-0.exe -save-temps" {} {{-0.i -0.s -0.o -0.exe}}
+outest "$b exe savetmp namedb" $sing "-o $b.exe -save-temps" {} {{--0.i --0.s --0.o .exe}}
+outest "$b exe savetmp named2" $mult "-o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe}}
+
+# Setting the main output to a dir selects it as the default aux&dump
+# location.
+outest "$b cpp savetmp namedir0" $sing "-E -o o/$b-0.i -save-temps" {o/} {{-0.i} {}}
+outest "$b asm savetmp namedir0" $sing "-S -o o/$b-0.s -save-temps" {o/} {{-0.i -0.s} {}}
+outest "$b obj savetmp namedir0" $sing "-c -o o/$b-0.o -save-temps" {o/} {{-0.i -0.s -0.o} {}}
+outest "$b cpp savetmp namedir" $sing "-E -o o/$b.i -save-temps" {o/} {{.i} {}}
+outest "$b asm savetmp namedir" $sing "-S -o o/$b.s -save-temps" {o/} {{.i .s} {}}
+outest "$b obj savetmp namedir" $sing "-c -o o/$b.o -save-temps" {o/} {{.i .s .o} {}}
+outest "$b exe savetmp namedir0" $sing "-o o/$b-0.exe -save-temps" {o/} {{-0.i -0.s -0.o -0.exe} {}}
+outest "$b exe savetmp namedirb" $sing "-o o/$b.exe -save-temps" {o/} {{--0.i --0.s --0.o .exe} {}}
+outest "$b exe savetmp namedir2" $mult "-o o/$b.exe -save-temps" {o/} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe} {}}
+
+# -save-temps=cwd overrides the aux output location to the current dir.
+outest "$b obj savecwd unnamed1" $sing "-c -save-temps=cwd" {} {{-0.i -0.s -0.o}}
+outest "$b obj savecwd unnamed2" $mult "-c -save-temps=cwd" {} {{-1.i -1.s -1.o -2.i -2.s -2.o}}
+outest "$b cpp savecwd named0" $sing "-E -o $b-0.i -save-temps=cwd" {} {{-0.i}}
+outest "$b asm savecwd named0" $sing "-S -o $b-0.s -save-temps=cwd" {} {{-0.i -0.s}}
+outest "$b obj savecwd named0" $sing "-c -o $b-0.o -save-temps=cwd" {} {{-0.i -0.s -0.o}}
+outest "$b cpp savecwd namedb" $sing "-E -o $b.i -save-temps=cwd" {} {{.i}}
+outest "$b asm savecwd namedb" $sing "-S -o $b.s -save-temps=cwd" {} {{.i .s}}
+outest "$b obj savecwd namedb" $sing "-c -o $b.o -save-temps=cwd" {} {{.i .s .o}}
+outest "$b exe savecwd unnamed1" $sing "-save-temps=cwd $oaout" {} {{a--0.i a--0.s a--0.o $aout}}
+outest "$b exe savecwd unnamed2" $mult "-save-temps=cwd $oaout" {} {{a--1.i a--1.s a--1.o a--2.i a--2.s a--2.o $aout}}
+outest "$b exe savecwd named0" $sing "-o $b-0.exe -save-temps=cwd" {} {{-0.i -0.s -0.o -0.exe}}
+outest "$b exe savecwd namedb" $sing "-o $b.exe -save-temps=cwd" {} {{--0.i --0.s --0.o .exe}}
+outest "$b exe savecwd named2" $mult "-o $b.exe -save-temps=cwd" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe}}
+
+outest "$b cpp savecwd namedir0" $sing "-E -o o/$b-0.i -save-temps=cwd" {o/} {{-0.i} {}}
+outest "$b asm savecwd namedir0" $sing "-S -o o/$b-0.s -save-temps=cwd" {o/} {{-0.s} {-0.i}}
+outest "$b obj savecwd namedir0" $sing "-c -o o/$b-0.o -save-temps=cwd" {o/} {{-0.o} {-0.i -0.s}}
+outest "$b cpp savecwd namedir" $sing "-E -o o/$b.i -save-temps=cwd" {o/} {{.i} {}}
+outest "$b asm savecwd namedir" $sing "-S -o o/$b.s -save-temps=cwd" {o/} {{.s} {.i}}
+outest "$b obj savecwd namedir" $sing "-c -o o/$b.o -save-temps=cwd" {o/} {{.o} {.i .s}}
+outest "$b exe savecwd namedir0" $sing "-o o/$b-0.exe -save-temps=cwd" {o/} {{-0.exe} {-0.i -0.s -0.o}}
+outest "$b exe savecwd namedirb" $sing "-o o/$b.exe -save-temps=cwd" {o/} {{.exe} {--0.i --0.s --0.o}}
+outest "$b exe savecwd namedir2" $mult "-o o/$b.exe -save-temps=cwd" {o/} {{.exe} {--1.i --1.s --1.o --2.i --2.s --2.o}}
+
+# -save-temps=obj overrides the aux output location to that of the
+# main output
+outest "$b obj saveobj unnamed1" $sing "-c -save-temps=obj" {} {{-0.i -0.s -0.o}}
+outest "$b obj saveobj unnamed2" $mult "-c -save-temps=obj" {} {{-1.i -1.s -1.o -2.i -2.s -2.o}}
+outest "$b cpp saveobj named0" $sing "-E -o $b-0.i -save-temps=obj" {} {{-0.i}}
+outest "$b asm saveobj named0" $sing "-S -o $b-0.s -save-temps=obj" {} {{-0.i -0.s}}
+outest "$b obj saveobj named0" $sing "-c -o $b-0.o -save-temps=obj" {} {{-0.i -0.s -0.o}}
+outest "$b cpp saveobj namedb" $sing "-E -o $b.i -save-temps=obj" {} {{.i}}
+outest "$b asm saveobj namedb" $sing "-S -o $b.s -save-temps=obj" {} {{.i .s}}
+outest "$b obj saveobj namedb" $sing "-c -o $b.o -save-temps=obj" {} {{.i .s .o}}
+outest "$b exe saveobj unnamed1" $sing "-save-temps=obj $oaout" {} {{a--0.i a--0.s a--0.o $aout}}
+outest "$b exe saveobj unnamed2" $mult "-save-temps=obj $oaout" {} {{a--1.i a--1.s a--1.o a--2.i a--2.s a--2.o $aout}}
+outest "$b exe saveobj named0" $sing "-o $b-0.exe -save-temps=obj" {} {{-0.i -0.s -0.o -0.exe}}
+outest "$b exe saveobj namedb" $sing "-o $b.exe -save-temps=obj" {} {{--0.i --0.s --0.o .exe}}
+outest "$b exe saveobj named2" $mult "-o $b.exe -save-temps=obj" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe}}
+
+outest "$b cpp saveobj namedir0" $sing "-E -o o/$b-0.i -save-temps=obj" {o/} {{-0.i} {}}
+outest "$b asm saveobj namedir0" $sing "-S -o o/$b-0.s -save-temps=obj" {o/} {{-0.i -0.s} {}}
+outest "$b obj saveobj namedir0" $sing "-c -o o/$b-0.o -save-temps=obj" {o/} {{-0.i -0.s -0.o} {}}
+outest "$b cpp saveobj namedir" $sing "-E -o o/$b.i -save-temps=obj" {o/} {{.i} {}}
+outest "$b asm saveobj namedir" $sing "-S -o o/$b.s -save-temps=obj" {o/} {{.i .s} {}}
+outest "$b obj saveobj namedir" $sing "-c -o o/$b.o -save-temps=obj" {o/} {{.i .s .o} {}}
+outest "$b exe saveobj namedir0" $sing "-o o/$b-0.exe -save-temps=obj" {o/} {{-0.i -0.s -0.o -0.exe} {}}
+outest "$b exe saveobj namedirb" $sing "-o o/$b.exe -save-temps=obj" {o/} {{--0.i --0.s --0.o .exe} {}}
+outest "$b exe saveobj namedir2" $mult "-o o/$b.exe -save-temps=obj" {o/} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe} {}}
+
+# Check -dumpdir overriding by -save-temps=*, and -save-temps
+# non-overriding, with one catch: the presence of a given dumpdir,
+# even if ultimately overridden, still disables the prepending of the
+# executable basename to the aux&dump output basenames (or rather the
+# appending of the executable basename to the dumpdir).
+outest "$b exe sobjovr namedir0" $sing "-o o/$b-0.exe -dumpdir no/ -save-temps=obj -save-temps" {o/} {{-0.i -0.s -0.o -0.exe} {}}
+outest "$b exe sobjovr namedirb" $sing "-o o/$b.exe -dumpdir no/ -save-temps=obj -save-temps" {o/} {{-0.i -0.s -0.o .exe} {}}
+outest "$b exe sobjovr namedir2" $mult "-o o/$b.exe -dumpdir no/ -save-temps=obj -save-temps" {o/} {{-1.i -1.s -1.o -2.i -2.s -2.o .exe} {}}
+outest "$b exe scwdovr namedir0" $sing "-o o/$b-0.exe -dumpdir o/ -save-temps=cwd -save-temps" {o/} {{-0.exe} {-0.i -0.s -0.o}}
+outest "$b exe scwdovr namedirb" $sing "-o o/$b.exe -dumpdir o/ -save-temps=cwd -save-temps" {o/} {{.exe} {-0.i -0.s -0.o}}
+outest "$b exe scwdovr namedir2" $mult "-o o/$b.exe -dumpdir o/ -save-temps=cwd -save-temps" {o/} {{.exe} {-1.i -1.s -1.o -2.i -2.s -2.o}}
+outest "$b exe ddstovr namedir0" $sing "-o $b-0.exe -dumpdir o/ -save-temps" {o/} {{-0.i -0.s -0.o} {-0.exe}}
+outest "$b exe ddstovr namedirb" $sing "-o $b.exe -dumpdir o/ -save-temps" {o/} {{-0.i -0.s -0.o} {.exe}}
+outest "$b exe ddstovr namedir2" $mult "-o $b.exe -dumpdir o/ -save-temps" {o/} {{-1.i -1.s -1.o -2.i -2.s -2.o} {.exe}}
+
+# Check -dumpdir prevailing over -save-temps*. Even though -dumpdir
+# overrides the -save-temps=* directory selection, -save-temps remains
+# enabled.
+outest "$b exe soddovr namedir0" $sing "-o o/$b-0.exe -save-temps=obj -dumpdir ./" {o/} {{-0.exe} {-0.i -0.s -0.o}}
+outest "$b exe soddovr namedirb" $sing "-o o/$b.exe -save-temps=obj -dumpdir ./" {o/} {{.exe} {-0.i -0.s -0.o}}
+outest "$b exe soddovr namedir2" $mult "-o o/$b.exe -save-temps=obj -dumpdir ./" {o/} {{.exe} {-1.i -1.s -1.o -2.i -2.s -2.o}}
+outest "$b exe scddovr namedir0" $sing "-o o/$b-0.exe -save-temps=cwd -dumpdir o/" {o/} {{-0.i -0.s -0.o -0.exe} {}}
+outest "$b exe scddovr namedirb" $sing "-o o/$b.exe -save-temps=cwd -dumpdir o/" {o/} {{-0.i -0.s -0.o .exe} {}}
+outest "$b exe scddovr namedir2" $mult "-o o/$b.exe -save-temps=cwd -dumpdir o/" {o/} {{-1.i -1.s -1.o -2.i -2.s -2.o .exe} {}}
+outest "$b exe ddstovr namedir0" $sing "-o $b-0.exe -save-temps -dumpdir o/" {o/} {{-0.i -0.s -0.o} {-0.exe}}
+outest "$b exe ddstovr namedirb" $sing "-o $b.exe -save-temps -dumpdir o/" {o/} {{-0.i -0.s -0.o} {.exe}}
+outest "$b exe ddstovr namedir2" $mult "-o $b.exe -save-temps -dumpdir o/" {o/} {{-1.i -1.s -1.o -2.i -2.s -2.o} {.exe}}
+
+
+# Compiler- and driver-generated aux and dump outputs.
+# -fdump-rtl-final creates a .c.???r.final dump in the compiler.
+# -fstack-usage creates a .su aux output in the compiler.
+# $gsplit_dwarf extracts a .dwo aux output from the .o in the driver.
+outest "$b asm auxdump 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su -0.s}}
+outest "$b asm auxdump 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-1.c.???r.final -1.su -1.s -2.c.???r.final -2.su -2.s}}
+outest "$b obj auxdump unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.o}}
+outest "$b obj auxdump unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -1.o -2.c.???r.final -2.su !!$gspd -2.dwo !0 -2.o}}
+
+outest "$b cpp auxdump named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.i}}
+outest "$b asm auxdump named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su -0.s}}
+outest "$b obj auxdump named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.o}}
+outest "$b cpp auxdump namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{.i}}
+outest "$b asm auxdump namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{.c.???r.final .su .s}}
+outest "$b obj auxdump namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{.c.???r.final .su !!$gspd .dwo !0 .o}}
+
+outest "$b exe auxdump unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf $oaout" {} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo !0 $aout}}
+outest "$b exe auxdump unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf $oaout" {} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo !0 $aout}}
+outest "$b exe auxdump named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.exe}}
+outest "$b exe auxdump namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{--0.c.???r.final --0.su !!$gspd --0.dwo !0 .exe}}
+outest "$b exe auxdump named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo !0 .exe}}
+
+outest "$b cpp auxdump namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{-0.i} {}}
+outest "$b asm auxdump namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{-0.c.???r.final -0.su -0.s} {}}
+outest "$b obj auxdump namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.o} {}}
+outest "$b cpp auxdump namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{.i} {}}
+outest "$b asm auxdump namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{.c.???r.final .su .s} {}}
+outest "$b obj auxdump namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{.c.???r.final .su !!$gspd .dwo !0 .o} {}}
+outest "$b exe auxdump namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.exe} {}}
+outest "$b exe auxdump namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{--0.c.???r.final --0.su !!$gspd --0.dwo !0 .exe} {}}
+outest "$b exe auxdump namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo !0 .exe} {}}
+
+# Check that -save-temps doesn't break compiler aux or dumps as it
+# changes temp file names.
+outest "$b asm auxdmps 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i -0.c.???r.final -0.su -0.s}}
+outest "$b asm auxdmps 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-1.i -1.c.???r.final -1.su -1.s -2.i -2.c.???r.final -2.su -2.s}}
+outest "$b obj auxdmps unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i -0.c.???r.final -0.su -0.s !!$gspd -0.dwo !0 -0.o}}
+outest "$b obj auxdmps unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-1.i -1.c.???r.final -1.su -1.s !!$gspd -1.dwo !0 -1.o -2.i -2.c.???r.final -2.su -2.s !!$gspd -2.dwo !0 -2.o}}
+
+outest "$b cpp auxdmps named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i}}
+outest "$b asm auxdmps named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i -0.c.???r.final -0.su -0.s}}
+outest "$b obj auxdmps named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i -0.c.???r.final -0.su -0.s !!$gspd -0.dwo !0 -0.o}}
+outest "$b cpp auxdmps namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{.i}}
+outest "$b asm auxdmps namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{.i .c.???r.final .su .s}}
+outest "$b obj auxdmps namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{.i .c.???r.final .su .s !!$gspd .dwo !0 .o}}
+
+outest "$b exe auxdmps unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps $oaout" {} {{a--0.i a--0.c.???r.final a--0.su a--0.s !!$gspd a--0.dwo !0 a--0.o $aout}}
+outest "$b exe auxdmps unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps $oaout" {} {{a--1.i a--1.c.???r.final a--1.su a--1.s !!$gspd a--1.dwo !0 a--1.o a--2.i a--2.c.???r.final a--2.su a--2.s !!$gspd a--2.dwo !0 a--2.o $aout}}
+outest "$b exe auxdmps named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i -0.c.???r.final -0.su -0.s !!$gspd -0.dwo !0 -0.o -0.exe}}
+outest "$b exe auxdmps namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{--0.i --0.c.???r.final --0.su --0.s !!$gspd --0.dwo !0 --0.o .exe}}
+outest "$b exe auxdmps named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{--1.i --1.c.???r.final --1.su --1.s !!$gspd --1.dwo !0 --1.o --2.i --2.c.???r.final --2.su --2.s !!$gspd --2.dwo !0 --2.o .exe}}
+
+outest "$b cpp auxdmps namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{-0.i} {}}
+outest "$b asm auxdmps namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{-0.i -0.c.???r.final -0.su -0.s} {}}
+outest "$b obj auxdmps namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{-0.i -0.c.???r.final -0.su -0.s !!$gspd -0.dwo !0 -0.o} {}}
+outest "$b cpp auxdmps namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{.i} {}}
+outest "$b asm auxdmps namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{.i .c.???r.final .su .s} {}}
+outest "$b obj auxdmps namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{.i .c.???r.final .su .s !!$gspd .dwo !0 .o} {}}
+outest "$b exe auxdmps namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{-0.i -0.c.???r.final -0.su -0.s !!$gspd -0.dwo !0 -0.o -0.exe} {}}
+outest "$b exe auxdmps namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{--0.i --0.c.???r.final --0.su --0.s !!$gspd --0.dwo !0 --0.o .exe} {}}
+outest "$b exe auxdmps namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{--1.i --1.c.???r.final --1.su --1.s !!$gspd --1.dwo !0 --1.o --2.i --2.c.???r.final --2.su --2.s !!$gspd --2.dwo !0 --2.o .exe} {}}
+
+
+# Check that dumpdir changes the location of non-primary outputs
+outest "$b asm dumpdir 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su} {-0.s}}
+outest "$b asm dumpdir 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-1.c.???r.final -1.su -2.c.???r.final -2.su} {-1.s -2.s}}
+outest "$b obj dumpdir unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {-0.o}}
+outest "$b obj dumpdir unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {-1.o -2.o}}
+
+outest "$b cpp dumpdir named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{} {-0.i}}
+outest "$b asm dumpdir named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su} {-0.s}}
+outest "$b obj dumpdir named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {-0.o}}
+outest "$b cpp dumpdir namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{} {.i}}
+outest "$b asm dumpdir namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{.c.???r.final .su} {.s}}
+outest "$b obj dumpdir namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{.c.???r.final .su !!$gspd .dwo} {.o}}
+
+outest "$b exe dumpdir unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a- $oaout" {od/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {$aout}}
+outest "$b exe dumpdir unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a- $oaout" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {$aout}}
+outest "$b exe dumpdir named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {-0.exe}}
+outest "$b exe dumpdir namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {.exe}}
+outest "$b exe dumpdir named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {.exe}}
+outest "$b exe dumpdira namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a-" {od/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {.exe}}
+outest "$b exe dumpdira named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a-" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe}}
+outest "$b exe dumpdirb namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/$b-" {od/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {.exe}}
+outest "$b exe dumpdirb named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/$b-" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe}}
+
+outest "$b cpp dumpdir namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{} {-0.i} {}}
+outest "$b asm dumpdir namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{-0.c.???r.final -0.su} {-0.s} {}}
+outest "$b obj dumpdir namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {-0.o} {}}
+outest "$b cpp dumpdir namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{} {.i} {}}
+outest "$b asm dumpdir namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{.c.???r.final .su} {.s} {}}
+outest "$b obj dumpdir namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{.c.???r.final .su !!$gspd .dwo} {.o} {}}
+outest "$b exe dumpdir namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {-0.exe} {}}
+outest "$b exe dumpdir namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {.exe} {}}
+outest "$b exe dumpdir namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {.exe} {}}
+outest "$b exe dumpdira namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a-" {od/ o/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {.exe} {}}
+outest "$b exe dumpdira namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a-" {od/ o/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe} {}}
+outest "$b exe dumpdirb namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/$b-" {od/ o/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {.exe} {}}
+outest "$b exe dumpdirb namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/$b-" {od/ o/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe} {}}
+
+# Check that a -dumpbase with a dir component disregards the -dumpdir
+# prefix. Also, start testing -dumpbase-ext to distinguish between
+# aux and dump files: only the latter retain the named extension.
+# -dumpbase-ext, if absent or used in combination with -dumpbase for
+# an executable name, defaults to the extension of the source file.
+# The specified dumpbase is combined with the dumpdir prefix when
+# processing more than one input (we couldn't use the same dumpbase
+# for them all), or when linking (the specified dumpbase is then used
+# as prefix instead of the linker output, and a new dumpbase is
+# computed per source).
+outest "$b asm dbsovrdd 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su} {-0.s}}
+outest "$b asm dbsovrddx 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su} {-0.s}}
+outest "$b asm dbsovrdd-x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.c" {od/} {{.c.???r.final .c.su} {-0.s}}
+outest "$b asm dbsovrdd.x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.x" {od/} {{.x.???r.final .x.su} {-0.s}}
+outest "$b asm dbsovrdd 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}}
+outest "$b asm dbsovrddx 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.x -dumpbase-ext .x" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}}
+outest "$b obj dbsovrdd unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}}
+outest "$b obj dbsovrddx unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su !!$gspd .dwo} {-0.o}}
+outest "$b obj dbsovrdd unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {-1.o -2.o}}
+
+outest "$b cpp dbsovrdd named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{} {-0.i}}
+outest "$b asm dbsovrdd named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su} {-0.s}}
+outest "$b obj dbsovrdd named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}}
+outest "$b cpp dbsovrdd namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{} {.i}}
+outest "$b asm dbsovrdd namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su} {.s}}
+outest "$b obj dbsovrdd namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {.o}}
+
+# Nit: -dumpdir affects whether the specified dumpbase is combined
+# into dumpdir or taken as the output basename, even if dumpbase will
+# ultimately override it.
+outest "$b exe dbsovrdd unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b $oaout" {od/} {{.???r.final .su !!$gspd .dwo} {$aout}}
+outest "$b exe dbsovrdd unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a $oaout" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {$aout}}
+outest "$b exe dbsovrdd named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.exe}}
+outest "$b exe dbsovrdd namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.exe -dumpbase-ext .exe" {od/} {{.exe.???r.final .su !!$gspd .dwo} {.exe}}
+outest "$b exe dbsovrdd named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe}}
+outest "$b exe dbsovrdda namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a" {od/} {{a.???r.final a.su !!$gspd a.dwo} {.exe}}
+outest "$b exe dbsovrddac namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a.c -dumpbase-ext .c" {od/} {{a.c.???r.final a.su !!$gspd a.dwo} {.exe}}
+outest "$b exe dbsovrdda named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe}}
+
+outest "$b cpp dbsovrdd namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{} {-0.i} {}}
+outest "$b asm dbsovrdd namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{.???r.final .su} {-0.s} {}}
+outest "$b obj dbsovrdd namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {-0.o} {}}
+outest "$b cpp dbsovrdd namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{} {.i} {}}
+outest "$b asm dbsovrdd namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{.???r.final .su} {.s} {}}
+outest "$b obj dbsovrdd namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {.o} {}}
+outest "$b exe dbsovrdd namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {-0.exe} {}}
+outest "$b exe dbsovrdd namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.exe -dumpbase-ext .exe" {od/ o/} {{.exe.???r.final .su !!$gspd .dwo} {.exe} {}}
+outest "$b exe dbsovrdd namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe} {}}
+outest "$b exe dbsovrdda namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a" {od/ o/} {{a.???r.final a.su !!$gspd a.dwo} {.exe} {}}
+outest "$b exe dbsovrdda namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a" {od/ o/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe} {}}
+
+
+# Check that a -dumpbase without a dir component adds to the -dumpdir
+# prefix.
+outest "$b asm dbswthdd 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su} {-0.s}}
+outest "$b asm dbswthddx 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su} {-0.s}}
+outest "$b asm dbswthdd-x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.c" {od/} {{.c.???r.final .c.su} {-0.s}}
+outest "$b asm dbswthdd.x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.x" {od/} {{.x.???r.final .x.su} {-0.s}}
+outest "$b asm dbswthdd 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}}
+outest "$b asm dbswthddx 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.x -dumpbase-ext .x" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}}
+outest "$b obj dbswthdd unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}}
+outest "$b obj dbswthddx unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su !!$gspd .dwo} {-0.o}}
+outest "$b obj dbswthdd unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {-1.o -2.o}}
+
+outest "$b cpp dbswthdd named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{} {-0.i}}
+outest "$b asm dbswthdd named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su} {-0.s}}
+outest "$b obj dbswthdd named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}}
+outest "$b cpp dbswthdd namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{} {.i}}
+outest "$b asm dbswthdd namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su} {.s}}
+outest "$b obj dbswthdd namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su !!$gspd .dwo} {.o}}
+
+# Nitty details: -dumpdir affects whether the specified dumpbase is
+# combined into dumpdir or taken as the output basename, even if
+# dumpbase will ultimately override it.
+outest "$b exe dbswthdd unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b $oaout" {od/} {{.???r.final .su !!$gspd .dwo} {$aout}}
+outest "$b exe dbswthdd unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a $oaout" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {$aout}}
+outest "$b exe dbswthdd named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.exe}}
+outest "$b exe dbswthdd namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.exe -dumpbase-ext .exe" {od/} {{.exe.???r.final .su !!$gspd .dwo} {.exe}}
+outest "$b exe dbswthdd named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe}}
+outest "$b exe dbswthdda namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a" {od/} {{a.???r.final a.su !!$gspd a.dwo} {.exe}}
+outest "$b exe dbswthddac namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a.c -dumpbase-ext .c" {od/} {{a.c.???r.final a.su !!$gspd a.dwo} {.exe}}
+outest "$b exe dbswthdda named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe}}
+
+outest "$b cpp dbswthdd namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{} {-0.i} {}}
+outest "$b asm dbswthdd namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{.???r.final .su} {-0.s} {}}
+outest "$b obj dbswthdd namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {-0.o} {}}
+outest "$b cpp dbswthdd namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{} {.i} {}}
+outest "$b asm dbswthdd namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{.???r.final .su} {.s} {}}
+outest "$b obj dbswthdd namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {.o} {}}
+outest "$b exe dbswthdd namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {-0.exe} {}}
+outest "$b exe dbswthdd namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.exe -dumpbase-ext .exe" {od/ o/} {{.exe.???r.final .su !!$gspd .dwo} {.exe} {}}
+outest "$b exe dbswthdd namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe} {}}
+outest "$b exe dbswthdda namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a" {od/ o/} {{a.???r.final a.su !!$gspd a.dwo} {.exe} {}}
+outest "$b exe dbswthdda namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a" {od/ o/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe} {}}
+
+
+# Check for the minor differences when -dumpbase is used without
+# -dumpdir. The main difference between dbwoutdd and dbswthdd tests
+# is in the single-input link tests: with the dump dir/ prefix moved
+# to dumpbase, and without -dumpdir we end up using -dumpbase as the
+# executable prefix rather than as the dumpbase for the single input.
+outest "$b asm dbwoutdd 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su} {-0.s}}
+outest "$b asm dbwoutddx 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su} {-0.s}}
+outest "$b asm dbwoutdd-x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.c" {od/} {{.c.???r.final .c.su} {-0.s}}
+outest "$b asm dbwoutdd.x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.x" {od/} {{.x.???r.final .x.su} {-0.s}}
+outest "$b asm dbwoutdd 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}}
+outest "$b asm dbwoutddx 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.x -dumpbase-ext .x" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}}
+outest "$b obj dbwoutdd unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}}
+outest "$b obj dbwoutddx unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su !!$gspd .dwo} {-0.o}}
+outest "$b obj dbwoutdd unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {-1.o -2.o}}
+
+outest "$b cpp dbwoutdd named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{} {-0.i}}
+outest "$b asm dbwoutdd named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su} {-0.s}}
+outest "$b obj dbwoutdd named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}}
+outest "$b cpp dbwoutdd namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{} {.i}}
+outest "$b asm dbwoutdd namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su} {.s}}
+outest "$b obj dbwoutdd namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {.o}}
+
+outest "$b exe dbwoutdd unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b $oaout" {od/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {$aout}}
+outest "$b exe dbwoutdd unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a $oaout" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {$aout}}
+outest "$b exe dbwoutdd named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {-0.exe}}
+outest "$b exe dbwoutdd named0d" $sing "-o od/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase $b" {od/} {{--0.c.???r.final --0.su !!$gspd --0.dwo !0 -0.exe} {}}
+outest "$b exe dbwoutdd namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.exe -dumpbase-ext .exe" {od/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {.exe}}
+outest "$b exe dbwoutdd named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe}}
+outest "$b exe dbwoutdda namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a" {od/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {.exe}}
+outest "$b exe dbwoutddac namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a.c -dumpbase-ext .c" {od/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {.exe}}
+outest "$b exe dbwoutdda named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe}}
+
+outest "$b cpp dbwoutdd namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{} {-0.i} {}}
+outest "$b asm dbwoutdd namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{.???r.final .su} {-0.s} {}}
+outest "$b obj dbwoutdd namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {-0.o} {}}
+outest "$b cpp dbwoutdd namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{} {.i} {}}
+outest "$b asm dbwoutdd namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{.???r.final .su} {.s} {}}
+outest "$b obj dbwoutdd namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {.o} {}}
+outest "$b exe dbwoutdd namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {-0.exe} {}}
+outest "$b exe dbwoutdd namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.exe -dumpbase-ext .exe" {od/ o/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {.exe} {}}
+outest "$b exe dbwoutdd namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe} {}}
+outest "$b exe dbwoutdda namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a" {od/ o/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {.exe} {}}
+outest "$b exe dbwoutdda namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a" {od/ o/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe} {}}
+
+# -fcompare-debug
+outest "$b obj compare-debug" $sing "-c -fcompare-debug -fdump-rtl-final -fstack-usage $gsplit_dwarf -fdump-final-insns" {} {{-0.c.???r.final -0.su -0.c.gkd -0.gk.c.???r.final !!$gspd -0.dwo !0 -0.o}}
+outest "$b obj compare-debug save-temps" $sing "-c -fcompare-debug -save-temps -fdump-rtl-final -fstack-usage $gsplit_dwarf -fdump-final-insns" {} {{-0.c.???r.final -0.su -0.i -0.c.gkd -0.s -0.gk.i -0.gk.c.???r.final -0.gk.c.gkd !!$gspd -0.dwo !0 -0.o}}
+
+if !$skip_lto {
+
+# -flto
+outest "$b lto sing unnamed" $sing "-O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--0.c.???i.icf !$ltop a--0.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}}
+outest "$b lto mult unnamed" $mult "-O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--1.c.???i.icf !$ltop a--1.c.???r.final !0 a--2.c.???i.icf !$ltop a--2.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}}
+outest "$b lto sing named" $sing "-o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}}
+outest "$b lto mult named" $mult "-o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}}
+outest "$b lto sing nameddir" $sing "-o dir/$b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}}
+outest "$b lto mult nameddir" $mult "-o dir/$b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}}
+
+if $ltop {
+# -flto -fno-use-linker-plugin
+outest "$b lto sing unnamed" $sing "-O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--0.c.???i.icf a--0.c.???r.final a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}}
+outest "$b lto mult unnamed" $mult "-O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--1.c.???i.icf a--1.c.???r.final a--2.c.???i.icf a--2.c.???r.final a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}}
+outest "$b lto sing named" $sing "-o $b.exe -O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{--0.c.???i.icf --0.c.???r.final .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}}
+outest "$b lto mult named" $mult "-o $b.exe -O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{--1.c.???i.icf --1.c.???r.final --2.c.???i.icf --2.c.???r.final .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}}
+outest "$b lto sing nameddir" $sing "-o dir/$b.exe -O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf --0.c.???r.final .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}}
+outest "$b lto mult nameddir" $mult "-o dir/$b.exe -O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf --1.c.???r.final --2.c.???i.icf --2.c.???r.final .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}}
+}
+
+# -dumpbase without -dumpdir. The trailing dumppfx dash after it is
+# combined with dumpbase turns into a period when passed to lto as
+# -dumpdir, because the dash is introduced by the compiler driver.
+outest "$b lto sing dumpbase unnamed" $sing "-dumpbase dir/$b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}}
+outest "$b lto mult dumpbase unnamed" $mult "-dumpbase dir/$b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}}
+outest "$b lto sing dumpbase named" $sing "-dumpbase dir/$b -o $b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-0.exe}}
+outest "$b lto mult dumpbase named" $mult "-dumpbase dir/$b -o $b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-1.exe}}
+outest "$b lto sing dumpbase namedb" $sing "-dumpbase dir/$b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}}
+outest "$b lto mult dumpbase namedb" $mult "-dumpbase dir/$b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}}
+
+# -dumpdir without -dumpbase. The trailing dash in -dumpdir is given
+# by the user, thus not replaced with a dot.
+outest "$b lto sing dumpdir unnamed" $sing "-dumpdir dir/$b- -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {$aout}}
+outest "$b lto mult dumpdir unnamed" $mult "-dumpdir dir/$b- -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {$aout}}
+outest "$b lto sing dumpdir named" $sing "-dumpdir dir/$b- -o $b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {-0.exe}}
+outest "$b lto mult dumpdir named" $mult "-dumpdir dir/$b- -o $b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {-1.exe}}
+outest "$b lto sing dumpdir namedb" $sing "-dumpdir dir/$b- -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {.exe}}
+outest "$b lto mult dumpdir namedb" $mult "-dumpdir dir/$b- -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {.exe}}
+
+# -dumpdir and non-overriding -dumpbase.
+outest "$b lto dbswthdd sing unnamed" $sing "-dumpdir dir/ -dumpbase $b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{!$ltop .???r.final !0 .???i.icf .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}}
+outest "$b lto dbswthdd mult unnamed" $mult "-dumpdir dir/ -dumpbase $b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}}
+outest "$b lto dbswthdd sing named" $sing "-dumpdir dir/ -dumpbase $b -o $b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.???i.icf !$ltop .???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-0.exe}}
+outest "$b lto dbswthdd mult named" $mult "-dumpdir dir/ -dumpbase $b -o $b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-1.exe}}
+outest "$b lto dbswthdd sing namedb" $sing "-dumpdir dir/ -dumpbase $b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.???i.icf !$ltop .???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}}
+outest "$b lto dbswthdd mult namedb" $mult "-dumpdir dir/ -dumpbase $b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}}
+
+# -dumpdir and an overriding -dumpbase.
+outest "$b lto dbsovrdd sing unnamed" $sing "-dumpdir ignore/ -dumpbase dir/$b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{.???i.icf !$ltop .???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}}
+outest "$b lto dbsovrdd mult unnamed" $mult "-dumpdir ignore/ -dumpbase dir/$b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}}
+outest "$b lto dbsovrdd sing named" $sing "-dumpdir ignore/ -dumpbase dir/$b -o $b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.???i.icf !$ltop .???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-0.exe}}
+outest "$b lto dbsovrdd mult named" $mult "-dumpdir ignore/ -dumpbase dir/$b -o $b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-1.exe}}
+outest "$b lto dbsovrdd sing namedb" $sing "-dumpdir ignore/ -dumpbase dir/$b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.???i.icf !$ltop .???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}}
+outest "$b lto dbsovrdd mult namedb" $mult "-dumpdir ignore/ -dumpbase dir/$b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}}
+
+# Check that -dumpbase '' gets source names as dumpbases for
+# compilation, and output name as dumpbase for linking, regardless of
+# how many source files.
+outest "$b lto sing empty dumpbase unnamed" $sing "-dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-0.c.???i.icf !$ltop -0.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}}
+outest "$b lto mult empty dumpbase unnamed" $mult "-dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}}
+outest "$b lto sing empty dumpbase named" $sing "-dumpbase \"\" -o dir/$b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-0.c.???i.icf !$ltop -0.c.???r.final !0 -0.wpa.???i.icf -0.ltrans0.ltrans.???r.final -0.ltrans0.ltrans.su -0.exe} {}}
+outest "$b lto mult empty dumpbase named" $mult "-dumpbase \"\" -o dir/$b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 -1.wpa.???i.icf -1.ltrans0.ltrans.???r.final -1.ltrans0.ltrans.su -1.exe} {}}
+outest "$b lto sing empty dumpbase namedb" $sing "-dumpbase \"\" -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{-0.c.???i.icf !$ltop -0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}}
+outest "$b lto mult empty dumpbase namedb" $mult "-dumpbase \"\" -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}}
+
+# Now with -dumpdir too.
+outest "$b lto sing empty dumpbase dumpdir unnamed" $sing "-dumpdir dir/$b- -dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 -a.wpa.???i.icf -a.ltrans0.ltrans.???r.final -a.ltrans0.ltrans.su} {$aout}}
+outest "$b lto mult empty dumpbase dumpdir unnamed" $mult "-dumpdir dir/$b- -dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 -a.wpa.???i.icf -a.ltrans0.ltrans.???r.final -a.ltrans0.ltrans.su} {$aout}}
+outest "$b lto sing empty dumpbase dumpdir named" $sing "-dumpdir dir/$b- -dumpbase \"\" -o $b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 --0.wpa.???i.icf --0.ltrans0.ltrans.???r.final --0.ltrans0.ltrans.su} {-0.exe}}
+outest "$b lto mult empty dumpbase dumpdir named" $mult "-dumpdir dir/$b- -dumpbase \"\" -o $b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 --1.wpa.???i.icf --1.ltrans0.ltrans.???r.final --1.ltrans0.ltrans.su} {-1.exe}}
+outest "$b lto sing empty dumpbase dumpdir namedb" $sing "-dumpdir dir/$b- -dumpbase \"\" -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 -.wpa.???i.icf -.ltrans0.ltrans.???r.final -.ltrans0.ltrans.su} {.exe}}
+outest "$b lto mult empty dumpbase dumpdir namedb" $mult "-dumpdir dir/$b- -dumpbase \"\" -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 -.wpa.???i.icf -.ltrans0.ltrans.???r.final -.ltrans0.ltrans.su} {.exe}}
+
+# And also with an empty -dumpdir. That's equivalent to -dumpdir ./,
+# overriding any dumpdir implied by the output.
+outest "$b lto sing empty dumpdir empty dumpbase unnamed" $sing "-dumpdir \"\" -dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-0.c.???i.icf !$ltop -0.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}}
+outest "$b lto mult empty dumpdir empty dumpbase unnamed" $mult "-dumpdir \"\" -dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}}
+outest "$b lto sing empty dumpdir empty dumpbase named" $sing "-dumpdir \"\" -dumpbase \"\" -o dir/$b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-0.exe} {-0.c.???i.icf !$ltop -0.c.???r.final !0 -0.wpa.???i.icf -0.ltrans0.ltrans.???r.final -0.ltrans0.ltrans.su}}
+outest "$b lto mult empty dumpdir empty dumpbase named" $mult "-dumpdir \"\" -dumpbase \"\" -o dir/$b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-1.exe} {-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 -1.wpa.???i.icf -1.ltrans0.ltrans.???r.final -1.ltrans0.ltrans.su}}
+outest "$b lto sing empty dumpdir empty dumpbase namedb" $sing "-dumpdir \"\" -dumpbase \"\" -o dir/$b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.exe} {-0.c.???i.icf !$ltop -0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su}}
+outest "$b lto mult empty dumpdir empty dumpbase namedb" $mult "-dumpdir \"\" -dumpbase \"\" -o dir/$b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.exe} {-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su}}
+
+# Now -flto with -save-temps, not exhaustive.
+outest "$b lto st sing empty dumpbase unnamed" $sing "-dumpbase \"\" -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-0.i -0.s -0.o -0.c.???i.icf !$ltop -0.c.???r.final !!$ltop a.lto_wrapper_args !0 a.wpa.???i.icf a.ltrans.out !!$ltop a.res !0 a.ltrans0.o a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a.ltrans0.ltrans.s a.ltrans0.ltrans.o $aout}}
+outest "$b lto st mult empty dumpbase unnamed" $mult "-dumpbase \"\" -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-1.i -1.s -1.o -1.c.???i.icf !$ltop -1.c.???r.final !0 -2.i -2.s -2.o -2.c.???i.icf !$ltop -2.c.???r.final !!$ltop a.lto_wrapper_args !0 a.wpa.???i.icf a.ltrans.out !!$ltop a.res !0 a.ltrans0.o a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a.ltrans0.ltrans.s a.ltrans0.ltrans.o $aout}}
+outest "$b lto st sing dumpdir empty dumpbase named" $sing "-dumpdir dir/ -dumpbase \"\" -o $b-0.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-0.i -0.s -0.o -0.c.???i.icf !$ltop -0.c.???r.final !!$ltop -0.lto_wrapper_args !0 -0.wpa.???i.icf -0.ltrans.out !!$ltop -0.res !0 -0.ltrans0.o -0.ltrans0.ltrans.???r.final -0.ltrans0.ltrans.su -0.ltrans0.ltrans.s -0.ltrans0.ltrans.o} {-0.exe}}
+outest "$b lto st mult dumpdir empty dumpbase named" $mult "-dumpdir dir/ -dumpbase \"\" -o $b-1.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-1.i -1.s -1.o -1.c.???i.icf !$ltop -1.c.???r.final !0 -2.i -2.s -2.o -2.c.???i.icf !$ltop -2.c.???r.final !!$ltop -1.lto_wrapper_args !0 -1.wpa.???i.icf -1.ltrans.out !!$ltop -1.res !0 -1.ltrans0.o -1.ltrans0.ltrans.???r.final -1.ltrans0.ltrans.su -1.ltrans0.ltrans.s -1.ltrans0.ltrans.o} {-1.exe}}
+outest "$b lto st sing empty dumpbase namedb" $sing "-dumpbase \"\" -o dir/$b.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-0.i -0.s -0.o -0.c.???i.icf !$ltop -0.c.???r.final !!$ltop .lto_wrapper_args !0 .wpa.???i.icf .ltrans.out !!$ltop .res !0 .ltrans0.o .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .ltrans0.ltrans.s .ltrans0.ltrans.o .exe} {}}
+outest "$b lto st mult empty dumpbase namedb" $mult "-dumpbase \"\" -o dir/$b.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-1.i -1.s -1.o -1.c.???i.icf !$ltop -1.c.???r.final !0 -2.i -2.s -2.o -2.c.???i.icf !$ltop -2.c.???r.final !!$ltop .lto_wrapper_args !0 .wpa.???i.icf .ltrans.out !!$ltop .res !0 .ltrans0.o .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .ltrans0.ltrans.s .ltrans0.ltrans.o .exe} {}}
+
+# lto save-temps without -dumpbase.
+outest "$b lto st sing unnamed" $sing "-save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--0.i a--0.s a--0.o a--0.c.???i.icf !$ltop a--0.c.???r.final !!$ltop a.lto_wrapper_args !0 a.wpa.???i.icf a.ltrans.out !!$ltop a.res !0 a.ltrans0.o a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a.ltrans0.ltrans.s a.ltrans0.ltrans.o $aout}}
+outest "$b lto st mult unnamed" $mult "-save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--1.i a--1.s a--1.o a--1.c.???i.icf !$ltop a--1.c.???r.final !0 a--2.i a--2.s a--2.o a--2.c.???i.icf !$ltop a--2.c.???r.final !!$ltop a.lto_wrapper_args !0 a.wpa.???i.icf a.ltrans.out !!$ltop a.res !0 a.ltrans0.o a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a.ltrans0.ltrans.s a.ltrans0.ltrans.o $aout}}
+outest "$b lto st sing dumpdir named" $sing "-dumpdir dir/$b- -o $b-0.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.i --0.s --0.o --0.c.???i.icf !$ltop --0.c.???r.final !!$ltop -lto_wrapper_args !0 -wpa.???i.icf -ltrans.out !!$ltop -res !0 -ltrans0.o -ltrans0.ltrans.???r.final -ltrans0.ltrans.su -ltrans0.ltrans.s -ltrans0.ltrans.o} {-0.exe}}
+outest "$b lto st mult dumpdir named" $mult "-dumpdir dir/$b- -o $b-1.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.i --1.s --1.o --1.c.???i.icf !$ltop --1.c.???r.final !0 --2.i --2.s --2.o --2.c.???i.icf !$ltop --2.c.???r.final !!$ltop -lto_wrapper_args !0 -wpa.???i.icf -ltrans.out !!$ltop -res !0 -ltrans0.o -ltrans0.ltrans.???r.final -ltrans0.ltrans.su -ltrans0.ltrans.s -ltrans0.ltrans.o} {-1.exe}}
+outest "$b lto st sing namedb" $sing "-o dir/$b.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.i --0.s --0.o --0.c.???i.icf !$ltop --0.c.???r.final !!$ltop .lto_wrapper_args !0 .wpa.???i.icf .ltrans.out !!$ltop .res !0 .ltrans0.o .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .ltrans0.ltrans.s .ltrans0.ltrans.o .exe} {}}
+outest "$b lto st mult namedb" $mult "-o dir/$b.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.i --1.s --1.o --1.c.???i.icf !$ltop --1.c.???r.final !0 --2.i --2.s --2.o --2.c.???i.icf !$ltop --2.c.???r.final !!$ltop .lto_wrapper_args !0 .wpa.???i.icf .ltrans.out !!$ltop .res !0 .ltrans0.o .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .ltrans0.ltrans.s .ltrans0.ltrans.o .exe} {}}
+
+# !$skip_lto
+}
+
+# PR96230 - -dumpbase "" with -dumpbase-ext, not linking
+outest "$b single -c -o -db'' -dbx.c" $sing "-c -o dir/$b.o -dumpbase \"\" -dumpbase-ext .c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 .o} {}}
+outest "$b mult -c -dd -db'' -dbx.c" $mult "-c -dumpdir dir/ -dumpbase \"\" -dumpbase-ext .c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {-1.o -2.o}}
+outest "$b single -c -o -db'' -dbx.x" $sing "-c -o dir/$b.o -dumpbase \"\" -dumpbase-ext .x -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 .o} {}}
+outest "$b mult -c -dd -db'' -dbx.x" $mult "-c -dumpdir dir/ -dumpbase \"\" -dumpbase-ext .x -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {-1.o -2.o}}
+# Test -dumpbase-ext without an explicit -dumpbase too.
+outest "$b single -c -o -dbx.c" $sing "-c -o dir/$b.o -dumpbase-ext .c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.c.???r.final .su !!$gspd .dwo !0 .o} {}}
+outest "$b mult -c -dd -dbx.c" $mult "-c -dumpdir dir/ -dumpbase-ext .c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {-1.o -2.o}}
+outest "$b single -c -o -dbx.x" $sing "-c -o dir/$b.o -dumpbase-ext .x -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.c.???r.final .su !!$gspd .dwo !0 .o} {}}
+outest "$b mult -c -dd -dbx.x" $mult "-c -dumpdir dir/ -dumpbase-ext .x -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {-1.o -2.o}}
+outest "$b obj compare-debug save-temps -dbx.x" $sing "-c -fcompare-debug -save-temps -fdump-rtl-final -fstack-usage $gsplit_dwarf -fdump-final-insns -dumpbase-ext .x" {} {{-0.c.???r.final -0.su -0.i -0.c.gkd -0.s -0.gk.i -0.gk.c.???r.final -0.gk.c.gkd !!$gspd -0.dwo !0 -0.o}}
+# -dumpbase-ext is dropped if identical to -dumpbase.
+outest "$b asm db=dbext 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase a -dumpbase-ext a" {} {{a.???r.final a.su -0.s}}
+
+
+# Below are examples taken from the documentation.
+# They are likely redundant with earlier test,
+# but we want to make sure behavior matches the docs.
+
+# gcc -c foo.c ...
+outest "$b doc single -c !-o" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.o}}
+
+# gcc -c foo.c -o dir/foobar.o ...
+outest "$b doc single -c +-o" $sing "-c -o dir/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.c.???r.final .su !!$gspd .dwo !0 .o} {}}
+
+# gcc foo.c bar.c -o dir/foobar ...
+outest "$b doc double !-c -o" $mult "-o dir/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo !0 .exe} {}}
+
+# gcc foo.c -o dir/foo ...
+outest "$b doc single !-c -o" $sing "-o dir/$b-0 -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0} {}}
+
+# gcc -save-temps -S foo.c
+outest "$b doc single -S -st" $sing "-save-temps -S" {} {{-0.i -0.s}}
+
+# gcc -save-temps -dumpbase save-foo -c foo.c
+outest "$b doc single -c -st -db" $sing "-save-temps -dumpbase $b -c" {} {{.i .s -0.o}}
+
+# gcc foo.c -c -o dir/foo.o -dumpbase alt/foo \
+# -dumpdir pfx- -save-temps=cwd ...
+outest "$b doc single -c -o -db" $sing "-c -o dir/$b.o -dumpbase alt/$b -dumpdir pfx- -save-temps=cwd -fdump-rtl-final -fstack-usage $gsplit_dwarf" {alt/ dir/} {{.i .s .???r.final .su !!$gspd .dwo} {.o} {}}
+
+# gcc foo.c bar.c -c -dumpbase main ...
+outest "$b doc double -c !-o -db" $mult "-c -dumpbase $b -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 -1.o --2.c.???r.final --2.su !!$gspd --2.dwo !0 -2.o}}
+
+# gcc -c foo.c -o dir/foobar.o -dumpbase '' ...
+outest "$b doc single -c -o -db''" $sing "-c -o dir/$b.o -dumpbase \"\" -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 .o} {}}
+
+if !$skip_lto {
+# gcc foo.c bar.c -o dir/foobar -dumpbase '' -flto ...
+outest "$b doc double !-c -o -db'' -flto" $mult "-o dir/$b.exe -dumpbase \"\" -flto -O2 -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}}
+}
+
+# gcc foo.c -c -o dir/foo.o -dumpbase x-foo.c -dumpbase-ext .c ...
+outest "$b doc single -c -o -dbx" $sing "-c -o dir/$b-0.o -dumpbase $b.c -dumpbase-ext .c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.c.???r.final .su !!$gspd .dwo !0 -0.o} {}}
+
+# gcc foo.c bar.c -o main.out -dumpbase-ext .out ...
+outest "$b doc double !-c -o -dbx" $mult "-o $b.out -dumpbase-ext .out -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo !0 .out}}
+
+# gcc -dumpdir pfx- -c foo.c ...
+outest "$b doc single -c !-o -dd" $sing "-dumpdir $b- -c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{--0.c.???r.final --0.su !!$gspd --0.dwo !0 -0.o}}
+
+# gcc -dumpdir dir/ -c foo.c -o obj/bar.o ...
+outest "$b doc single -c -o -dd" $sing "-dumpdir dir/ -c -o obj/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/ obj/} {{.c.???r.final .su !!$gspd .dwo} {.o} {}}
+
+# gcc -dumpdir pfx- -c foo.c -save-temps=obj ...
+outest "$b doc single -c -o -dd -st=" $sing "-dumpdir $b- -c -save-temps=obj -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.i -0.s -0.o}}
+
+# gcc foo.c bar.c -c -dumpdir dir/pfx- -dumpbase main ...
+outest "$b doc double -c !-o -dd -db" $mult "-c -dumpdir dir/ -dumpbase $b -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {-1.o -2.o}}
+
+# gcc foo.c -c -dumpdir dir/pfx- -dumpbase main ...
+outest "$b doc single -c !-o -dd -db" $sing "-c -dumpdir dir/ -dumpbase $b -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.???r.final .su !!$gspd .dwo} {-0.o}}
+
+# gcc foo.c bar.c -dumpdir dir/pfx- -o main ...
+outest "$b doc double !-c -o -dd" $mult "-dumpdir dir/ -o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {.exe}}
+
+# gcc foo.c -dumpdir alt/pfx- -o dir/main.exe -save-temps=cwd ...
+outest "$b doc single !-c -o -dd -st=" $sing "-c -dumpdir dir/ -dumpbase $b -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.???r.final .su !!$gspd .dwo} {-0.o}}
+
+
+gcc_parallel_test_enable 1
diff --git a/gcc/testsuite/gcc.target/aarch64/acle/jcvt_2.c b/gcc/testsuite/gcc.target/aarch64/acle/jcvt_2.c
new file mode 100644
index 00000000000..ea2dfd14cf2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/acle/jcvt_2.c
@@ -0,0 +1,33 @@
+/* Test the __jcvt ACLE intrinsic. */
+/* { dg-do run } */
+/* { dg-options "-O2 -march=armv8.3-a -save-temps" } */
+/* { dg-require-effective-target aarch64_fjcvtzs_hw } */
+
+#include <arm_acle.h>
+
+extern void abort (void);
+
+#ifdef __ARM_FEATURE_JCVT
+volatile int32_t x;
+
+int __attribute__((noinline))
+foo (double a, int b, int c)
+{
+ b = b > c;
+ x = __jcvt (a);
+ return b;
+}
+
+int
+main (void)
+{
+ int x = foo (1.1, 2, 3);
+ if (x)
+ abort ();
+
+ return 0;
+}
+
+#endif
+
+/* { dg-final { scan-assembler-times "fjcvtzs\tw\[0-9\]+, d\[0-9\]+\n" 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/asimd-mull-elem.c b/gcc/testsuite/gcc.target/aarch64/asimd-mull-elem.c
new file mode 100644
index 00000000000..513721cee0c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/asimd-mull-elem.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-options "-Ofast" } */
+
+#include <arm_neon.h>
+
+void s_mult_i (int32_t* restrict res, int32_t* restrict a, int32_t b)
+{
+ for (int x = 0; x < 16; x++)
+ res[x] = a[x] * b;
+}
+
+void s_mult_f (float32_t* restrict res, float32_t* restrict a, float32_t b)
+{
+ for (int x = 0; x < 16; x++)
+ res[x] = a[x] * b;
+}
+
+/* { dg-final { scan-assembler-times {\s+mul\tv[0-9]+\.4s, v[0-9]+\.4s, v[0-9]+\.s\[0\]} 4 } } */
+/* { dg-final { scan-assembler-times {\s+fmul\tv[0-9]+\.4s, v[0-9]+\.4s, v[0-9]+\.s\[0\]} 4 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/bti-4.c b/gcc/testsuite/gcc.target/aarch64/bti-4.c
new file mode 100644
index 00000000000..28495a5c199
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/bti-4.c
@@ -0,0 +1,60 @@
+/* { dg-do compile } */
+/* If configured with --enable-standard-branch-protection, disable it. */
+/* { dg-additional-options "-mbranch-protection=none" { target { default_branch_protection } } } */
+
+void f1 (void *);
+void f2 (void *);
+void f3 (void *, void (*)(void *));
+
+int
+retbr_trampolines (void *a, int b)
+{
+ if (!b)
+ {
+ f1 (a);
+ return 1;
+ }
+ if (b)
+ {
+ /* Suppress "ISO C forbids nested functions" warning. */
+ _Pragma("GCC diagnostic push")
+ _Pragma("GCC diagnostic ignored \"-Wpedantic\"")
+ void retbr_tramp_internal (void *c)
+ {
+ _Pragma("GCC diagnostic pop")
+ if (c == a)
+ f2 (c);
+ }
+ f3 (a, retbr_tramp_internal);
+ }
+ return 0;
+}
+
+__attribute__((target("branch-protection=bti,arch=armv8.3-a")))
+int
+retbr_trampolines2 (void *a, int b)
+{
+ if (!b)
+ {
+ f1 (a);
+ return 1;
+ }
+ if (b)
+ {
+ /* Suppress "ISO C forbids nested functions" warning. */
+ _Pragma("GCC diagnostic push")
+ _Pragma("GCC diagnostic ignored \"-Wpedantic\"")
+ __attribute__((target("branch-protection=bti,arch=armv8.3-a")))
+ void retbr_tramp_internal2 (void *c)
+ {
+ _Pragma("GCC diagnostic pop")
+ if (c == a)
+ f2 (c);
+ }
+ f3 (a, retbr_tramp_internal2);
+ }
+ return 0;
+}
+
+/* Trampoline should have BTI C. */
+/* { dg-final { scan-assembler "\.LTRAMP0:\n\thint\t34" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/aarch64-cpunative.exp b/gcc/testsuite/gcc.target/aarch64/cpunative/aarch64-cpunative.exp
new file mode 100644
index 00000000000..ce80ca04b8d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/aarch64-cpunative.exp
@@ -0,0 +1,35 @@
+# Copyright (C) 2014-2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Exit immediately if this isn't an AArch64 target.
+if ![istarget aarch64*-*-*] then {
+ return
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
+ "" ""
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_0 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_0
new file mode 100644
index 00000000000..ef4a3f606fa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_0
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 asimddp
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_1 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_1
new file mode 100644
index 00000000000..0f434bca285
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_1
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : fp
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_10 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_10
new file mode 100644
index 00000000000..c6e9d7ca9e2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_10
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features :
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_11 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_11
new file mode 100644
index 00000000000..fb76f7d45bc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_11
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : asimd fp sb
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_12 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_12
new file mode 100644
index 00000000000..9b6aa7bc248
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_12
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : asimd fp ssbs
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_13 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_13
new file mode 100644
index 00000000000..ef4a3f606fa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_13
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 asimddp
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_14 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_14
new file mode 100644
index 00000000000..33897571513
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_14
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : Lorem ipsum dolor sit ametd rebum expetendis per at Dolor lucilius referrentur ei mei virtute eruditi eum ne Iisque verterem tacimates eu mea ei autem asimd fp asimddp
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_15 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_15
new file mode 100644
index 00000000000..bc645394556
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_15
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : Lorem ipsum dolor sit ametd rebum expetendis per at Dolor lucilius referrentur ei mei virtute eruditi eum ne Iisque verter svesm4 asimd fp
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_2 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_2
new file mode 100644
index 00000000000..965d37760ac
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_2
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : asimd
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_3 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_3
new file mode 100644
index 00000000000..0c276f884a8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_3
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : asimd fp
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_4 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_4
new file mode 100644
index 00000000000..716210c1417
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_4
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : asimd fp aes pmull sha1 sha2
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_5 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_5
new file mode 100644
index 00000000000..7a002e1c4c8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_5
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : asimd fp fphp asimdhp
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_6 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_6
new file mode 100644
index 00000000000..d341dfe86f4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_6
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : asimd fp aes pmull sha1 sha2 fphp asimdhp
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_7 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_7
new file mode 100644
index 00000000000..ccb784915d5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_7
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : asimd pmull sha1 fp aes sha2 fphp asimdhp
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_8 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_8
new file mode 100644
index 00000000000..d6d9d03a2a2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_8
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : asimd sve fp
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_9 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_9
new file mode 100644
index 00000000000..c9aa4a9a07d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_9
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : asimd fp svesm4
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_0.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_0.c
new file mode 100644
index 00000000000..f155f51bae7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_0.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_0" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+crypto\+crc\+dotprod} } } */
+
+/* Test a normal looking procinfo. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_1.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_1.c
new file mode 100644
index 00000000000..2cf0e89994b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_1" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+nosimd} } } */
+
+/* Test one where fp is on by default so turn off simd. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_10.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_10.c
new file mode 100644
index 00000000000..6a753965c52
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_10.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_10" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+nofp\+nosimd} } } */
+
+/* Test one with no entry in feature list. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_11.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_11.c
new file mode 100644
index 00000000000..96b9ca434eb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_11.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_11" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+sb} } } */
+
+/* Test one with a feature name that overlaps with another one. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_12.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_12.c
new file mode 100644
index 00000000000..c3b44adbf6c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_12.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_12" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+ssbs} } } */
+
+/* Test one where the longer feature overlaps with a shorter one. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_13.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_13.c
new file mode 100644
index 00000000000..b7b3a8e13df
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_13.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_13" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+crypto\+crc\+dotprod} } } */
+
+/* Test one with mixed order of feature bits. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_14.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_14.c
new file mode 100644
index 00000000000..781ab1ebbfb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_14.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_14" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+dotprod} } } */
+
+/* Test one where valid feature bits are at a boundary > buffer size. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_15.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_15.c
new file mode 100644
index 00000000000..c9205d95b79
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_15.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_15" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+sve2-sm4} } } */
+
+/* Test one where the bounary of buffer size would cut off and leave
+ a valid feature in the first full buffer. e.g. this will cut off at
+ sve leaving 2-sm4 to yet be read. Check that this doesn't enable
+ +sve by mistake. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_2.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_2.c
new file mode 100644
index 00000000000..aad71f4347d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_2" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+nofp\+nosimd} } } */
+
+/* Test one where asimd is provided byt no fp. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_3.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_3.c
new file mode 100644
index 00000000000..50685c297db
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_3.c
@@ -0,0 +1,13 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_3" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a} } } */
+
+/* Test where asimd and fp are the only ones provided, these are default
+ and so shouldn't emit anything. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_4.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_4.c
new file mode 100644
index 00000000000..91ae809757a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_4.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_4" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+crypto} } } */
+
+/* Test one where all crypto bits are given so crypto should be enabled. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_5.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_5.c
new file mode 100644
index 00000000000..84139e58ee0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_5.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_5" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+fp16} } } */
+
+/* Test one where fp16 is available and so should be emitted. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_6.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_6.c
new file mode 100644
index 00000000000..da72052e623
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_6.c
@@ -0,0 +1,13 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_6" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+crypto\+fp16} } } */
+
+/* Test one where the feature bits for crypto and fp16 are given in
+ same order as declared in options file. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_7.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_7.c
new file mode 100644
index 00000000000..96ad4c14db1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_7.c
@@ -0,0 +1,13 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_7" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+crypto\+fp16} } } */
+
+/* Test one where the crypto and fp16 options are specified in different
+ order from what is in the options file. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_8.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_8.c
new file mode 100644
index 00000000000..7a5a2144a39
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_8.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_8" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+sve} } } */
+
+/* Test one where sve is enabled. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_9.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_9.c
new file mode 100644
index 00000000000..528b5d029f1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_9.c
@@ -0,0 +1,14 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_9" } */
+/* { dg-additional-options "-mcpu=native" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+sve2-sm4} } } */
+
+/* Test one here a feature that is a prefix of another is enabled.
+ In this case sve is a prefix to svesm4, but sve2-sm4 should be
+ enabled. */
diff --git a/gcc/testsuite/gcc.target/aarch64/cpymem-q-reg_1.c b/gcc/testsuite/gcc.target/aarch64/cpymem-q-reg_1.c
new file mode 100644
index 00000000000..df5f67e425b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpymem-q-reg_1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#define N 8
+extern int src[N], dst[N];
+
+void
+foo (void)
+{
+ __builtin_memcpy (dst, src, N * sizeof (int));
+}
+
+/* { dg-final { scan-assembler {ldp\tq[0-9]*} } } */
+/* { dg-final { scan-assembler-not {ldp\tx[0-9]*} } } */
+/* { dg-final { scan-assembler {stp\tq[0-9]*} } } */
+/* { dg-final { scan-assembler-not {stp\tx[0-9]*} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/csinv-neg.c b/gcc/testsuite/gcc.target/aarch64/csinv-neg.c
new file mode 100644
index 00000000000..cc64b4094d7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/csinv-neg.c
@@ -0,0 +1,104 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+/*
+** inv1:
+** cmp w0, 0
+** csinv w0, w1, w2, ne
+** ret
+*/
+unsigned long long
+inv1(unsigned a, unsigned b, unsigned c)
+{
+ return a ? b : ~c;
+}
+
+/*
+** inv1_local:
+** cmp w0, 0
+** csinv w0, w1, w2, ne
+** ret
+*/
+unsigned long long
+inv1_local(unsigned a, unsigned b, unsigned c)
+{
+ unsigned d = ~c;
+ return a ? b : d;
+}
+
+/*
+** inv_zero1:
+** cmp w0, 0
+** csinv w0, wzr, w1, ne
+** ret
+*/
+unsigned long long
+inv_zero1(unsigned a, unsigned b)
+{
+ return a ? 0 : ~b;
+}
+
+/*
+** inv_zero2:
+** cmp w0, 0
+** csinv w0, wzr, w1, eq
+** ret
+*/
+unsigned long long
+inv_zero2(unsigned a, unsigned b)
+{
+ return a ? ~b : 0;
+}
+
+
+/*
+** inv2:
+** cmp w0, 0
+** csinv w0, w2, w1, eq
+** ret
+*/
+unsigned long long
+inv2(unsigned a, unsigned b, unsigned c)
+{
+ return a ? ~b : c;
+}
+
+/*
+** inv2_local:
+** cmp w0, 0
+** csinv w0, w2, w1, eq
+** ret
+*/
+unsigned long long
+inv2_local(unsigned a, unsigned b, unsigned c)
+{
+ unsigned d = ~b;
+ return a ? d : c;
+}
+
+/*
+** neg1:
+** cmp w0, 0
+** csneg w0, w1, w2, ne
+** ret
+*/
+unsigned long long
+neg1(unsigned a, unsigned b, unsigned c)
+{
+ return a ? b : -c;
+}
+
+
+/*
+** neg2:
+** cmp w0, 0
+** csneg w0, w2, w1, eq
+** ret
+*/
+unsigned long long
+neg2(unsigned a, unsigned b, unsigned c)
+{
+ return a ? -b : c;
+}
+
+/* { dg-final { check-function-bodies "**" "" "" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/get_fpcr64_1.c b/gcc/testsuite/gcc.target/aarch64/get_fpcr64_1.c
new file mode 100644
index 00000000000..66afca49107
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/get_fpcr64_1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+long long unsigned
+get_fpcr64 ()
+{
+ return __builtin_aarch64_get_fpcr64 ();
+}
+
+/* { dg-final { scan-assembler-times {\tmrs\tx0, fpcr\n} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/get_fpsr64_1.c b/gcc/testsuite/gcc.target/aarch64/get_fpsr64_1.c
new file mode 100644
index 00000000000..9e94f1cf3ea
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/get_fpsr64_1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+long long unsigned
+get_fpsr64 ()
+{
+ return __builtin_aarch64_get_fpsr64 ();
+}
+
+/* { dg-final { scan-assembler-times {\tmrs\tx0, fpsr\n} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/large_struct_copy_2.c b/gcc/testsuite/gcc.target/aarch64/large_struct_copy_2.c
index 565434244e8..8ee0a9fae92 100644
--- a/gcc/testsuite/gcc.target/aarch64/large_struct_copy_2.c
+++ b/gcc/testsuite/gcc.target/aarch64/large_struct_copy_2.c
@@ -16,11 +16,10 @@ struct S2 {
struct S0 f3;
};
-void fn1 () {
- struct S2 b = {0, 1, 7, 4073709551611, 4, 8, 7};
+void fn1 (struct S2 b) {
a = b.f3;
}
-/* { dg-final { scan-assembler-times {ldp\s+x[0-9]+} 2 } } */
-/* { dg-final { scan-assembler-times {stp\s+x[0-9]+} 2 } } */
+/* { dg-final { scan-assembler-times {ldp\s+q[0-9]+} 1 } } */
+/* { dg-final { scan-assembler-times {stp\s+q[0-9]+} 1 } } */
/* { dg-final { scan-assembler-not {ld[1-3]} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/ldp_vec_v2sf.c b/gcc/testsuite/gcc.target/aarch64/ldp_vec_v2sf.c
new file mode 100644
index 00000000000..fbdae1c6cff
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/ldp_vec_v2sf.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef float __attribute__((vector_size(8))) vec;
+
+vec
+load_long(vec *v) {
+ return v[110] + v[111] + v[112] + v[113];
+}
+
+/* { dg-final { scan-assembler {add\tx[0-9]+, x[0-9]+, 880} } } */
+/* { dg-final { scan-assembler {ldp\td[0-9]+, d[0-9]+, \[x[0-9]+\]} } } */
+/* { dg-final { scan-assembler {ldp\td[0-9]+, d[0-9]+, \[x[0-9]+, 16\]} } } */
+/* { dg-final { scan-assembler-not "ldr\t" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/ldp_vec_v2si.c b/gcc/testsuite/gcc.target/aarch64/ldp_vec_v2si.c
new file mode 100644
index 00000000000..7714cd6cd9e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/ldp_vec_v2si.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef int __attribute__((vector_size(8))) vec;
+
+vec
+load_long(vec *v) {
+ return v[110] + v[111] + v[112] + v[113];
+}
+
+/* { dg-final { scan-assembler {add\tx[0-9]+, x[0-9]+, 880} } } */
+/* { dg-final { scan-assembler {ldp\td[0-9]+, d[0-9]+, \[x[0-9]+\]} } } */
+/* { dg-final { scan-assembler {ldp\td[0-9]+, d[0-9]+, \[x[0-9]+, 16\]} } } */
+/* { dg-final { scan-assembler-not "ldr\t" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_5.c b/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_5.c
new file mode 100644
index 00000000000..589509a7a88
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_5.c
@@ -0,0 +1,14 @@
+/* { dg-options "-mgeneral-regs-only -O2" } */
+
+struct S { float d; };
+
+void bar (struct S);
+
+void
+f0 (int x)
+{
+ struct S s = { .d = 0.0f }; /* { dg-error "'-mgeneral-regs-only' is incompatible with the use of floating-point types" } */
+ ((char *) &s.d)[0] = x;
+ s.d *= 7.0; /* { dg-error "'-mgeneral-regs-only' is incompatible with the use of floating-point types" } */
+ bar (s); /* { dg-error "'-mgeneral-regs-only' is incompatible with the use of floating-point types" } */
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_6.c b/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_6.c
new file mode 100644
index 00000000000..427ae6a0e4b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_6.c
@@ -0,0 +1,15 @@
+/* { dg-options "-O2 -march=armv8.2-a+sve" } */
+/* { dg-prune-output "compilation terminated" } */
+
+#include <arm_sve.h>
+
+#pragma GCC push_options
+#pragma GCC target "general-regs-only"
+
+svint8x2_t
+foo (svint8_t x0, svint8_t x1) /* { dg-error {'foo' requires the SVE ISA extension} } */
+{
+ return svcreate2 (x0, x1); /* { dg-error {ACLE function 'svcreate2_s8' is incompatible with the use of '-mgeneral-regs-only'} } */
+}
+
+#pragma GCC pop_options
diff --git a/gcc/testsuite/gcc.target/aarch64/nospill.c b/gcc/testsuite/gcc.target/aarch64/nospill.c
new file mode 100644
index 00000000000..968a4267e0d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/nospill.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+/* The pseudo for P is marked as moveable in the IRA pass. */
+float
+func_0 (float a, float b, float c)
+{
+ float p = c / a;
+
+ if (b > 1)
+ {
+ b /= p;
+ if (c > 2)
+ a /= 3;
+ }
+
+ return b / c * a;
+}
+
+/* If first_moveable_pseudo and last_moveable_pseudo are not reset correctly,
+ they will carry over and spill the pseudo for Q. */
+float
+func_1 (float a, float b, float c)
+{
+ float q = a + b;
+
+ c *= a / (b + b);
+ if (a > 0)
+ c *= q;
+
+ return a * b * c;
+}
+
+/* We have plenty of spare registers, so check nothing has been spilled. */
+/* { dg-final { scan-assembler-not "\tstr\t" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/pr95254.c b/gcc/testsuite/gcc.target/aarch64/pr95254.c
new file mode 100644
index 00000000000..10bfc868197
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr95254.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-slp-vectorize -march=armv8.2-a+sve -msve-vector-bits=256" } */
+
+typedef short __attribute__((vector_size (8))) v4hi;
+
+typedef union U4HI { v4hi v; short a[4]; } u4hi;
+
+short b[4];
+
+void pass_v4hi (v4hi v)
+{
+ int i;
+ u4hi u;
+ u.v = v;
+ for (i = 0; i < 4; i++)
+ b[i] = u.a[i];
+};
+
+/* { dg-final { scan-assembler-not "ptrue" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/pr96377-1.c b/gcc/testsuite/gcc.target/aarch64/pr96377-1.c
new file mode 100644
index 00000000000..51e3e36edfc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr96377-1.c
@@ -0,0 +1,20 @@
+/* { dg-options "" } */
+
+#include <arm_neon.h>
+
+struct aegis128_state {
+ uint8x16_t v[5];
+};
+
+void foo(const void *key, const void *iv, const void *const0, const void *const1)
+{
+ uint8x16_t k = vld1q_u8(key);
+ uint8x16_t kiv = k ^ vld1q_u8(iv);
+ struct aegis128_state st = {{
+ kiv,
+ vld1q_u8(const1),
+ vld1q_u8(const0),
+ k ^ vld1q_u8(const0),
+ k ^ vld1q_u8(const1),
+ }};
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/pr96402.c b/gcc/testsuite/gcc.target/aarch64/pr96402.c
new file mode 100644
index 00000000000..fa2dddfac15
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr96402.c
@@ -0,0 +1,16 @@
+/* PR target/96402 */
+/* { dg-do run { target int128 } } */
+/* { dg-options "-moutline-atomics" } */
+
+int
+main ()
+{
+ __int128 a = 0;
+ __sync_val_compare_and_swap (&a, (__int128) 0, (__int128) 1);
+ if (a != 1)
+ __builtin_abort ();
+ __sync_val_compare_and_swap (&a, (__int128) 1, (((__int128) 0xdeadbeeffeedbac1ULL) << 64) | 0xabadcafe00c0ffeeULL);
+ if (a != ((((__int128) 0xdeadbeeffeedbac1ULL) << 64) | 0xabadcafe00c0ffeeULL))
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/return_address_sign_1.c b/gcc/testsuite/gcc.target/aarch64/return_address_sign_1.c
index 0140bee194f..232ba67ade0 100644
--- a/gcc/testsuite/gcc.target/aarch64/return_address_sign_1.c
+++ b/gcc/testsuite/gcc.target/aarch64/return_address_sign_1.c
@@ -41,12 +41,12 @@ func3 (int a, int b, int c)
void __attribute__ ((target ("arch=armv8.3-a")))
func4 (long offset, void *handler, int *ptr, int imm1, int imm2)
{
- /* paciasp */
+ /* no paciasp */
*ptr = imm1 + foo (imm1) + imm2;
__builtin_eh_return (offset, handler);
- /* autiasp */
+ /* no autiasp */
return;
}
-/* { dg-final { scan-assembler-times "autiasp" 4 } } */
-/* { dg-final { scan-assembler-times "paciasp" 4 } } */
+/* { dg-final { scan-assembler-times "autiasp" 3 } } */
+/* { dg-final { scan-assembler-times "paciasp" 3 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/return_address_sign_b_1.c b/gcc/testsuite/gcc.target/aarch64/return_address_sign_b_1.c
index 32d788ddf3f..43e32ab6cb7 100644
--- a/gcc/testsuite/gcc.target/aarch64/return_address_sign_b_1.c
+++ b/gcc/testsuite/gcc.target/aarch64/return_address_sign_b_1.c
@@ -41,12 +41,12 @@ func3 (int a, int b, int c)
void __attribute__ ((target ("arch=armv8.3-a")))
func4 (long offset, void *handler, int *ptr, int imm1, int imm2)
{
- /* pacibsp */
+ /* no pacibsp */
*ptr = imm1 + foo (imm1) + imm2;
__builtin_eh_return (offset, handler);
- /* autibsp */
+ /* no autibsp */
return;
}
-/* { dg-final { scan-assembler-times "pacibsp" 4 } } */
-/* { dg-final { scan-assembler-times "autibsp" 4 } } */
+/* { dg-final { scan-assembler-times "pacibsp" 3 } } */
+/* { dg-final { scan-assembler-times "autibsp" 3 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/set_fpcr64_1.c b/gcc/testsuite/gcc.target/aarch64/set_fpcr64_1.c
new file mode 100644
index 00000000000..0b95e33ad77
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/set_fpcr64_1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void
+set_fpcr64 (long long unsigned x)
+{
+ return __builtin_aarch64_set_fpcr64 (x);
+}
+
+/* { dg-final { scan-assembler-times {\tmsr\tfpcr, x0\n} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/set_fpsr64_1.c b/gcc/testsuite/gcc.target/aarch64/set_fpsr64_1.c
new file mode 100644
index 00000000000..e0256ea4db9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/set_fpsr64_1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void
+set_fpsr64 (long long unsigned x)
+{
+ return __builtin_aarch64_set_fpsr64 (x);
+}
+
+/* { dg-final { scan-assembler-times {\tmsr\tfpsr, x0\n} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/shrink_wrap_1.c b/gcc/testsuite/gcc.target/aarch64/shrink_wrap_1.c
new file mode 100644
index 00000000000..ab7cd74ec3b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/shrink_wrap_1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile { target { aarch64*-*-* } } } */
+/* { dg-options "-O2" } */
+/* { dg-final { check-function-bodies "**" "" } } */
+
+/*
+** foo:
+** ...
+** str d8, \[sp\]
+** ldr d8, \[sp\]
+** ...
+*/
+void
+foo (int x)
+{
+ int tmp[0x1000];
+ asm volatile ("" : "=m" (tmp));
+ if (x == 1)
+ asm volatile ("" ::: "d8");
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr-bti.c b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr-bti.c
new file mode 100644
index 00000000000..b1fb754c7b6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr-bti.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-mharden-sls=blr -mbranch-protection=bti" } */
+/*
+ Ensure that the SLS hardening of BLR leaves no BLR instructions.
+ Here we also check that there are no BR instructions with anything except an
+ x16 or x17 register. This is because a `BTI c` instruction can be branched
+ to using a BLR instruction using any register, but can only be branched to
+ with a BR using an x16 or x17 register.
+ */
+typedef int (foo) (int, int);
+typedef void (bar) (int, int);
+struct sls_testclass {
+ foo *x;
+ bar *y;
+ int left;
+ int right;
+};
+
+/* We test both RTL patterns for a call which returns a value and a call which
+ does not. */
+int blr_call_value (struct sls_testclass x)
+{
+ int retval = x.x(x.left, x.right);
+ if (retval % 10)
+ return 100;
+ return 9;
+}
+
+int blr_call (struct sls_testclass x)
+{
+ x.y(x.left, x.right);
+ if (x.left % 10)
+ return 100;
+ return 9;
+}
+
+/* { dg-final { scan-assembler-not {\tblr\t} } } */
+/* { dg-final { scan-assembler-not {\tbr\tx(?!16|17)} } } */
+/* { dg-final { scan-assembler {\tbr\tx(16|17)} } } */
+
diff --git a/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr.c b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr.c
new file mode 100644
index 00000000000..88baffffe54
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr.c
@@ -0,0 +1,33 @@
+/* { dg-additional-options "-mharden-sls=blr -save-temps" } */
+/* Ensure that the SLS hardening of BLR leaves no BLR instructions.
+ We only test that all BLR instructions have been removed, not that the
+ resulting code makes sense. */
+typedef int (foo) (int, int);
+typedef void (bar) (int, int);
+struct sls_testclass {
+ foo *x;
+ bar *y;
+ int left;
+ int right;
+};
+
+/* We test both RTL patterns for a call which returns a value and a call which
+ does not. */
+int blr_call_value (struct sls_testclass x)
+{
+ int retval = x.x(x.left, x.right);
+ if (retval % 10)
+ return 100;
+ return 9;
+}
+
+int blr_call (struct sls_testclass x)
+{
+ x.y(x.left, x.right);
+ if (x.left % 10)
+ return 100;
+ return 9;
+}
+
+/* { dg-final { scan-assembler-not {\tblr\t} } } */
+/* { dg-final { scan-assembler {\tbr\tx[0-9][0-9]?} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr-pacret.c b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr-pacret.c
new file mode 100644
index 00000000000..fa1887a71e7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr-pacret.c
@@ -0,0 +1,21 @@
+/* Avoid ILP32 since pacret is only available for LP64 */
+/* { dg-do compile { target { ! ilp32 } } } */
+/* { dg-additional-options "-mharden-sls=retbr -mbranch-protection=pac-ret -march=armv8.3-a" } */
+
+/* Testing the do_return pattern for retaa and retab. */
+long retbr_subcall(void);
+long retbr_do_return_retaa(void)
+{
+ return retbr_subcall()+1;
+}
+
+__attribute__((target("branch-protection=pac-ret+b-key")))
+long retbr_do_return_retab(void)
+{
+ return retbr_subcall()+1;
+}
+
+/* Ensure there are no BR or RET instructions which are not directly followed
+ by a speculation barrier. */
+/* { dg-final { scan-assembler-not {\t(br|ret|retaa|retab)\tx[0-9][0-9]?\n\t(?!dsb\tsy\n\tisb)} } } */
+/* { dg-final { scan-assembler-not {ret\t} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr.c b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr.c
new file mode 100644
index 00000000000..76b8d03afe4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr.c
@@ -0,0 +1,119 @@
+/* We ensure that -Wpedantic is off since it complains about the trampolines
+ we explicitly want to test. */
+/* { dg-additional-options "-mharden-sls=retbr -Wno-pedantic " } */
+/*
+ Ensure that the SLS hardening of RET and BR leaves no unprotected RET/BR
+ instructions.
+ */
+typedef int (foo) (int, int);
+typedef void (bar) (int, int);
+struct sls_testclass {
+ foo *x;
+ bar *y;
+ int left;
+ int right;
+};
+
+int
+retbr_sibcall_value_insn (struct sls_testclass x)
+{
+ return x.x(x.left, x.right);
+}
+
+void
+retbr_sibcall_insn (struct sls_testclass x)
+{
+ x.y(x.left, x.right);
+}
+
+/* Aim to test two different returns.
+ One that introduces a tail call in the middle of the function, and one that
+ has a normal return. */
+int
+retbr_multiple_returns (struct sls_testclass x)
+{
+ int temp;
+ if (x.left % 10)
+ return x.x(x.left, 100);
+ else if (x.right % 20)
+ {
+ return x.x(x.left * x.right, 100);
+ }
+ temp = x.left % x.right;
+ temp *= 100;
+ temp /= 2;
+ return temp % 3;
+}
+
+void
+retbr_multiple_returns_void (struct sls_testclass x)
+{
+ if (x.left % 10)
+ {
+ x.y(x.left, 100);
+ }
+ else if (x.right % 20)
+ {
+ x.y(x.left * x.right, 100);
+ }
+ return;
+}
+
+/* Testing the casesi jump via register. */
+__attribute__ ((optimize ("Os")))
+int
+retbr_casesi_dispatch (struct sls_testclass x)
+{
+ switch (x.left)
+ {
+ case -5:
+ return -2;
+ case -3:
+ return -1;
+ case 0:
+ return 0;
+ case 3:
+ return 1;
+ case 5:
+ break;
+ default:
+ __builtin_unreachable ();
+ }
+ return x.right;
+}
+
+/* Testing the BR in trampolines is mitigated against. */
+void f1 (void *);
+void f3 (void *, void (*)(void *));
+void f2 (void *);
+
+int
+retbr_trampolines (void *a, int b)
+{
+ if (!b)
+ {
+ f1 (a);
+ return 1;
+ }
+ if (b)
+ {
+ void retbr_tramp_internal (void *c)
+ {
+ if (c == a)
+ f2 (c);
+ }
+ f3 (a, retbr_tramp_internal);
+ }
+ return 0;
+}
+
+/* Testing the indirect_jump pattern. */
+void
+retbr_indirect_jump (int *buf)
+{
+ __builtin_longjmp(buf, 1);
+}
+
+/* Ensure there are no BR or RET instructions which are not directly followed
+ by a speculation barrier. */
+/* { dg-final { scan-assembler-not {\t(br|ret|retaa|retab)\tx[0-9][0-9]?\n\t(?!dsb\tsy\n\tisb|sb)} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-mitigation.exp b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-mitigation.exp
new file mode 100644
index 00000000000..812250379f8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-mitigation.exp
@@ -0,0 +1,73 @@
+# Regression driver for SLS mitigation on AArch64.
+# Copyright (C) 2020 Free Software Foundation, Inc.
+# Contributed by ARM Ltd.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>. */
+
+# Exit immediately if this isn't an AArch64 target.
+if {![istarget aarch64*-*-*] } then {
+ return
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+load_lib torture-options.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " "
+}
+
+# Initialize `dg'.
+dg-init
+torture-init
+
+# Use different architectures as well as the normal optimisation options.
+# (i.e. use both SB and DSB+ISB barriers).
+
+set save-dg-do-what-default ${dg-do-what-default}
+# Main loop.
+# Run with torture tests (i.e. a bunch of different optimisation levels) just
+# to increase test coverage.
+set dg-do-what-default assemble
+gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
+ "-save-temps" $DEFAULT_CFLAGS
+
+# Run the same tests but this time with SB extension.
+# Since not all supported assemblers will support that extension we decide
+# whether to assemble or just compile based on whether the extension is
+# supported for the available assembler.
+
+set templist {}
+foreach x $DG_TORTURE_OPTIONS {
+ lappend templist "$x -march=armv8.3-a+sb "
+ lappend templist "$x -march=armv8-a+sb "
+}
+set-torture-options $templist
+if { [check_effective_target_aarch64_asm_sb_ok] } {
+ set dg-do-what-default assemble
+} else {
+ set dg-do-what-default compile
+}
+gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
+ "-save-temps" $DEFAULT_CFLAGS
+set dg-do-what-default ${save-dg-do-what-default}
+
+# All done.
+torture-finish
+dg-finish
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-protector-1.c b/gcc/testsuite/gcc.target/aarch64/stack-protector-1.c
new file mode 100644
index 00000000000..73e83bc413f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/stack-protector-1.c
@@ -0,0 +1,89 @@
+/* { dg-do run } */
+/* { dg-require-effective-target fstack_protector } */
+/* { dg-options "-fstack-protector-all -O2" } */
+
+extern volatile long *stack_chk_guard_ptr;
+
+volatile long *
+get_ptr (void)
+{
+ return stack_chk_guard_ptr;
+}
+
+void __attribute__ ((noipa))
+f (void)
+{
+ volatile int x;
+ x = 1;
+ x += 1;
+}
+
+#define CHECK(REG) "\tcmp\tx0, " #REG "\n\tbeq\t1f\n"
+
+asm (
+" .pushsection .data\n"
+" .align 3\n"
+" .globl stack_chk_guard_ptr\n"
+"stack_chk_guard_ptr:\n"
+#if __ILP32__
+" .word __stack_chk_guard\n"
+#else
+" .xword __stack_chk_guard\n"
+#endif
+" .weak __stack_chk_guard\n"
+"__stack_chk_guard:\n"
+" .word 0xdead4321\n"
+" .word 0xbeef8765\n"
+" .text\n"
+" .globl main\n"
+" .type main, %function\n"
+"main:\n"
+" bl get_ptr\n"
+" str x0, [sp, #-16]!\n"
+" bl f\n"
+" str x0, [sp, #8]\n"
+" ldr x0, [sp]\n"
+#if __ILP32__
+" ldr w0, [x0]\n"
+#else
+" ldr x0, [x0]\n"
+#endif
+ CHECK (x1)
+ CHECK (x2)
+ CHECK (x3)
+ CHECK (x4)
+ CHECK (x5)
+ CHECK (x6)
+ CHECK (x7)
+ CHECK (x8)
+ CHECK (x9)
+ CHECK (x10)
+ CHECK (x11)
+ CHECK (x12)
+ CHECK (x13)
+ CHECK (x14)
+ CHECK (x15)
+ CHECK (x16)
+ CHECK (x17)
+ CHECK (x18)
+ CHECK (x19)
+ CHECK (x20)
+ CHECK (x21)
+ CHECK (x22)
+ CHECK (x23)
+ CHECK (x24)
+ CHECK (x25)
+ CHECK (x26)
+ CHECK (x27)
+ CHECK (x28)
+ CHECK (x29)
+ CHECK (x30)
+" ldr x1, [sp]\n"
+ CHECK (x1)
+" mov x0, #0\n"
+" b exit\n"
+"1:\n"
+" b abort\n"
+" .size main, .-main\n"
+" .popsection"
+);
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-protector-2.c b/gcc/testsuite/gcc.target/aarch64/stack-protector-2.c
new file mode 100644
index 00000000000..266c36fdbc6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/stack-protector-2.c
@@ -0,0 +1,6 @@
+/* { dg-do run } */
+/* { dg-require-effective-target fstack_protector } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-fstack-protector-all -O2 -fpic" } */
+
+#include "stack-protector-1.c"
diff --git a/gcc/testsuite/gcc.target/aarch64/stp_vec_v2df.c b/gcc/testsuite/gcc.target/aarch64/stp_vec_v2df.c
new file mode 100644
index 00000000000..3ee039d6415
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/stp_vec_v2df.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef double __attribute__((vector_size(16))) vec;
+
+void
+store_adjusted(vec *out, vec x, vec y)
+{
+ out[100] = x;
+ out[101] = y;
+ out[102] = y;
+ out[103] = x;
+}
+
+/* { dg-final { scan-assembler {add\tx[0-9]+, x[0-9]+, 1600} } } */
+/* { dg-final { scan-assembler {stp\tq[0-9]+, q[0-9]+, \[x[0-9]+\]} } } */
+/* { dg-final { scan-assembler {stp\tq[0-9]+, q[0-9]+, \[x[0-9]+, 32\]} } } */
+/* { dg-final { scan-assembler-not "str\t" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/stp_vec_v2di.c b/gcc/testsuite/gcc.target/aarch64/stp_vec_v2di.c
new file mode 100644
index 00000000000..85d7b5b955e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/stp_vec_v2di.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef long long __attribute__((vector_size(16))) vec;
+
+void
+store_adjusted(vec *out, vec x, vec y)
+{
+ out[100] = x;
+ out[101] = y;
+ out[102] = y;
+ out[103] = x;
+}
+
+/* { dg-final { scan-assembler {add\tx[0-9]+, x[0-9]+, 1600} } } */
+/* { dg-final { scan-assembler {stp\tq[0-9]+, q[0-9]+, \[x[0-9]+\]} } } */
+/* { dg-final { scan-assembler {stp\tq[0-9]+, q[0-9]+, \[x[0-9]+, 32\]} } } */
+/* { dg-final { scan-assembler-not "str\t" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/stp_vec_v2sf.c b/gcc/testsuite/gcc.target/aarch64/stp_vec_v2sf.c
new file mode 100644
index 00000000000..e7c2e6e62ce
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/stp_vec_v2sf.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef float __attribute__((vector_size(8))) vec;
+
+void
+store_adjusted(vec *out, vec x, vec y)
+{
+ out[400] = x;
+ out[401] = y;
+ out[402] = y;
+ out[403] = x;
+}
+
+/* { dg-final { scan-assembler {add\tx[0-9]+, x[0-9]+, 3200} } } */
+/* { dg-final { scan-assembler {stp\td[0-9]+, d[0-9]+, \[x[0-9]+\]} } } */
+/* { dg-final { scan-assembler {stp\td[0-9]+, d[0-9]+, \[x[0-9]+, 16\]} } } */
+/* { dg-final { scan-assembler-not "str\t" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/stp_vec_v2si.c b/gcc/testsuite/gcc.target/aarch64/stp_vec_v2si.c
new file mode 100644
index 00000000000..17b44a2aed5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/stp_vec_v2si.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef int __attribute__((vector_size(8))) vec;
+
+void
+store_adjusted(vec *out, vec x, vec y)
+{
+ out[400] = x;
+ out[401] = y;
+ out[402] = y;
+ out[403] = x;
+}
+
+/* { dg-final { scan-assembler {add\tx[0-9]+, x[0-9]+, 3200} } } */
+/* { dg-final { scan-assembler {stp\td[0-9]+, d[0-9]+, \[x[0-9]+\]} } } */
+/* { dg-final { scan-assembler {stp\td[0-9]+, d[0-9]+, \[x[0-9]+, 16\]} } } */
+/* { dg-final { scan-assembler-not "str\t" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c
new file mode 100644
index 00000000000..0f1a2b0e46b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c
@@ -0,0 +1,15 @@
+/* { dg-options "-msve-vector-bits=256" } */
+
+#include <arm_sve.h>
+
+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32)));
+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32)));
+
+void
+f (svuint8_t sve_u1, svint8_t sve_s1,
+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1)
+{
+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 };
+ gnu_uint8_t arr2[] = { gnu_s1 }; // { dg-error "incompatible types" }
+ gnu_uint8_t arr3[] = { sve_s1 }; // { dg-error "incompatible types" }
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c
new file mode 100644
index 00000000000..ac4e0d12ff8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c
@@ -0,0 +1,15 @@
+/* { dg-options "-msve-vector-bits=256 -flax-vector-conversions" } */
+
+#include <arm_sve.h>
+
+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32)));
+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32)));
+
+void
+f (svuint8_t sve_u1, svint8_t sve_s1,
+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1)
+{
+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 };
+ gnu_uint8_t arr2[] = { gnu_s1 };
+ gnu_uint8_t arr3[] = { sve_s1 };
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_8.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_8.c
new file mode 100644
index 00000000000..f302927c55b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_8.c
@@ -0,0 +1,101 @@
+/* { dg-options "-msve-vector-bits=256 -W -Wall" } */
+
+#include <arm_sve.h>
+
+#define N __ARM_FEATURE_SVE_BITS
+#define FIXED_ATTR __attribute__ ((arm_sve_vector_bits (N)))
+#define ALIGNED_ATTR __attribute__((aligned(N / 8)))
+
+typedef svint8_t var1;
+typedef __SVInt8_t var2;
+
+typedef const var1 const_var1;
+typedef const var2 const_var2;
+
+typedef var1 aligned_var1 ALIGNED_ATTR;
+typedef var2 aligned_var2 ALIGNED_ATTR;
+
+typedef var1 fixed1 FIXED_ATTR;
+typedef var1 fixed1_alias FIXED_ATTR;
+typedef var2 fixed2 FIXED_ATTR;
+
+typedef const_var1 const_fixed1 FIXED_ATTR;
+typedef const var1 const_fixed1_alias FIXED_ATTR;
+typedef const_var2 const_fixed2 FIXED_ATTR;
+
+typedef aligned_var1 aligned_fixed1 FIXED_ATTR;
+typedef var1 aligned_fixed1_alias FIXED_ATTR ALIGNED_ATTR;
+typedef aligned_var2 aligned_fixed2 FIXED_ATTR;
+
+extern fixed1 extern1;
+extern fixed1_alias extern1_alias;
+extern fixed2 extern2;
+
+extern const_fixed1 const_extern1;
+extern const_fixed1_alias const_extern1_alias;
+extern const_fixed2 const_extern2;
+
+fixed1 *ptr1a = &extern1;
+fixed1_alias *ptr1b = &extern1;
+fixed2 *ptr1c = &extern1;
+
+fixed1 *ptr2a = &extern1_alias;
+fixed1_alias *ptr2b = &extern1_alias;
+fixed2 *ptr2c = &extern1_alias;
+
+fixed1 *ptr3a = &extern2;
+fixed1_alias *ptr3b = &extern2;
+fixed2 *ptr3c = &extern2;
+
+fixed1 *ptr4a = &const_extern1; // { dg-error {invalid conversion} "c++" { target c++ } }
+ // { dg-warning {discards 'const' qualifier} "c" { target c } .-1 }
+fixed1_alias *ptr4b = &const_extern1; // { dg-error {invalid conversion} "c++" { target c++ } }
+ // { dg-warning {discards 'const' qualifier} "c" { target c } .-1 }
+fixed2 *ptr4c = &const_extern1; // { dg-error {invalid conversion} "c++" { target c++ } }
+ // { dg-warning {discards 'const' qualifier} "c" { target c } .-1 }
+
+const fixed1 *ptr5a = &const_extern2;
+const fixed1_alias *ptr5b = &const_extern2;
+const fixed2 *ptr5c = &const_extern2;
+
+const_fixed1 *const_ptr1a = &extern1;
+const_fixed1_alias *const_ptr1b = &extern1;
+const_fixed2 *const_ptr1c = &extern1;
+
+const_fixed1 *const_ptr2a = &extern1_alias;
+const_fixed1_alias *const_ptr2b = &extern1_alias;
+const_fixed2 *const_ptr2c = &extern1_alias;
+
+const_fixed1 *const_ptr3a = &extern2;
+const_fixed1_alias *const_ptr3b = &extern2;
+const_fixed2 *const_ptr3c = &extern2;
+
+const_fixed1 *const_ptr4a = &const_extern1;
+const_fixed1_alias *const_ptr4b = &const_extern1;
+const_fixed2 *const_ptr4c = &const_extern1;
+
+const_fixed1 *const_ptr5a = &const_extern1_alias;
+const_fixed1_alias *const_ptr5b = &const_extern1_alias;
+const_fixed2 *const_ptr5c = &const_extern1_alias;
+
+const_fixed1 *const_ptr6a = &const_extern2;
+const_fixed1_alias *const_ptr6b = &const_extern2;
+const_fixed2 *const_ptr6c = &const_extern2;
+
+struct normal1 { int x; fixed1 y; };
+struct normal1_alias { int x; fixed1_alias y; };
+struct normal2 { int x; fixed2 y; };
+
+struct aligned1 { int x; aligned_fixed1 y; };
+struct aligned1_alias { int x; aligned_fixed1_alias y; };
+struct aligned2 { int x; aligned_fixed2 y; };
+
+#define ASSERT(NAME, TEST) typedef int NAME[(TEST) ? 1 : -1]
+
+ASSERT (check_normal1, sizeof (struct normal1) == N / 8 + 16);
+ASSERT (check_normal1_alias, sizeof (struct normal1_alias) == N / 8 + 16);
+ASSERT (check_normal2, sizeof (struct normal2) == N / 8 + 16);
+
+ASSERT (check_aligned1, sizeof (struct aligned1) == N / 4);
+ASSERT (check_aligned1_alias, sizeof (struct aligned1_alias) == N / 4);
+ASSERT (check_aligned2, sizeof (struct aligned2) == N / 4);
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr96146.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr96146.c
new file mode 100644
index 00000000000..b05fac4918d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr96146.c
@@ -0,0 +1,20 @@
+/* { dg-do run { target aarch64_sve_hw } } */
+/* { dg-options "-O3" } */
+
+#include <arm_sve.h>
+
+void __attribute__ ((noipa))
+f (volatile int *x)
+{
+ int i;
+ for (int i = 0; i < svcntd (); ++i)
+ *x = i;
+}
+
+int
+main (void)
+{
+ volatile int x;
+ f (&x);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/clastb_1.c b/gcc/testsuite/gcc.target/aarch64/sve/clastb_1.c
index d3ea52dea47..f4445d443ac 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/clastb_1.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/clastb_1.c
@@ -17,5 +17,5 @@ condition_reduction (int *a, int min_v)
return last;
}
-/* { dg-final { scan-tree-dump "using a fully-masked loop." "vect" } } */
+/* { dg-final { scan-tree-dump "operating on partial vectors." "vect" } } */
/* { dg-final { scan-assembler {\tclastb\ts[0-9]+, p[0-7], s[0-9]+, z[0-9]+\.s} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/clastb_2.c b/gcc/testsuite/gcc.target/aarch64/sve/clastb_2.c
index c222b707912..27d4cd94a3c 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/clastb_2.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/clastb_2.c
@@ -23,5 +23,5 @@ condition_reduction (TYPE *a, TYPE min_v)
return last;
}
-/* { dg-final { scan-tree-dump "using a fully-masked loop." "vect" } } */
+/* { dg-final { scan-tree-dump "operating on partial vectors." "vect" } } */
/* { dg-final { scan-assembler {\tclastb\ts[0-9]+, p[0-7], s[0-9]+, z[0-9]+\.s} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/clastb_3.c b/gcc/testsuite/gcc.target/aarch64/sve/clastb_3.c
index 5aaa71f948d..597f8268413 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/clastb_3.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/clastb_3.c
@@ -5,5 +5,5 @@
#include "clastb_2.c"
-/* { dg-final { scan-tree-dump "using a fully-masked loop." "vect" } } */
+/* { dg-final { scan-tree-dump "operating on partial vectors." "vect" } } */
/* { dg-final { scan-assembler {\tclastb\tb[0-9]+, p[0-7], b[0-9]+, z[0-9]+\.b} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/clastb_4.c b/gcc/testsuite/gcc.target/aarch64/sve/clastb_4.c
index b4db170ea06..788e29fe982 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/clastb_4.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/clastb_4.c
@@ -5,5 +5,5 @@
#include "clastb_2.c"
-/* { dg-final { scan-tree-dump "using a fully-masked loop." "vect" } } */
+/* { dg-final { scan-tree-dump "operating on partial vectors." "vect" } } */
/* { dg-final { scan-assembler {\tclastb\tw[0-9]+, p[0-7], w[0-9]+, z[0-9]+\.h} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/clastb_5.c b/gcc/testsuite/gcc.target/aarch64/sve/clastb_5.c
index 28d40a01f93..0e7e20b69ec 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/clastb_5.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/clastb_5.c
@@ -5,5 +5,5 @@
#include "clastb_2.c"
-/* { dg-final { scan-tree-dump "using a fully-masked loop." "vect" } } */
+/* { dg-final { scan-tree-dump "operating on partial vectors." "vect" } } */
/* { dg-final { scan-assembler {\tclastb\td[0-9]+, p[0-7], d[0-9]+, z[0-9]+\.d} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/clastb_6.c b/gcc/testsuite/gcc.target/aarch64/sve/clastb_6.c
index 38632a21be1..b9d687e0597 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/clastb_6.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/clastb_6.c
@@ -21,5 +21,5 @@ condition_reduction (TYPE *a, TYPE min_v)
return last;
}
-/* { dg-final { scan-tree-dump "using a fully-masked loop." "vect" } } */
+/* { dg-final { scan-tree-dump "operating on partial vectors." "vect" } } */
/* { dg-final { scan-assembler {\tclastb\ts[0-9]+, p[0-7], s[0-9]+, z[0-9]+\.s} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/clastb_7.c b/gcc/testsuite/gcc.target/aarch64/sve/clastb_7.c
index e5307d2edc8..a9f1a6aea98 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/clastb_7.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/clastb_7.c
@@ -4,5 +4,5 @@
#define TYPE double
#include "clastb_6.c"
-/* { dg-final { scan-tree-dump "using a fully-masked loop." "vect" } } */
+/* { dg-final { scan-tree-dump "operating on partial vectors." "vect" } } */
/* { dg-final { scan-assembler {\tclastb\td[0-9]+, p[0-7], d[0-9]+, z[0-9]+\.d} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/cost_model_2.c b/gcc/testsuite/gcc.target/aarch64/sve/cost_model_2.c
index d9d707893d8..a7d748397d6 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/cost_model_2.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/cost_model_2.c
@@ -9,4 +9,4 @@ vset (int *restrict dst, int *restrict src, int count)
*dst++ = 1;
}
-/* { dg-final { scan-assembler-times {\tst1w\tz} 1 } } */
+/* { dg-final { scan-assembler-times {\tstr\tq} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/load_const_offset_2.c b/gcc/testsuite/gcc.target/aarch64/sve/load_const_offset_2.c
index e02a6b5abee..0aab81b8560 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/load_const_offset_2.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/load_const_offset_2.c
@@ -1,5 +1,5 @@
/* { dg-do assemble { target aarch64_asm_sve_ok } } */
-/* { dg-options "-O2 -ftree-vectorize -save-temps" } */
+/* { dg-options "-O2 -ftree-vectorize -save-temps --param aarch64-sve-compare-costs=0" } */
#include <stdint.h>
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_abs.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_abs.c
new file mode 100644
index 00000000000..814e44cfbb9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_abs.c
@@ -0,0 +1,16 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+#include <stdlib.h>
+
+void
+f (uint32_t *restrict dst, int8_t *restrict src)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (int8_t) abs(src[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tabs\tz[0-9]+\.b, p[0-9]+/m, z[0-9]+\.b\n} 1 } } */
+/* { dg-final { scan-assembler-times {\tsxtb\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_1.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_1.c
new file mode 100644
index 00000000000..784035528f7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_1.c
@@ -0,0 +1,16 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint32_t *restrict dst, uint16_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint16_t) (src1[i] & src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tand\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 1 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_2.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_2.c
new file mode 100644
index 00000000000..08b274512e1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_2.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint16_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint16_t) (src1[i] & src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtb\tz[0-9]+\.h,} 1 } } */
+/* { dg-final { scan-assembler-times {\tand\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_3.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_3.c
new file mode 100644
index 00000000000..c823470ca92
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_3.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint32_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint32_t) (src1[i] & src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1w\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtb\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tand\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtw\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_4.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_4.c
new file mode 100644
index 00000000000..52c92911d9b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_4.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint32_t *restrict src1, uint16_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint32_t) (src1[i] & src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1w\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tand\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtw\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_5.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_5.c
new file mode 100644
index 00000000000..784035528f7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_5.c
@@ -0,0 +1,16 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint32_t *restrict dst, uint16_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint16_t) (src1[i] & src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tand\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 1 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_6.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_6.c
new file mode 100644
index 00000000000..1552ed85302
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_6.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint16_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint16_t) (src1[i] & src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtb\tz[0-9]+\.h,} 1 } } */
+/* { dg-final { scan-assembler-times {\tand\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_7.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_7.c
new file mode 100644
index 00000000000..484d9daf38f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_and_7.c
@@ -0,0 +1,16 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint32_t *restrict src1, uint8_t *restrict src2){
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint32_t) (src1[i] & src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1w\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtb\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tand\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtw\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_1.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_1.c
new file mode 100644
index 00000000000..2460305630d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_1.c
@@ -0,0 +1,15 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint32_t *restrict src1, uint32_t *restrict src2)
+{
+ for (int i = 0; i < 3; ++i)
+ dst[i] = (uint32_t) (src1[i] & ~src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1w\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tbic\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 1 } } */
+/* { dg-final { scan-assembler-times {\tuxtw\tz[0-9]+\.d,} 1 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_2.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_2.c
new file mode 100644
index 00000000000..61066a940f5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_2.c
@@ -0,0 +1,15 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint8_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 3; ++i)
+ dst[i] = (uint8_t) (src1[i] & ~src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tbic\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 1 } } */
+/* { dg-final { scan-assembler-times {\tuxtb\tz[0-9]+\.d,} 1 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_3.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_3.c
new file mode 100644
index 00000000000..2c9586a36f6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_3.c
@@ -0,0 +1,15 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint32_t *restrict dst, uint16_t *restrict src1, uint16_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint16_t) (src1[i] & ~src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.s,} 2 } } */
+/* { dg-final { scan-assembler-times {\tbic\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 1 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_4.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_4.c
new file mode 100644
index 00000000000..5fca2144355
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_bic_4.c
@@ -0,0 +1,15 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint16_t *restrict dst, uint8_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 15; ++i)
+ dst[i] = (uint8_t) (src1[i] & ~src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.h,} 2 } } */
+/* { dg-final { scan-assembler-times {\tbic\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 1 } } */
+/* { dg-final { scan-assembler-times {\tuxtb\tz[0-9]+\.h,} 1 } } */
+/* { dg-final { scan-assembler-times {\tst1h\tz[0-9]+\.h,} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_1.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_1.c
new file mode 100644
index 00000000000..36a0b8c0c02
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_1.c
@@ -0,0 +1,16 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint32_t *restrict dst, uint16_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint16_t) (src1[i] ^ src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\teor\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 1 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_2.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_2.c
new file mode 100644
index 00000000000..23ddeb9f9b1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_2.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint16_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint16_t) (src1[i] ^ src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtb\tz[0-9]+\.h,} 1 } } */
+/* { dg-final { scan-assembler-times {\teor\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_3.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_3.c
new file mode 100644
index 00000000000..4dd1e085646
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_3.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint32_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint32_t) (src1[i] ^ src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1w\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtb\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\teor\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtw\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_4.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_4.c
new file mode 100644
index 00000000000..a31a2d425fa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_4.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint32_t *restrict src1, uint16_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint32_t) (src1[i] ^ src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1w\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\teor\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtw\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_5.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_5.c
new file mode 100644
index 00000000000..36a0b8c0c02
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_5.c
@@ -0,0 +1,16 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint32_t *restrict dst, uint16_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint16_t) (src1[i] ^ src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\teor\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 1 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_6.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_6.c
new file mode 100644
index 00000000000..416567b21f7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_6.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint16_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint16_t) (src1[i] ^ src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtb\tz[0-9]+\.h,} 1 } } */
+/* { dg-final { scan-assembler-times {\teor\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_7.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_7.c
new file mode 100644
index 00000000000..3f7c3ddbba8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_eor_7.c
@@ -0,0 +1,16 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint32_t *restrict src1, uint8_t *restrict src2){
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint32_t) (src1[i] ^ src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1w\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtb\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\teor\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtw\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_neg.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_neg.c
new file mode 100644
index 00000000000..1f8b3d349f3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_neg.c
@@ -0,0 +1,16 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+#include <stdlib.h>
+
+void
+f (uint32_t *restrict dst, int8_t *restrict src)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (int8_t) -src[i];
+}
+
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tneg\tz[0-9]+\.b, p[0-9]+/m, z[0-9]+\.b\n} 1 } } */
+/* { dg-final { scan-assembler-times {\tsxtb\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_not.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_not.c
new file mode 100644
index 00000000000..a9d36b842c5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_not.c
@@ -0,0 +1,16 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+#include <stdlib.h>
+
+void
+f (uint32_t *restrict dst, int8_t *restrict src)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (int8_t) ~src[i];
+}
+
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tnot\tz[0-9]+\.b, p[0-9]+/m, z[0-9]+\.b\n} 1 } } */
+/* { dg-final { scan-assembler-times {\tsxtb\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_1.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_1.c
new file mode 100644
index 00000000000..6131792c82f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_1.c
@@ -0,0 +1,16 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint32_t *restrict dst, uint16_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint16_t) (src1[i] | src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\torr\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 1 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_2.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_2.c
new file mode 100644
index 00000000000..593de65a02c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_2.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint16_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint16_t) (src1[i] | src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtb\tz[0-9]+\.h,} 1 } } */
+/* { dg-final { scan-assembler-times {\torr\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_3.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_3.c
new file mode 100644
index 00000000000..ec34e753eab
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_3.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint32_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint32_t) (src1[i] | src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1w\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtb\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\torr\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtw\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_4.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_4.c
new file mode 100644
index 00000000000..561a104a23f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_4.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint32_t *restrict src1, uint16_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint32_t) (src1[i] | src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1w\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\torr\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtw\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_5.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_5.c
new file mode 100644
index 00000000000..6131792c82f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_5.c
@@ -0,0 +1,16 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint32_t *restrict dst, uint16_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint16_t) (src1[i] | src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\torr\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 1 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_6.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_6.c
new file mode 100644
index 00000000000..3ce1c3fb1e6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_6.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint16_t *restrict src1, uint8_t *restrict src2)
+{
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint16_t) (src1[i] | src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtb\tz[0-9]+\.h,} 1 } } */
+/* { dg-final { scan-assembler-times {\torr\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxth\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_7.c b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_7.c
new file mode 100644
index 00000000000..e6a429167ea
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/logical_unpacked_orr_7.c
@@ -0,0 +1,16 @@
+/* { dg-options "-O3 -msve-vector-bits=256" } */
+
+#include <stdint.h>
+
+void
+f (uint64_t *restrict dst, uint32_t *restrict src1, uint8_t *restrict src2){
+ for (int i = 0; i < 7; ++i)
+ dst[i] = (uint32_t) (src1[i] | src2[i]);
+}
+
+/* { dg-final { scan-assembler-times {\tld1w\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtb\tz[0-9]+\.s,} 1 } } */
+/* { dg-final { scan-assembler-times {\torr\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 2 } } */
+/* { dg-final { scan-assembler-times {\tuxtw\tz[0-9]+\.d,} 2 } } */
+/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr95199.c b/gcc/testsuite/gcc.target/aarch64/sve/pr95199.c
new file mode 100644
index 00000000000..adcd5124a7c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/pr95199.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=armv8.2-a+sve -fdump-tree-vect" } */
+
+void
+foo (double *a, double *b, double m, int inc_x, int inc_y)
+{
+ int ix = 0, iy = 0;
+ for (int i = 0; i < 1000; ++i)
+ {
+ a[ix] += m * b[iy];
+ ix += inc_x;
+ iy += inc_y;
+ }
+ return ;
+}
+
+/* { dg-final { scan-tree-dump-times "VEC_SERIES_EXPR" 2 "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr95361.c b/gcc/testsuite/gcc.target/aarch64/sve/pr95361.c
new file mode 100644
index 00000000000..ce70d0d5cdf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/pr95361.c
@@ -0,0 +1,11 @@
+/* { dg-options "-O2" } */
+
+__SVInt8_t
+f (__SVInt8_t x, int y)
+{
+ if (y == 1)
+ asm volatile ("" ::: "z8");
+ if (y == 2)
+ asm volatile ("" ::: "z9");
+ return x;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr95523.c b/gcc/testsuite/gcc.target/aarch64/sve/pr95523.c
new file mode 100644
index 00000000000..547120a82ec
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/pr95523.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fpack-struct=2" } */
+
+#include <arm_sve.h>
+
+void foo ()
+{
+ // Do nothing
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr95961.c b/gcc/testsuite/gcc.target/aarch64/sve/pr95961.c
new file mode 100644
index 00000000000..b9802c8d0cd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/pr95961.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=armv8.2-a+sve -fno-vect-cost-model" } */
+
+typedef struct {
+ unsigned short mprr_2[5][16][16];
+} ImageParameters;
+int s[16][2];
+void intrapred_luma_16x16(ImageParameters *img, int s0)
+{
+ for (int j=0; j < 16; j++)
+ for (int i=0; i < 16; i++)
+ {
+ img->mprr_2[1 ][j][i]=s[j][1];
+ img->mprr_2[2 ][j][i]=s0;
+ }
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr96195.c b/gcc/testsuite/gcc.target/aarch64/sve/pr96195.c
new file mode 100644
index 00000000000..d879efda5c8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/pr96195.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fopenmp-simd -ftree-vectorize -msve-vector-bits=128" } */
+
+int by;
+
+#pragma omp declare simd
+int
+zp (int);
+
+void
+qh (int oh)
+{
+#pragma omp simd
+ for (by = 0; by < oh; ++by)
+ by = zp (by);
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/scatter_store_6.c b/gcc/testsuite/gcc.target/aarch64/sve/scatter_store_6.c
index ee31562440f..a9c37c4414b 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/scatter_store_6.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/scatter_store_6.c
@@ -1,5 +1,5 @@
/* { dg-do assemble { target aarch64_asm_sve_ok } } */
-/* { dg-options "-O2 -ftree-vectorize -fwrapv --save-temps" } */
+/* { dg-options "-O2 -ftree-vectorize -fwrapv --save-temps --param aarch64-sve-compare-costs=0" } */
#include <stdint.h>
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/scatter_store_7.c b/gcc/testsuite/gcc.target/aarch64/sve/scatter_store_7.c
index 784921e5d3c..147eadc63a4 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/scatter_store_7.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/scatter_store_7.c
@@ -1,5 +1,5 @@
/* { dg-do assemble { target aarch64_asm_sve_ok } } */
-/* { dg-options "-O2 -ftree-vectorize --save-temps" } */
+/* { dg-options "-O2 -ftree-vectorize --save-temps --param aarch64-sve-compare-costs=0" } */
#define INDEX16 uint16_t
#define INDEX32 uint32_t
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/strided_load_3.c b/gcc/testsuite/gcc.target/aarch64/sve/strided_load_3.c
index 8f720dcc1b6..2e7cd98e906 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/strided_load_3.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/strided_load_3.c
@@ -1,5 +1,5 @@
/* { dg-do assemble { target aarch64_asm_sve_ok } } */
-/* { dg-options "-O2 -ftree-vectorize --save-temps" } */
+/* { dg-options "-O2 -ftree-vectorize --save-temps --param aarch64-sve-compare-costs=0" } */
#include <stdint.h>
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/strided_store_3.c b/gcc/testsuite/gcc.target/aarch64/sve/strided_store_3.c
index 68835af5fe8..335f99bb5a9 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/strided_store_3.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/strided_store_3.c
@@ -1,5 +1,5 @@
/* { dg-do assemble { target aarch64_asm_sve_ok } } */
-/* { dg-options "-O2 -ftree-vectorize --save-temps" } */
+/* { dg-options "-O2 -ftree-vectorize --save-temps --param aarch64-sve-compare-costs=0" } */
#include <stdint.h>
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/unpack_signed_1.c b/gcc/testsuite/gcc.target/aarch64/sve/unpack_signed_1.c
index d4da3690f48..ecb6e99400c 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/unpack_signed_1.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/unpack_signed_1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -fno-inline" } */
+/* { dg-options "-O2 -ftree-vectorize -fno-inline --param aarch64-sve-compare-costs=0" } */
#include <stdint.h>
diff --git a/gcc/testsuite/gcc.target/aarch64/target_attr_20.c b/gcc/testsuite/gcc.target/aarch64/target_attr_20.c
new file mode 100644
index 00000000000..509fb039e84
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/target_attr_20.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-march=armv8-a+nolse -moutline-atomics" } */
+
+int b, c, d, e, f, h;
+short g;
+int foo (int) __attribute__ ((__const__));
+
+__attribute__ ((target ("no-outline-atomics")))
+void
+bar (void)
+{
+ while (1)
+ {
+ while (1)
+ {
+ __atomic_load_n (&e, 0);
+ if (foo (2))
+ __sync_val_compare_and_swap (&c, 0, f);
+ b = 1;
+ if (h == e)
+ break;
+ }
+ __sync_val_compare_and_swap (&g, -1, f);
+ }
+}
+
+/* { dg-final { scan-assembler-not "bl.*__aarch64_cas2_acq_rel" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/target_attr_21.c b/gcc/testsuite/gcc.target/aarch64/target_attr_21.c
new file mode 100644
index 00000000000..acace4c8f2a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/target_attr_21.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-march=armv8-a+nolse -mno-outline-atomics" } */
+
+int b, c, d, e, f, h;
+short g;
+int foo (int) __attribute__ ((__const__));
+
+__attribute__ ((target ("outline-atomics")))
+void
+bar (void)
+{
+ while (1)
+ {
+ while (1)
+ {
+ __atomic_load_n (&e, 0);
+ if (foo (2))
+ __sync_val_compare_and_swap (&c, 0, f);
+ b = 1;
+ if (h == e)
+ break;
+ }
+ __sync_val_compare_and_swap (&g, -1, f);
+ }
+}
+
+/* { dg-final { scan-assembler-times "bl.*__aarch64_cas2_acq_rel" 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/vdup_n_3.c b/gcc/testsuite/gcc.target/aarch64/vdup_n_3.c
new file mode 100644
index 00000000000..5234f5e563d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/vdup_n_3.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#define vector __attribute__((vector_size(4*sizeof(float))))
+
+/* These are both dups. */
+vector float f(vector float a, vector float b)
+{
+ return __builtin_shuffle (a, a, (vector int){0, 1, 0, 1});
+}
+vector float f1(vector float a, vector float b)
+{
+ return __builtin_shuffle (a, a, (vector int){2, 3, 2, 3});
+}
+
+/* { dg-final { scan-assembler-times {[ \t]*dup[ \t]+v[0-9]+\.2d} 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/vins-1.c b/gcc/testsuite/gcc.target/aarch64/vins-1.c
new file mode 100644
index 00000000000..eefb93c262a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/vins-1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#define vector __attribute__((vector_size(4*sizeof(float))))
+
+vector float f0(vector float a, vector float b)
+{
+ return __builtin_shuffle (a, a, (vector int){3, 1, 2, 3});
+}
+vector float f1(vector float a, vector float b)
+{
+ return __builtin_shuffle (a, a, (vector int){0, 0, 2, 3});
+}
+vector float f2(vector float a, vector float b)
+{
+ return __builtin_shuffle (a, a, (vector int){0, 1, 0, 3});
+}
+vector float f3(vector float a, vector float b)
+{
+ return __builtin_shuffle (a, a, (vector int){0, 1, 2, 0});
+}
+
+/* { dg-final { scan-assembler-times {[ \t]*ins[ \t]+v[0-9]+\.s} 4 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/vins-2.c b/gcc/testsuite/gcc.target/aarch64/vins-2.c
new file mode 100644
index 00000000000..1501b600c03
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/vins-2.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#define vector __attribute__((vector_size(8*sizeof(short))))
+
+vector short f0(vector short a, vector short b)
+{
+ return __builtin_shuffle (a, a, (vector short){6, 1, 2, 3, 4, 5, 6, 7});
+}
+vector short f2(vector short a, vector short b)
+{
+ return __builtin_shuffle (a, a, (vector short){0, 1, 2, 1, 4, 5, 6, 7});
+}
+vector short f4(vector short a, vector short b)
+{
+ return __builtin_shuffle (a, a, (vector short){0, 1, 2, 3, 0, 5, 6, 7});
+}
+vector short f6(vector short a, vector short b)
+{
+ return __builtin_shuffle (a, a, (vector short){0, 1, 2, 3, 4, 5, 6, 1});
+}
+
+/* { dg-final { scan-assembler-times {[ \t]*ins[ \t]+v[0-9]+\.h} 4 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/vins-3.c b/gcc/testsuite/gcc.target/aarch64/vins-3.c
new file mode 100644
index 00000000000..3b087019ce1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/vins-3.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#define vector __attribute__((vector_size(4*sizeof(float))))
+
+vector float f0(vector float a, vector float b)
+{
+ return __builtin_shuffle (a, b, (vector int){0, 5, 6, 7});
+}
+vector float f1(vector float a, vector float b)
+{
+ return __builtin_shuffle (a, b, (vector int){4, 0, 6, 7});
+}
+vector float f2(vector float a, vector float b)
+{
+ return __builtin_shuffle (a, b, (vector int){4, 5, 0, 7});
+}
+vector float f3(vector float a, vector float b)
+{
+ return __builtin_shuffle (a, b, (vector int){4, 5, 6, 0});
+}
+
+/* { dg-final { scan-assembler-times {[ \t]*ins[ \t]+v[0-9]+\.s} 4 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/vzip_1.c b/gcc/testsuite/gcc.target/aarch64/vzip_1.c
new file mode 100644
index 00000000000..837adb029cb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/vzip_1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target aarch64_little_endian } */
+
+#define vector __attribute__((vector_size(2*sizeof(float))))
+
+vector float f(vector float a, vector float b)
+{
+ return __builtin_shuffle (a, b, (vector int){0, 2});
+}
+
+/* { dg-final { scan-assembler-times {[ \t]*zip1[ \t]+v[0-9]+\.2s} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/vzip_2.c b/gcc/testsuite/gcc.target/aarch64/vzip_2.c
new file mode 100644
index 00000000000..2287d815ffc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/vzip_2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target aarch64_little_endian } */
+
+#define vector __attribute__((vector_size(4*sizeof(float))))
+
+vector float f(vector float a, vector float b)
+{
+ /* This is the same as zip1 v.2d as {0, 1, 4, 5} can be converted to {0, 2}. */
+ return __builtin_shuffle (a, b, (vector int){0, 1, 4, 5});
+}
+
+/* { dg-final { scan-assembler-times {[ \t]*zip1[ \t]+v[0-9]+\.2d} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/vzip_3.c b/gcc/testsuite/gcc.target/aarch64/vzip_3.c
new file mode 100644
index 00000000000..91c444b8d88
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/vzip_3.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target aarch64_little_endian } */
+
+#define vector __attribute__((vector_size(4*sizeof(float))))
+
+vector float f(vector float a, vector float b)
+{
+ /* This is the same as zip1 v.2d as {4, 5, 0, 1} can be converted to {2, 0}. */
+ return __builtin_shuffle (a, b, (vector int){4, 5, 0, 1});
+}
+
+/* { dg-final { scan-assembler-times {[ \t]*zip1[ \t]+v[0-9]+\.2d} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/vzip_4.c b/gcc/testsuite/gcc.target/aarch64/vzip_4.c
new file mode 100644
index 00000000000..b4047e22b73
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/vzip_4.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target aarch64_little_endian } */
+
+#define vector __attribute__((vector_size(4*sizeof(float))))
+
+vector float f(vector float a, vector float b)
+{
+ /* This is the same as zip2 v.2d as {2, 3, 6, 7} can be converted to {1, 3}. */
+ return __builtin_shuffle (a, b, (vector int){2, 3, 6, 7});
+}
+
+/* { dg-final { scan-assembler-times {[ \t]*zip2[ \t]+v[0-9]+\.2d} 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/empty_fiq_handler.c b/gcc/testsuite/gcc.target/arm/empty_fiq_handler.c
index 8313f219912..6911ffce1c8 100644
--- a/gcc/testsuite/gcc.target/arm/empty_fiq_handler.c
+++ b/gcc/testsuite/gcc.target/arm/empty_fiq_handler.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-skip-if "" { ! arm_cortex_m } { "-mthumb" } } */
+/* { dg-options "-mgeneral-regs-only" } */
/* Below code used to trigger an ICE due to missing constraints for
sp = fp + cst pattern. */
diff --git a/gcc/testsuite/gcc.target/arm/handler-align.c b/gcc/testsuite/gcc.target/arm/handler-align.c
index 6c5187b2028..93db8e2a738 100644
--- a/gcc/testsuite/gcc.target/arm/handler-align.c
+++ b/gcc/testsuite/gcc.target/arm/handler-align.c
@@ -1,6 +1,6 @@
/* Test epilogue of a realigned interrupt handler. */
/* { dg-do run } */
-/* { dg-options "-mthumb -Os" } */
+/* { dg-options "-mthumb -Os -mgeneral-regs-only" } */
/* { dg-skip-if "" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */
/* { dg-require-effective-target arm_cortex_m } */
/* { dg-require-effective-target arm_eabi } */
diff --git a/gcc/testsuite/gcc.target/arm/interrupt-1.c b/gcc/testsuite/gcc.target/arm/interrupt-1.c
index 493763d7d4c..de1ecc503c4 100644
--- a/gcc/testsuite/gcc.target/arm/interrupt-1.c
+++ b/gcc/testsuite/gcc.target/arm/interrupt-1.c
@@ -2,7 +2,7 @@
__attribute__ ((interrupt)). */
/* { dg-do assemble } */
/* { dg-require-effective-target arm_nothumb } */
-/* { dg-options "-O0 -marm -save-temps" } */
+/* { dg-options "-mgeneral-regs-only -O0 -marm -save-temps" } */
/* This test is not valid when -mthumb. */
extern void bar (int);
diff --git a/gcc/testsuite/gcc.target/arm/interrupt-2.c b/gcc/testsuite/gcc.target/arm/interrupt-2.c
index 5be1f1612ac..c64b98b9502 100644
--- a/gcc/testsuite/gcc.target/arm/interrupt-2.c
+++ b/gcc/testsuite/gcc.target/arm/interrupt-2.c
@@ -2,7 +2,7 @@
__attribute__ ((interrupt)). */
/* { dg-do assemble } */
/* { dg-require-effective-target arm_nothumb } */
-/* { dg-options "-O1 -marm -save-temps" } */
+/* { dg-options "-mgeneral-regs-only -O1 -marm -save-temps" } */
/* This test is not valid when -mthumb. */
extern void bar (int);
diff --git a/gcc/testsuite/gcc.target/arm/ivopts.c b/gcc/testsuite/gcc.target/arm/ivopts.c
index 5d272405ec6..2733e66988e 100644
--- a/gcc/testsuite/gcc.target/arm/ivopts.c
+++ b/gcc/testsuite/gcc.target/arm/ivopts.c
@@ -11,6 +11,6 @@ tr5 (short array[], int n)
}
/* { dg-final { scan-tree-dump-times "PHI <" 1 "ivopts"} } */
-/* { dg-final { object-size text <= 20 { target arm_thumb2 } } } */
+/* { dg-final { object-size text <= 20 { target { arm_thumb2_ok_no_arm_v8_1_lob } } } } */
/* { dg-final { object-size text <= 32 { target { arm_nothumb && { ! arm_iwmmxt_ok } } } } } */
/* { dg-final { object-size text <= 36 { target { arm_nothumb && arm_iwmmxt_ok } } } } */
diff --git a/gcc/testsuite/gcc.target/arm/lob.h b/gcc/testsuite/gcc.target/arm/lob.h
new file mode 100644
index 00000000000..feaae7cc899
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/lob.h
@@ -0,0 +1,15 @@
+#include <string.h>
+
+/* Common code for lob tests. */
+
+#define NO_LOB asm volatile ("@ clobber lr" : : : "lr" )
+
+#define N 10000
+
+static void
+reset_data (int *a, int *b, int *c)
+{
+ memset (a, -1, N * sizeof (*a));
+ memset (b, -1, N * sizeof (*b));
+ memset (c, -1, N * sizeof (*c));
+}
diff --git a/gcc/testsuite/gcc.target/arm/lob1.c b/gcc/testsuite/gcc.target/arm/lob1.c
new file mode 100644
index 00000000000..b92dc551d50
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/lob1.c
@@ -0,0 +1,85 @@
+/* Check that GCC generates Armv8.1-M low over head loop instructions
+ for some simple loops. */
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_1_lob_ok } */
+/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
+/* { dg-options "-march=armv8.1-m.main -O3 --save-temps" } */
+#include <stdlib.h>
+#include "lob.h"
+
+int a[N];
+int b[N];
+int c[N];
+
+int
+foo (int a, int b)
+{
+ return a + b;
+}
+
+void __attribute__((noinline))
+loop1 (int *a, int *b, int *c)
+{
+ for (int i = 0; i < N; i++)
+ {
+ a[i] = i;
+ b[i] = i * 2;
+ c[i] = a[i] + b[i];
+ }
+}
+
+void __attribute__((noinline))
+loop2 (int *a, int *b, int *c)
+{
+ int i = 0;
+ while (i < N)
+ {
+ a[i] = i - 2;
+ b[i] = i * 5;
+ c[i] = a[i] + b[i];
+ i++;
+ }
+}
+
+void __attribute__((noinline))
+loop3 (int *a, int *b, int *c)
+{
+ int i = 0;
+ do
+ {
+ a[i] = i - 4;
+ b[i] = i * 3;
+ c[i] = a[i] + b[i];
+ i++;
+ } while (i < N);
+}
+
+void
+check (int *a, int *b, int *c)
+{
+ for (int i = 0; i < N; i++)
+ {
+ NO_LOB;
+ if (c[i] != a[i] + b[i])
+ abort ();
+ }
+}
+
+int
+main (void)
+{
+ reset_data (a, b, c);
+ loop1 (a, b ,c);
+ check (a, b ,c);
+ reset_data (a, b, c);
+ loop2 (a, b ,c);
+ check (a, b ,c);
+ reset_data (a, b, c);
+ loop3 (a, b ,c);
+ check (a, b ,c);
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {dls\s\S*,\s\S*} 3 } } */
+/* { dg-final { scan-assembler-times {le\slr,\s\S*} 3 } } */
diff --git a/gcc/testsuite/gcc.target/arm/lob2.c b/gcc/testsuite/gcc.target/arm/lob2.c
new file mode 100644
index 00000000000..1fe9a9d82bb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/lob2.c
@@ -0,0 +1,32 @@
+/* Check that GCC does not generate Armv8.1-M low over head loop instructions
+ if a non-inlineable function call takes place inside the loop. */
+/* { dg-do compile } */
+/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
+/* { dg-options "-march=armv8.1-m.main -O3 --save-temps" } */
+#include <stdlib.h>
+#include "lob.h"
+
+int a[N];
+int b[N];
+int c[N];
+
+int __attribute__ ((noinline))
+foo (int a, int b)
+{
+ return a + b;
+}
+
+int
+main (void)
+{
+ for (int i = 0; i < N; i++)
+ {
+ a[i] = i;
+ b[i] = i * 2;
+ c[i] = foo (a[i], b[i]);
+ }
+
+ return 0;
+}
+/* { dg-final { scan-assembler-not {dls\s\S*,\s\S*} } } */
+/* { dg-final { scan-assembler-not {le\slr,\s\S*} } } */
diff --git a/gcc/testsuite/gcc.target/arm/lob3.c b/gcc/testsuite/gcc.target/arm/lob3.c
new file mode 100644
index 00000000000..17cba007ccb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/lob3.c
@@ -0,0 +1,27 @@
+/* Check that GCC does not generate Armv8.1-M low over head loop instructions
+ if causes VFP emulation library calls to happen inside the loop. */
+/* { dg-do compile } */
+/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
+/* { dg-options "-march=armv8.1-m.main -O3 --save-temps -mfloat-abi=soft" } */
+/* { dg-require-effective-target arm_softfloat } */
+#include <stdlib.h>
+#include "lob.h"
+
+double a[N];
+double b[N];
+double c[N];
+
+int
+main (void)
+{
+ for (int i = 0; i < N; i++)
+ {
+ a[i] = i;
+ b[i] = i * 2;
+ c[i] = a[i] + b[i];
+ }
+
+ return 0;
+}
+/* { dg-final { scan-assembler-not {dls\s\S*,\s\S*} } } */
+/* { dg-final { scan-assembler-not {le\slr,\s\S*} } } */
diff --git a/gcc/testsuite/gcc.target/arm/lob4.c b/gcc/testsuite/gcc.target/arm/lob4.c
new file mode 100644
index 00000000000..444a2c7b4bf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/lob4.c
@@ -0,0 +1,34 @@
+/* Check that GCC does not generate Armv8.1-M low over head loop instructions
+ if LR is modified within the loop. */
+/* { dg-do compile } */
+/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
+/* { dg-options "-march=armv8.1-m.main -O3 --save-temps -mfloat-abi=soft" } */
+/* { dg-require-effective-target arm_softfloat } */
+#include <stdlib.h>
+#include "lob.h"
+
+int a[N];
+int b[N];
+int c[N];
+
+static __attribute__ ((always_inline)) inline int
+foo (int a, int b)
+{
+ NO_LOB;
+ return a + b;
+}
+
+int
+main (void)
+{
+ for (int i = 0; i < N; i++)
+ {
+ a[i] = i;
+ b[i] = i * 2;
+ c[i] = foo(a[i], b[i]);
+ }
+
+ return 0;
+}
+/* { dg-final { scan-assembler-not {dls\s\S*,\s\S*} } } */
+/* { dg-final { scan-assembler-not {le\slr,\s\S*} } } */
diff --git a/gcc/testsuite/gcc.target/arm/lob5.c b/gcc/testsuite/gcc.target/arm/lob5.c
new file mode 100644
index 00000000000..c4f46e41532
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/lob5.c
@@ -0,0 +1,35 @@
+/* Check that GCC does not generates Armv8.1-M low over head loop
+ instructions. Innermost loop has no fixed number of iterations
+ therefore is not optimizable. Outer loops are not optimized. */
+/* { dg-do compile } */
+/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
+/* { dg-options "-march=armv8.1-m.main -O3 --save-temps" } */
+#include <stdlib.h>
+#include "lob.h"
+
+int a[N];
+int b[N];
+int c[N];
+
+int
+main (void)
+{
+ for (int i = 0; i < N; i++)
+ {
+ a[i] = i;
+ b[i] = i * 2;
+
+ int k = b[i];
+ while (k != 0)
+ {
+ if (k % 2 == 0)
+ c[i - 1] = k % 2;
+ k /= 2;
+ }
+ c[i] = a[i] - b[i];
+ }
+
+ return 0;
+}
+/* { dg-final { scan-assembler-not {dls\s\S*,\s\S*} } } */
+/* { dg-final { scan-assembler-not {le\slr,\s\S*} } } */
diff --git a/gcc/testsuite/gcc.target/arm/lob6.c b/gcc/testsuite/gcc.target/arm/lob6.c
new file mode 100644
index 00000000000..56126769460
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/lob6.c
@@ -0,0 +1,97 @@
+/* Check that GCC generates Armv8.1-M low over head loop instructions
+ with some less trivial loops and the result is correct. */
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_1_lob_ok } */
+/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
+/* { dg-options "-march=armv8.1-m.main -O3 --save-temps" } */
+#include <stdlib.h>
+#include "lob.h"
+
+#define TEST_CODE1 \
+ { \
+ for (int i = 0; i < N; i++) \
+ { \
+ a[i] = i; \
+ b[i] = i * 2; \
+ \
+ for (int k = 0; k < N; k++) \
+ { \
+ MAYBE_LOB; \
+ c[k] = k / 2; \
+ } \
+ c[i] = a[i] - b[i]; \
+ } \
+ }
+
+#define TEST_CODE2 \
+ { \
+ for (int i = 0; i < N / 2; i++) \
+ { \
+ MAYBE_LOB; \
+ if (c[i] % 2 == 0) \
+ break; \
+ a[i]++; \
+ b[i]++; \
+ } \
+ }
+
+int a1[N];
+int b1[N];
+int c1[N];
+
+int a2[N];
+int b2[N];
+int c2[N];
+
+#define MAYBE_LOB
+void __attribute__((noinline))
+loop1 (int *a, int *b, int *c)
+ TEST_CODE1;
+
+void __attribute__((noinline))
+loop2 (int *a, int *b, int *c)
+ TEST_CODE2;
+
+#undef MAYBE_LOB
+#define MAYBE_LOB NO_LOB
+
+void
+ref1 (int *a, int *b, int *c)
+ TEST_CODE1;
+
+void
+ref2 (int *a, int *b, int *c)
+ TEST_CODE2;
+
+void
+check (void)
+{
+ for (int i = 0; i < N; i++)
+ {
+ NO_LOB;
+ if (a1[i] != a2[i]
+ && b1[i] != b2[i]
+ && c1[i] != c2[i])
+ abort ();
+ }
+}
+
+int
+main (void)
+{
+ reset_data (a1, b1, c1);
+ reset_data (a2, b2, c2);
+ loop1 (a1, b1, c1);
+ ref1 (a2, b2, c2);
+ check ();
+
+ reset_data (a1, b1, c1);
+ reset_data (a2, b2, c2);
+ loop2 (a1, b1, c1);
+ ref2 (a2, b2, c2);
+ check ();
+
+ return 0;
+}
+/* { dg-final { scan-assembler-times {dls\s\S*,\s\S*} 1 } } */
+/* { dg-final { scan-assembler-times {le\slr,\s\S*} 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/multilib.exp b/gcc/testsuite/gcc.target/arm/multilib.exp
index f67a92a9201..c5f3c02c28e 100644
--- a/gcc/testsuite/gcc.target/arm/multilib.exp
+++ b/gcc/testsuite/gcc.target/arm/multilib.exp
@@ -40,7 +40,7 @@ proc multilib_config {profile} {
proc check_multi_dir { gcc_opts multi_dir } {
global tool
- set options [list "additional_flags=[concat "--print-multi-directory" [gcc_opts]]"]
+ set options [list "additional_flags=[concat "--print-multi-directory" $gcc_opts]"]
set gcc_output [${tool}_target_compile "" "" "none" $options]
if { [string match "$multi_dir\n" $gcc_output] } {
pass "multilibdir $gcc_opts $multi_dir"
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve-vldstr16-no-writeback.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve-vldstr16-no-writeback.c
new file mode 100644
index 00000000000..0a69aced8b4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve-vldstr16-no-writeback.c
@@ -0,0 +1,17 @@
+/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
+/* { dg-add-options arm_v8_1m_mve_fp } */
+/* { dg-additional-options "-O2" } */
+
+void
+fn1 (__fp16 *pSrc)
+{
+ __fp16 high;
+ __fp16 *pDst = 0;
+ unsigned i;
+ for (i = 0;; i++)
+ if (pSrc[i])
+ pDst[i] = high;
+}
+
+/* { dg-final { scan-assembler {vldr\.16\ts[0-9]+, \[r[0-9]+\]\n} } } */
+/* { dg-final { scan-assembler {vstr\.16\ts[0-9]+, \[r[0-9]+\]\n} } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts1.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts1.c
new file mode 100644
index 00000000000..db2335fc76e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts1.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_mve_hw } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_v8_1m_mve } */
+
+#include "arm_mve.h"
+#include "stdio.h"
+#include <stdlib.h>
+
+void
+foo (int64_t acc, int shift)
+{
+ acc = sqrshrl_sat48 (acc, shift);
+ if (acc != 16)
+ abort();
+ acc = sqrshrl (acc, shift);
+ if (acc != 2)
+ abort();
+}
+
+void
+foo1 (uint64_t acc, int shift)
+{
+ acc = uqrshll_sat48 (acc, shift);
+ if (acc != 16)
+ abort();
+ acc = uqrshll (acc, shift);
+ if (acc != 128)
+ abort();
+}
+
+int main()
+{
+ int64_t acc = 128;
+ uint64_t acc1 = 2;
+ int shift = 3;
+ foo (acc, shift);
+ foo1 (acc1, shift);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts2.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts2.c
new file mode 100644
index 00000000000..5a63d385cb7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts2.c
@@ -0,0 +1,35 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_mve_hw } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_v8_1m_mve } */
+
+#include "arm_mve.h"
+#include "stdio.h"
+#include <stdlib.h>
+
+#define IMM 3
+
+void
+foo (int64_t acc, uint64_t acc1)
+{
+ acc = sqshll (acc, IMM);
+ if (acc != 128)
+ abort();
+ acc = srshrl (acc, IMM);
+ if (acc != 16)
+ abort();
+ acc1 = uqshll (acc1, IMM);
+ if (acc1 != 128)
+ abort();
+ acc1 = urshrl (acc1, IMM);
+ if (acc1 != 16)
+ abort();
+}
+
+int main()
+{
+ int64_t acc = 16;
+ uint64_t acc1 = 16;
+ foo (acc, acc1);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts3.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts3.c
new file mode 100644
index 00000000000..f0d5ee32f82
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts3.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_mve_hw } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_v8_1m_mve } */
+
+#include "arm_mve.h"
+#include "stdio.h"
+#include <stdlib.h>
+
+void
+foo (int32_t acc, uint32_t acc1, int shift)
+{
+ acc = sqrshr (acc, shift);
+ if (acc != 16)
+ abort();
+ acc1 = uqrshl (acc1, shift);
+ if (acc1 != 128)
+ abort();
+}
+
+int main()
+{
+ int32_t acc = 128;
+ uint32_t acc1 = 16;
+ int shift = 3;
+ foo (acc, acc1, shift);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts4.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts4.c
new file mode 100644
index 00000000000..283742fcf98
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_scalar_shifts4.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_mve_hw } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_v8_1m_mve } */
+
+#include "arm_mve.h"
+#include <stdlib.h>
+
+#define IMM 3
+
+void
+foo (int32_t acc, uint32_t acc1)
+{
+ acc = sqshl (acc, IMM);
+ if (acc != 128)
+ abort();
+ acc = srshr (acc, IMM);
+ if (acc != 16)
+ abort();
+ acc1 = uqshl (acc1, IMM);
+ if (acc1 != 128)
+ abort();
+ acc1 = urshr (acc1, IMM);
+ if (acc1 != 16)
+ abort();
+}
+
+int main()
+{
+ int32_t acc = 16;
+ uint32_t acc1 = 16;
+ foo (acc, acc1);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vaddq_m.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vaddq_m.c
new file mode 100644
index 00000000000..719b95d9020
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vaddq_m.c
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
+/* { dg-add-options arm_v8_1m_mve_fp } */
+/* { dg-additional-options "-O2" } */
+
+#include <arm_mve.h>
+mve_pred16_t p;
+
+int32x4_t fn1 (int32x4_t vecIdx)
+{
+ return vaddq_m(vuninitializedq_s32(), vecIdx, 1, p);
+}
+
+int16x8_t fn2 (int16x8_t vecIdx)
+{
+ return vaddq_m(vuninitializedq_s16(), vecIdx, 1, p);
+}
+
+int8x16_t fn3 (int8x16_t vecIdx)
+{
+ return vaddq_m(vuninitializedq_s8(), vecIdx, 1, p);
+}
+
+uint32x4_t fn4 (uint32x4_t vecIdx)
+{
+ return vaddq_m(vuninitializedq_u32(), vecIdx, 1, p);
+}
+
+uint16x8_t fn5 (uint16x8_t vecIdx)
+{
+ return vaddq_m(vuninitializedq_u16(), vecIdx, 1, p);
+}
+
+uint8x16_t fn6 (uint8x16_t vecIdx)
+{
+ return vaddq_m(vuninitializedq_u8(), vecIdx, 1, p);
+}
+
+float32x4_t fn7 (float32x4_t vecIdx)
+{
+ return vaddq_m(vuninitializedq_f32(), vecIdx, (float32_t) 1.23, p);
+}
+
+float16x8_t fn8 (float16x8_t vecIdx)
+{
+ return vaddq_m(vuninitializedq_f16(), vecIdx, (float16_t) 1.40, p);
+}
+
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vector_float2.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vector_float2.c
index e3cf8f8207d..35f83c6b298 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vector_float2.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vector_float2.c
@@ -11,10 +11,6 @@ foo32 ()
return b;
}
-/* { dg-final { scan-assembler "vmov\\tq\[0-7\], q\[0-7\]" } } */
-/* { dg-final { scan-assembler "vstrb.*" } } */
-/* { dg-final { scan-assembler "vldr.64*" } } */
-
float16x8_t
foo16 ()
{
@@ -22,6 +18,9 @@ foo16 ()
return b;
}
-/* { dg-final { scan-assembler "vmov\\tq\[0-7\], q\[0-7\]" } } */
-/* { dg-final { scan-assembler "vstrb.*" } } */
-/* { dg-final { scan-assembler "vldr.64.*" } } */
+/* { dg-final { scan-assembler-times "vmov\\tq\[0-7\], q\[0-7\]" 2 } } */
+/* { dg-final { scan-assembler-times "vstrw.32*" 1 } } */
+/* { dg-final { scan-assembler-times "vstrh.16*" 1 } } */
+/* { dg-final { scan-assembler-times "vldrw.32*" 1 } } */
+/* { dg-final { scan-assembler-times "vldrh.16*" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vldr.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vldr.c
new file mode 100644
index 00000000000..15656ed8c3c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vldr.c
@@ -0,0 +1,61 @@
+/* { dg-require-effective-target arm_v8_1m_mve_ok } */
+/* { dg-add-options arm_v8_1m_mve } */
+/* { dg-additional-options "-O2" } */
+
+#include "arm_mve.h"
+void
+foo (uint16_t row_x_col, int8_t *out)
+{
+ for (;;)
+ {
+ int32x4_t out_3;
+ int8_t *rhs_0;
+ int8_t *lhs_3;
+ int i_row_x_col;
+ for (;i_row_x_col < row_x_col; i_row_x_col++)
+ {
+ int32x4_t ker_0 = vldrbq_s32(rhs_0);
+ int32x4_t ip_3 = vldrbq_s32(lhs_3);
+ out_3 = vmulq_s32(ip_3, ker_0);
+ }
+ vstrbq_s32(out, out_3);
+ }
+}
+
+void
+foo1 (uint16_t row_x_col, int8_t *out)
+{
+ for (;;)
+ {
+ int16x8_t out_3;
+ int8_t *rhs_0;
+ int8_t *lhs_3;
+ int i_row_x_col;
+ for (; i_row_x_col < row_x_col; i_row_x_col++)
+ {
+ int16x8_t ker_0 = vldrbq_s16(rhs_0);
+ int16x8_t ip_3 = vldrbq_s16(lhs_3);
+ out_3 = vmulq_s16(ip_3, ker_0);
+ }
+ vstrbq_s16(out, out_3);
+ }
+}
+
+void
+foo2 (uint16_t row_x_col, int16_t *out)
+{
+ for (;;)
+ {
+ int32x4_t out_3;
+ int16_t *rhs_0;
+ int16_t *lhs_3;
+ int i_row_x_col;
+ for (; i_row_x_col < row_x_col; i_row_x_col++)
+ {
+ int32x4_t ker_0 = vldrhq_s32(rhs_0);
+ int32x4_t ip_3 = vldrhq_s32(lhs_3);
+ out_3 = vmulq_s32(ip_3, ker_0);
+ }
+ vstrhq_s32(out, out_3);
+ }
+}
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vldr_z.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vldr_z.c
new file mode 100644
index 00000000000..ae640837d14
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vldr_z.c
@@ -0,0 +1,73 @@
+/* { dg-require-effective-target arm_v8_1m_mve_ok } */
+/* { dg-add-options arm_v8_1m_mve } */
+/* { dg-additional-options "-O2" } */
+
+#include "arm_mve.h"
+void
+foo (uint16_t row_len, const int32_t *bias, int8_t *out)
+{
+ int i_out_ch;
+ for (;;)
+ {
+ int8_t *ip_c3;
+ int32_t acc_3;
+ int32_t row_loop_cnt = row_len;
+ int32x4_t res = {acc_3};
+ uint32x4_t scatter_offset;
+ int i_row_loop;
+ for (; i_row_loop < row_loop_cnt; i_row_loop++)
+ {
+ mve_pred16_t p;
+ int16x8_t r0;
+ int16x8_t c3 = vldrbq_z_s16(ip_c3, p);
+ acc_3 = vmladavaq_p_s16(acc_3, r0, c3, p);
+ }
+ vstrbq_scatter_offset_s32(&out[i_out_ch], scatter_offset, res);
+ }
+}
+
+void
+foo1 (uint16_t row_len, const int32_t *bias, int8_t *out)
+{
+ int i_out_ch;
+ for (;;)
+ {
+ int8_t *ip_c3;
+ int32_t acc_3;
+ int32_t row_loop_cnt = row_len;
+ int i_row_loop;
+ int32x4_t res = {acc_3};
+ uint32x4_t scatter_offset;
+ for (; i_row_loop < row_loop_cnt; i_row_loop++)
+ {
+ mve_pred16_t p;
+ int32x4_t r0;
+ int32x4_t c3 = vldrbq_z_s32(ip_c3, p);
+ acc_3 = vmladavaq_p_s32(acc_3, r0, c3, p);
+ }
+ vstrbq_scatter_offset_s32(&out[i_out_ch], scatter_offset, res);
+ }
+}
+
+void
+foo2 (uint16_t row_len, const int32_t *bias, int8_t *out)
+{
+ int i_out_ch;
+ for (;;)
+ {
+ int16_t *ip_c3;
+ int32_t acc_3;
+ int32_t row_loop_cnt = row_len;
+ int i_row_loop;
+ int32x4_t res = {acc_3};
+ uint32x4_t scatter_offset;
+ for (; i_row_loop < row_loop_cnt; i_row_loop++)
+ {
+ mve_pred16_t p;
+ int32x4_t r0;
+ int32x4_t c3 = vldrhq_z_s32(ip_c3, p);
+ acc_3 = vmladavaq_p_s32(acc_3, r0, c3, p);
+ }
+ vstrbq_scatter_offset_s32(&out[i_out_ch], scatter_offset, res);
+ }
+}
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_base.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_base.c
new file mode 100644
index 00000000000..21b9e12d57e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_base.c
@@ -0,0 +1,67 @@
+/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
+/* { dg-add-options arm_v8_1m_mve_fp } */
+/* { dg-additional-options "-O2" } */
+
+#include "arm_mve.h"
+
+int
+foows32(uint32x4_t pDataDest, int32x4_t value, int32_t * ret)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ vstrwq_scatter_base_s32 (pDataDest, 4, value);
+ vstrwq_scatter_base_s32 (pDataDest, 132, value);
+ vstrwq_scatter_offset_s32 (ret, vecOffs1, (int32x4_t) pDataDest);
+ vstrwq_scatter_offset_s32 (ret, vecOffs2, (int32x4_t) pDataDest);
+ return 0;
+}
+
+int
+foowu32(uint32x4_t pDataDest, uint32x4_t value, int32_t * ret)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ vstrwq_scatter_base_u32 (pDataDest, 4, value);
+ vstrwq_scatter_base_u32 (pDataDest, 132, value);
+ vstrwq_scatter_offset_s32 (ret, vecOffs1, (int32x4_t) pDataDest);
+ vstrwq_scatter_offset_s32 (ret, vecOffs2, (int32x4_t) pDataDest);
+ return 0;
+}
+
+int
+foowf32(uint32x4_t pDataDest, float32x4_t value, int32_t * ret)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ vstrwq_scatter_base_f32 (pDataDest, 4, value);
+ vstrwq_scatter_base_f32 (pDataDest, 132, value);
+ vstrwq_scatter_offset_s32 (ret, vecOffs1, (int32x4_t) pDataDest);
+ vstrwq_scatter_offset_s32 (ret, vecOffs2, (int32x4_t) pDataDest);
+ return 0;
+}
+
+int
+foods64(uint64x2_t pDataDest, int64x2_t value, int32_t * ret)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ vstrdq_scatter_base_s64 (pDataDest, 256, value);
+ vstrdq_scatter_base_s64 (pDataDest, 512, value);
+ vstrwq_scatter_offset_s32 (ret, vecOffs1, (int32x4_t) pDataDest);
+ vstrwq_scatter_offset_s32 (ret, vecOffs2, (int32x4_t) pDataDest);
+ return 0;
+}
+
+int
+foodu64(uint64x2_t pDataDest, uint64x2_t value, int32_t * ret)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ vstrdq_scatter_base_u64 (pDataDest, 256, value);
+ vstrdq_scatter_base_u64 (pDataDest, 512, value);
+ vstrwq_scatter_offset_s32 (ret, vecOffs1, (int32x4_t) pDataDest);
+ vstrwq_scatter_offset_s32 (ret, vecOffs2, (int32x4_t) pDataDest);
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times "vstr\[a-z\]" 20 } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_base_p.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_base_p.c
new file mode 100644
index 00000000000..15c6496732a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_base_p.c
@@ -0,0 +1,69 @@
+/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
+/* { dg-add-options arm_v8_1m_mve_fp } */
+/* { dg-additional-options "-O2" } */
+
+#include "arm_mve.h"
+
+mve_pred16_t __p;
+
+int
+foows32(uint32x4_t pDataDest, int32x4_t value, int32_t * ret)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ vstrwq_scatter_base_p_s32 (pDataDest, 4, value, __p);
+ vstrwq_scatter_base_p_s32 (pDataDest, 132, value, __p);
+ vstrwq_scatter_offset_p_s32 (ret, vecOffs1, (int32x4_t) pDataDest, __p);
+ vstrwq_scatter_offset_p_s32 (ret, vecOffs2, (int32x4_t) pDataDest, __p);
+ return 0;
+}
+
+int
+foowu32(uint32x4_t pDataDest, uint32x4_t value, int32_t * ret)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ vstrwq_scatter_base_p_u32 (pDataDest, 4, value, __p);
+ vstrwq_scatter_base_p_u32 (pDataDest, 132, value, __p);
+ vstrwq_scatter_offset_p_s32 (ret, vecOffs1, (int32x4_t) pDataDest, __p);
+ vstrwq_scatter_offset_p_s32 (ret, vecOffs2, (int32x4_t) pDataDest, __p);
+ return 0;
+}
+
+int
+foowf32(uint32x4_t pDataDest, float32x4_t value, int32_t * ret)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ vstrwq_scatter_base_p_f32 (pDataDest, 4, value, __p);
+ vstrwq_scatter_base_p_f32 (pDataDest, 132, value, __p);
+ vstrwq_scatter_offset_p_s32 (ret, vecOffs1, (int32x4_t) pDataDest, __p);
+ vstrwq_scatter_offset_p_s32 (ret, vecOffs2, (int32x4_t) pDataDest, __p);
+ return 0;
+}
+
+int
+foods64(uint64x2_t pDataDest, int64x2_t value, int32_t * ret)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ vstrdq_scatter_base_p_s64 (pDataDest, 256, value, __p);
+ vstrdq_scatter_base_p_s64 (pDataDest, 512, value, __p);
+ vstrwq_scatter_offset_p_s32 (ret, vecOffs1, (int32x4_t) pDataDest, __p);
+ vstrwq_scatter_offset_p_s32 (ret, vecOffs2, (int32x4_t) pDataDest, __p);
+ return 0;
+}
+
+int
+foodu64(uint64x2_t pDataDest, uint64x2_t value, int32_t * ret)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ vstrdq_scatter_base_p_u64 (pDataDest, 256, value, __p);
+ vstrdq_scatter_base_p_u64 (pDataDest, 512, value, __p);
+ vstrwq_scatter_offset_p_s32 (ret, vecOffs1, (int32x4_t) pDataDest, __p);
+ vstrwq_scatter_offset_p_s32 (ret, vecOffs2, (int32x4_t) pDataDest, __p);
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times "vstr\[a-z\]t" 20 } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_offset.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_offset.c
new file mode 100644
index 00000000000..6d123669c13
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_offset.c
@@ -0,0 +1,215 @@
+/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
+/* { dg-add-options arm_v8_1m_mve_fp } */
+/* { dg-additional-options "-O2" } */
+
+#include "arm_mve.h"
+
+int
+foobu8( uint8_t * pDataSrc, uint8_t * pDataDest)
+{
+ const uint8x16_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5, 9, 11, 13, 10, 12, 15, 8, 14};
+ const uint8x16_t vecOffs2 = { 31, 29, 27, 25, 23, 28, 21, 26, 19, 24, 17, 22, 16, 20, 18, 30};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[16]);
+ vstrbq_scatter_offset_u8 (pDataDest, vecOffs1, (uint8x16_t) vecIn1);
+ vstrbq_scatter_offset_u8 (pDataDest, vecOffs2, (uint8x16_t) vecIn2);
+ pDataDest[32] = pDataSrc[32];
+ return 0;
+}
+
+int
+foobu16( uint8_t * pDataSrc, uint8_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 11, 13, 10, 12, 15, 8, 14, 9};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[8]);
+ vstrbq_scatter_offset_u16 (pDataDest, vecOffs1, (uint16x8_t) vecIn1);
+ vstrbq_scatter_offset_u16 (pDataDest, vecOffs2, (uint16x8_t) vecIn2);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foobu32( uint8_t * pDataSrc, uint8_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[4]);
+ vstrbq_scatter_offset_u32 (pDataDest, vecOffs1, (uint32x4_t) vecIn1);
+ vstrbq_scatter_offset_u32 (pDataDest, vecOffs2, (uint32x4_t) vecIn2);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foobs8( int8_t * pDataSrc, int8_t * pDataDest)
+{
+ const uint8x16_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5, 9, 11, 13, 10, 12, 15, 8, 14};
+ const uint8x16_t vecOffs2 = { 31, 29, 27, 25, 23, 28, 21, 26, 19, 24, 17, 22, 16, 20, 18, 30};
+ int32x4_t vecIn1 = vldrwq_s32 ((int32_t const *) pDataSrc);
+ int32x4_t vecIn2 = vldrwq_s32 ((int32_t const *) &pDataSrc[16]);
+ vstrbq_scatter_offset_s8 (pDataDest, vecOffs1, (int8x16_t) vecIn1);
+ vstrbq_scatter_offset_s8 (pDataDest, vecOffs2, (int8x16_t) vecIn2);
+ pDataDest[32] = pDataSrc[32];
+ return 0;
+}
+
+int
+foobs16( int8_t * pDataSrc, int8_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 11, 13, 10, 12, 15, 8, 14, 9};
+ int32x4_t vecIn1 = vldrwq_s32 ((int32_t const *) pDataSrc);
+ int32x4_t vecIn2 = vldrwq_s32 ((int32_t const *) &pDataSrc[8]);
+ vstrbq_scatter_offset_s16 (pDataDest, vecOffs1, (int16x8_t) vecIn1);
+ vstrbq_scatter_offset_s16 (pDataDest, vecOffs2, (int16x8_t) vecIn2);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foobs32( uint8_t * pDataSrc, int8_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ int32x4_t vecIn1 = vldrwq_s32 ((int32_t const *) pDataSrc);
+ int32x4_t vecIn2 = vldrwq_s32 ((int32_t const *) &pDataSrc[4]);
+ vstrbq_scatter_offset_s32 (pDataDest, vecOffs1, (int32x4_t) vecIn1);
+ vstrbq_scatter_offset_s32 (pDataDest, vecOffs2, (int32x4_t) vecIn2);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foohu16( uint16_t * pDataSrc, uint16_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 11, 13, 10, 12, 15, 8, 14, 9};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[8]);
+ vstrhq_scatter_offset_u16 (pDataDest, vecOffs1, (uint16x8_t) vecIn1);
+ vstrhq_scatter_offset_u16 (pDataDest, vecOffs2, (uint16x8_t) vecIn2);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foohu32( uint16_t * pDataSrc, uint16_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[4]);
+ vstrhq_scatter_offset_u32 (pDataDest, vecOffs1, (uint32x4_t) vecIn1);
+ vstrhq_scatter_offset_u32 (pDataDest, vecOffs2, (uint32x4_t) vecIn2);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foohs16( int16_t * pDataSrc, int16_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 11, 13, 10, 12, 15, 8, 14, 9};
+ int32x4_t vecIn1 = vldrwq_s32 ((int32_t const *) pDataSrc);
+ int32x4_t vecIn2 = vldrwq_s32 ((int32_t const *) &pDataSrc[8]);
+ vstrhq_scatter_offset_s16 (pDataDest, vecOffs1, (int16x8_t) vecIn1);
+ vstrhq_scatter_offset_s16 (pDataDest, vecOffs2, (int16x8_t) vecIn2);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foohs32( uint16_t * pDataSrc, int16_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ int32x4_t vecIn1 = vldrwq_s32 ((int32_t const *) pDataSrc);
+ int32x4_t vecIn2 = vldrwq_s32 ((int32_t const *) &pDataSrc[4]);
+ vstrhq_scatter_offset_s32 (pDataDest, vecOffs1, (int32x4_t) vecIn1);
+ vstrhq_scatter_offset_s32 (pDataDest, vecOffs2, (int32x4_t) vecIn2);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foohf16( float16_t * pDataSrc, float16_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 11, 13, 10, 12, 15, 8, 14, 9};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[8]);
+ vstrhq_scatter_offset_f16 (pDataDest, vecOffs1, (float16x8_t) vecIn1);
+ vstrhq_scatter_offset_f16 (pDataDest, vecOffs2, (float16x8_t) vecIn2);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foowu32( uint32_t * pDataSrc, uint32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[4]);
+ vstrwq_scatter_offset_u32 (pDataDest, vecOffs1, (uint32x4_t) vecIn1);
+ vstrwq_scatter_offset_u32 (pDataDest, vecOffs2, (uint32x4_t) vecIn2);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foows32( int32_t * pDataSrc, int32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[4]);
+ vstrwq_scatter_offset_s32 (pDataDest, vecOffs1, (int32x4_t) vecIn1);
+ vstrwq_scatter_offset_s32 (pDataDest, vecOffs2, (int32x4_t) vecIn2);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foowf32( float32_t * pDataSrc, float32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[8]);
+ vstrwq_scatter_offset_f32 (pDataDest, vecOffs1, (float32x4_t) vecIn1);
+ vstrwq_scatter_offset_f32 (pDataDest, vecOffs2, (float32x4_t) vecIn2);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foowu64( uint64_t * pDataSrc, uint64_t * pDataDest)
+{
+ const uint64x2_t vecOffs1 = { 0, 3};
+ const uint64x2_t vecOffs2 = { 1, 2};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[2]);
+ vstrdq_scatter_offset_u64 (pDataDest, vecOffs1, (uint64x2_t) vecIn1);
+ vstrdq_scatter_offset_u64 (pDataDest, vecOffs2, (uint64x2_t) vecIn2);
+ pDataDest[4] = pDataSrc[4];
+ return 0;
+}
+
+int
+foows64( int64_t * pDataSrc, int64_t * pDataDest)
+{
+ const uint64x2_t vecOffs1 = { 0, 3};
+ const uint64x2_t vecOffs2 = { 1, 2};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[2]);
+ vstrdq_scatter_offset_s64 (pDataDest, vecOffs1, (int64x2_t) vecIn1);
+ vstrdq_scatter_offset_s64 (pDataDest, vecOffs2, (int64x2_t) vecIn2);
+ pDataDest[4] = pDataSrc[4];
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times "vstr\[a-z\]" 32 } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_offset_p.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_offset_p.c
new file mode 100644
index 00000000000..cd2e1ee80f9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_offset_p.c
@@ -0,0 +1,216 @@
+/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
+/* { dg-add-options arm_v8_1m_mve_fp } */
+/* { dg-additional-options "-O2" } */
+
+#include "arm_mve.h"
+
+mve_pred16_t __p;
+int
+foobu8( uint8_t * pDataSrc, uint8_t * pDataDest)
+{
+ const uint8x16_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5, 9, 11, 13, 10, 12, 15, 8, 14};
+ const uint8x16_t vecOffs2 = { 31, 29, 27, 25, 23, 28, 21, 26, 19, 24, 17, 22, 16, 20, 18, 30};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[16]);
+ vstrbq_scatter_offset_p_u8(pDataDest, vecOffs1, (uint8x16_t) vecIn1, __p);
+ vstrbq_scatter_offset_p_u8(pDataDest, vecOffs2, (uint8x16_t) vecIn2, __p);
+ pDataDest[32] = pDataSrc[32];
+ return 0;
+}
+
+int
+foobu16( uint8_t * pDataSrc, uint8_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 11, 13, 10, 12, 15, 8, 14, 9};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[8]);
+ vstrbq_scatter_offset_p_u16 (pDataDest, vecOffs1, (uint16x8_t) vecIn1, __p);
+ vstrbq_scatter_offset_p_u16 (pDataDest, vecOffs2, (uint16x8_t) vecIn2, __p);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foobu32( uint8_t * pDataSrc, uint8_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[4]);
+ vstrbq_scatter_offset_p_u32 (pDataDest, vecOffs1, (uint32x4_t) vecIn1, __p);
+ vstrbq_scatter_offset_p_u32 (pDataDest, vecOffs2, (uint32x4_t) vecIn2, __p);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foobs8( int8_t * pDataSrc, int8_t * pDataDest)
+{
+ const uint8x16_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5, 9, 11, 13, 10, 12, 15, 8, 14};
+ const uint8x16_t vecOffs2 = { 31, 29, 27, 25, 23, 28, 21, 26, 19, 24, 17, 22, 16, 20, 18, 30};
+ int32x4_t vecIn1 = vldrwq_s32 ((int32_t const *) pDataSrc);
+ int32x4_t vecIn2 = vldrwq_s32 ((int32_t const *) &pDataSrc[16]);
+ vstrbq_scatter_offset_p_s8 (pDataDest, vecOffs1, (int8x16_t) vecIn1, __p);
+ vstrbq_scatter_offset_p_s8 (pDataDest, vecOffs2, (int8x16_t) vecIn2, __p);
+ pDataDest[32] = pDataSrc[32];
+ return 0;
+}
+
+int
+foobs16( int8_t * pDataSrc, int8_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 11, 13, 10, 12, 15, 8, 14, 9};
+ int32x4_t vecIn1 = vldrwq_s32 ((int32_t const *) pDataSrc);
+ int32x4_t vecIn2 = vldrwq_s32 ((int32_t const *) &pDataSrc[8]);
+ vstrbq_scatter_offset_p_s16 (pDataDest, vecOffs1, (int16x8_t) vecIn1, __p);
+ vstrbq_scatter_offset_p_s16 (pDataDest, vecOffs2, (int16x8_t) vecIn2, __p);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foobs32( uint8_t * pDataSrc, int8_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ int32x4_t vecIn1 = vldrwq_s32 ((int32_t const *) pDataSrc);
+ int32x4_t vecIn2 = vldrwq_s32 ((int32_t const *) &pDataSrc[4]);
+ vstrbq_scatter_offset_p_s32 (pDataDest, vecOffs1, (int32x4_t) vecIn1, __p);
+ vstrbq_scatter_offset_p_s32 (pDataDest, vecOffs2, (int32x4_t) vecIn2, __p);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foohu16( uint16_t * pDataSrc, uint16_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 11, 13, 10, 12, 15, 8, 14, 9};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[8]);
+ vstrhq_scatter_offset_p_u16 (pDataDest, vecOffs1, (uint16x8_t) vecIn1, __p);
+ vstrhq_scatter_offset_p_u16 (pDataDest, vecOffs2, (uint16x8_t) vecIn2, __p);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foohu32( uint16_t * pDataSrc, uint16_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[4]);
+ vstrhq_scatter_offset_p_u32 (pDataDest, vecOffs1, (uint32x4_t) vecIn1, __p);
+ vstrhq_scatter_offset_p_u32 (pDataDest, vecOffs2, (uint32x4_t) vecIn2, __p);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foohs16( int16_t * pDataSrc, int16_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 11, 13, 10, 12, 15, 8, 14, 9};
+ int32x4_t vecIn1 = vldrwq_s32 ((int32_t const *) pDataSrc);
+ int32x4_t vecIn2 = vldrwq_s32 ((int32_t const *) &pDataSrc[8]);
+ vstrhq_scatter_offset_p_s16 (pDataDest, vecOffs1, (int16x8_t) vecIn1, __p);
+ vstrhq_scatter_offset_p_s16 (pDataDest, vecOffs2, (int16x8_t) vecIn2, __p);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foohs32( uint16_t * pDataSrc, int16_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ int32x4_t vecIn1 = vldrwq_s32 ((int32_t const *) pDataSrc);
+ int32x4_t vecIn2 = vldrwq_s32 ((int32_t const *) &pDataSrc[4]);
+ vstrhq_scatter_offset_p_s32 (pDataDest, vecOffs1, (int32x4_t) vecIn1, __p);
+ vstrhq_scatter_offset_p_s32 (pDataDest, vecOffs2, (int32x4_t) vecIn2, __p);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foohf16( float16_t * pDataSrc, float16_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 11, 13, 10, 12, 15, 8, 14, 9};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[8]);
+ vstrhq_scatter_offset_p_f16 (pDataDest, vecOffs1, (float16x8_t) vecIn1, __p);
+ vstrhq_scatter_offset_p_f16 (pDataDest, vecOffs2, (float16x8_t) vecIn2, __p);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foowu32( uint32_t * pDataSrc, uint32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[4]);
+ vstrwq_scatter_offset_p_u32 (pDataDest, vecOffs1, (uint32x4_t) vecIn1, __p);
+ vstrwq_scatter_offset_p_u32 (pDataDest, vecOffs2, (uint32x4_t) vecIn2, __p);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foows32( int32_t * pDataSrc, int32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[4]);
+ vstrwq_scatter_offset_p_s32 (pDataDest, vecOffs1, (int32x4_t) vecIn1, __p);
+ vstrwq_scatter_offset_p_s32 (pDataDest, vecOffs2, (int32x4_t) vecIn2, __p);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foowf32( float32_t * pDataSrc, float32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[8]);
+ vstrwq_scatter_offset_p_f32 (pDataDest, vecOffs1, (float32x4_t) vecIn1, __p);
+ vstrwq_scatter_offset_p_f32 (pDataDest, vecOffs2, (float32x4_t) vecIn2, __p);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foowu64( uint64_t * pDataSrc, uint64_t * pDataDest)
+{
+ const uint64x2_t vecOffs1 = { 0, 3};
+ const uint64x2_t vecOffs2 = { 1, 2};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[2]);
+ vstrdq_scatter_offset_p_u64 (pDataDest, vecOffs1, (uint64x2_t) vecIn1, __p);
+ vstrdq_scatter_offset_p_u64 (pDataDest, vecOffs2, (uint64x2_t) vecIn2, __p);
+ pDataDest[4] = pDataSrc[4];
+ return 0;
+}
+
+int
+foows64( int64_t * pDataSrc, int64_t * pDataDest)
+{
+ const uint64x2_t vecOffs1 = { 0, 3};
+ const uint64x2_t vecOffs2 = { 1, 2};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[2]);
+ vstrdq_scatter_offset_p_s64 (pDataDest, vecOffs1, (int64x2_t) vecIn1, __p);
+ vstrdq_scatter_offset_p_s64 (pDataDest, vecOffs2, (int64x2_t) vecIn2, __p);
+ pDataDest[4] = pDataSrc[4];
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times "vstr\[a-z\]t" 32 } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_shifted_offset.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_shifted_offset.c
new file mode 100644
index 00000000000..62dfb450a6d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_shifted_offset.c
@@ -0,0 +1,141 @@
+/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
+/* { dg-add-options arm_v8_1m_mve_fp } */
+/* { dg-additional-options "-O2" } */
+
+#include "arm_mve.h"
+
+int
+foowu32( uint32_t * pDataSrc, uint32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[4]);
+ vstrwq_scatter_shifted_offset_u32 (pDataDest, vecOffs1, vecIn1);
+ vstrwq_scatter_shifted_offset_u32 (pDataDest, vecOffs2, vecIn2);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foowf32( float32_t * pDataSrc, float32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ float32x4_t vecIn1 = vldrwq_f32 ((float32_t const *) pDataSrc);
+ float32x4_t vecIn2 = vldrwq_f32 ((float32_t const *) &pDataSrc[4]);
+ vstrwq_scatter_shifted_offset_f32 (pDataDest, vecOffs1, vecIn1);
+ vstrwq_scatter_shifted_offset_f32 (pDataDest, vecOffs2, vecIn2);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foohu16( uint16_t * pDataSrc, uint16_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 9, 11, 13, 10, 12, 15, 8, 14};
+ uint16x8_t vecIn1 = vldrhq_u16 ((uint16_t const *) pDataSrc);
+ uint16x8_t vecIn2 = vldrhq_u16 ((uint16_t const *) &pDataSrc[8]);
+ vstrhq_scatter_shifted_offset_u16 (pDataDest, vecOffs1, vecIn1);
+ vstrhq_scatter_shifted_offset_u16 (pDataDest, vecOffs2, vecIn2);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foohu32( uint32_t * pDataSrc, uint32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ uint32x4_t vecIn1 = vldrhq_u32 ((uint16_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrhq_u32 ((uint16_t const *) &pDataSrc[4]);
+ vstrhq_scatter_shifted_offset_u32 ((uint16_t *)pDataDest, vecOffs1, vecIn1);
+ vstrhq_scatter_shifted_offset_u32 ((uint16_t *)pDataDest, vecOffs2, vecIn2);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foohf16( float16_t * pDataSrc, float16_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 9, 11, 13, 10, 12, 15, 8, 14};
+ float16x8_t vecIn1 = vldrhq_f16 ((float16_t const *) pDataSrc);
+ float16x8_t vecIn2 = vldrhq_f16 ((float16_t const *) &pDataSrc[8]);
+ vstrhq_scatter_shifted_offset_f16 (pDataDest, vecOffs1, vecIn1);
+ vstrhq_scatter_shifted_offset_f16 (pDataDest, vecOffs2, vecIn2);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foodu64( uint64_t * pDataSrc, uint64_t * pDataDest)
+{
+ const uint64x2_t vecOffs1 = { 0, 1};
+ const uint64x2_t vecOffs2 = { 2, 3};
+ uint32x4_t vecIn1 = vldrwq_u32 ((uint32_t const *) pDataSrc);
+ uint32x4_t vecIn2 = vldrwq_u32 ((uint32_t const *) &pDataSrc[2]);
+
+ vstrdq_scatter_shifted_offset_u64 (pDataDest, vecOffs1, (uint64x2_t) vecIn1);
+ vstrdq_scatter_shifted_offset_u64 (pDataDest, vecOffs2, (uint64x2_t) vecIn2);
+
+ pDataDest[2] = pDataSrc[2];
+ return 0;
+}
+
+int
+foows32( int32_t * pDataSrc, int32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ int32x4_t vecIn1 = vldrwq_s32 ((int32_t const *) pDataSrc);
+ int32x4_t vecIn2 = vldrwq_s32 ((int32_t const *) &pDataSrc[4]);
+ vstrwq_scatter_shifted_offset_s32 (pDataDest, vecOffs1, vecIn1);
+ vstrwq_scatter_shifted_offset_s32 (pDataDest, vecOffs2, vecIn2);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foohs16( int16_t * pDataSrc, int16_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 9, 11, 13, 10, 12, 15, 8, 14};
+ int16x8_t vecIn1 = vldrhq_s16 ((int16_t const *) pDataSrc);
+ int16x8_t vecIn2 = vldrhq_s16 ((int16_t const *) &pDataSrc[8]);
+ vstrhq_scatter_shifted_offset_s16 (pDataDest, vecOffs1, vecIn1);
+ vstrhq_scatter_shifted_offset_s16 (pDataDest, vecOffs2, vecIn2);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foohs32( int32_t * pDataSrc, int32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ int32x4_t vecIn1 = vldrhq_s32 ((int16_t const *) pDataSrc);
+ int32x4_t vecIn2 = vldrhq_s32 ((int16_t const *) &pDataSrc[4]);
+ vstrhq_scatter_shifted_offset_s32 ((int16_t *)pDataDest, vecOffs1, vecIn1);
+ vstrhq_scatter_shifted_offset_s32 ((int16_t *)pDataDest, vecOffs2, vecIn2);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foods64( int64_t * pDataSrc, int64_t * pDataDest)
+{
+ const uint64x2_t vecOffs1 = { 0, 1};
+ const uint64x2_t vecOffs2 = { 2, 3};
+ int32x4_t vecIn1 = vldrwq_s32 ((int32_t const *) pDataSrc);
+ int32x4_t vecIn2 = vldrwq_s32 ((int32_t const *) &pDataSrc[2]);
+
+ vstrdq_scatter_shifted_offset_s64 (pDataDest, vecOffs1, (int64x2_t) vecIn1);
+ vstrdq_scatter_shifted_offset_s64 (pDataDest, vecOffs2, (int64x2_t) vecIn2);
+
+ pDataDest[2] = pDataSrc[2];
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times "vstr\[a-z\]" 20 } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_shifted_offset_p.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_shifted_offset_p.c
new file mode 100644
index 00000000000..a51d3a21167
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstore_scatter_shifted_offset_p.c
@@ -0,0 +1,142 @@
+/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
+/* { dg-add-options arm_v8_1m_mve_fp } */
+/* { dg-additional-options "-O2" } */
+
+#include "arm_mve.h"
+
+mve_pred16_t __p;
+int
+foowu32( uint32_t * pDataSrc, uint32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ uint32x4_t vecIn1 = vldrwq_z_u32 ((uint32_t const *) pDataSrc, __p);
+ uint32x4_t vecIn2 = vldrwq_z_u32 ((uint32_t const *) &pDataSrc[4], __p);
+ vstrwq_scatter_shifted_offset_p_u32 (pDataDest, vecOffs1, vecIn1, __p);
+ vstrwq_scatter_shifted_offset_p_u32 (pDataDest, vecOffs2, vecIn2, __p);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foowf32( float32_t * pDataSrc, float32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ float32x4_t vecIn1 = vldrwq_z_f32 ((float32_t const *) pDataSrc, __p);
+ float32x4_t vecIn2 = vldrwq_z_f32 ((float32_t const *) &pDataSrc[4], __p);
+ vstrwq_scatter_shifted_offset_p_f32 (pDataDest, vecOffs1, vecIn1, __p);
+ vstrwq_scatter_shifted_offset_p_f32 (pDataDest, vecOffs2, vecIn2, __p);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foohu16( uint16_t * pDataSrc, uint16_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 9, 11, 13, 10, 12, 15, 8, 14};
+ uint16x8_t vecIn1 = vldrhq_z_u16 ((uint16_t const *) pDataSrc, __p);
+ uint16x8_t vecIn2 = vldrhq_z_u16 ((uint16_t const *) &pDataSrc[8], __p);
+ vstrhq_scatter_shifted_offset_p_u16 (pDataDest, vecOffs1, vecIn1, __p);
+ vstrhq_scatter_shifted_offset_p_u16 (pDataDest, vecOffs2, vecIn2, __p);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foohu32( uint32_t * pDataSrc, uint32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ uint32x4_t vecIn1 = vldrhq_z_u32 ((uint16_t const *) pDataSrc, __p);
+ uint32x4_t vecIn2 = vldrhq_z_u32 ((uint16_t const *) &pDataSrc[4], __p);
+ vstrhq_scatter_shifted_offset_p_u32 ((uint16_t *)pDataDest, vecOffs1, vecIn1, __p);
+ vstrhq_scatter_shifted_offset_p_u32 ((uint16_t *)pDataDest, vecOffs2, vecIn2, __p);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foohf16( float16_t * pDataSrc, float16_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 9, 11, 13, 10, 12, 15, 8, 14};
+ float16x8_t vecIn1 = vldrhq_z_f16 ((float16_t const *) pDataSrc, __p);
+ float16x8_t vecIn2 = vldrhq_z_f16 ((float16_t const *) &pDataSrc[8], __p);
+ vstrhq_scatter_shifted_offset_p_f16 (pDataDest, vecOffs1, vecIn1, __p);
+ vstrhq_scatter_shifted_offset_p_f16 (pDataDest, vecOffs2, vecIn2, __p);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foodu64( uint64_t * pDataSrc, uint64_t * pDataDest)
+{
+ const uint64x2_t vecOffs1 = { 0, 1};
+ const uint64x2_t vecOffs2 = { 2, 3};
+ uint32x4_t vecIn1 = vldrwq_z_u32 ((uint32_t const *) pDataSrc, __p);
+ uint32x4_t vecIn2 = vldrwq_z_u32 ((uint32_t const *) &pDataSrc[2], __p);
+
+ vstrdq_scatter_shifted_offset_p_u64 (pDataDest, vecOffs1, (uint64x2_t) vecIn1, __p);
+ vstrdq_scatter_shifted_offset_p_u64 (pDataDest, vecOffs2, (uint64x2_t) vecIn2, __p);
+
+ pDataDest[2] = pDataSrc[2];
+ return 0;
+}
+
+int
+foows32( int32_t * pDataSrc, int32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ int32x4_t vecIn1 = vldrwq_z_s32 ((int32_t const *) pDataSrc, __p);
+ int32x4_t vecIn2 = vldrwq_z_s32 ((int32_t const *) &pDataSrc[4], __p);
+ vstrwq_scatter_shifted_offset_p_s32 (pDataDest, vecOffs1, vecIn1, __p);
+ vstrwq_scatter_shifted_offset_p_s32 (pDataDest, vecOffs2, vecIn2, __p);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foohs16( int16_t * pDataSrc, int16_t * pDataDest)
+{
+ const uint16x8_t vecOffs1 = { 0, 3, 6, 1, 4, 7, 2, 5};
+ const uint16x8_t vecOffs2 = { 9, 11, 13, 10, 12, 15, 8, 14};
+ int16x8_t vecIn1 = vldrhq_z_s16 ((int16_t const *) pDataSrc, __p);
+ int16x8_t vecIn2 = vldrhq_z_s16 ((int16_t const *) &pDataSrc[8], __p);
+ vstrhq_scatter_shifted_offset_p_s16 (pDataDest, vecOffs1, vecIn1, __p);
+ vstrhq_scatter_shifted_offset_p_s16 (pDataDest, vecOffs2, vecIn2, __p);
+ pDataDest[16] = pDataSrc[16];
+ return 0;
+}
+
+int
+foohs32( int32_t * pDataSrc, int32_t * pDataDest)
+{
+ const uint32x4_t vecOffs1 = { 0, 3, 6, 1};
+ const uint32x4_t vecOffs2 = { 4, 7, 2, 5};
+ int32x4_t vecIn1 = vldrhq_z_s32 ((int16_t const *) pDataSrc, __p);
+ int32x4_t vecIn2 = vldrhq_z_s32 ((int16_t const *) &pDataSrc[4], __p);
+ vstrhq_scatter_shifted_offset_p_s32 ((int16_t *)pDataDest, vecOffs1, vecIn1, __p);
+ vstrhq_scatter_shifted_offset_p_s32 ((int16_t *)pDataDest, vecOffs2, vecIn2, __p);
+ pDataDest[8] = pDataSrc[8];
+ return 0;
+}
+
+int
+foods64( int64_t * pDataSrc, int64_t * pDataDest)
+{
+ const uint64x2_t vecOffs1 = { 0, 1};
+ const uint64x2_t vecOffs2 = { 2, 3};
+ int32x4_t vecIn1 = vldrwq_z_s32 ((int32_t const *) pDataSrc, __p);
+ int32x4_t vecIn2 = vldrwq_z_s32 ((int32_t const *) &pDataSrc[2], __p);
+
+ vstrdq_scatter_shifted_offset_p_s64 (pDataDest, vecOffs1, (int64x2_t) vecIn1, __p);
+ vstrdq_scatter_shifted_offset_p_s64 (pDataDest, vecOffs2, (int64x2_t) vecIn2, __p);
+
+ pDataDest[2] = pDataSrc[2];
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times "vstr\[a-z\]t" 20 } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstr.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstr.c
new file mode 100644
index 00000000000..dd785f28bc0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstr.c
@@ -0,0 +1,43 @@
+/* { dg-require-effective-target arm_v8_1m_mve_ok } */
+/* { dg-add-options arm_v8_1m_mve } */
+/* { dg-additional-options "-O2" } */
+
+#include "arm_mve.h"
+void
+foo (const int32_t *output_bias, int8_t *out, uint16_t num_ch)
+{
+ int32_t loop_count = num_ch;
+ const int32_t *bias = output_bias;
+ int i_loop_cnt;
+ for (; i_loop_cnt < loop_count; out += 4, i_loop_cnt++)
+ {
+ int32x4_t out_0 = vldrwq_s32(bias);
+ vstrbq_s32(out, out_0);
+ }
+}
+
+void
+foo1 (const int16_t *output_bias, int8_t *out, uint16_t num_ch)
+{
+ int32_t loop_count = num_ch;
+ const int16_t *bias = output_bias;
+ int i_loop_cnt;
+ for (; i_loop_cnt < loop_count; out += 4, i_loop_cnt++)
+ {
+ int16x8_t out_0 = vldrhq_s16(bias);
+ vstrbq_s16(out, out_0);
+ }
+}
+
+void
+foo2 (const int32_t *output_bias, int16_t *out, uint16_t num_ch)
+{
+ int32_t loop_count = num_ch;
+ const int32_t *bias = output_bias;
+ int i_loop_cnt;
+ for (; i_loop_cnt < loop_count; out += 4, i_loop_cnt++)
+ {
+ int32x4_t out_0 = vldrwq_s32(bias);
+ vstrhq_s32(out, out_0);
+ }
+}
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstr_p.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstr_p.c
new file mode 100644
index 00000000000..8b222f1be0a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vstr_p.c
@@ -0,0 +1,42 @@
+/* { dg-require-effective-target arm_v8_1m_mve_ok } */
+/* { dg-add-options arm_v8_1m_mve } */
+/* { dg-additional-options "-O2" } */
+
+#include "arm_mve.h"
+void
+foo1 (int8_t *x, int32_t * i1)
+{
+ mve_pred16_t p;
+ int32x4_t x_0;
+ int32_t * bias1 = i1;
+ for (;; x++)
+ {
+ x_0 = vldrwq_s32(bias1);
+ vstrbq_p_s32(x, x_0, p);
+ }
+}
+void
+foo2 (int8_t *x, int16_t * i1)
+{
+ mve_pred16_t p;
+ int16x8_t x_0;
+ int16_t * bias1 = i1;
+ for (;; x++)
+ {
+ x_0 = vldrhq_s16(bias1);
+ vstrbq_p_s16(x, x_0, p);
+ }
+}
+
+void
+foo3 (int16_t *x, int32_t * i1)
+{
+ mve_pred16_t p;
+ int32x4_t x_0;
+ int32_t * bias1 = i1;
+ for (;; x++)
+ {
+ x_0 = vldrwq_s32(bias1);
+ vstrhq_p_s32(x, x_0, p);
+ }
+}
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_f16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_f16.c
index eed2bc7951e..c15f1f91d07 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_f16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_f16.c
@@ -19,3 +19,4 @@ foo1 (float16x8_t a, float16x8_t b)
}
/* { dg-final { scan-assembler "vbic" } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_f32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_f32.c
index 5e543dc87a1..c8659d460a0 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_f32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_f32.c
@@ -19,3 +19,4 @@ foo1 (float32x4_t a, float32x4_t b)
}
/* { dg-final { scan-assembler "vbic" } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_s16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_s16.c
index ecc48503fc2..6258727d82f 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_s16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_s16.c
@@ -17,3 +17,4 @@ foo1 (int16x8_t a)
}
/* { dg-final { scan-assembler-times "vbic.i16" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_s32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_s32.c
index 013cdf15cfd..be641abf556 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_s32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_s32.c
@@ -17,3 +17,4 @@ foo1 (int32x4_t a)
}
/* { dg-final { scan-assembler-times "vbic.i32" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_u16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_u16.c
index b24db154ad8..0b26ffda0dc 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_u16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_u16.c
@@ -17,3 +17,4 @@ foo1 (uint16x8_t a)
}
/* { dg-final { scan-assembler-times "vbic.i16" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_u32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_u32.c
index 1261fbb523c..47820bd184a 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_u32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_u32.c
@@ -17,3 +17,4 @@ foo1 (uint32x4_t a)
}
/* { dg-final { scan-assembler-times "vbic.i32" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_s16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_s16.c
index fe4f15e4bc2..4ffacdd9733 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_s16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_s16.c
@@ -19,3 +19,4 @@ foo1 (int16x8_t a, int16x8_t b)
}
/* { dg-final { scan-assembler "vbic" } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_s32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_s32.c
index 969ccaed426..13fbff40746 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_s32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_s32.c
@@ -19,3 +19,4 @@ foo1 (int32x4_t a, int32x4_t b)
}
/* { dg-final { scan-assembler "vbic" } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_s8.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_s8.c
index c1092dd194d..b9fba943a83 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_s8.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_s8.c
@@ -19,3 +19,4 @@ foo1 (int8x16_t a, int8x16_t b)
}
/* { dg-final { scan-assembler "vbic" } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_u16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_u16.c
index f2856da1ccf..5d94a6396c4 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_u16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_u16.c
@@ -19,3 +19,4 @@ foo1 (uint16x8_t a, uint16x8_t b)
}
/* { dg-final { scan-assembler "vbic" } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_u32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_u32.c
index 17c3990dde6..893dc3deefc 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_u32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_u32.c
@@ -19,3 +19,4 @@ foo1 (uint32x4_t a, uint32x4_t b)
}
/* { dg-final { scan-assembler "vbic" } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_u8.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_u8.c
index e5da270ccda..bd5e9bc0197 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_u8.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_u8.c
@@ -19,3 +19,4 @@ foo1 (uint8x16_t a, uint8x16_t b)
}
/* { dg-final { scan-assembler "vbic" } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_f16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_f16.c
index 5e42f634412..699e40d0e3b 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_f16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_f16.c
@@ -10,12 +10,11 @@ foo (float16_t const * base)
return vld1q_f16 (base);
}
-/* { dg-final { scan-assembler "vldrh.f16" } } */
-
float16x8_t
foo1 (float16_t const * base)
{
return vld1q (base);
}
-/* { dg-final { scan-assembler "vldrh.f16" } } */
+/* { dg-final { scan-assembler-times "vldrh.16" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_f32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_f32.c
index 99d1a7a9c5e..86592303362 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_f32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_f32.c
@@ -10,12 +10,11 @@ foo (float32_t const * base)
return vld1q_f32 (base);
}
-/* { dg-final { scan-assembler "vldrw.f32" } } */
-
float32x4_t
foo1 (float32_t const * base)
{
return vld1q (base);
}
-/* { dg-final { scan-assembler "vldrw.f32" } } */
+/* { dg-final { scan-assembler-times "vldrw.32" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_s16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_s16.c
index d77f98ea889..f4f04f534db 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_s16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_s16.c
@@ -10,12 +10,11 @@ foo (int16_t const * base)
return vld1q_s16 (base);
}
-/* { dg-final { scan-assembler "vldrh.s16" } } */
-
int16x8_t
foo1 (int16_t const * base)
{
return vld1q (base);
}
-/* { dg-final { scan-assembler "vldrh.s16" } } */
+/* { dg-final { scan-assembler-times "vldrh.16" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_s32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_s32.c
index 9a7f024f735..e0f66166751 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_s32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_s32.c
@@ -10,12 +10,11 @@ foo (int32_t const * base)
return vld1q_s32 (base);
}
-/* { dg-final { scan-assembler "vldrw.s32" } } */
-
int32x4_t
foo1 (int32_t const * base)
{
return vld1q (base);
}
-/* { dg-final { scan-assembler "vldrw.s32" } } */
+/* { dg-final { scan-assembler-times "vldrw.32" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_s8.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_s8.c
index 9c67bb60110..1b7edead6b1 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_s8.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_s8.c
@@ -10,12 +10,11 @@ foo (int8_t const * base)
return vld1q_s8 (base);
}
-/* { dg-final { scan-assembler "vldrb.s8" } } */
-
int8x16_t
foo1 (int8_t const * base)
{
return vld1q (base);
}
-/* { dg-final { scan-assembler "vldrb.s8" } } */
+/* { dg-final { scan-assembler-times "vldrb.8" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_u16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_u16.c
index 2bef21a5a1d..50e1f5cedcb 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_u16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_u16.c
@@ -10,12 +10,11 @@ foo (uint16_t const * base)
return vld1q_u16 (base);
}
-/* { dg-final { scan-assembler "vldrh.u16" } } */
-
uint16x8_t
foo1 (uint16_t const * base)
{
return vld1q (base);
}
-/* { dg-final { scan-assembler "vldrh.u16" } } */
+/* { dg-final { scan-assembler-times "vldrh.16" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_u32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_u32.c
index 01a1dd611ed..a13fe824382 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_u32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_u32.c
@@ -10,12 +10,11 @@ foo (uint32_t const * base)
return vld1q_u32 (base);
}
-/* { dg-final { scan-assembler "vldrw.u32" } } */
-
uint32x4_t
foo1 (uint32_t const * base)
{
return vld1q (base);
}
-/* { dg-final { scan-assembler "vldrw.u32" } } */
+/* { dg-final { scan-assembler-times "vldrw.32" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_u8.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_u8.c
index 997bc1b212d..dfd1deb93f0 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_u8.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_u8.c
@@ -10,12 +10,11 @@ foo (uint8_t const * base)
return vld1q_u8 (base);
}
-/* { dg-final { scan-assembler "vldrb.u8" } } */
-
uint8x16_t
foo1 (uint8_t const * base)
{
return vld1q (base);
}
-/* { dg-final { scan-assembler "vldrb.u8" } } */
+/* { dg-final { scan-assembler-times "vldrb.8" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_f16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_f16.c
index ea5593a9dd1..3c32e408e42 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_f16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_f16.c
@@ -10,12 +10,12 @@ foo (float16_t const * base, mve_pred16_t p)
return vld1q_z_f16 (base, p);
}
-/* { dg-final { scan-assembler "vldrht.f16" } } */
-
float16x8_t
foo1 (float16_t const * base, mve_pred16_t p)
{
return vld1q_z (base, p);
}
-/* { dg-final { scan-assembler "vldrht.f16" } } */
+/* { dg-final { scan-assembler-times "vpst" 2 } } */
+/* { dg-final { scan-assembler-times "vldrht.16" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_f32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_f32.c
index 28937cd18aa..3fc935c889b 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_f32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_f32.c
@@ -10,12 +10,12 @@ foo (float32_t const * base, mve_pred16_t p)
return vld1q_z_f32 (base, p);
}
-/* { dg-final { scan-assembler "vldrwt.f32" } } */
-
float32x4_t
foo1 (float32_t const * base, mve_pred16_t p)
{
return vld1q_z (base, p);
}
-/* { dg-final { scan-assembler "vldrwt.f32" } } */
+/* { dg-final { scan-assembler-times "vpst" 2 } } */
+/* { dg-final { scan-assembler-times "vldrwt.32" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_s16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_s16.c
index 81a1c439d6e..49cc81092f3 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_s16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_s16.c
@@ -10,12 +10,12 @@ foo (int16_t const * base, mve_pred16_t p)
return vld1q_z_s16 (base, p);
}
-/* { dg-final { scan-assembler "vldrht.s16" } } */
-
int16x8_t
foo1 (int16_t const * base, mve_pred16_t p)
{
return vld1q_z (base, p);
}
-/* { dg-final { scan-assembler "vldrht.s16" } } */
+/* { dg-final { scan-assembler-times "vpst" 2 } } */
+/* { dg-final { scan-assembler-times "vldrht.16" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_s32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_s32.c
index d03ab345f19..ec317cd70e8 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_s32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_s32.c
@@ -10,12 +10,12 @@ foo (int32_t const * base, mve_pred16_t p)
return vld1q_z_s32 (base, p);
}
-/* { dg-final { scan-assembler "vldrwt.s32" } } */
-
int32x4_t
foo1 (int32_t const * base, mve_pred16_t p)
{
return vld1q_z (base, p);
}
-/* { dg-final { scan-assembler "vldrwt.s32" } } */
+/* { dg-final { scan-assembler-times "vpst" 2 } } */
+/* { dg-final { scan-assembler-times "vldrwt.32" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_s8.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_s8.c
index e535662c7d0..538c140e78e 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_s8.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_s8.c
@@ -10,12 +10,12 @@ foo (int8_t const * base, mve_pred16_t p)
return vld1q_z_s8 (base, p);
}
-/* { dg-final { scan-assembler "vldrbt.s8" } } */
-
int8x16_t
foo1 (int8_t const * base, mve_pred16_t p)
{
return vld1q_z (base, p);
}
-/* { dg-final { scan-assembler "vldrbt.s8" } } */
+/* { dg-final { scan-assembler-times "vpst" 2 } } */
+/* { dg-final { scan-assembler-times "vldrbt.8" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_u16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_u16.c
index 3f20f4ed9ca..e5e588a187e 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_u16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_u16.c
@@ -10,12 +10,12 @@ foo (uint16_t const * base, mve_pred16_t p)
return vld1q_z_u16 (base, p);
}
-/* { dg-final { scan-assembler "vldrht.u16" } } */
-
uint16x8_t
foo1 (uint16_t const * base, mve_pred16_t p)
{
return vld1q_z (base, p);
}
-/* { dg-final { scan-assembler "vldrht.u16" } } */
+/* { dg-final { scan-assembler-times "vpst" 2 } } */
+/* { dg-final { scan-assembler-times "vldrht.16" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_u32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_u32.c
index 1d3b53e38e8..999beefa7e8 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_u32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_u32.c
@@ -10,12 +10,12 @@ foo (uint32_t const * base, mve_pred16_t p)
return vld1q_z_u32 (base, p);
}
-/* { dg-final { scan-assembler "vldrwt.u32" } } */
-
uint32x4_t
foo1 (uint32_t const * base, mve_pred16_t p)
{
return vld1q_z (base, p);
}
-/* { dg-final { scan-assembler "vldrwt.u32" } } */
+/* { dg-final { scan-assembler-times "vpst" 2 } } */
+/* { dg-final { scan-assembler-times "vldrwt.32" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_u8.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_u8.c
index 47d3f6fa4c7..172053c7142 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_u8.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vld1q_z_u8.c
@@ -10,12 +10,12 @@ foo (uint8_t const * base, mve_pred16_t p)
return vld1q_z_u8 (base, p);
}
-/* { dg-final { scan-assembler "vldrbt.u8" } } */
-
uint8x16_t
foo1 (uint8_t const * base, mve_pred16_t p)
{
return vld1q_z (base, p);
}
-/* { dg-final { scan-assembler "vldrbt.u8" } } */
+/* { dg-final { scan-assembler-times "vpst" 2 } } */
+/* { dg-final { scan-assembler-times "vldrbt.8" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_s8.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_s8.c
index 886491f0052..ec2f2176ccf 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_s8.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_s8.c
@@ -10,4 +10,5 @@ foo (int8_t const * base)
return vldrbq_s8 (base);
}
-/* { dg-final { scan-assembler "vldrb.s8" } } */
+/* { dg-final { scan-assembler-times "vldrb.8" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_u8.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_u8.c
index e58120a2b64..d07b472a4ff 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_u8.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_u8.c
@@ -10,4 +10,5 @@ foo (uint8_t const * base)
return vldrbq_u8 (base);
}
-/* { dg-final { scan-assembler "vldrb.u8" } } */
+/* { dg-final { scan-assembler-times "vldrb.8" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_z_s8.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_z_s8.c
index 7d66c704516..aed3c910063 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_z_s8.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_z_s8.c
@@ -10,4 +10,6 @@ foo (int8_t const * base, mve_pred16_t p)
return vldrbq_z_s8 (base, p);
}
-/* { dg-final { scan-assembler "vldrbt.s8" } } */
+/* { dg-final { scan-assembler-times "vpst" 1 } } */
+/* { dg-final { scan-assembler-times "vldrbt.8" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_z_u8.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_z_u8.c
index 05ae2628d56..54c61e74454 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_z_u8.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrbq_z_u8.c
@@ -10,4 +10,6 @@ foo (uint8_t const * base, mve_pred16_t p)
return vldrbq_z_u8 (base, p);
}
-/* { dg-final { scan-assembler "vldrbt.u8" } } */
+/* { dg-final { scan-assembler-times "vpst" 1 } } */
+/* { dg-final { scan-assembler-times "vldrbt.8" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_s64.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_s64.c
index 0d1ee769ec6..7420d0198e7 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_s64.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_s64.c
@@ -10,6 +10,7 @@ foo (uint64x2_t * addr)
return vldrdq_gather_base_wb_s64 (addr, 8);
}
-/* { dg-final { scan-assembler "vldrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
/* { dg-final { scan-assembler "vldrd.64\tq\[0-9\]+, \\\[q\[0-9\]+, #\[0-9\]+\\\]!" } } */
-/* { dg-final { scan-assembler "vstrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler-times "vldr.64" 1 } } */
+/* { dg-final { scan-assembler-times "vstr.64" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_u64.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_u64.c
index cb2a41bdcd3..ebe5b2fd70c 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_u64.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_u64.c
@@ -10,6 +10,7 @@ foo (uint64x2_t * addr)
return vldrdq_gather_base_wb_u64 (addr, 8);
}
-/* { dg-final { scan-assembler "vldrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
/* { dg-final { scan-assembler "vldrd.64\tq\[0-9\]+, \\\[q\[0-9\]+, #\[0-9\]+\\\]!" } } */
-/* { dg-final { scan-assembler "vstrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler-times "vldr.64" 1 } } */
+/* { dg-final { scan-assembler-times "vstr.64" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_s64.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_s64.c
index 243fbeacc34..231a24a1e55 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_s64.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_s64.c
@@ -8,8 +8,8 @@ int64x2_t foo (uint64x2_t * addr, mve_pred16_t p)
return vldrdq_gather_base_wb_z_s64 (addr, 1016, p);
}
-/* { dg-final { scan-assembler "vldrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
-/* { dg-final { scan-assembler "vmsr\t P0, r\[0-9\]+.*$" } } */
/* { dg-final { scan-assembler "vpst" } } */
/* { dg-final { scan-assembler "vldrdt.u64\tq\[0-9\]+, \\\[q\[0-9\]+, #\[0-9\]+\\\]!" } } */
-/* { dg-final { scan-assembler "vstrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler-times "vldr.64" 1 } } */
+/* { dg-final { scan-assembler-times "vstr.64" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_u64.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_u64.c
index 10ba42405fe..b8d9b5c1391 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_u64.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_u64.c
@@ -8,8 +8,8 @@ uint64x2_t foo (uint64x2_t * addr, mve_pred16_t p)
return vldrdq_gather_base_wb_z_u64 (addr, 8, p);
}
-/* { dg-final { scan-assembler "vldrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
-/* { dg-final { scan-assembler "vmsr\t P0, r\[0-9\]+.*" } } */
/* { dg-final { scan-assembler "vpst" } } */
/* { dg-final { scan-assembler "vldrdt.u64\tq\[0-9\]+, \\\[q\[0-9\]+, #\[0-9\]+\\\]!" } } */
-/* { dg-final { scan-assembler "vstrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler-times "vldr.64" 1 } } */
+/* { dg-final { scan-assembler-times "vstr.64" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_f16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_f16.c
index b79c0e9bfe4..05bef418d82 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_f16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_f16.c
@@ -10,4 +10,5 @@ foo (float16_t const * base)
return vldrhq_f16 (base);
}
-/* { dg-final { scan-assembler "vldrh.f16" } } */
+/* { dg-final { scan-assembler-times "vldrh.16" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_s16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_s16.c
index 4872eb555f3..7c977b6a699 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_s16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_s16.c
@@ -10,4 +10,5 @@ foo (int16_t const * base)
return vldrhq_s16 (base);
}
-/* { dg-final { scan-assembler "vldrh.s16" } } */
+/* { dg-final { scan-assembler-times "vldrh.16" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_s32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_s32.c
index e73e208c26a..229b52163fa 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_s32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_s32.c
@@ -10,4 +10,5 @@ foo (int16_t const * base)
return vldrhq_s32 (base);
}
-/* { dg-final { scan-assembler "vldrh.s32" } } */
+/* { dg-final { scan-assembler-times "vldrh.s32" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_u16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_u16.c
index 6b285d45aaa..07f6d9e3944 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_u16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_u16.c
@@ -10,4 +10,5 @@ foo (uint16_t const * base)
return vldrhq_u16 (base);
}
-/* { dg-final { scan-assembler "vldrh.u16" } } */
+/* { dg-final { scan-assembler-times "vldrh.16" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_u32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_u32.c
index 994cd4a20ba..cd24f01831f 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_u32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_u32.c
@@ -10,4 +10,5 @@ foo (uint16_t const * base)
return vldrhq_u32 (base);
}
-/* { dg-final { scan-assembler "vldrh.u32" } } */
+/* { dg-final { scan-assembler-times "vldrh.u32" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_f16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_f16.c
index 2b866a99dd4..dd0fc9c7b73 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_f16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_f16.c
@@ -10,4 +10,6 @@ foo (float16_t const * base, mve_pred16_t p)
return vldrhq_z_f16 (base, p);
}
-/* { dg-final { scan-assembler "vldrht.f16" } } */
+/* { dg-final { scan-assembler-times "vpst" 1 } } */
+/* { dg-final { scan-assembler-times "vldrht.16" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_s16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_s16.c
index 6c92c50ba12..36d3458d95c 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_s16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_s16.c
@@ -10,4 +10,6 @@ foo (int16_t const * base, mve_pred16_t p)
return vldrhq_z_s16 (base, p);
}
-/* { dg-final { scan-assembler "vldrht.s16" } } */
+/* { dg-final { scan-assembler-times "vpst" 1 } } */
+/* { dg-final { scan-assembler-times "vldrht.16" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_s32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_s32.c
index 4cd97ba5743..9c67b479be7 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_s32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_s32.c
@@ -10,4 +10,6 @@ foo (int16_t const * base, mve_pred16_t p)
return vldrhq_z_s32 (base, p);
}
-/* { dg-final { scan-assembler "vldrht.s32" } } */
+/* { dg-final { scan-assembler-times "vpst" 1 } } */
+/* { dg-final { scan-assembler-times "vldrht.s32" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_u16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_u16.c
index 80ae0e5cd17..26354b5971a 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_u16.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_u16.c
@@ -10,4 +10,6 @@ foo (uint16_t const * base, mve_pred16_t p)
return vldrhq_z_u16 (base, p);
}
-/* { dg-final { scan-assembler "vldrht.u16" } } */
+/* { dg-final { scan-assembler-times "vpst" 1 } } */
+/* { dg-final { scan-assembler-times "vldrht.16" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_u32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_u32.c
index 1a8590116eb..948fe5ee5b4 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_u32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrhq_z_u32.c
@@ -10,4 +10,6 @@ foo (uint16_t const * base, mve_pred16_t p)
return vldrhq_z_u32 (base, p);
}
-/* { dg-final { scan-assembler "vldrht.u32" } } */
+/* { dg-final { scan-assembler-times "vpst" 1 } } */
+/* { dg-final { scan-assembler-times "vldrht.u32" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_f32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_f32.c
index 2c834ae53df..143079aa23f 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_f32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_f32.c
@@ -10,4 +10,5 @@ foo (float32_t const * base)
return vldrwq_f32 (base);
}
-/* { dg-final { scan-assembler "vldrw.f32" } } */
+/* { dg-final { scan-assembler-times "vldrw.32" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_f32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_f32.c
index db8108e3732..8e2994f75d7 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_f32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_f32.c
@@ -10,6 +10,7 @@ foo (uint32x4_t * addr)
return vldrwq_gather_base_wb_f32 (addr, 8);
}
-/* { dg-final { scan-assembler "vldrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler "vldrw.32\tq\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
/* { dg-final { scan-assembler "vldrw.u32\tq\[0-9\]+, \\\[q\[0-9\]+, #\[0-9\]+\\\]!" } } */
-/* { dg-final { scan-assembler "vstrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler "vstrw.32\tq\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_s32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_s32.c
index 3da64e218e2..e5054738b75 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_s32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_s32.c
@@ -10,6 +10,7 @@ foo (uint32x4_t * addr)
return vldrwq_gather_base_wb_s32 (addr, 8);
}
-/* { dg-final { scan-assembler "vldrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler "vldrw.32\tq\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
/* { dg-final { scan-assembler "vldrw.u32\tq\[0-9\]+, \\\[q\[0-9\]+, #\[0-9\]+\\\]!" } } */
-/* { dg-final { scan-assembler "vstrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler "vstrw.32\tq\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_u32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_u32.c
index 2597ee11608..7f39414143b 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_u32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_u32.c
@@ -10,6 +10,7 @@ foo (uint32x4_t * addr)
return vldrwq_gather_base_wb_u32 (addr, 8);
}
-/* { dg-final { scan-assembler "vldrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler "vldrw.32\tq\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
/* { dg-final { scan-assembler "vldrw.u32\tq\[0-9\]+, \\\[q\[0-9\]+, #\[0-9\]+\\\]!" } } */
-/* { dg-final { scan-assembler "vstrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler "vstrw.32\tq\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_f32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_f32.c
index 9fb47daf486..f3219e2e825 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_f32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_f32.c
@@ -10,8 +10,9 @@ foo (uint32x4_t * addr, mve_pred16_t p)
return vldrwq_gather_base_wb_z_f32 (addr, 8, p);
}
-/* { dg-final { scan-assembler "vldrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler "vldrw.32\tq\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
/* { dg-final { scan-assembler "vmsr\t P0, r\[0-9\]+.*" } } */
/* { dg-final { scan-assembler "vpst" } } */
/* { dg-final { scan-assembler "vldrwt.u32\tq\[0-9\]+, \\\[q\[0-9\]+, #\[0-9\]+\\\]!" } } */
-/* { dg-final { scan-assembler "vstrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler "vstrw.32\tq\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_s32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_s32.c
index 56da5a46c64..4d093d243fe 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_s32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_s32.c
@@ -10,8 +10,9 @@ foo (uint32x4_t * addr, mve_pred16_t p)
return vldrwq_gather_base_wb_z_s32 (addr, 8, p);
}
-/* { dg-final { scan-assembler "vldrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler "vldrw.32\tq\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
/* { dg-final { scan-assembler "vmsr\t P0, r\[0-9\]+.*" } } */
/* { dg-final { scan-assembler "vpst" } } */
/* { dg-final { scan-assembler "vldrwt.u32\tq\[0-9\]+, \\\[q\[0-9\]+, #\[0-9\]+\\\]!" } } */
-/* { dg-final { scan-assembler "vstrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler "vstrw.32\tq\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_u32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_u32.c
index 63165d97c1a..e796522a49c 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_u32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_u32.c
@@ -10,8 +10,9 @@ foo (uint32x4_t * addr, mve_pred16_t p)
return vldrwq_gather_base_wb_z_u32 (addr, 8, p);
}
-/* { dg-final { scan-assembler "vldrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler "vldrw.32\tq\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
/* { dg-final { scan-assembler "vmsr\t P0, r\[0-9\]+.*" } } */
/* { dg-final { scan-assembler "vpst" } } */
/* { dg-final { scan-assembler "vldrwt.u32\tq\[0-9\]+, \\\[q\[0-9\]+, #\[0-9\]+\\\]!" } } */
-/* { dg-final { scan-assembler "vstrb.8 q\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler "vstrw.32\tq\[0-9\]+, \\\[r\[0-9\]+\\\]" } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_s32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_s32.c
index f48c29f8bff..860dd324d25 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_s32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_s32.c
@@ -10,4 +10,5 @@ foo (int32_t const * base)
return vldrwq_s32 (base);
}
-/* { dg-final { scan-assembler "vldrw.s32" } } */
+/* { dg-final { scan-assembler-times "vldrw.32" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_u32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_u32.c
index 7c722200ecc..513ed49fb6e 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_u32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_u32.c
@@ -10,4 +10,5 @@ foo (uint32_t const * base)
return vldrwq_u32 (base);
}
-/* { dg-final { scan-assembler "vldrw.u32" } } */
+/* { dg-final { scan-assembler-times "vldrw.32" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_z_f32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_z_f32.c
index bcdcecab468..3e0a6a60bcf 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_z_f32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_z_f32.c
@@ -10,4 +10,6 @@ foo (float32_t const * base, mve_pred16_t p)
return vldrwq_z_f32 (base, p);
}
-/* { dg-final { scan-assembler "vldrwt.f32" } } */
+/* { dg-final { scan-assembler-times "vpst" 1 } } */
+/* { dg-final { scan-assembler-times "vldrwt.32" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_z_s32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_z_s32.c
index fd32b305656..82b914885b5 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_z_s32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_z_s32.c
@@ -10,4 +10,6 @@ foo (int32_t const * base, mve_pred16_t p)
return vldrwq_z_s32 (base, p);
}
-/* { dg-final { scan-assembler "vldrwt.s32" } } */
+/* { dg-final { scan-assembler-times "vpst" 1 } } */
+/* { dg-final { scan-assembler-times "vldrwt.32" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_z_u32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_z_u32.c
index f4944043834..6a66e167881 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_z_u32.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vldrwq_z_u32.c
@@ -10,4 +10,6 @@ foo (uint32_t const * base, mve_pred16_t p)
return vldrwq_z_u32 (base, p);
}
-/* { dg-final { scan-assembler "vldrwt.u32" } } */
+/* { dg-final { scan-assembler-times "vpst" 1 } } */
+/* { dg-final { scan-assembler-times "vldrwt.32" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_float.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_float.c
index 52bad05b621..739f282c476 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_float.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_float.c
@@ -1,6 +1,6 @@
/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
/* { dg-add-options arm_v8_1m_mve_fp } */
-/* { dg-additional-options "-O0" } */
+/* { dg-additional-options "-O2" } */
#include "arm_mve.h"
@@ -14,4 +14,6 @@ foo ()
fb = vuninitializedq_f32 ();
}
-/* { dg-final { scan-assembler-times "vstrb.8" 4 } } */
+/* { dg-final { scan-assembler-times "vstrh.16" 1 } } */
+/* { dg-final { scan-assembler-times "vstrw.32" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_float1.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_float1.c
index c6724a52074..a9130607f26 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_float1.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_float1.c
@@ -1,6 +1,6 @@
/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
/* { dg-add-options arm_v8_1m_mve_fp } */
-/* { dg-additional-options "-O0" } */
+/* { dg-additional-options "-O2" } */
#include "arm_mve.h"
@@ -14,4 +14,6 @@ foo ()
fb = vuninitializedq (fbb);
}
-/* { dg-final { scan-assembler-times "vstrb.8" 6 } } */
+/* { dg-final { scan-assembler-times "vstrh.16" 1 } } */
+/* { dg-final { scan-assembler-times "vstrw.32" 1 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_int.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_int.c
index 13a0109a9b5..bf6692fe573 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_int.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_int.c
@@ -1,6 +1,6 @@
/* { dg-require-effective-target arm_v8_1m_mve_ok } */
/* { dg-add-options arm_v8_1m_mve } */
-/* { dg-additional-options "-O0" } */
+/* { dg-additional-options "-O2" } */
#include "arm_mve.h"
int8x16_t a;
@@ -25,4 +25,8 @@ foo ()
ud = vuninitializedq_u64 ();
}
-/* { dg-final { scan-assembler-times "vstrb.8" 16 } } */
+/* { dg-final { scan-assembler-times "vstrb.8" 2 } } */
+/* { dg-final { scan-assembler-times "vstrh.16" 2 } } */
+/* { dg-final { scan-assembler-times "vstrw.32" 2 } } */
+/* { dg-final { scan-assembler-times "vstr.64" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_int1.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_int1.c
index a321398709e..4f66a07ac29 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_int1.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vuninitializedq_int1.c
@@ -1,6 +1,6 @@
/* { dg-require-effective-target arm_v8_1m_mve_ok } */
/* { dg-add-options arm_v8_1m_mve } */
-/* { dg-additional-options "-O0" } */
+/* { dg-additional-options "-O2" } */
#include "arm_mve.h"
@@ -26,4 +26,8 @@ foo ()
ud = vuninitializedq (udd);
}
-/* { dg-final { scan-assembler-times "vstrb.8" 24 } } */
+/* { dg-final { scan-assembler-times "vstrb.8" 2 } } */
+/* { dg-final { scan-assembler-times "vstrh.16" 2 } } */
+/* { dg-final { scan-assembler-times "vstrw.32" 2 } } */
+/* { dg-final { scan-assembler-times "vstr.64" 2 } } */
+/* { dg-final { scan-assembler-not "__ARM_undef" } } */
diff --git a/gcc/testsuite/gcc.target/arm/pr70830.c b/gcc/testsuite/gcc.target/arm/pr70830.c
index cd84c4283bd..bca596c2d63 100644
--- a/gcc/testsuite/gcc.target/arm/pr70830.c
+++ b/gcc/testsuite/gcc.target/arm/pr70830.c
@@ -1,7 +1,7 @@
/* PR target/70830. */
/* { dg-do assemble } */
/* { dg-require-effective-target arm_arm_ok } */
-/* { dg-options "-Os -marm -save-temps" } */
+/* { dg-options "-mgeneral-regs-only -Os -marm -save-temps" } */
/* This test is not valid when -mthumb. */
diff --git a/gcc/testsuite/gcc.target/arm/pr94743-1-hard.c b/gcc/testsuite/gcc.target/arm/pr94743-1-hard.c
new file mode 100644
index 00000000000..b4c961e288f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr94743-1-hard.c
@@ -0,0 +1,29 @@
+/* PR target/94743 */
+/* { dg-do compile } */
+/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } {"-mfloat-abi=hard" } } */
+/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-add-options arm_vfp } */
+/* Make sure with use -mfloat-abi=hard. */
+/* { dg-additional-options "-mfloat-abi=hard" } */
+
+/* Check that we emit a warning when compiling an IRQ handler without
+ -mgeneral-regs-only. */
+typedef struct {
+ double fpdata[32];
+} dummy_t;
+
+dummy_t global_d;
+dummy_t global_d1;
+
+/* This function may clobber VFP registers. */
+__attribute__ ((interrupt("IRQ"))) void IRQ_HDLR_Test(void)
+{ /* { dg-warning { FP registers might be clobbered despite 'interrupt' attribute: compile with '-mgeneral-regs-only'} "" { target *-*-* } . } */
+ global_d.fpdata[3] += global_d.fpdata[3] * global_d1.fpdata[3];
+}
+
+/* This function does not need to clobber VFP registers. */
+/* Do we want to emit a (useless?) warning? */
+__attribute__ ((interrupt("IRQ"))) void IRQ_HDLR_Test2(void)
+{ /* { dg-warning { FP registers might be clobbered despite 'interrupt' attribute: compile with '-mgeneral-regs-only'} "" { target *-*-* } . } */
+ global_d.fpdata[3] = 1.0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr94743-1-soft.c b/gcc/testsuite/gcc.target/arm/pr94743-1-soft.c
new file mode 100644
index 00000000000..e06a16d166c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr94743-1-soft.c
@@ -0,0 +1,27 @@
+/* PR target/94743 */
+/* { dg-do compile } */
+/* Thumb1 mode not supported for interrupt routines. */
+/* { dg-require-effective-target arm32 } */
+/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } {"-mfloat-abi=soft" } } */
+/* { dg-options "-mfloat-abi=soft" } */
+
+/* Check that we do not emit a warning when compiling an IRQ handler without
+ -mgeneral-regs-only with -mfloat-abi=soft. */
+typedef struct {
+ double fpdata[32];
+} dummy_t;
+
+dummy_t global_d;
+dummy_t global_d1;
+
+/* This function may clobber VFP registers. */
+__attribute__ ((interrupt("IRQ"))) void IRQ_HDLR_Test(void)
+{
+ global_d.fpdata[3] += global_d.fpdata[3] * global_d1.fpdata[3];
+}
+
+/* This function does not need to clobber VFP registers. */
+__attribute__ ((interrupt("IRQ"))) void IRQ_HDLR_Test2(void)
+{
+ global_d.fpdata[3] = 1.0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr94743-1-softfp.c b/gcc/testsuite/gcc.target/arm/pr94743-1-softfp.c
new file mode 100644
index 00000000000..33202496c6c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr94743-1-softfp.c
@@ -0,0 +1,29 @@
+/* PR target/94743 */
+/* { dg-do compile } */
+/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } {"-mfloat-abi=softfp" } } */
+/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-add-options arm_vfp } */
+/* Make sure with use -mfloat-abi=softfp. */
+/* { dg-additional-options "-mfloat-abi=softfp" } */
+
+/* Check that we emit a warning when compiling an IRQ handler without
+ -mgeneral-regs-only. */
+typedef struct {
+ double fpdata[32];
+} dummy_t;
+
+dummy_t global_d;
+dummy_t global_d1;
+
+/* This function may clobber VFP registers. */
+__attribute__ ((interrupt("IRQ"))) void IRQ_HDLR_Test(void)
+{ /* { dg-warning { FP registers might be clobbered despite 'interrupt' attribute: compile with '-mgeneral-regs-only'} "" { target *-*-* } . } */
+ global_d.fpdata[3] += global_d.fpdata[3] * global_d1.fpdata[3];
+}
+
+/* This function does not need to clobber VFP registers. */
+/* Do we want to emit a (useless?) warning? */
+__attribute__ ((interrupt("IRQ"))) void IRQ_HDLR_Test2(void)
+{ /* { dg-warning { FP registers might be clobbered despite 'interrupt' attribute: compile with '-mgeneral-regs-only'} "" { target *-*-* } . } */
+ global_d.fpdata[3] = 1.0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr94743-2.c b/gcc/testsuite/gcc.target/arm/pr94743-2.c
new file mode 100644
index 00000000000..50a97de69b8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr94743-2.c
@@ -0,0 +1,22 @@
+/* PR target/94743 */
+/* { dg-do compile } */
+/* Thumb1 mode not supported for interrupt routines. */
+/* { dg-require-effective-target arm32 } */
+/* { dg-options "-mgeneral-regs-only" } */
+
+/* Check that we do not emit a warning when compiling an IRQ handler
+ with -mgeneral-regs-only. */
+typedef struct {
+ /* Do not use floating-point types, which are not compatible with
+ -mgeneral-regs-only under -mfloat-abi=hard */
+ int fpdata[32];
+} dummy_t;
+
+dummy_t global_d;
+dummy_t global_d1;
+
+/* This function does not clobber VFP registers. */
+__attribute__ ((interrupt("IRQ"))) void IRQ_HDLR_Test(void)
+{
+ global_d.fpdata[3] += global_d.fpdata[3] * global_d1.fpdata[3];
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr94743-3.c b/gcc/testsuite/gcc.target/arm/pr94743-3.c
new file mode 100644
index 00000000000..6b8ed2b8dfa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr94743-3.c
@@ -0,0 +1,23 @@
+/* PR target/94743 */
+/* { dg-do compile } */
+/* Thumb1 mode not supported for interrupt routines. */
+/* { dg-require-effective-target arm32 } */
+/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } {"-mfloat-abi=soft" } } */
+/* { dg-options "-mgeneral-regs-only -mfloat-abi=soft" } */
+
+/* Check that we do not emit a warning when compiling an IRQ handler
+ with -mgeneral-regs-only even when using floating-point data. */
+typedef struct {
+ /* Since we use -mfloat=abi=soft, this will generate calls to
+ libgcc, but won't clobber VFP registers. */
+ double fpdata[32];
+} dummy_t;
+
+dummy_t global_d;
+dummy_t global_d1;
+
+/* This function does not clobber VFP registers. */
+__attribute__ ((interrupt("IRQ"))) void IRQ_HDLR_Test(void)
+{
+ global_d.fpdata[3] += global_d.fpdata[3] * global_d1.fpdata[3];
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr95646.c b/gcc/testsuite/gcc.target/arm/pr95646.c
new file mode 100644
index 00000000000..12d06a0c8c1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr95646.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv8-m.base" } } */
+/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mcpu=*" } { "-mcpu=cortex-m23" } } */
+/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mfpu=*" } { } } */
+/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */
+/* { dg-options "-mcpu=cortex-m23 -mcmse" } */
+/* { dg-additional-options "-Os" } */
+/* { dg-final { check-function-bodies "**" "" } } */
+
+int __attribute__ ((cmse_nonsecure_entry))
+foo (void)
+{
+ return 1;
+}
+/* { { dg-final { scan-assembler-not "mov\tr9, r0" } } */
+
+/*
+** __acle_se_bar:
+** mov (r[0-3]), r9
+** push {\1}
+** ...
+** pop {(r[0-3])}
+** mov r9, \2
+** ...
+** bxns lr
+*/
+int __attribute__ ((cmse_nonsecure_entry))
+bar (void)
+{
+ asm ("": : : "r9");
+ return 1;
+}
diff --git a/gcc/testsuite/gcc.target/arm/simd/vmmla_1.c b/gcc/testsuite/gcc.target/arm/simd/vmmla_1.c
index b766a9141ce..fa512d905e2 100644
--- a/gcc/testsuite/gcc.target/arm/simd/vmmla_1.c
+++ b/gcc/testsuite/gcc.target/arm/simd/vmmla_1.c
@@ -1,7 +1,6 @@
/* { dg-do assemble } */
/* { dg-require-effective-target arm_v8_2a_i8mm_ok } */
-/* { dg-options "-save-temps -O2" } */
-/* { dg-additional-options "-march=armv8.2-a+i8mm" } */
+/* { dg-options "-save-temps -O2 -march=armv8.2-a+i8mm" } */
#include "arm_neon.h"
diff --git a/gcc/testsuite/gcc.target/arm/stack-protector-1.c b/gcc/testsuite/gcc.target/arm/stack-protector-1.c
new file mode 100644
index 00000000000..8d28b0a847c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/stack-protector-1.c
@@ -0,0 +1,63 @@
+/* { dg-do run } */
+/* { dg-require-effective-target fstack_protector } */
+/* { dg-options "-fstack-protector-all -O2" } */
+
+extern volatile long *stack_chk_guard_ptr;
+
+volatile long *
+get_ptr (void)
+{
+ return stack_chk_guard_ptr;
+}
+
+void __attribute__ ((noipa))
+f (void)
+{
+ volatile int x;
+ x = 1;
+ x += 1;
+}
+
+#define CHECK(REG) "\tcmp\tr0, " #REG "\n\tbeq\t1f\n"
+
+asm (
+" .data\n"
+" .align 3\n"
+" .globl stack_chk_guard_ptr\n"
+"stack_chk_guard_ptr:\n"
+" .word __stack_chk_guard\n"
+" .weak __stack_chk_guard\n"
+"__stack_chk_guard:\n"
+" .word 0xdead4321\n"
+" .text\n"
+" .globl main\n"
+" .type main, %function\n"
+"main:\n"
+" bl get_ptr\n"
+" sub sp, sp, #8\n"
+" str r0, [sp]\n"
+" bl f\n"
+" str r0, [sp, #4]\n"
+" ldr r0, [sp]\n"
+" ldr r0, [r0]\n"
+ CHECK (r1)
+ CHECK (r2)
+ CHECK (r3)
+ CHECK (r4)
+ CHECK (r5)
+ CHECK (r6)
+ CHECK (r7)
+ CHECK (r8)
+ CHECK (r9)
+ CHECK (r10)
+ CHECK (r11)
+ CHECK (r12)
+ CHECK (r14)
+" ldr r1, [sp, #4]\n"
+ CHECK (r1)
+" mov r0, #0\n"
+" b exit\n"
+"1:\n"
+" b abort\n"
+" .size main, .-main"
+);
diff --git a/gcc/testsuite/gcc.target/arm/stack-protector-2.c b/gcc/testsuite/gcc.target/arm/stack-protector-2.c
new file mode 100644
index 00000000000..266c36fdbc6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/stack-protector-2.c
@@ -0,0 +1,6 @@
+/* { dg-do run } */
+/* { dg-require-effective-target fstack_protector } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-fstack-protector-all -O2 -fpic" } */
+
+#include "stack-protector-1.c"
diff --git a/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c b/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c
index 5668eb1eac4..9272e4ce9b8 100644
--- a/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c
+++ b/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-require-effective-target arm_thumb2_ok_no_arm_v8_1_lob } */
/* { dg-options "-O" } */
unsigned short foo (unsigned short x, unsigned short c)
diff --git a/gcc/testsuite/gcc.target/bpf/diag-funargs-2.c b/gcc/testsuite/gcc.target/bpf/diag-funargs-2.c
index 7c991af336b..116f1bc849d 100644
--- a/gcc/testsuite/gcc.target/bpf/diag-funargs-2.c
+++ b/gcc/testsuite/gcc.target/bpf/diag-funargs-2.c
@@ -23,4 +23,3 @@ int foo ()
jorl (je, 1, 2, 3); /* { dg-error "too many function arguments" } */
return 2L /1;
}
-
diff --git a/gcc/testsuite/gcc.target/bpf/diag-funargs-3.c b/gcc/testsuite/gcc.target/bpf/diag-funargs-3.c
index d9d42c18258..598a9dbeb4b 100644
--- a/gcc/testsuite/gcc.target/bpf/diag-funargs-3.c
+++ b/gcc/testsuite/gcc.target/bpf/diag-funargs-3.c
@@ -23,4 +23,3 @@ int foo ()
jorl (je, 1, 2, 3, 4); /* { dg-error "too many function arguments" } */
return 2L /1;
}
-
diff --git a/gcc/testsuite/gcc.target/bpf/helper-bind.c b/gcc/testsuite/gcc.target/bpf/helper-bind.c
index 2d1fedc4ce8..8dfde242a23 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-bind.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-bind.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
void *ctx, *addr;
int addr_len;
- ret = __builtin_bpf_helper_bind (ctx, addr, addr_len);
+ ret = bpf_bind (ctx, addr, addr_len);
}
/* { dg-final { scan-assembler "call\t64" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-bpf-redirect.c b/gcc/testsuite/gcc.target/bpf/helper-bpf-redirect.c
index 844c88d3e34..9937d5ab4cc 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-bpf-redirect.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-bpf-redirect.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
uint32_t ifindex;
uint64_t flags;
- ret = __builtin_bpf_helper_redirect (ifindex, flags);
+ ret = bpf_redirect (ifindex, flags);
}
/* { dg-final { scan-assembler "call\t23" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-clone-redirect.c b/gcc/testsuite/gcc.target/bpf/helper-clone-redirect.c
index a4fb8139234..e38adbc40e7 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-clone-redirect.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-clone-redirect.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,7 +12,7 @@ foo ()
uint32_t ifindex;
uint64_t flags;
- ret = __builtin_bpf_helper_clone_redirect (skb, ifindex, flags);
+ ret = bpf_clone_redirect (skb, ifindex, flags);
}
/* { dg-final { scan-assembler "call\t13" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-csum-diff.c b/gcc/testsuite/gcc.target/bpf/helper-csum-diff.c
index ef38192efd3..a1c8bf5a026 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-csum-diff.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-csum-diff.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,7 +12,7 @@ foo ()
uint64_t to_size, from_size;
int seed;
- ret = __builtin_bpf_helper_csum_diff (from, from_size, to, to_size, seed);
+ ret = bpf_csum_diff (from, from_size, to, to_size, seed);
}
/* { dg-final { scan-assembler "call\t28" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-csum-update.c b/gcc/testsuite/gcc.target/bpf/helper-csum-update.c
index 3cde8678cb5..4f65033acb4 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-csum-update.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-csum-update.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
void *skb;
int csum;
- ret = __builtin_bpf_helper_csum_update (skb, csum);
+ ret = bpf_csum_update (skb, csum);
}
/* { dg-final { scan-assembler "call\t40" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-current-task-under-cgroup.c b/gcc/testsuite/gcc.target/bpf/helper-current-task-under-cgroup.c
index a7eb6e617e8..5b05378a730 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-current-task-under-cgroup.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-current-task-under-cgroup.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
void *map;
uint32_t index;
- ret = __builtin_bpf_helper_current_task_under_cgroup (map, index);
+ ret = bpf_current_task_under_cgroup (map, index);
}
/* { dg-final { scan-assembler "call\t37" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-fib-lookup.c b/gcc/testsuite/gcc.target/bpf/helper-fib-lookup.c
index 9a9f79d402c..8290234108a 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-fib-lookup.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-fib-lookup.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,7 +12,7 @@ foo ()
int plen;
uint32_t flags;
- ret = __builtin_bpf_helper_fib_lookup (ctx, params, plen, flags);
+ ret = bpf_fib_lookup (ctx, params, plen, flags);
}
/* { dg-final { scan-assembler "call\t69" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-cgroup-classid.c b/gcc/testsuite/gcc.target/bpf/helper-get-cgroup-classid.c
index 6cfd14d0ad1..5d85a89c632 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-cgroup-classid.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-cgroup-classid.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,7 +10,7 @@ foo ()
uint32_t ret;
void *skb;
- ret = __builtin_bpf_helper_get_cgroup_classid (skb);
+ ret = bpf_get_cgroup_classid (skb);
}
/* { dg-final { scan-assembler "call\t17" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-current-cgroup-id.c b/gcc/testsuite/gcc.target/bpf/helper-get-current-cgroup-id.c
index 916dc4d3bb1..6f55e5167fa 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-current-cgroup-id.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-current-cgroup-id.c
@@ -1,13 +1,15 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
uint64_t ret;
-
- ret = __builtin_bpf_helper_get_current_cgroup_id ();
+
+ ret = bpf_get_current_cgroup_id ();
}
/* { dg-final { scan-assembler "call\t80" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-current-comm.c b/gcc/testsuite/gcc.target/bpf/helper-get-current-comm.c
index efc330c3c98..1e25cd1cc7e 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-current-comm.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-current-comm.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
void *buf;
uint32_t size_of_buf;
- ret = __builtin_bpf_helper_get_current_comm (buf, size_of_buf);
+ ret = bpf_get_current_comm (buf, size_of_buf);
}
/* { dg-final { scan-assembler "call\t16" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-current-pid-tgid.c b/gcc/testsuite/gcc.target/bpf/helper-get-current-pid-tgid.c
index 32d3e9c91d1..1dd7a1e507b 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-current-pid-tgid.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-current-pid-tgid.c
@@ -1,13 +1,15 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
uint64_t ret;
- ret = __builtin_bpf_helper_get_current_pid_tgid ();
+ ret = bpf_get_current_pid_tgid ();
}
/* { dg-final { scan-assembler "call\t14" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-current-task.c b/gcc/testsuite/gcc.target/bpf/helper-get-current-task.c
index 016c134b132..79344d15abf 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-current-task.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-current-task.c
@@ -1,13 +1,15 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
uint64_t ret;
- ret = __builtin_bpf_helper_get_current_task ();
+ ret = bpf_get_current_task ();
}
/* { dg-final { scan-assembler "call\t35" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-current-uid-gid.c b/gcc/testsuite/gcc.target/bpf/helper-get-current-uid-gid.c
index 1dc2f9f41e5..b3e7261c35b 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-current-uid-gid.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-current-uid-gid.c
@@ -1,13 +1,15 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
uint64_t ret;
- ret = __builtin_bpf_helper_get_current_uid_gid ();
+ ret = bpf_get_current_uid_gid ();
}
/* { dg-final { scan-assembler "call\t15" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-hash-recalc.c b/gcc/testsuite/gcc.target/bpf/helper-get-hash-recalc.c
index 1db5d871c26..e9d87ae9bcc 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-hash-recalc.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-hash-recalc.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,7 +10,7 @@ foo ()
uint32_t ret;
void *skb;
- ret = __builtin_bpf_helper_get_hash_recalc (skb);
+ ret = bpf_get_hash_recalc (skb);
}
/* { dg-final { scan-assembler "call\t34" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-listener-sock.c b/gcc/testsuite/gcc.target/bpf/helper-get-listener-sock.c
index 298da1c949b..500ba787a3a 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-listener-sock.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-listener-sock.c
@@ -1,13 +1,15 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
void *ret, *sk;
- ret = __builtin_bpf_helper_get_listener_sock (sk);
+ ret = bpf_get_listener_sock (sk);
}
/* { dg-final { scan-assembler "call\t98" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-local-storage.c b/gcc/testsuite/gcc.target/bpf/helper-get-local-storage.c
index 88da67e99ae..616342c4d62 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-local-storage.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-local-storage.c
@@ -1,14 +1,16 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
void *ret, *map;
uint64_t flags;
-
- ret = __builtin_bpf_helper_get_local_storage (map, flags);
+
+ ret = bpf_get_local_storage (map, flags);
}
/* { dg-final { scan-assembler "call\t81" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-numa-node-id.c b/gcc/testsuite/gcc.target/bpf/helper-get-numa-node-id.c
index 628e1012152..e6477a5c1ff 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-numa-node-id.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-numa-node-id.c
@@ -1,13 +1,15 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
int ret;
- ret = __builtin_bpf_helper_get_numa_node_id ();
+ ret = bpf_get_numa_node_id ();
}
/* { dg-final { scan-assembler "call\t42" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-prandom-u32.c b/gcc/testsuite/gcc.target/bpf/helper-get-prandom-u32.c
index 6d3e5bc7a22..f30cafd36b0 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-prandom-u32.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-prandom-u32.c
@@ -1,13 +1,15 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
uint32_t ret;
- ret = __builtin_bpf_helper_get_prandom_u32 ();
+ ret = bpf_get_prandom_u32 ();
}
/* { dg-final { scan-assembler "call\t7" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-route-realm.c b/gcc/testsuite/gcc.target/bpf/helper-get-route-realm.c
index 5056c4adb1f..b7794307802 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-route-realm.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-route-realm.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,7 +10,7 @@ foo ()
uint32_t ret;
void *skb;
- ret = __builtin_bpf_helper_get_route_realm (skb);
+ ret = bpf_get_route_realm (skb);
}
/* { dg-final { scan-assembler "call\t24" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-smp-processor-id.c b/gcc/testsuite/gcc.target/bpf/helper-get-smp-processor-id.c
index 655b87341df..7d0e9869826 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-smp-processor-id.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-smp-processor-id.c
@@ -1,13 +1,15 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
uint32_t ret;
- ret = __builtin_bpf_helper_get_smp_processor_id ();
+ ret = bpf_get_smp_processor_id ();
}
/* { dg-final { scan-assembler "call\t8" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-socket-cookie.c b/gcc/testsuite/gcc.target/bpf/helper-get-socket-cookie.c
index afd17ddcd50..e6c538578b7 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-socket-cookie.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-socket-cookie.c
@@ -1,14 +1,16 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
uint64_t ret;
void *skb;
-
- ret = __builtin_bpf_helper_get_socket_cookie (skb);
+
+ ret = bpf_get_socket_cookie (skb);
}
/* { dg-final { scan-assembler "call\t46" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-socket-uid.c b/gcc/testsuite/gcc.target/bpf/helper-get-socket-uid.c
index 3a274c965f7..c1eaa2b7c29 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-socket-uid.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-socket-uid.c
@@ -1,14 +1,16 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
uint32_t ret;
void *skb;
-
- ret = __builtin_bpf_helper_get_socket_uid (skb);
+
+ ret = bpf_get_socket_uid (skb);
}
/* { dg-final { scan-assembler "call\t47" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-stack.c b/gcc/testsuite/gcc.target/bpf/helper-get-stack.c
index bbcdeb58775..cc3f6a06bb2 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-stack.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-stack.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,7 +12,7 @@ foo ()
uint32_t size;
uint64_t flags;
- ret = __builtin_bpf_helper_get_stack (regs, buf, size, flags);
+ ret = bpf_get_stack (regs, buf, size, flags);
}
/* { dg-final { scan-assembler "call\t67" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-get-stackid.c b/gcc/testsuite/gcc.target/bpf/helper-get-stackid.c
index 319d15cd2fa..cc3ecb01a05 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-get-stackid.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-get-stackid.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
void *ctx, *map;
uint64_t flags;
- ret = __builtin_bpf_helper_get_stackid (ctx, map, flags);
+ ret = bpf_get_stackid (ctx, map, flags);
}
/* { dg-final { scan-assembler "call\t27" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-getsockopt.c b/gcc/testsuite/gcc.target/bpf/helper-getsockopt.c
index fb16f15e6ea..3f71b6bfa6c 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-getsockopt.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-getsockopt.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,9 +11,9 @@ foo ()
void *bpf_socket;
int level, optname, optlen;
char *optval;
-
- ret = __builtin_bpf_helper_getsockopt (bpf_socket, level,
- optname, optval, optlen);
+
+ ret = bpf_getsockopt (bpf_socket, level,
+ optname, optval, optlen);
}
/* { dg-final { scan-assembler "call\t57" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-ktime-get-ns.c b/gcc/testsuite/gcc.target/bpf/helper-ktime-get-ns.c
index 405df057e30..77f1661f387 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-ktime-get-ns.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-ktime-get-ns.c
@@ -1,12 +1,14 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
uint64_t ret;
- ret = __builtin_bpf_helper_ktime_get_ns ();
+ ret = bpf_ktime_get_ns ();
}
/* { dg-final { scan-assembler "call\t5" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-l3-csum-replace.c b/gcc/testsuite/gcc.target/bpf/helper-l3-csum-replace.c
index ac17662c5d6..c3f1b78397a 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-l3-csum-replace.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-l3-csum-replace.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,7 +12,7 @@ foo ()
uint32_t offset;
uint64_t from, to, size;
- ret = __builtin_bpf_helper_l3_csum_replace (skb, offset, from, to, size);
+ ret = bpf_l3_csum_replace (skb, offset, from, to, size);
}
/* { dg-final { scan-assembler "call\t10" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-l4-csum-replace.c b/gcc/testsuite/gcc.target/bpf/helper-l4-csum-replace.c
index 52b5514b6cb..fd54f0b5e88 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-l4-csum-replace.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-l4-csum-replace.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,7 +12,7 @@ foo ()
uint32_t offset;
uint64_t from, to, size;
- ret = __builtin_bpf_helper_l4_csum_replace (skb, offset, from, to, size);
+ ret = bpf_l4_csum_replace (skb, offset, from, to, size);
}
/* { dg-final { scan-assembler "call\t11" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-lwt-push-encap.c b/gcc/testsuite/gcc.target/bpf/helper-lwt-push-encap.c
index 1baed27fac7..c6d82ccf8ba 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-lwt-push-encap.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-lwt-push-encap.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,8 +10,8 @@ foo ()
int ret;
void *skb, *hdr;
uint32_t type, len;
-
- ret = __builtin_bpf_helper_lwt_push_encap (skb, type, hdr, len);
+
+ ret = bpf_lwt_push_encap (skb, type, hdr, len);
}
/* { dg-final { scan-assembler "call\t73" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-lwt-seg6-action.c b/gcc/testsuite/gcc.target/bpf/helper-lwt-seg6-action.c
index ccc94c1af9d..2fc7e48e526 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-lwt-seg6-action.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-lwt-seg6-action.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,9 +10,9 @@ foo ()
int ret;
void *skb, *param;
uint32_t action, param_len;
-
- ret = __builtin_bpf_helper_lwt_seg6_action (skb, action,
- param, param_len);
+
+ ret = bpf_lwt_seg6_action (skb, action,
+ param, param_len);
}
/* { dg-final { scan-assembler "call\t76" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-lwt-seg6-adjust-srh.c b/gcc/testsuite/gcc.target/bpf/helper-lwt-seg6-adjust-srh.c
index 5e95124ad0f..762ab411ef2 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-lwt-seg6-adjust-srh.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-lwt-seg6-adjust-srh.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,9 +10,8 @@ foo ()
int ret;
void *skb;
uint32_t offset, delta;
-
- ret = __builtin_bpf_helper_lwt_seg6_adjust_srh (skb, offset,
- delta);
+
+ ret = bpf_lwt_seg6_adjust_srh (skb, offset, delta);
}
/* { dg-final { scan-assembler "call\t75" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-lwt-seg6-store-bytes.c b/gcc/testsuite/gcc.target/bpf/helper-lwt-seg6-store-bytes.c
index 098f97680f2..80a1f1205f0 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-lwt-seg6-store-bytes.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-lwt-seg6-store-bytes.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,9 +10,8 @@ foo ()
int ret;
void *skb, *from;
uint32_t offset, len;
-
- ret = __builtin_bpf_helper_lwt_seg6_store_bytes (skb, offset,
- from, len);
+
+ ret = bpf_lwt_seg6_store_bytes (skb, offset, from, len);
}
/* { dg-final { scan-assembler "call\t74" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-map-delete-elem.c b/gcc/testsuite/gcc.target/bpf/helper-map-delete-elem.c
index b8a6cdec4ee..0200b15eb45 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-map-delete-elem.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-map-delete-elem.c
@@ -1,4 +1,7 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+#include <bpf-helpers.h>
char *map () { return 0; }
@@ -8,7 +11,7 @@ foo ()
int ret;
char *key = 0;
- ret = __builtin_bpf_helper_map_delete_elem (map (), key);
+ ret = bpf_map_delete_elem (map (), key);
}
/* { dg-final { scan-assembler "call\t3" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-map-lookup-elem.c b/gcc/testsuite/gcc.target/bpf/helper-map-lookup-elem.c
index 839cfc423a7..1d443a05138 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-map-lookup-elem.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-map-lookup-elem.c
@@ -1,4 +1,7 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+#include <bpf-helpers.h>
char *map () { return 0; }
@@ -6,7 +9,7 @@ void
foo ()
{
char *key = 0, *value = 0;
- value = __builtin_bpf_helper_map_lookup_elem (map (), key);
+ value = bpf_map_lookup_elem (map (), key);
}
/* { dg-final { scan-assembler "call\t1" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-map-peek-elem.c b/gcc/testsuite/gcc.target/bpf/helper-map-peek-elem.c
index 6d0acb1dcb7..de833f202a9 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-map-peek-elem.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-map-peek-elem.c
@@ -1,4 +1,7 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+#include <bpf-helpers.h>
char *map () { return 0; }
@@ -8,7 +11,7 @@ foo ()
int ret;
char *value = 0;
- ret = __builtin_bpf_helper_map_peek_elem (map (), value);
+ ret = bpf_map_peek_elem (map (), value);
}
/* { dg-final { scan-assembler "call\t89" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-map-pop-elem.c b/gcc/testsuite/gcc.target/bpf/helper-map-pop-elem.c
index 71a7851ca9c..7d76f853f38 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-map-pop-elem.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-map-pop-elem.c
@@ -1,4 +1,7 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+#include <bpf-helpers.h>
char *map () { return 0; }
@@ -8,7 +11,7 @@ foo ()
int ret;
char *value = 0;
- ret = __builtin_bpf_helper_map_pop_elem (map (), value);
+ ret = bpf_map_pop_elem (map (), value);
}
/* { dg-final { scan-assembler "call\t88" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-map-push-elem.c b/gcc/testsuite/gcc.target/bpf/helper-map-push-elem.c
index 53bc0ac5dd7..b4b2a8ef1ef 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-map-push-elem.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-map-push-elem.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
/* { dg-options "-std=gnu99" } */
+#include <bpf-helpers.h>
+
char *map () { return 0; }
void
@@ -10,7 +12,7 @@ foo ()
char *value = 0;
long long flags = 0;
- ret = __builtin_bpf_helper_map_push_elem (map (), value, flags);
+ ret = bpf_map_push_elem (map (), value, flags);
}
/* { dg-final { scan-assembler "call\t87" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-map-update-elem.c b/gcc/testsuite/gcc.target/bpf/helper-map-update-elem.c
index 6281442ba3d..6cceafe62e3 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-map-update-elem.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-map-update-elem.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
/* { dg-options "-std=gnu99" } */
+#include <bpf-helpers.h>
+
char *map () { return 0; }
void
@@ -10,7 +12,7 @@ foo ()
long long flags = 0;
char *key = 0, *value = 0;
- ret = __builtin_bpf_helper_map_update_elem (map (), key, value, flags);
+ ret = bpf_map_update_elem (map (), key, value, flags);
}
/* { dg-final { scan-assembler "call\t2" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-msg-apply-bytes.c b/gcc/testsuite/gcc.target/bpf/helper-msg-apply-bytes.c
index 3b831acad64..e72035cff7c 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-msg-apply-bytes.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-msg-apply-bytes.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,8 +10,8 @@ foo ()
int ret;
void *msg;
uint32_t bytes;
-
- ret = __builtin_bpf_helper_msg_apply_bytes (msg, bytes);
+
+ ret = bpf_msg_apply_bytes (msg, bytes);
}
/* { dg-final { scan-assembler "call\t61" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-msg-cork-bytes.c b/gcc/testsuite/gcc.target/bpf/helper-msg-cork-bytes.c
index 2c4ee218832..350c2bfa0e6 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-msg-cork-bytes.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-msg-cork-bytes.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,8 +10,8 @@ foo ()
int ret;
void *msg;
uint32_t bytes;
-
- ret = __builtin_bpf_helper_msg_cork_bytes (msg, bytes);
+
+ ret = bpf_msg_cork_bytes (msg, bytes);
}
/* { dg-final { scan-assembler "call\t62" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-msg-pop-data.c b/gcc/testsuite/gcc.target/bpf/helper-msg-pop-data.c
index 377c036603e..567904433f9 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-msg-pop-data.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-msg-pop-data.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,7 +12,7 @@ foo ()
uint32_t start, pop;
uint64_t flags;
- ret = __builtin_bpf_helper_msg_pop_data (skb, start, pop, flags);
+ ret = bpf_msg_pop_data (skb, start, pop, flags);
}
/* { dg-final { scan-assembler "call\t91" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-msg-pull-data.c b/gcc/testsuite/gcc.target/bpf/helper-msg-pull-data.c
index ef27493122b..98d343b0295 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-msg-pull-data.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-msg-pull-data.c
@@ -1,16 +1,17 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
int ret;
void *msg;
- uint32_t start, end;
- uint64_t flags;
-
- ret = __builtin_bpf_helper_msg_pull_data (msg, start, end, flags);
+ int len;
+
+ ret = bpf_msg_pull_data (msg, len);
}
/* { dg-final { scan-assembler "call\t63" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-msg-push-data.c b/gcc/testsuite/gcc.target/bpf/helper-msg-push-data.c
index 9e256bc5ca7..40b936162fc 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-msg-push-data.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-msg-push-data.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,7 +12,7 @@ foo ()
uint32_t start, len;
uint64_t flags;
- ret = __builtin_bpf_helper_msg_push_data (skb, start, len, flags);
+ ret = bpf_msg_push_data (skb, start, len, flags);
}
/* { dg-final { scan-assembler "call\t90" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-msg-redirect-hash.c b/gcc/testsuite/gcc.target/bpf/helper-msg-redirect-hash.c
index 2e9d4137d66..6ac680cc098 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-msg-redirect-hash.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-msg-redirect-hash.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
void *msg, *map, *key;
uint64_t flags;
- ret = __builtin_bpf_helper_msg_redirect_hash (msg, map, key,
+ ret = bpf_msg_redirect_hash (msg, map, key,
flags);
}
diff --git a/gcc/testsuite/gcc.target/bpf/helper-msg-redirect-map.c b/gcc/testsuite/gcc.target/bpf/helper-msg-redirect-map.c
index f5f8405e324..ed7652bfc90 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-msg-redirect-map.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-msg-redirect-map.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,9 +11,8 @@ foo ()
void *msg, *map;
uint64_t key;
uint64_t flags;
-
- ret = __builtin_bpf_helper_msg_redirect_map (msg, map, key,
- flags);
+
+ ret = bpf_msg_redirect_map (msg, map, key, flags);
}
/* { dg-final { scan-assembler "call\t60" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-override-return.c b/gcc/testsuite/gcc.target/bpf/helper-override-return.c
index 3bd5424353f..50366861c1d 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-override-return.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-override-return.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,8 +10,8 @@ foo ()
int ret;
void *regs;
uint64_t rc;
-
- ret = __builtin_bpf_helper_override_return (regs, rc);
+
+ ret = bpf_override_return (regs, rc);
}
/* { dg-final { scan-assembler "call\t58" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-perf-event-output.c b/gcc/testsuite/gcc.target/bpf/helper-perf-event-output.c
index afb32010bdd..24ed565097e 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-perf-event-output.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-perf-event-output.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -11,7 +12,7 @@ foo ()
void *data;
uint64_t size;
- ret = __builtin_bpf_helper_perf_event_output (ctx, map, flags, data, size);
+ ret = bpf_perf_event_output (ctx, map, flags, data, size);
}
/* { dg-final { scan-assembler "call\t25" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-perf-event-read-value.c b/gcc/testsuite/gcc.target/bpf/helper-perf-event-read-value.c
index 1d512c9ec65..6e6184f4512 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-perf-event-read-value.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-perf-event-read-value.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,8 +11,8 @@ foo ()
void *map, *buf;
uint64_t flags;
uint64_t buf_size;
-
- ret = __builtin_bpf_helper_perf_event_read_value (map, flags, buf, buf_size);
+
+ ret = bpf_perf_event_read_value (map, flags, buf, buf_size);
}
/* { dg-final { scan-assembler "call\t55" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-perf-event-read.c b/gcc/testsuite/gcc.target/bpf/helper-perf-event-read.c
index f099a09d66f..674058daa8d 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-perf-event-read.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-perf-event-read.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
void *map;
uint64_t flags;
- ret = __builtin_bpf_helper_perf_event_read (map, flags);
+ ret = bpf_perf_event_read (map, flags);
}
/* { dg-final { scan-assembler "call\t22" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-perf-prog-read-value.c b/gcc/testsuite/gcc.target/bpf/helper-perf-prog-read-value.c
index 00c4a3a78b5..341a541838d 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-perf-prog-read-value.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-perf-prog-read-value.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,8 +10,8 @@ foo ()
int ret;
void *ctx, *buf;
uint64_t buf_size;
-
- ret = __builtin_bpf_helper_perf_prog_read_value (ctx, buf, buf_size);
+
+ ret = bpf_perf_prog_read_value (ctx, buf, buf_size);
}
/* { dg-final { scan-assembler "call\t56" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-probe-read-str.c b/gcc/testsuite/gcc.target/bpf/helper-probe-read-str.c
index fd04760221d..02d1a07cb4a 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-probe-read-str.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-probe-read-str.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,8 +11,8 @@ foo ()
int size;
void *dst;
const void *unsafe_ptr;
-
- ret = __builtin_bpf_helper_probe_read_str (dst, size, unsafe_ptr);
+
+ ret = bpf_probe_read_str (dst, size, unsafe_ptr);
}
/* { dg-final { scan-assembler "call\t45" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-probe-read.c b/gcc/testsuite/gcc.target/bpf/helper-probe-read.c
index a77a907767b..64261c56f92 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-probe-read.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-probe-read.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
void *src, *dst;
uint32_t size;
- ret = __builtin_bpf_helper_probe_read (dst, size, src);
+ ret = bpf_probe_read (dst, size, src);
}
/* { dg-final { scan-assembler "call\t4" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-probe-write-user.c b/gcc/testsuite/gcc.target/bpf/helper-probe-write-user.c
index bf226206769..127ae61c8a4 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-probe-write-user.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-probe-write-user.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
void *dst, *src;
uint32_t len;
- ret = __builtin_bpf_helper_probe_write_user (dst, src, len);
+ ret = bpf_probe_write_user (dst, src, len);
}
/* { dg-final { scan-assembler "call\t36" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-rc-keydown.c b/gcc/testsuite/gcc.target/bpf/helper-rc-keydown.c
index 58e9395dbeb..dd90423b14b 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-rc-keydown.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-rc-keydown.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,9 +11,8 @@ foo ()
void *ctx;
uint32_t protocol, toggle;
uint64_t scancode;
-
- ret = __builtin_bpf_helper_rc_keydown (ctx, protocol,
- scancode, toggle);
+
+ ret = bpf_rc_keydown (ctx, protocol, scancode, toggle);
}
/* { dg-final { scan-assembler "call\t78" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-rc-pointer-rel.c b/gcc/testsuite/gcc.target/bpf/helper-rc-pointer-rel.c
index e776bc75963..ca0a5c4ac75 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-rc-pointer-rel.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-rc-pointer-rel.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
void *ctx;
int32_t rel_x, rel_y;
- ret = __builtin_bpf_helper_rc_pointer_rel (ctx, rel_x, rel_y);
+ ret = bpf_rc_pointer_rel (ctx, rel_x, rel_y);
}
/* { dg-final { scan-assembler "call\t92" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-rc-repeat.c b/gcc/testsuite/gcc.target/bpf/helper-rc-repeat.c
index 0ebc7de5bdf..79d3b5c5fdf 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-rc-repeat.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-rc-repeat.c
@@ -1,14 +1,16 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
int ret;
void *ctx;
-
- ret = __builtin_bpf_helper_rc_repeat (ctx);
+
+ ret = bpf_rc_repeat (ctx);
}
/* { dg-final { scan-assembler "call\t77" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-redirect-map.c b/gcc/testsuite/gcc.target/bpf/helper-redirect-map.c
index daeecc2a01e..50b3e814893 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-redirect-map.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-redirect-map.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,8 +11,8 @@ foo ()
void *map;
uint32_t key;
uint64_t flags;
-
- ret = __builtin_bpf_helper_redirect_map (map, key, flags);
+
+ ret = bpf_redirect_map (map, key, flags);
}
/* { dg-final { scan-assembler "call\t51" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-set-hash-invalid.c b/gcc/testsuite/gcc.target/bpf/helper-set-hash-invalid.c
index 4bc63ffa063..adbc41bce19 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-set-hash-invalid.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-set-hash-invalid.c
@@ -1,13 +1,15 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
void *skb;
- __builtin_bpf_helper_set_hash_invalid (skb);
+ bpf_set_hash_invalid (skb);
}
/* { dg-final { scan-assembler "call\t41" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-set-hash.c b/gcc/testsuite/gcc.target/bpf/helper-set-hash.c
index d01ae6eb268..cafe5399c7d 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-set-hash.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-set-hash.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,8 +10,8 @@ foo ()
uint32_t ret;
void *skb;
uint32_t hash;
-
- ret = __builtin_bpf_helper_set_hash (skb, hash);
+
+ ret = bpf_set_hash (skb, hash);
}
/* { dg-final { scan-assembler "call\t48" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-setsockopt.c b/gcc/testsuite/gcc.target/bpf/helper-setsockopt.c
index 6f3b450639e..930b8b2f2a0 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-setsockopt.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-setsockopt.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -11,9 +13,8 @@ foo ()
int optname;
void *optval;
int optlen;
-
- ret = __builtin_bpf_helper_setsockopt (bpf_socket, level, optname,
- optval, optlen);
+
+ ret = bpf_setsockopt (bpf_socket, level, optname, optval, optlen);
}
/* { dg-final { scan-assembler "call\t49" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sk-fullsock.c b/gcc/testsuite/gcc.target/bpf/helper-sk-fullsock.c
index abe813d94f6..9e66e94f57f 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sk-fullsock.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sk-fullsock.c
@@ -1,13 +1,15 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
void *ret, *sk;
- ret = __builtin_bpf_helper_sk_fullsock (sk);
+ ret = bpf_sk_fullsock (sk);
}
/* { dg-final { scan-assembler "call\t95" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sk-lookup-tcp.c b/gcc/testsuite/gcc.target/bpf/helper-sk-lookup-tcp.c
index 4408640a6b2..9d48c4cecf7 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sk-lookup-tcp.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sk-lookup-tcp.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,11 +11,11 @@ foo ()
void *ctx, *tuple;
uint32_t tuple_size;
uint64_t netns, flags;
-
- ret = __builtin_bpf_helper_sk_lookup_tcp (ctx,
- tuple,
- tuple_size,
- netns, flags);
+
+ ret = bpf_sk_lookup_tcp (ctx,
+ tuple,
+ tuple_size,
+ netns, flags);
}
/* { dg-final { scan-assembler "call\t84" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sk-lookup-upd.c b/gcc/testsuite/gcc.target/bpf/helper-sk-lookup-upd.c
index 4c50f9c6327..f41fd327c83 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sk-lookup-upd.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sk-lookup-upd.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,11 +11,11 @@ foo ()
void *ctx, *tuple;
uint32_t tuple_size;
uint64_t netns, flags;
-
- ret = __builtin_bpf_helper_sk_lookup_udp (ctx,
- tuple,
- tuple_size,
- netns, flags);
+
+ ret = bpf_sk_lookup_udp (ctx,
+ tuple,
+ tuple_size,
+ netns, flags);
}
/* { dg-final { scan-assembler "call\t85" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sk-redirect-hash.c b/gcc/testsuite/gcc.target/bpf/helper-sk-redirect-hash.c
index 7047c9f1290..f449b5b8254 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sk-redirect-hash.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sk-redirect-hash.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,8 +11,7 @@ foo ()
void *skb, *map, *key;
uint64_t flags;
- ret = __builtin_bpf_helper_sk_redirect_hash (skb, map, key,
- flags);
+ ret = bpf_sk_redirect_hash (skb, map, key, flags);
}
/* { dg-final { scan-assembler "call\t72" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sk-redirect-map.c b/gcc/testsuite/gcc.target/bpf/helper-sk-redirect-map.c
index 5afb0ac4100..42aab8a954b 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sk-redirect-map.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sk-redirect-map.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,8 +11,8 @@ foo ()
void *ctx, *map;
uint32_t key;
uint64_t flags;
-
- ret = __builtin_bpf_helper_sk_redirect_map (ctx, map, key, flags);
+
+ ret = bpf_sk_redirect_map (ctx, map, key, flags);
}
/* { dg-final { scan-assembler "call\t52" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sk-release.c b/gcc/testsuite/gcc.target/bpf/helper-sk-release.c
index f054c90652c..b01412c751b 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sk-release.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sk-release.c
@@ -1,14 +1,16 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
int ret;
void *sock;
-
- ret = __builtin_bpf_helper_sk_release (sock);
+
+ ret = bpf_sk_release (sock);
}
/* { dg-final { scan-assembler "call\t86" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sk-select-reuseport.c b/gcc/testsuite/gcc.target/bpf/helper-sk-select-reuseport.c
index 399ad2c0231..b1a28020297 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sk-select-reuseport.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sk-select-reuseport.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,9 +10,9 @@ foo ()
int ret;
void *reuse, *map, *key;
uint64_t flags;
-
- ret = __builtin_bpf_helper_sk_select_reuseport (reuse, map,
- key, flags);
+
+ ret = bpf_sk_select_reuseport (reuse, map,
+ key, flags);
}
/* { dg-final { scan-assembler "call\t82" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sk-storage-delete.c b/gcc/testsuite/gcc.target/bpf/helper-sk-storage-delete.c
index 07c5875d930..ea36a3d6a1c 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sk-storage-delete.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sk-storage-delete.c
@@ -1,14 +1,16 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
int ret;
void *map, *sk;
-
- ret = __builtin_bpf_helper_sk_storage_delete (map, sk);
+
+ ret = bpf_sk_storage_delete (map, sk);
}
/* { dg-final { scan-assembler "call\t108" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sk-storage-get.c b/gcc/testsuite/gcc.target/bpf/helper-sk-storage-get.c
index a199ef0ae64..1ea0e7b12f7 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sk-storage-get.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sk-storage-get.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,9 +10,8 @@ foo ()
void *ret;
void *map, *sk, *value;
uint64_t flags;
-
- ret = __builtin_bpf_helper_sk_storage_get (map, sk, value,
- flags);
+
+ ret = bpf_sk_storage_get (map, sk, value, flags);
}
/* { dg-final { scan-assembler "call\t107" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-adjust-room.c b/gcc/testsuite/gcc.target/bpf/helper-skb-adjust-room.c
index 88196f5e070..3bce73fa852 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-adjust-room.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-adjust-room.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,8 +12,8 @@ foo ()
int32_t len_diff;
uint32_t mode;
uint64_t flags;
-
- ret = __builtin_bpf_helper_skb_adjust_room (skb, len_diff, mode, flags);
+
+ ret = bpf_skb_adjust_room (skb, len_diff, mode, flags);
}
/* { dg-final { scan-assembler "call\t50" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-cgroup-id.c b/gcc/testsuite/gcc.target/bpf/helper-skb-cgroup-id.c
index 7c9021e1763..5085c756b9c 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-cgroup-id.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-cgroup-id.c
@@ -1,14 +1,16 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
uint64_t ret;
void *skb;
-
- ret = __builtin_bpf_helper_skb_cgroup_id (skb);
+
+ ret = bpf_skb_cgroup_id (skb);
}
/* { dg-final { scan-assembler "call\t79" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-change-head.c b/gcc/testsuite/gcc.target/bpf/helper-skb-change-head.c
index de6281539fd..281104b6152 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-change-head.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-change-head.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,8 +11,8 @@ foo ()
void *skb;
uint32_t len;
uint64_t flags;
-
- ret = __builtin_bpf_helper_skb_change_head (skb, len, flags);
+
+ ret = bpf_skb_change_head (skb, len, flags);
}
/* { dg-final { scan-assembler "call\t43" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-change-proto.c b/gcc/testsuite/gcc.target/bpf/helper-skb-change-proto.c
index 5738f3cc59b..a41d197fd52 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-change-proto.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-change-proto.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,7 +12,7 @@ foo ()
int16_t proto;
uint64_t flags;
- ret = __builtin_bpf_helper_skb_change_proto (skb, proto, flags);
+ ret = bpf_skb_change_proto (skb, proto, flags);
}
/* { dg-final { scan-assembler "call\t31" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-change-tail.c b/gcc/testsuite/gcc.target/bpf/helper-skb-change-tail.c
index 1fb6b45cd1b..2bfc5979a92 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-change-tail.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-change-tail.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,7 +12,7 @@ foo ()
uint32_t len;
uint64_t flags;
- ret = __builtin_bpf_helper_skb_change_tail (skb, len, flags);
+ ret = bpf_skb_change_tail (skb, len, flags);
}
/* { dg-final { scan-assembler "call\t38" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-change-type.c b/gcc/testsuite/gcc.target/bpf/helper-skb-change-type.c
index bcf22cebc28..46a94213fb3 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-change-type.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-change-type.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
void *skb;
uint32_t type;
- ret = __builtin_bpf_helper_skb_change_type (skb, type);
+ ret = bpf_skb_change_type (skb, type);
}
/* { dg-final { scan-assembler "call\t32" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-ecn-set-ce.c b/gcc/testsuite/gcc.target/bpf/helper-skb-ecn-set-ce.c
index f769993f120..c028ec1d6bb 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-ecn-set-ce.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-ecn-set-ce.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,7 +10,7 @@ foo ()
int ret;
void *skb;
- ret = __builtin_bpf_helper_skb_ecn_set_ce (skb);
+ ret = bpf_skb_ecn_set_ce (skb);
}
/* { dg-final { scan-assembler "call\t97" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-get-tunnel-key.c b/gcc/testsuite/gcc.target/bpf/helper-skb-get-tunnel-key.c
index 0d4db236865..aad847256ec 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-get-tunnel-key.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-get-tunnel-key.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,7 +12,7 @@ foo ()
uint32_t size;
uint64_t flags;
- ret = __builtin_bpf_helper_skb_get_tunnel_key (skb, key, size, flags);
+ ret = bpf_skb_get_tunnel_key (skb, key, size, flags);
}
/* { dg-final { scan-assembler "call\t20" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-get-tunnel-opt.c b/gcc/testsuite/gcc.target/bpf/helper-skb-get-tunnel-opt.c
index 9428657b932..0b39ad728a1 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-get-tunnel-opt.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-get-tunnel-opt.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,7 +12,7 @@ foo ()
uint8_t *opt;
uint32_t size;
- ret = __builtin_bpf_helper_skb_get_tunnel_opt (skb, opt, size);
+ ret = bpf_skb_get_tunnel_opt (skb, opt, size);
}
/* { dg-final { scan-assembler "call\t29" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-get-xfrm-state.c b/gcc/testsuite/gcc.target/bpf/helper-skb-get-xfrm-state.c
index 8217b4a17df..de83d91849e 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-get-xfrm-state.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-get-xfrm-state.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,8 +12,8 @@ foo ()
uint32_t index, size;
uint64_t flags;
- ret = __builtin_bpf_helper_skb_get_xfrm_state (skb, index,
- xfrm_state, size, flags);
+ ret = bpf_skb_get_xfrm_state (skb, index,
+ xfrm_state, size, flags);
}
/* { dg-final { scan-assembler "call\t66" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-load-bytes-relative.c b/gcc/testsuite/gcc.target/bpf/helper-skb-load-bytes-relative.c
index bcaa43be9de..cd8c2c2437e 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-load-bytes-relative.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-load-bytes-relative.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,9 +11,9 @@ foo ()
void *skb, *to;
uint32_t offset, len, start_header;
- ret = __builtin_bpf_helper_skb_load_bytes_relative (skb, offset,
- to, len,
- start_header);
+ ret = bpf_skb_load_bytes_relative (skb, offset,
+ to, len,
+ start_header);
}
/* { dg-final { scan-assembler "call\t68" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-load-bytes.c b/gcc/testsuite/gcc.target/bpf/helper-skb-load-bytes.c
index 9da545400c7..1e4612a5c98 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-load-bytes.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-load-bytes.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
void *skb, *to;
uint32_t offset, len;
- ret = __builtin_bpf_helper_skb_load_bytes (skb, offset, to, len);
+ ret = bpf_skb_load_bytes (skb, offset, to, len);
}
/* { dg-final { scan-assembler "call\t26" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-pull-data.c b/gcc/testsuite/gcc.target/bpf/helper-skb-pull-data.c
index 9bb8b8d6e78..579d8562e3d 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-pull-data.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-pull-data.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
void *skb;
uint32_t len;
- ret = __builtin_bpf_helper_skb_pull_data (skb, len);
+ ret = bpf_skb_pull_data (skb, len);
}
/* { dg-final { scan-assembler "call\t39" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-set-tunnel-key.c b/gcc/testsuite/gcc.target/bpf/helper-skb-set-tunnel-key.c
index 21b835f5cef..85754fdb88a 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-set-tunnel-key.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-set-tunnel-key.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,7 +12,7 @@ foo ()
uint32_t size;
uint64_t flags;
- ret = __builtin_bpf_helper_skb_set_tunnel_key (skb, key, size, flags);
+ ret = bpf_skb_set_tunnel_key (skb, key, size, flags);
}
/* { dg-final { scan-assembler "call\t21" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-set-tunnel-opt.c b/gcc/testsuite/gcc.target/bpf/helper-skb-set-tunnel-opt.c
index 5a0528ec0a3..591eb48d6ad 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-set-tunnel-opt.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-set-tunnel-opt.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,7 +12,7 @@ foo ()
uint8_t *opt;
uint32_t size;
- ret = __builtin_bpf_helper_skb_set_tunnel_opt (skb, opt, size);
+ ret = bpf_skb_set_tunnel_opt (skb, opt, size);
}
/* { dg-final { scan-assembler "call\t30" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-store-bytes.c b/gcc/testsuite/gcc.target/bpf/helper-skb-store-bytes.c
index a41967cb904..17f8e02e55c 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-store-bytes.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-store-bytes.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -12,7 +14,7 @@ foo ()
uint32_t len;
uint64_t flags;
- ret = __builtin_bpf_helper_skb_store_bytes (skb, offset, from, len, flags);
+ ret = bpf_skb_store_bytes (skb, offset, from, len, flags);
}
/* { dg-final { scan-assembler "call\t9" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-under-cgroup.c b/gcc/testsuite/gcc.target/bpf/helper-skb-under-cgroup.c
index 0ccee8bed5c..72adfcd9f3f 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-under-cgroup.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-under-cgroup.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
void *skb, *map;
uint32_t index;
- ret = __builtin_bpf_helper_skb_under_cgroup (skb, map, index);
+ ret = bpf_skb_under_cgroup (skb, map, index);
}
/* { dg-final { scan-assembler "call\t33" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-vlan-pop.c b/gcc/testsuite/gcc.target/bpf/helper-skb-vlan-pop.c
index e99a0ac7802..4d5b347d6da 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-vlan-pop.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-vlan-pop.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,7 +10,7 @@ foo ()
int ret;
void *skb;
- ret = __builtin_bpf_helper_skb_vlan_pop (skb);
+ ret = bpf_skb_vlan_pop (skb);
}
/* { dg-final { scan-assembler "call\t19" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skb-vlan-push.c b/gcc/testsuite/gcc.target/bpf/helper-skb-vlan-push.c
index dbe52aee1b8..1a43bd42e07 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skb-vlan-push.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skb-vlan-push.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,7 +12,7 @@ foo ()
int16_t vlan_proto;
uint16_t vlan_tci;
- ret = __builtin_bpf_helper_skb_vlan_push (skb, vlan_proto, vlan_tci);
+ ret = bpf_skb_vlan_push (skb, vlan_proto, vlan_tci);
}
/* { dg-final { scan-assembler "call\t18" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-skc-lookup-tcp.c b/gcc/testsuite/gcc.target/bpf/helper-skc-lookup-tcp.c
index bbc4b99a808..8ed2d46c813 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-skc-lookup-tcp.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-skc-lookup-tcp.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,8 +12,8 @@ foo ()
uint32_t tuple_size;
uint64_t netns, flags;
- ret = __builtin_bpf_helper_skc_lookup_tcp (ctx, tuple,
- tuple_size, netns, flags);
+ ret = bpf_skc_lookup_tcp (ctx, tuple,
+ tuple_size, netns, flags);
}
/* { dg-final { scan-assembler "call\t99" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sock-hash-update.c b/gcc/testsuite/gcc.target/bpf/helper-sock-hash-update.c
index bbb77ef9ad5..81ff4dd7e8b 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sock-hash-update.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sock-hash-update.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +11,7 @@ foo ()
void *skops, *map, *key;
uint64_t flags;
- ret = __builtin_bpf_helper_sock_hash_update (skops, map, key,
+ ret = bpf_sock_hash_update (skops, map, key,
flags);
}
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sock-map-update.c b/gcc/testsuite/gcc.target/bpf/helper-sock-map-update.c
index 301e59e975b..b263583be45 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sock-map-update.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sock-map-update.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,9 +10,8 @@ foo ()
int ret;
void *skops, *map, *key;
uint64_t flags;
-
- ret = __builtin_bpf_helper_sock_map_update (skops, map, key,
- flags);
+
+ ret = bpf_sock_map_update (skops, map, key, flags);
}
/* { dg-final { scan-assembler "call\t53" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sock-ops-cb-flags-set.c b/gcc/testsuite/gcc.target/bpf/helper-sock-ops-cb-flags-set.c
index 2056312bcf3..7a98fa9b92e 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sock-ops-cb-flags-set.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sock-ops-cb-flags-set.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,9 +10,8 @@ foo ()
int ret;
void *bpf_sock;
int argval;
-
- ret = __builtin_bpf_helper_sock_ops_cb_flags_set (bpf_sock,
- argval);
+
+ ret = bpf_sock_ops_cb_flags_set (bpf_sock, argval);
}
/* { dg-final { scan-assembler "call\t59" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-spin-lock.c b/gcc/testsuite/gcc.target/bpf/helper-spin-lock.c
index 4178914ae13..8358e88fd9e 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-spin-lock.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-spin-lock.c
@@ -1,13 +1,15 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
void *lock;
- __builtin_bpf_helper_spin_lock (lock);
+ bpf_spin_lock (lock);
}
/* { dg-final { scan-assembler "call\t93" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-spin-unlock.c b/gcc/testsuite/gcc.target/bpf/helper-spin-unlock.c
index c2416b66994..400695f7aae 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-spin-unlock.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-spin-unlock.c
@@ -1,13 +1,15 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
void *lock;
- __builtin_bpf_helper_spin_unlock (lock);
+ bpf_spin_unlock (lock);
}
/* { dg-final { scan-assembler "call\t94" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-strtol.c b/gcc/testsuite/gcc.target/bpf/helper-strtol.c
index e15b6d6b968..d98a0a7c565 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-strtol.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-strtol.c
@@ -1,7 +1,9 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
#include <stddef.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -11,8 +13,8 @@ foo ()
long res;
uint64_t flags;
size_t buf_len;
-
- ret = __builtin_bpf_helper_strtol (buf, buf_len, flags, &res);
+
+ ret = bpf_strtol (buf, buf_len, flags, &res);
}
/* { dg-final { scan-assembler "call\t105" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-strtoul.c b/gcc/testsuite/gcc.target/bpf/helper-strtoul.c
index bc0d77656d2..f68abf2f7d7 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-strtoul.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-strtoul.c
@@ -1,7 +1,9 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
#include <stddef.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -11,8 +13,8 @@ foo ()
unsigned long res;
uint64_t flags;
size_t buf_len;
-
- ret = __builtin_bpf_helper_strtoul (buf, buf_len, flags, &res);
+
+ ret = bpf_strtoul (buf, buf_len, flags, &res);
}
/* { dg-final { scan-assembler "call\t106" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sysctl-get-current-value.c b/gcc/testsuite/gcc.target/bpf/helper-sysctl-get-current-value.c
index 803584171dd..a1f6529f356 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sysctl-get-current-value.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sysctl-get-current-value.c
@@ -1,7 +1,9 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
#include <stddef.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,9 +11,8 @@ foo ()
int ret;
void *ctx, *buf;
size_t buf_len;
-
- ret = __builtin_bpf_helper_sysctl_get_current_value (ctx, buf,
- buf_len);
+
+ ret = bpf_sysctl_get_current_value (ctx, buf, buf_len);
}
/* { dg-final { scan-assembler "call\t102" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sysctl-get-name.c b/gcc/testsuite/gcc.target/bpf/helper-sysctl-get-name.c
index a748b4bf911..ca9c42ba6a8 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sysctl-get-name.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sysctl-get-name.c
@@ -1,7 +1,9 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
#include <stddef.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -10,9 +12,8 @@ foo ()
void *ctx, *buf;
size_t buf_len;
uint64_t flags;
-
- ret = __builtin_bpf_helper_sysctl_get_name (ctx, buf,
- buf_len, flags);
+
+ ret = bpf_sysctl_get_name (ctx, buf, buf_len, flags);
}
/* { dg-final { scan-assembler "call\t101" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sysctl-get-new-value.c b/gcc/testsuite/gcc.target/bpf/helper-sysctl-get-new-value.c
index 2c4835100c9..d22b214d67b 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sysctl-get-new-value.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sysctl-get-new-value.c
@@ -1,7 +1,9 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
#include <stddef.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,9 +11,8 @@ foo ()
int ret;
void *ctx, *buf;
size_t buf_len;
-
- ret = __builtin_bpf_helper_sysctl_get_new_value (ctx, buf,
- buf_len);
+
+ ret = bpf_sysctl_get_new_value (ctx, buf, buf_len);
}
/* { dg-final { scan-assembler "call\t103" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-sysctl-set-new-value.c b/gcc/testsuite/gcc.target/bpf/helper-sysctl-set-new-value.c
index fc3780da7e2..78004c252a9 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-sysctl-set-new-value.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-sysctl-set-new-value.c
@@ -1,7 +1,9 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
#include <stddef.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,9 +11,8 @@ foo ()
int ret;
void *ctx, *buf;
size_t buf_len;
-
- ret = __builtin_bpf_helper_sysctl_set_new_value (ctx, buf,
- buf_len);
+
+ ret = bpf_sysctl_set_new_value (ctx, buf, buf_len);
}
/* { dg-final { scan-assembler "call\t104" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-tail-call.c b/gcc/testsuite/gcc.target/bpf/helper-tail-call.c
index 618064f4aea..0f35b00a786 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-tail-call.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-tail-call.c
@@ -1,14 +1,17 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
+ int ret;
void *ctx, *prog_array_map;
uint32_t index;
- __builtin_bpf_helper_tail_call (ctx, prog_array_map, index);
+ ret = bpf_tail_call (ctx, prog_array_map, index);
}
/* { dg-final { scan-assembler "call\t12" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-tcp-check-syncookie.c b/gcc/testsuite/gcc.target/bpf/helper-tcp-check-syncookie.c
index 95846c6f2d7..06210bb2959 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-tcp-check-syncookie.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-tcp-check-syncookie.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,10 +10,10 @@ foo ()
int ret;
void *sk, *iph, *th;
uint32_t iph_len, th_len;
-
- ret = __builtin_bpf_helper_tcp_check_syncookie (sk, iph,
- iph_len,
- th, th_len);
+
+ ret = bpf_tcp_check_syncookie (sk, iph,
+ iph_len,
+ th, th_len);
}
/* { dg-final { scan-assembler "call\t100" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-tcp-sock.c b/gcc/testsuite/gcc.target/bpf/helper-tcp-sock.c
index ab8f2de05d8..cd6d995f5bf 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-tcp-sock.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-tcp-sock.c
@@ -1,13 +1,15 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
{
void *ret, *sk;
- ret = __builtin_bpf_helper_tcp_sock (sk);
+ ret = bpf_tcp_sock (sk);
}
/* { dg-final { scan-assembler "call\t96" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-trace-printk.c b/gcc/testsuite/gcc.target/bpf/helper-trace-printk.c
index fcf9d5c9e50..135ae295d84 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-trace-printk.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-trace-printk.c
@@ -1,4 +1,7 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+#include <bpf-helpers.h>
char *map () { return 0; }
@@ -7,7 +10,7 @@ foo ()
{
int ret;
- ret = __builtin_bpf_helper_trace_printk ("foo %d %d", sizeof ("foo %d %d"), 10, 20);
+ ret = bpf_trace_printk ("foo %d %d", sizeof ("foo %d %d"), 10, 20);
}
/* { dg-final { scan-assembler "call\t6" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-xdp-adjust-head.c b/gcc/testsuite/gcc.target/bpf/helper-xdp-adjust-head.c
index 3dce5434535..ac6fef43587 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-xdp-adjust-head.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-xdp-adjust-head.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,8 +10,8 @@ foo ()
int ret;
void *xdp_md;
int delta;
-
- ret = __builtin_bpf_helper_xdp_adjust_head (xdp_md, delta);
+
+ ret = bpf_xdp_adjust_head (xdp_md, delta);
}
/* { dg-final { scan-assembler "call\t44" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-xdp-adjust-meta.c b/gcc/testsuite/gcc.target/bpf/helper-xdp-adjust-meta.c
index 38a13748737..13793508116 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-xdp-adjust-meta.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-xdp-adjust-meta.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,8 +10,8 @@ foo ()
int ret;
void *xdp_md;
int delta;
-
- ret = __builtin_bpf_helper_xdp_adjust_meta (xdp_md, delta);
+
+ ret = bpf_xdp_adjust_meta (xdp_md, delta);
}
/* { dg-final { scan-assembler "call\t54" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/helper-xdp-adjust-tail.c b/gcc/testsuite/gcc.target/bpf/helper-xdp-adjust-tail.c
index 319b65a233d..db55168144b 100644
--- a/gcc/testsuite/gcc.target/bpf/helper-xdp-adjust-tail.c
+++ b/gcc/testsuite/gcc.target/bpf/helper-xdp-adjust-tail.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -9,7 +10,7 @@ foo ()
void *xdp_md;
int delta;
- ret = __builtin_bpf_helper_xdp_adjust_tail (xdp_md, delta);
+ ret = bpf_xdp_adjust_tail (xdp_md, delta);
}
/* { dg-final { scan-assembler "call\t65" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/skb-ancestor-cgroup-id.c b/gcc/testsuite/gcc.target/bpf/skb-ancestor-cgroup-id.c
index ce193ec14bf..13ccf36b4d6 100644
--- a/gcc/testsuite/gcc.target/bpf/skb-ancestor-cgroup-id.c
+++ b/gcc/testsuite/gcc.target/bpf/skb-ancestor-cgroup-id.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
#include <stdint.h>
+#include <bpf-helpers.h>
void
foo ()
@@ -8,9 +10,8 @@ foo ()
int ret;
void *skb;
int ancestor_level;
-
- ret = __builtin_bpf_helper_skb_ancestor_cgroup_id (skb,
- ancestor_level);
+
+ ret = bpf_skb_ancestor_cgroup_id (skb, ancestor_level);
}
/* { dg-final { scan-assembler "call\t83" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/xbpf-callee-saved-regs-1.c b/gcc/testsuite/gcc.target/bpf/xbpf-callee-saved-regs-1.c
new file mode 100644
index 00000000000..6d6fe6e8e1b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/bpf/xbpf-callee-saved-regs-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-mxbpf" } */
+
+/* GCC should save and restore callee-saved registers when generating
+ code for xBPF. */
+
+int
+foo ()
+{
+ register int f asm ("r6");
+
+ f = 20;
+ return f + 1;
+}
+
+/* { dg-final { scan-assembler "stxdw\t\\\[%fp\\+-8\\\],%r6" } } */
+/* { dg-final { scan-assembler "ldxdw\t%r6,\\\[%fp\\+-8\\\]" } } */
diff --git a/gcc/testsuite/gcc.target/bpf/xbpf-callee-saved-regs-2.c b/gcc/testsuite/gcc.target/bpf/xbpf-callee-saved-regs-2.c
new file mode 100644
index 00000000000..dec71cfe65d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/bpf/xbpf-callee-saved-regs-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-mno-xbpf" } */
+
+/* GCC should not save and restore callee-saved registers unless
+ generating code for xBPF. */
+
+int
+foo ()
+{
+ register int f asm ("r6");
+
+ f = 20;
+ return f + 1;
+}
+
+/* { dg-final { scan-assembler-not "stxdw\t\\\[%fp\\+-8\\\],%r6" } } */
+/* { dg-final { scan-assembler-not "ldxdw\t%r6,\\\[%fp\\+-8\\\]" } } */
diff --git a/gcc/testsuite/gcc.target/cris/asm-other.S b/gcc/testsuite/gcc.target/cris/asm-other.S
index 4fe7ebfc41c..6f34f11fdcf 100644
--- a/gcc/testsuite/gcc.target/cris/asm-other.S
+++ b/gcc/testsuite/gcc.target/cris/asm-other.S
@@ -1,13 +1,10 @@
/* { dg-do assemble } */
-/* { dg-options "-DOTHER_ISA=0 -march=v0" { target crisv32-*-* } } */
-/* { dg-options "-DOTHER_ISA=32 -march=v32" { target cris-*-* } } */
+/* The base test-case is sort-of-disabled or rather made
+ always-pass, but remains included by other tests. */
-/* Make sure we can assemble for the "other" variant, with the twist
- that the gcc option -march=v0 isn't valid for the assembler. */
+/* Make sure we can *assemble* for another variant. */
.text
-#if OTHER_ISA == 32
- addoq 42,$r1,$acr
-#else
+#ifdef OTHER_ISA
0:
move.d [$r2=$r0+42],$r1
bwf 0b
diff --git a/gcc/testsuite/gcc.target/cris/asmreg-1.c b/gcc/testsuite/gcc.target/cris/asmreg-1.c
index f430fafbeea..d77d1514667 100644
--- a/gcc/testsuite/gcc.target/cris/asmreg-1.c
+++ b/gcc/testsuite/gcc.target/cris/asmreg-1.c
@@ -3,7 +3,7 @@
/* { dg-final { scan-assembler "\\\.ifnc \\\$r9-\\\$r10-\\\$r11-\\\$r12" } } */
/* Sanity check for asm register operands in syscall failed for
- cris-axis-linux-gnu due to regmove bug.
+ cris-axis-linux-gnu due to a regmove bug.
Hans-Peter Nilsson <hp@axis.com>. */
extern void lseek64 (int, long long, int);
diff --git a/gcc/testsuite/gcc.target/cris/cris.exp b/gcc/testsuite/gcc.target/cris/cris.exp
index 52164514d3d..59105571743 100644
--- a/gcc/testsuite/gcc.target/cris/cris.exp
+++ b/gcc/testsuite/gcc.target/cris/cris.exp
@@ -18,7 +18,7 @@
# looping over tests.
# Exit immediately if this isn't a CRIS target.
-if { ![istarget cris-*-*] && ![istarget crisv32-*-*] } then {
+if { ![istarget cris-*-*] } then {
return
}
diff --git a/gcc/testsuite/gcc.target/cris/inasm-other.c b/gcc/testsuite/gcc.target/cris/inasm-other.c
index c1c043f56d3..deeb09d8df6 100644
--- a/gcc/testsuite/gcc.target/cris/inasm-other.c
+++ b/gcc/testsuite/gcc.target/cris/inasm-other.c
@@ -1,6 +1,6 @@
/* { dg-do assemble } */
-/* { dg-options "-DOTHER_ISA=0 -march=v0" { target crisv32-*-* } } */
-/* { dg-options "-DOTHER_ISA=32 -march=v32" { target cris-*-* } } */
+/* The base test-case is sort-of-disabled or rather made
+ always-pass, but remains included by other tests. */
/* Make sure we can (generate code and) assemble for the "other"
variant, with the twist that the gcc option -march=v0 isn't
@@ -13,9 +13,7 @@
void f(void)
{
-#if OTHER_ISA == 32
- asm volatile ("addoq 42,$r11,$acr");
-#else
+#ifdef OTHER_ISA
asm volatile ("0: move.d [$r12=$sp+42],$r10\n\t"
"bwf 0b\n\t"
"nop");
diff --git a/gcc/testsuite/gcc.target/cris/peep2-movulsr.c b/gcc/testsuite/gcc.target/cris/peep2-movulsr.c
new file mode 100644
index 00000000000..a19afce3982
--- /dev/null
+++ b/gcc/testsuite/gcc.target/cris/peep2-movulsr.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-final { scan-assembler "movu.w " } } */
+/* { dg-final { scan-assembler "movu.b " } } */
+/* { dg-final { scan-assembler-not "and.. " } } */
+/* { dg-options "-O2" } */
+
+/* Test the "movulsrb", "movulsrw" peephole2:s trivially. */
+
+unsigned int
+movulsrb (unsigned int x)
+{
+ return (x & 255) >> 1;
+}
+
+unsigned int
+movulsrw (unsigned int x)
+{
+ return (x & 65535) >> 4;
+}
diff --git a/gcc/testsuite/gcc.target/cris/pr93372-36.c b/gcc/testsuite/gcc.target/cris/pr93372-36.c
new file mode 100644
index 00000000000..84fbdb7091d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/cris/pr93372-36.c
@@ -0,0 +1,37 @@
+/* Check that we produce sign- and zero-extended additions and
+ subtractions, and that no (eliminable) test- or compare-instructions
+ are used. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not {\tcmp|\ttest|\tsub\.|\tadd\.|\tmovs} } } */
+/* { dg-final { scan-assembler "\tadds" } } */
+/* { dg-final { scan-assembler "\tsubs" } } */
+
+#ifndef t
+#define t signed char
+#define s _sc
+#endif
+
+#ifndef t2
+#define t2 int
+#endif
+
+#ifndef f
+#define f0(a, s) a ## s
+#define f(a, s) f0(a, s)
+#endif
+
+extern void g(int);
+
+t2 f(a, s) (t2 a, t *b, int *c)
+{
+ t2 d = a + *b;
+ *c = d == 0;
+ return d;
+}
+t2 f(b, s) (t2 a, t *b, int *c)
+{
+ t2 d = a - *b;
+ *c = d == 0;
+ return d;
+}
diff --git a/gcc/testsuite/gcc.target/cris/pr93372-37.c b/gcc/testsuite/gcc.target/cris/pr93372-37.c
new file mode 100644
index 00000000000..0c43d77fc72
--- /dev/null
+++ b/gcc/testsuite/gcc.target/cris/pr93372-37.c
@@ -0,0 +1,26 @@
+/* Check that we produce sign- and zero-extended additions and
+ subtractions, and that no (eliminable) test- or compare-instructions
+ are used. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not {\tcmp|\ttest|\tsub\.|\tadd\.|\tmovu|\tmovs} } } */
+/* { dg-final { scan-assembler-times "\tadds" 1 } } */
+/* { dg-final { scan-assembler-times "\tsubs" 1 } } */
+/* { dg-final { scan-assembler-times "\taddu" 2 } } */
+/* { dg-final { scan-assembler-times "\tsubu" 2 } } */
+
+#define t unsigned char
+#define s _uc
+#include "pr93372-36.c"
+
+#undef t
+#undef s
+#define t signed short int
+#define s _ss
+#include "pr93372-36.c"
+
+#undef t
+#undef s
+#define t unsigned short int
+#define s _us
+#include "pr93372-36.c"
diff --git a/gcc/testsuite/gcc.target/cris/pr93372-38.c b/gcc/testsuite/gcc.target/cris/pr93372-38.c
new file mode 100644
index 00000000000..c7cba3b4f15
--- /dev/null
+++ b/gcc/testsuite/gcc.target/cris/pr93372-38.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not {\tcmp|\tsub\.|\tadd\.|\tmovu|\tmovs} } } */
+/* { dg-final { scan-assembler-times "\ttest\.w" 4 } } */
+/* { dg-final { scan-assembler-times "\tadds" 1 } } */
+/* { dg-final { scan-assembler-times "\tsubs" 1 } } */
+/* { dg-final { scan-assembler-times "\taddu" 1 } } */
+/* { dg-final { scan-assembler-times "\tsubu" 1 } } */
+
+/* Check that we produce sign- and zero-extended additions and
+ subtractions, also for 8-bit to 16-bit results. Note that we can't
+ eliminate compare insns, as the condition codes reflect the 32-bit
+ result.
+ This test-case is brittle, as with the presence of compare
+ instructions, there are several optimal instruction sequence, some of
+ which match the non-matcher patterns and do not contain the matching
+ patterns. */
+
+#define t unsigned char
+#define t2 unsigned short
+#define s _us
+#include "pr93372-36.c"
+
+#undef t
+#undef s
+#undef t2
+#define t signed char
+#define t2 signed short
+#define s _ss
+#include "pr93372-36.c"
diff --git a/gcc/testsuite/gcc.target/cris/pr93372-39.c b/gcc/testsuite/gcc.target/cris/pr93372-39.c
new file mode 100644
index 00000000000..6cc387fd794
--- /dev/null
+++ b/gcc/testsuite/gcc.target/cris/pr93372-39.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not {\tcmp|\ttest|\tmovu|\tmovs} } } */
+/* { dg-final { scan-assembler-times "\tbound.b" 1 } } */
+/* { dg-final { scan-assembler-times "\tbound.w" 1 } } */
+
+unsigned int ub (unsigned int a, unsigned char *b, int *c)
+{
+ unsigned int d = a < *b ? a : *b;
+ *c = d == 0;
+ return d;
+}
+
+unsigned int us (unsigned int a, unsigned short *b, int *c)
+{
+ unsigned int d = a < *b ? a : *b;
+ *c = d == 0;
+ return d;
+}
diff --git a/gcc/testsuite/gcc.target/cris/pr93372-44.c b/gcc/testsuite/gcc.target/cris/pr93372-44.c
new file mode 100644
index 00000000000..5bd35d12087
--- /dev/null
+++ b/gcc/testsuite/gcc.target/cris/pr93372-44.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not {\tcmp|\ttest} } } */
+
+extern void foo(void);
+unsigned int x (unsigned int a, unsigned int b, unsigned int *c)
+{
+ unsigned int y = a & 15;
+ unsigned int z = y + b;
+ if (y == 0)
+ *c = z;
+ return z;
+}
diff --git a/gcc/testsuite/gcc.target/cris/pr93372-45.c b/gcc/testsuite/gcc.target/cris/pr93372-45.c
new file mode 100644
index 00000000000..4fb7a9ac6fc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/cris/pr93372-45.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not {\tcmp|\ttest} } } */
+
+extern void foo(void);
+unsigned int x (unsigned int b, unsigned int a, unsigned int *c)
+{
+ unsigned int y = a & 15;
+ unsigned int z = y + b;
+ if (y == 0)
+ *c = z;
+ return z;
+}
diff --git a/gcc/testsuite/gcc.target/cris/pr93372-46.c b/gcc/testsuite/gcc.target/cris/pr93372-46.c
new file mode 100644
index 00000000000..5d7c0301318
--- /dev/null
+++ b/gcc/testsuite/gcc.target/cris/pr93372-46.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=v10" } */
+/* { dg-final { scan-assembler-not {\tnop} } } */
+/* { dg-final { scan-assembler-times {\tcmp|\ttest|\tmove.d \$r10,\$r} 1 } } */
+
+/* We either have a move from "a" to some other register or a compare. */
+
+extern void foo(void);
+unsigned int x (unsigned int a, unsigned int b, unsigned int *c, unsigned int *d)
+{
+ unsigned int z = __builtin_clz(b);
+ if (a != 0)
+ *c = a;
+ *d = a;
+ return z;
+}
diff --git a/gcc/testsuite/gcc.target/cris/sync-1-v10.c b/gcc/testsuite/gcc.target/cris/sync-1-v10.c
index 861fc8c538d..fd88f2125e8 100644
--- a/gcc/testsuite/gcc.target/cris/sync-1-v10.c
+++ b/gcc/testsuite/gcc.target/cris/sync-1-v10.c
@@ -1,5 +1,4 @@
/* Check that we can assemble both base atomic variants. */
/* { dg-do assemble } */
/* { dg-options "-O2 -march=v10" { target { ! march_option } } } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
#include "sync-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/sync-1-v32.c b/gcc/testsuite/gcc.target/cris/sync-1-v32.c
deleted file mode 100644
index 3c1d076ab78..00000000000
--- a/gcc/testsuite/gcc.target/cris/sync-1-v32.c
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Check that we can assemble both base atomic variants. */
-/* { dg-do assemble } */
-/* { dg-options "-O2 -march=v32" } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
-#include "sync-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/sync-2i.c b/gcc/testsuite/gcc.target/cris/sync-2i.c
index d491d3c0869..e43aa5356f5 100644
--- a/gcc/testsuite/gcc.target/cris/sync-2i.c
+++ b/gcc/testsuite/gcc.target/cris/sync-2i.c
@@ -2,7 +2,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -Dop -Dtype=int" } */
/* { dg-additional-options "-mtrap-using-break8 -mtrap-unaligned-atomic" { target cris-*-elf } } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
/* { dg-final { scan-assembler "\tbreak 8" } } */
/* { dg-final { scan-assembler "\tbtstq \\(2-1\\)," } } */
/* { dg-final { scan-assembler-not "\tand" } } */
diff --git a/gcc/testsuite/gcc.target/cris/sync-2s.c b/gcc/testsuite/gcc.target/cris/sync-2s.c
index 06ff98a2769..9be7dc6bcb5 100644
--- a/gcc/testsuite/gcc.target/cris/sync-2s.c
+++ b/gcc/testsuite/gcc.target/cris/sync-2s.c
@@ -2,7 +2,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -Dop -Dtype=short" } */
/* { dg-additional-options "-mtrap-using-break8 -mtrap-unaligned-atomic" { target cris-*-elf } } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
/* { dg-final { scan-assembler "\tbreak 8" } } */
/* { dg-final { scan-assembler "\tbtstq \\(1-1\\)," } } */
/* { dg-final { scan-assembler-not "\tand" } } */
diff --git a/gcc/testsuite/gcc.target/cris/sync-3i.c b/gcc/testsuite/gcc.target/cris/sync-3i.c
index 9e67d61cb35..114e0a846e8 100644
--- a/gcc/testsuite/gcc.target/cris/sync-3i.c
+++ b/gcc/testsuite/gcc.target/cris/sync-3i.c
@@ -4,7 +4,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -Dxchg -Dtype=int" } */
/* { dg-additional-options "-mtrap-using-break8 -mtrap-unaligned-atomic" { target cris-*-elf } } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
/* { dg-final { scan-assembler "\tbreak 8" } } */
/* { dg-final { scan-assembler "\tbtstq \\(2-1\\)," { xfail *-*-* } } } */
/* { dg-final { scan-assembler-not "\tand" { xfail *-*-* } } } */
diff --git a/gcc/testsuite/gcc.target/cris/sync-3s.c b/gcc/testsuite/gcc.target/cris/sync-3s.c
index 8e87a3b6221..facbb39ed94 100644
--- a/gcc/testsuite/gcc.target/cris/sync-3s.c
+++ b/gcc/testsuite/gcc.target/cris/sync-3s.c
@@ -4,7 +4,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -Dxchg -Dtype=short" } */
/* { dg-additional-options "-mtrap-using-break8 -mtrap-unaligned-atomic" { target cris-*-elf } } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
/* { dg-final { scan-assembler "\tbreak 8" } } */
/* { dg-final { scan-assembler "\tbtstq \\(1-1\\)," { xfail *-*-* } } } */
/* { dg-final { scan-assembler-not "\tand" { xfail *-*-* } } } */
diff --git a/gcc/testsuite/gcc.target/cris/sync-4i.c b/gcc/testsuite/gcc.target/cris/sync-4i.c
index 78a7012ccdb..9756c696386 100644
--- a/gcc/testsuite/gcc.target/cris/sync-4i.c
+++ b/gcc/testsuite/gcc.target/cris/sync-4i.c
@@ -1,7 +1,6 @@
/* Check that we don't get alignment-checking code, int. */
/* { dg-do compile } */
/* { dg-options "-O2 -Dtype=int -mno-trap-unaligned-atomic" } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
/* { dg-final { scan-assembler-not "\tbreak\[ \t\]" } } */
/* { dg-final { scan-assembler-not "\tbtstq\[ \t\]\[^5\]" } } */
/* { dg-final { scan-assembler-not "\tand" } } */
diff --git a/gcc/testsuite/gcc.target/cris/sync-4s.c b/gcc/testsuite/gcc.target/cris/sync-4s.c
index 6691a48283f..2d644303a79 100644
--- a/gcc/testsuite/gcc.target/cris/sync-4s.c
+++ b/gcc/testsuite/gcc.target/cris/sync-4s.c
@@ -1,7 +1,6 @@
/* Check that we don't get alignment-checking code, short. */
/* { dg-do compile } */
/* { dg-options "-O2 -Dtype=short -mno-trap-unaligned-atomic" } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
/* { dg-final { scan-assembler-not "\tbreak\[ \t\]" } } */
/* { dg-final { scan-assembler-not "\tbtstq\[ \t\]\[^5\]" } } */
/* { dg-final { scan-assembler-not "\tand" } } */
diff --git a/gcc/testsuite/gcc.target/cris/torture/cris-torture.exp b/gcc/testsuite/gcc.target/cris/torture/cris-torture.exp
index d9fb8530042..c03e657e250 100644
--- a/gcc/testsuite/gcc.target/cris/torture/cris-torture.exp
+++ b/gcc/testsuite/gcc.target/cris/torture/cris-torture.exp
@@ -18,7 +18,7 @@
# optimization options.
# Exit immediately if this isn't a CRIS target.
-if { ![istarget cris-*-*] && ![istarget crisv32-*-*] } then {
+if { ![istarget cris-*-*] } then {
return
}
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1.c
deleted file mode 100644
index dd8704cc92d..00000000000
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run { target *-*-linux* } } */
-/* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dop -Dtype=int -mno-unaligned-atomic-may-use-library" } */
-#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1a.c
index 8055fd380e9..4cd233316e2 100644
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1a.c
+++ b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1a.c
@@ -2,5 +2,4 @@
/* { dg-additional-sources "../sync-1.c" } */
/* { dg-options "-Dop -Dtype=int -DTRAP_USING_ABORT -mno-trap-using-break8" } */
/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1ml.c
deleted file mode 100644
index c8cef184149..00000000000
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1ml.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run { target *-*-linux* } } */
-/* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dop -Dtype=int -Dmis_ok" } */
-#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2.c
deleted file mode 100644
index 3c162e96a4d..00000000000
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run { target *-*-linux* } } */
-/* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dop -Dtype=int -Dmisalignment=2 -mno-unaligned-atomic-may-use-library" } */
-#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2a.c
index 61e1c2047b4..3596e9ea5b1 100644
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2a.c
+++ b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2a.c
@@ -2,5 +2,4 @@
/* { dg-additional-sources "../sync-1.c" } */
/* { dg-options "-Dop -Dtype=int -Dmisalignment=2 -DTRAP_USING_ABORT -mno-trap-using-break8" } */
/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2ml.c
deleted file mode 100644
index 0d78e90019d..00000000000
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2ml.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run { target *-*-linux* } } */
-/* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dop -Dtype=int -Dmisalignment=2 -Dmis_ok" } */
-#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3.c
deleted file mode 100644
index 626a3d5cba4..00000000000
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run { target *-*-linux* } } */
-/* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dop -Dtype=int -Dmisalignment=3 -mno-unaligned-atomic-may-use-library" } */
-#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3a.c
index 339e74cd86c..46a04f42c0e 100644
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3a.c
+++ b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3a.c
@@ -2,5 +2,4 @@
/* { dg-additional-sources "../sync-1.c" } */
/* { dg-options "-Dop -Dtype=int -Dmisalignment=3 -DTRAP_USING_ABORT -mno-trap-using-break8" } */
/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3ml.c
deleted file mode 100644
index 17c6d34d11a..00000000000
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3ml.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run { target *-*-linux* } } */
-/* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dop -Dtype=int -Dmisalignment=3 -Dmis_ok" } */
-#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1.c
index f2835aa06c1..9a50732ef32 100644
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1.c
+++ b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target { ! *-*-* } } } */
/* { dg-additional-sources "../sync-1.c" } */
/* { dg-options "-Dop -Dtype=short -mno-unaligned-atomic-may-use-library" } */
@@ -47,12 +47,8 @@ type ret = 42;
void my_abort (void) __asm__ (SYMSTR (abort)) __attribute__ ((__used__));
void my_abort (void)
#else
-#ifdef __gnu_linux__
-void trap_handler(int signum)
-#else
#error "can't catch break 8"
#endif
-#endif
{
if (1
#ifndef TRAP_USING_ABORT
@@ -78,13 +74,6 @@ int main(void)
{
type ret;
-#ifndef TRAP_USING_ABORT
-#ifdef __gnu_linux__
- if (signal (SIGTRAP, trap_handler) == SIG_ERR)
- abort ();
-#endif
-#endif
-
#ifndef mis_ok
trap_expected = 1;
#endif
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1a.c
index ba639172ba9..fc91e7c9a8a 100644
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1a.c
+++ b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1a.c
@@ -2,5 +2,4 @@
/* { dg-additional-sources "../sync-1.c" } */
/* { dg-options "-Dop -Dtype=short -DTRAP_USING_ABORT -mno-trap-using-break8" } */
/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1ml.c
deleted file mode 100644
index 3685c504731..00000000000
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1ml.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run { target *-*-linux* } } */
-/* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dop -Dtype=short -Dmis_ok" } */
-#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1.c
deleted file mode 100644
index da25614e23b..00000000000
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run { target *-*-linux* } } */
-/* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dxchg -Dtype=int -mno-unaligned-atomic-may-use-library" } */
-#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1a.c
index 09a7a9ea3a0..af6ef8ac748 100644
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1a.c
+++ b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1a.c
@@ -2,5 +2,4 @@
/* { dg-additional-sources "../sync-1.c" } */
/* { dg-options "-Dxchg -Dtype=int -DTRAP_USING_ABORT -mno-trap-using-break8" } */
/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1ml.c
deleted file mode 100644
index d757a683b17..00000000000
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1ml.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run { target *-*-linux* } } */
-/* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dxchg -Dtype=int -Dmis_ok" } */
-#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2.c
deleted file mode 100644
index e8a425328eb..00000000000
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run { target *-*-linux* } } */
-/* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=2 -mno-unaligned-atomic-may-use-library" } */
-#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2a.c
index 2b97613de3c..8c7918470c6 100644
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2a.c
+++ b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2a.c
@@ -2,5 +2,4 @@
/* { dg-additional-sources "../sync-1.c" } */
/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=2 -DTRAP_USING_ABORT -mno-trap-using-break8" } */
/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2ml.c
deleted file mode 100644
index fb711e0ef78..00000000000
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2ml.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run { target *-*-linux* } } */
-/* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=2 -Dmis_ok" } */
-#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3.c
deleted file mode 100644
index 4a3511bf2fb..00000000000
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run { target *-*-linux* } } */
-/* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=3 -mno-unaligned-atomic-may-use-library" } */
-#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3a.c
index 94a25e37f04..e7c90a360d3 100644
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3a.c
+++ b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3a.c
@@ -2,5 +2,4 @@
/* { dg-additional-sources "../sync-1.c" } */
/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=3 -DTRAP_USING_ABORT -mno-trap-using-break8" } */
/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3ml.c
deleted file mode 100644
index 32f8ebbd9bf..00000000000
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3ml.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run { target *-*-linux* } } */
-/* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=3 -Dmis_ok" } */
-#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1.c
deleted file mode 100644
index d8dede9c1f6..00000000000
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run { target *-*-linux* } } */
-/* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dxchg -Dtype=short -mno-unaligned-atomic-may-use-library" } */
-#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1a.c
index 6f5eb02afed..5dcef52207d 100644
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1a.c
+++ b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1a.c
@@ -2,5 +2,4 @@
/* { dg-additional-sources "../sync-1.c" } */
/* { dg-options "-Dxchg -Dtype=short -DTRAP_USING_ABORT -mno-trap-using-break8" } */
/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
-/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1ml.c
deleted file mode 100644
index a6f501c10cc..00000000000
--- a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1ml.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run { target *-*-linux* } } */
-/* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dxchg -Dtype=short -Dmis_ok" } */
-#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/gcn/gcn.exp b/gcc/testsuite/gcc.target/gcn/gcn.exp
new file mode 100644
index 00000000000..0e799e8bc80
--- /dev/null
+++ b/gcc/testsuite/gcc.target/gcn/gcn.exp
@@ -0,0 +1,42 @@
+# Specific regression driver for nvptx.
+# Copyright (C) 2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Exit immediately if this isn't a nvptx target.
+if ![istarget amdgcn*-*-*] then {
+ return
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.target/gcn/vcc-clobber.c b/gcc/testsuite/gcc.target/gcn/vcc-clobber.c
new file mode 100644
index 00000000000..e52733cf1e5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/gcn/vcc-clobber.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+/* Test that gcn_expand_scalar_to_vector_address does not clobber VCC.
+ If it does then spills and reloads will be unsafe, leading to unexpected
+ conditional branch behaviour. */
+
+extern void abort ();
+
+__attribute__((vector_size(256))) int vec[2] = {{0}, {0}};
+
+int
+main()
+{
+ long vcc = 0;
+
+ /* Load a known value into VCC. The memory barrier ensures that the vector
+ load must happen after this point. */
+ asm volatile ("s_mov_b32 vcc_lo, 0x12345689\n\t"
+ "s_mov_b32 vcc_hi, 0xabcdef0"
+ ::: "memory");
+
+ /* Compiler inserts vector load here. */
+
+ /* Consume the abitrary vector, and return the current value of VCC. */
+ asm volatile ("; no-op" : "=cV"(vcc) : "v"(vec[0]), "v"(vec[1]));
+
+ /* The value should match the initialized value. */
+ if (vcc != 0xabcdef012345689)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx2-shiftqihi-constant-1.c b/gcc/testsuite/gcc.target/i386/avx2-shiftqihi-constant-1.c
new file mode 100644
index 00000000000..72065039581
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx2-shiftqihi-constant-1.c
@@ -0,0 +1,31 @@
+/* PR target/95524 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx2" } */
+/* { dg-final { scan-assembler-times "vpand\[^\n\]*%ymm" 3 } } */
+typedef char v32qi __attribute__ ((vector_size (32)));
+typedef unsigned char v32uqi __attribute__ ((vector_size (32)));
+
+__attribute__((noipa)) v32qi
+foo_ashiftrt_256 (v32qi a)
+{
+ return a >> 2;
+}
+/* { dg-final { scan-assembler-times "vpsraw\[^\n\]*%ymm" 1 } } */
+/* { dg-final { scan-assembler-times "vpxor\[^\n\]*%ymm" 1 } } */
+/* { dg-final { scan-assembler-times "vpsubb\[^\n\]*%ymm" 1 } } */
+
+__attribute__((noipa)) v32qi
+foo_ashift_256 (v32qi a)
+{
+ return a << 7;
+}
+
+/* { dg-final { scan-assembler-times "vpsllw\[^\n\]*%ymm" 1 } } */
+
+__attribute__((noipa)) v32uqi
+foo_lshiftrt_256 (v32uqi a)
+{
+ return a >> 2;
+}
+
+/* { dg-final { scan-assembler-times "vpsrlw\[^\n\]*%ymm" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx2-shiftqihi-constant-2.c b/gcc/testsuite/gcc.target/i386/avx2-shiftqihi-constant-2.c
new file mode 100644
index 00000000000..509d5a8d762
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx2-shiftqihi-constant-2.c
@@ -0,0 +1,62 @@
+/* PR target/95524 */
+/* { dg-do run } */
+/* { dg-options "-O2 -mavx512bw -Wno-shift-count-overflow" } */
+
+#ifndef CHECK
+#define CHECK "avx512bw-check.h"
+#endif
+
+#include CHECK
+
+#ifndef TEST
+#define TEST avx512bw_test
+#endif
+
+typedef char v64qi __attribute__ ((vector_size (64)));
+typedef unsigned char v64uqi __attribute__ ((vector_size (64)));
+
+#define TEST_SHIFT(N) \
+ do \
+ { \
+ int i; \
+ for (i = 0; i < 64; i++) \
+ exp1.a[i] = op1.a[i] << N; \
+ res1.x = (__m512i) (((v64qi) op1.x) << N); \
+ if (check_union512i_b (res1, exp1.a)) \
+ abort (); \
+ \
+ for (i = 0; i < 64; i++) \
+ exp1.a[i] = op1.a[i] >> N; \
+ res1.x = (__m512i) (((v64qi) op1.x) >> N); \
+ if (check_union512i_b (res1, exp1.a)) \
+ abort (); \
+ \
+ for (i = 0; i < 64; i++) \
+ exp2.a[i] = op2.a[i] >> N; \
+ res2.x = (__m512i) (((v64uqi) op2.x >> N)); \
+ if (check_union512i_ub (res2, exp2.a)) \
+ abort (); \
+ } \
+ while (0)
+
+static void
+TEST (void)
+{
+ union512i_b op1, exp1, res1;
+ union512i_ub op2, exp2, res2;
+ for (int i = 0; i != 64; i++)
+ {
+ op2.a[i] = i * i;
+ op1.a[i] = i * i + 200 * i;
+ }
+ TEST_SHIFT (0);
+ TEST_SHIFT (1);
+ TEST_SHIFT (2);
+ TEST_SHIFT (3);
+ TEST_SHIFT (4);
+ TEST_SHIFT (5);
+ TEST_SHIFT (6);
+ TEST_SHIFT (7);
+ TEST_SHIFT (8);
+}
+
diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-pr95488-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-pr95488-1.c
new file mode 100644
index 00000000000..594e511868d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512bw-pr95488-1.c
@@ -0,0 +1,21 @@
+/* PR target/95488 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx512bw" } */
+/* { dg-final { scan-assembler-times "vpmovzxbw" 4 } } */
+/* { dg-final { scan-assembler-times "vpmullw\[^\n\]*zmm" 2 } } */
+/* { dg-final { scan-assembler-times "vpmovwb" 2 } } */
+
+typedef char v32qi __attribute__ ((vector_size (32)));
+typedef unsigned char v32uqi __attribute__ ((vector_size (32)));
+
+__attribute__((noipa)) v32qi
+mul_512 (v32qi a, v32qi b)
+{
+ return a * b;
+}
+
+__attribute__((noipa)) v32uqi
+umul_512 (v32uqi a, v32uqi b)
+{
+ return a * b;
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-pr95488-2.c b/gcc/testsuite/gcc.target/i386/avx512bw-pr95488-2.c
new file mode 100644
index 00000000000..de319664618
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512bw-pr95488-2.c
@@ -0,0 +1,47 @@
+/* { dg-do run } */
+/* { dg-require-effective-target avx512bw } */
+/* { dg-options "-O2 -mavx512bw -mavx512vl" } */
+
+#ifndef CHECK
+#define CHECK "avx512f-helper.h"
+#endif
+
+#include CHECK
+
+#ifndef TEST
+#define TEST avx512bw_test
+#endif
+
+#include "avx512bw-pr95488-1.c"
+
+#define TEST_MULB(typeV, typeS, N, fn) \
+do \
+ { \
+ typeV v1, v2, res; \
+ typeS s1[N], s2[N], exp[N]; \
+ int i,j; \
+ \
+ for (i = 0; i < N; i++) \
+ { \
+ s1[i] = i * i; \
+ s2[i] = i + 20; \
+ } \
+ for (i = 0; i < N; i++) \
+ exp[i] = s1[i] * s2[i]; \
+ v1 = *(typeV *)&s1[0]; \
+ v2 = *(typeV *)&s2[0]; \
+ res = fn (v1, v2); \
+ for (j = 0; j < N; j++) \
+ { \
+ if (res[j] != exp[j]) \
+ abort(); \
+ } \
+} \
+while (0)
+
+static void
+TEST (void)
+{
+ TEST_MULB (v32qi, char, 32, mul_512);
+ TEST_MULB (v32uqi, unsigned char, 32, umul_512);
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-pr96246-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-pr96246-1.c
new file mode 100644
index 00000000000..2bfcc840a91
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512bw-pr96246-1.c
@@ -0,0 +1,30 @@
+/* PR target/96246 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -mavx512bw" } */
+/* { dg-final { scan-assembler-times "vpblendm\[bwdq\]\[\t ]" 4 } } */
+/* { dg-final { scan-assembler-times "vblendmp\[sd\]\[\t ]" 2 } } */
+
+typedef char v64qi __attribute__((vector_size (64)));
+typedef short v32hi __attribute__((vector_size (64)));
+typedef int v16si __attribute__((vector_size (64)));
+typedef long long v8di __attribute__((vector_size (64)));
+typedef float v16sf __attribute__((vector_size (64)));
+typedef double v8df __attribute__((vector_size (64)));
+
+#define COMPILE_TEST(vtype, num) \
+ vtype \
+ __attribute__ ((noipa)) \
+ foo_##vtype (vtype a, vtype b, vtype c, vtype d) \
+ { \
+ vtype e; \
+ for (int i = 0; i != num; i++) \
+ e[i] = a[i] > b[i] ? c[i] : d[i]; \
+ return e; \
+ }
+
+COMPILE_TEST (v64qi, 64);
+COMPILE_TEST (v32hi, 32);
+COMPILE_TEST (v16si, 16);
+COMPILE_TEST (v8di, 8);
+COMPILE_TEST (v16sf, 16);
+COMPILE_TEST (v8df, 8);
diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-pr96246-2.c b/gcc/testsuite/gcc.target/i386/avx512bw-pr96246-2.c
new file mode 100644
index 00000000000..422fcfe4ea8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512bw-pr96246-2.c
@@ -0,0 +1,47 @@
+/* PR target/96246 */
+/* { dg-do run } */
+/* { dg-require-effective-target avx512bw } */
+/* { dg-options "-Ofast -mavx512bw" } */
+
+#ifndef CHECK
+#define CHECK "avx512f-helper.h"
+#endif
+
+#include CHECK
+
+#ifndef TEST
+#define TEST avx512bw_test
+#endif
+
+#include "avx512bw-pr96246-1.c"
+
+#define RUNTIME_TEST(vtype, num) \
+ do \
+ { \
+ vtype a, b, c, d; \
+ vtype res; \
+ for (int i = 0; i != num; i++) \
+ { \
+ a[i] = i * 2; \
+ b[i] = i * i - 5; \
+ c[i] = 1; \
+ d[i] = 0; \
+ } \
+ res = foo_##vtype (a, b, c, d); \
+ for (int i = 0; i != num; i++) \
+ if (res [i] != (a[i] > b[i] ? c[i] : d[i])) \
+ __builtin_abort (); \
+ } \
+ while (0)
+
+static void
+__attribute__ ((optimize (0)))
+TEST (void)
+{
+ RUNTIME_TEST (v64qi, 64);
+ RUNTIME_TEST (v32hi, 32);
+ RUNTIME_TEST (v16si, 16);
+ RUNTIME_TEST (v8di, 8);
+ RUNTIME_TEST (v16sf, 16);
+ RUNTIME_TEST (v8df, 8);
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-shiftqihi-constant-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-shiftqihi-constant-1.c
new file mode 100644
index 00000000000..78bf5d33689
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512bw-shiftqihi-constant-1.c
@@ -0,0 +1,31 @@
+/* PR target/95524 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx512bw" } */
+/* { dg-final { scan-assembler-times "vpand\[^\n\]*%zmm" 3 } } */
+typedef char v64qi __attribute__ ((vector_size (64)));
+typedef unsigned char v64uqi __attribute__ ((vector_size (64)));
+
+__attribute__((noipa)) v64qi
+foo_ashiftrt_512 (v64qi a)
+{
+ return a >> 2;
+}
+/* { dg-final { scan-assembler-times "vpsraw\[^\n\]*%zmm" 1 } } */
+/* { dg-final { scan-assembler-times "vpxor\[^\n\]*%zmm" 1 } } */
+/* { dg-final { scan-assembler-times "vpsubb\[^\n\]*%zmm" 1 } } */
+
+__attribute__((noipa)) v64qi
+foo_ashift_512 (v64qi a)
+{
+ return a << 7;
+}
+
+/* { dg-final { scan-assembler-times "vpsllw\[^\n\]*%zmm" 1 } } */
+
+__attribute__((noipa)) v64uqi
+foo_lshiftrt_512 (v64uqi a)
+{
+ return a >> 2;
+}
+
+/* { dg-final { scan-assembler-times "vpsrlw\[^\n\]*%zmm" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-shiftqihi-constant-2.c b/gcc/testsuite/gcc.target/i386/avx512bw-shiftqihi-constant-2.c
new file mode 100644
index 00000000000..d6f7934f3b4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512bw-shiftqihi-constant-2.c
@@ -0,0 +1,62 @@
+/* PR target/95524 */
+/* { dg-do run } */
+/* { dg-options "-O2 -mavx2 -Wno-shift-count-overflow" } */
+
+#ifndef CHECK
+#define CHECK "avx2-check.h"
+#endif
+
+#include CHECK
+
+#ifndef TEST
+#define TEST avx2_test
+#endif
+
+typedef char v32qi __attribute__ ((vector_size (32)));
+typedef unsigned char v32uqi __attribute__ ((vector_size (32)));
+
+#define TEST_SHIFT(N) \
+ do \
+ { \
+ int i; \
+ for (i = 0; i < 32; i++) \
+ exp1.a[i] = op1.a[i] << N; \
+ res1.x = (__m256i) (((v32qi) op1.x) << N); \
+ if (check_union256i_b (res1, exp1.a)) \
+ abort (); \
+ \
+ for (i = 0; i < 32; i++) \
+ exp1.a[i] = op1.a[i] >> N; \
+ res1.x = (__m256i) (((v32qi) op1.x) >> N); \
+ if (check_union256i_b (res1, exp1.a)) \
+ abort (); \
+ \
+ for (i = 0; i < 32; i++) \
+ exp2.a[i] = op2.a[i] >> N; \
+ res2.x = (__m256i) (((v32uqi) op2.x >> N)); \
+ if (check_union256i_ub (res2, exp2.a)) \
+ abort (); \
+ } \
+ while (0)
+
+static void
+TEST (void)
+{
+ union256i_b op1, exp1, res1;
+ union256i_ub op2, exp2, res2;
+ for (int i = 0; i != 32; i++)
+ {
+ op2.a[i] = i * i;
+ op1.a[i] = i * i + 200 * i;
+ }
+ TEST_SHIFT (0);
+ TEST_SHIFT (1);
+ TEST_SHIFT (2);
+ TEST_SHIFT (3);
+ TEST_SHIFT (4);
+ TEST_SHIFT (5);
+ TEST_SHIFT (6);
+ TEST_SHIFT (7);
+ TEST_SHIFT (8);
+}
+
diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vmovdqu16-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-vmovdqu16-1.c
index 06550420360..a0d0e36389b 100644
--- a/gcc/testsuite/gcc.target/i386/avx512bw-vmovdqu16-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx512bw-vmovdqu16-1.c
@@ -1,8 +1,8 @@
/* { dg-do compile } */
/* { dg-options "-mavx512bw -mavx512vl -O2" } */
-/* { dg-final { scan-assembler-times "vmovdqu16\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "vmovdqu16\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "vmovdqu16\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdqu16|vpblendmw)\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdqu16|vpblendmw)\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdqu16|vpblendmw)\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqu16\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqu16\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqu16\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vmovdqu8-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-vmovdqu8-1.c
index 7f2a964bf0b..6d24e79bf66 100644
--- a/gcc/testsuite/gcc.target/i386/avx512bw-vmovdqu8-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx512bw-vmovdqu8-1.c
@@ -1,8 +1,8 @@
/* { dg-do compile } */
/* { dg-options "-mavx512bw -mavx512vl -O2" } */
-/* { dg-final { scan-assembler-times "vmovdqu8\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "vmovdqu8\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "vmovdqu8\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdqu8|vpblendmb)\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdqu8|vpblendmb)\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdqu8|vpblendmb)\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqu8\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqu8\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqu8\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-pr95060.c b/gcc/testsuite/gcc.target/i386/avx512f-pr95060.c
new file mode 100644
index 00000000000..b38dc4f1e13
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512f-pr95060.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/95060 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math -mavx512f" } */
+/* { dg-final { scan-assembler "\tvfnmsub" } } */
+/* { dg-final { scan-assembler-not "\tvfmadd" } } */
+
+#define N 32
+float r[N], a[N], b[N], c[N];
+
+void
+foo (void)
+{
+ for (int i = 0; i < N; i++)
+ r[i] = -(a[i] * b[i]) - c[i];
+}
+
+void
+bar (void)
+{
+ for (int i = 0; i < N; i++)
+ r[i] = -(a[i] * b[i] + c[i]);
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcmppd-3.c b/gcc/testsuite/gcc.target/i386/avx512f-vcmppd-3.c
new file mode 100644
index 00000000000..3d36eca78fa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512f-vcmppd-3.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-O0 -mavx512f" } */
+
+#include "avx512f-vcmppd-1.c"
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcmpps-3.c b/gcc/testsuite/gcc.target/i386/avx512f-vcmpps-3.c
new file mode 100644
index 00000000000..af797aad2de
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512f-vcmpps-3.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-O0 -mavx512f" } */
+
+#include "avx512f-vcmpps-1.c"
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvtps2ph-pr95254.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvtps2ph-pr95254.c
new file mode 100644
index 00000000000..9e0da947368
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvtps2ph-pr95254.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx512f" } */
+
+#include<immintrin.h>
+extern __m256i res;
+void
+foo (__m512 a, __mmask16 m)
+{
+ res = _mm512_maskz_cvtps_ph (m, a, 10);
+}
+
+/* { dg-final { scan-assembler-not "vcvtps2ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]\[^\n\]*res\[^\n\]*\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)"} } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vmovapd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vmovapd-1.c
index e869f70665a..7fc84b16e2b 100644
--- a/gcc/testsuite/gcc.target/i386/avx512f-vmovapd-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx512f-vmovapd-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-mavx512f -O2" } */
-/* { dg-final { scan-assembler-times "vmovapd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovapd|vblendmpd)\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovapd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovapd\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovapd\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vmovaps-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vmovaps-1.c
index a7635a3ebf2..c2e2655fda6 100644
--- a/gcc/testsuite/gcc.target/i386/avx512f-vmovaps-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx512f-vmovaps-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-mavx512f -O2" } */
-/* { dg-final { scan-assembler-times "vmovaps\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovaps|vblendmps)\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovaps\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovaps\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovaps\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vmovdqa32-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vmovdqa32-1.c
index b93727d9ef2..8fb816c1317 100644
--- a/gcc/testsuite/gcc.target/i386/avx512f-vmovdqa32-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx512f-vmovdqa32-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-mavx512f -O2" } */
-/* { dg-final { scan-assembler-times "vmovdqa32\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdqa32|vpblendmd)\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqa32\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqa32\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqa32\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vmovdqa64-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vmovdqa64-1.c
index 1c372c4f92a..4352b12b6e7 100644
--- a/gcc/testsuite/gcc.target/i386/avx512f-vmovdqa64-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx512f-vmovdqa64-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-mavx512f -O2" } */
-/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdqa64|vpblendmq)\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-pr92686-movcc-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-pr92686-movcc-1.c
index 1b9644a3790..8d0b2e94001 100644
--- a/gcc/testsuite/gcc.target/i386/avx512vl-pr92686-movcc-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx512vl-pr92686-movcc-1.c
@@ -3,10 +3,10 @@
/* { dg-options "-Ofast -mavx512bw -mavx512vl -mno-xop -mprefer-vector-width=256" } */
/* { dg-final { scan-assembler-times "vpcmp\[bwdq\]\[\t ]" 8 } } */
/* { dg-final { scan-assembler-times "vpcmpu\[bwdq\]\[\t ]" 8 } } */
-/* { dg-final { scan-assembler-times "vmovdq\[au\]8\[^\{\n\]*%ymm0+\[^\n\]*\{%k\[1-7\]\}" 4 } } */
-/* { dg-final { scan-assembler-times "vmovdq\[au\]16\[^\{\n\]*%ymm0+\[^\n\]*\{%k\[1-7\]\}" 4 } } */
-/* { dg-final { scan-assembler-times "vmovdq\[au\]32\[^\{\n\]*%ymm0+\[^\n\]*\{%k\[1-7\]\}" 4 } } */
-/* { dg-final { scan-assembler-times "vmovdq\[au\]64\[^\{\n\]*%ymm0+\[^\n\]*\{%k\[1-7\]\}" 4 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdq\[au\]8|vpblendmb)\[^\{\n\]*%ymm0+\[^\n\]*\{%k\[1-7\]\}" 4 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdq\[au\]16|vpblendmw)\[^\{\n\]*%ymm0+\[^\n\]*\{%k\[1-7\]\}" 4 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdq\[au\]32|vpblendmd)\[^\{\n\]*%ymm0+\[^\n\]*\{%k\[1-7\]\}" 4 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdq\[au\]64|vpblendmq)\[^\{\n\]*%ymm0+\[^\n\]*\{%k\[1-7\]\}" 4 } } */
__attribute__((noipa)) void
f1 (char *__restrict dst, char *__restrict src1, char *__restrict src2)
diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-pr95488-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-pr95488-1.c
new file mode 100644
index 00000000000..b3674fbd04f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512vl-pr95488-1.c
@@ -0,0 +1,36 @@
+/* PR target/pr95488 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx512bw -mavx512vl" } */
+/* { dg-final { scan-assembler-times "vpmovzxbw" 8 } } */
+/* { dg-final { scan-assembler-times "vpmullw\[^\n\]*ymm" 2 } } */
+/* { dg-final { scan-assembler-times "vpmullw\[^\n\]*xmm" 2 } } */
+/* { dg-final { scan-assembler-times "vpmovwb" 4 } } */
+
+typedef char v16qi __attribute__ ((vector_size (16)));
+typedef char v8qi __attribute__ ((vector_size (8)));
+typedef unsigned char v16uqi __attribute__ ((vector_size (16)));
+typedef unsigned char v8uqi __attribute__ ((vector_size (8)));
+
+__attribute__((noipa)) v8qi
+mul_128 (v8qi a, v8qi b)
+{
+ return a * b;
+}
+
+__attribute__((noipa)) v16qi
+mul_256 (v16qi a, v16qi b)
+{
+ return a * b;
+}
+
+__attribute__((noipa)) v8uqi
+umul_128 (v8uqi a, v8uqi b)
+{
+ return a * b;
+}
+
+__attribute__((noipa)) v16uqi
+umul_256 (v16uqi a, v16uqi b)
+{
+ return a * b;
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-pr95488-2.c b/gcc/testsuite/gcc.target/i386/avx512vl-pr95488-2.c
new file mode 100644
index 00000000000..45d7437bab6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512vl-pr95488-2.c
@@ -0,0 +1,50 @@
+/* { dg-do run } */
+/* { dg-require-effective-target avx512bw } */
+/* { dg-require-effective-target avx512vl } */
+/* { dg-options "-O2 -mavx512bw -mavx512vl" } */
+
+#ifndef CHECK
+#define CHECK "avx512f-helper.h"
+#endif
+
+#include CHECK
+
+#ifndef TEST
+#define TEST avx512bw_test
+#endif
+
+#include "avx512vl-pr95488-1.c"
+
+#define TEST_MULB(typeV, typeS, N, fn) \
+do \
+ { \
+ typeV v1, v2, res; \
+ int i,j; \
+ typeS s1[N], s2[N], exp[N]; \
+ \
+ for (i = 0; i < N; i++) \
+ { \
+ s1[i] = i * i; \
+ s2[i] = i + 20; \
+ } \
+ for (i = 0; i < N; i++) \
+ exp[i] = s1[i] * s2[i]; \
+ v1 = *(typeV *)s1; \
+ v2 = *(typeV *)s2; \
+ res = fn (v1, v2); \
+ for (j = 0; j < N; j++) \
+ { \
+ if (res[j] != exp[j]) \
+ abort(); \
+ } \
+ } \
+while (0)
+
+static void
+TEST (void)
+{
+ TEST_MULB(v8qi, char, 8, mul_128);
+ TEST_MULB(v8uqi, unsigned char, 8, umul_128);
+ TEST_MULB(v16qi, char, 16, mul_256);
+ TEST_MULB(v16uqi, unsigned char, 16, umul_256);
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-pr96246-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-pr96246-1.c
new file mode 100644
index 00000000000..95357d6fc84
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512vl-pr96246-1.c
@@ -0,0 +1,36 @@
+/* PR target/96246 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -mavx512bw -mavx512vl" } */
+/* { dg-final { scan-assembler-times "vpblendm\[bwdq\]\[\t ]" 6 } } */
+/* { dg-final { scan-assembler-times "vblendmp\[sd\]\[\t ]" 3 } } */
+
+typedef char v16qi __attribute__ ((vector_size (16)));
+typedef char v32qi __attribute__ ((vector_size (32)));
+typedef char v16hi __attribute__ ((vector_size (32)));
+typedef int v4si __attribute__((vector_size (16)));
+typedef int v8si __attribute__((vector_size (32)));
+typedef long long v4di __attribute__((vector_size (32)));
+typedef float v4sf __attribute__((vector_size (16)));
+typedef float v8sf __attribute__((vector_size (32)));
+typedef double v4df __attribute__((vector_size (32)));
+
+#define COMPILE_TEST(vtype, num) \
+ vtype \
+ __attribute__ ((noipa)) \
+ foo_##vtype (vtype a, vtype b, vtype c, vtype d) \
+ { \
+ vtype e; \
+ for (int i = 0; i != num; i++) \
+ e[i] = a[i] > b[i] ? c[i] : d[i]; \
+ return e; \
+ }
+
+COMPILE_TEST (v16qi, 16);
+COMPILE_TEST (v32qi, 32);
+COMPILE_TEST (v16hi, 16);
+COMPILE_TEST (v4si, 4);
+COMPILE_TEST (v8si, 8);
+COMPILE_TEST (v4sf, 4);
+COMPILE_TEST (v8sf, 8);
+COMPILE_TEST (v4di, 4);
+COMPILE_TEST (v4df, 4);
diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-pr96246-2.c b/gcc/testsuite/gcc.target/i386/avx512vl-pr96246-2.c
new file mode 100644
index 00000000000..d219f7c15ad
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512vl-pr96246-2.c
@@ -0,0 +1,51 @@
+/* PR target/96246 */
+/* { dg-do run } */
+/* { dg-require-effective-target avx512bw } */
+/* { dg-require-effective-target avx512vl } */
+/* { dg-options "-Ofast -mavx512bw -mavx512vl" } */
+
+#ifndef CHECK
+#define CHECK "avx512f-helper.h"
+#endif
+
+#include CHECK
+
+#ifndef TEST
+#define TEST avx512bw_test
+#endif
+
+#include "avx512vl-pr96246-1.c"
+
+#define RUNTIME_TEST(vtype, num) \
+ do \
+ { \
+ vtype a, b, c, d; \
+ vtype res; \
+ for (int i = 0; i != num; i++) \
+ { \
+ a[i] = i * 2; \
+ b[i] = i * i - 5; \
+ c[i] = 1; \
+ d[i] = 0; \
+ } \
+ res = foo_##vtype (a, b, c, d); \
+ for (int i = 0; i != num; i++) \
+ if (res [i] != (a[i] > b[i] ? c[i] : d[i])) \
+ __builtin_abort (); \
+ } \
+ while (0)
+
+static void
+__attribute__ ((optimize (0)))
+TEST (void)
+{
+ RUNTIME_TEST (v16qi, 16);
+ RUNTIME_TEST (v32qi, 32);
+ RUNTIME_TEST (v16hi, 16);
+ RUNTIME_TEST (v4si, 4);
+ RUNTIME_TEST (v8si, 8);
+ RUNTIME_TEST (v4sf, 4);
+ RUNTIME_TEST (v8sf, 8);
+ RUNTIME_TEST (v4di, 4);
+ RUNTIME_TEST (v4df, 4);
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vcvtps2ph-pr95254.c b/gcc/testsuite/gcc.target/i386/avx512vl-vcvtps2ph-pr95254.c
new file mode 100644
index 00000000000..0c685ea66fd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512vl-vcvtps2ph-pr95254.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx512vl -mavx512f" } */
+
+#include<immintrin.h>
+extern __m128i res;
+void
+foo (__m256 a, __mmask8 m)
+{
+ res = _mm256_maskz_cvtps_ph (m, a, 10);
+}
+
+void
+foo1 (__m128 a, __mmask8 m)
+{
+ res = _mm_maskz_cvtps_ph (m, a, 10);
+}
+
+/* { dg-final { scan-assembler-not "vcvtps2ph\[ \\t\]+\[^\{\n\]*%\[xy\]mm\[0-9\]\[^\n\]*res\[^\n\]*\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)"} } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vmovapd-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vmovapd-1.c
index 89c3ebefe35..fd59660f932 100644
--- a/gcc/testsuite/gcc.target/i386/avx512vl-vmovapd-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx512vl-vmovapd-1.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-mavx512vl -O2" } */
-/* { dg-final { scan-assembler-times "vmovapd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "vmovapd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovapd|vblendmpd)\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovapd|vblendmpd)\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovapd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovapd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovapd\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vmovaps-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vmovaps-1.c
index 2196ebb55d9..455b1a9dc37 100644
--- a/gcc/testsuite/gcc.target/i386/avx512vl-vmovaps-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx512vl-vmovaps-1.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-mavx512vl -O2" } */
-/* { dg-final { scan-assembler-times "vmovaps\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "vmovaps\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovaps|vblendmps)\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovaps|vblendmps)\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovaps\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovaps\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovaps\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa32-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa32-1.c
index e391de5b432..217afbc6904 100644
--- a/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa32-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa32-1.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-mavx512vl -O2" } */
-/* { dg-final { scan-assembler-times "vmovdqa32\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "vmovdqa32\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdqa32|vpblendmd)\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdqa32|vpblendmd)\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqa32\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqa32\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqa32\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa64-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa64-1.c
index db4d9d14875..9dc794d6a80 100644
--- a/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa64-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa64-1.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-mavx512vl -O2" } */
-/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdqa64|vpblendmq)\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "(?:vmovdqa64|vpblendmq)\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vmovdqa\[ \\t\]+\\(\[^\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 { target nonpic } } } */
diff --git a/gcc/testsuite/gcc.target/i386/builtin-bswap-5.c b/gcc/testsuite/gcc.target/i386/builtin-bswap-5.c
new file mode 100644
index 00000000000..a73a870dad2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/builtin-bswap-5.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int128 } */
+/* { dg-final { scan-assembler-not "call" } } */
+
+__uint128_t foo (__uint128_t x)
+{
+ return __builtin_bswap128 (x);
+}
diff --git a/gcc/testsuite/gcc.target/i386/builtin_target.c b/gcc/testsuite/gcc.target/i386/builtin_target.c
index 7a8b6e805ed..aa9680544d8 100644
--- a/gcc/testsuite/gcc.target/i386/builtin_target.c
+++ b/gcc/testsuite/gcc.target/i386/builtin_target.c
@@ -7,348 +7,53 @@
/* { dg-do run } */
#include <assert.h>
+#include <stdlib.h>
#include "cpuid.h"
-
-/* Check if the Intel CPU model and sub-model are identified. */
-static void
-check_intel_cpu_model (unsigned int family, unsigned int model,
- unsigned int brand_id)
-{
- /* Parse family and model only if brand ID is 0. */
- if (brand_id == 0)
- {
- switch (family)
- {
- case 0x5:
- /* Pentium. */
- break;
- case 0x6:
- switch (model)
- {
- case 0x1c:
- case 0x26:
- /* Atom. */
- assert (__builtin_cpu_is ("atom"));
- break;
- case 0x37:
- case 0x4a:
- case 0x4d:
- case 0x5a:
- case 0x5d:
- /* Silvermont. */
- assert (__builtin_cpu_is ("silvermont"));
- break;
- case 0x5c:
- case 0x5f:
- /* Goldmont. */
- assert (__builtin_cpu_is ("goldmont"));
- break;
- case 0x7a:
- /* Goldmont Plus. */
- assert (__builtin_cpu_is ("goldmont-plus"));
- break;
- case 0x57:
- /* Knights Landing. */
- assert (__builtin_cpu_is ("knl"));
- break;
- case 0x85:
- /* Knights Mill */
- assert (__builtin_cpu_is ("knm"));
- break;
- case 0x1a:
- case 0x1e:
- case 0x1f:
- case 0x2e:
- /* Nehalem. */
- assert (__builtin_cpu_is ("corei7"));
- assert (__builtin_cpu_is ("nehalem"));
- break;
- case 0x25:
- case 0x2c:
- case 0x2f:
- /* Westmere. */
- assert (__builtin_cpu_is ("corei7"));
- assert (__builtin_cpu_is ("westmere"));
- break;
- case 0x2a:
- case 0x2d:
- /* Sandy Bridge. */
- assert (__builtin_cpu_is ("corei7"));
- assert (__builtin_cpu_is ("sandybridge"));
- break;
- case 0x3a:
- case 0x3e:
- /* Ivy Bridge. */
- assert (__builtin_cpu_is ("corei7"));
- assert (__builtin_cpu_is ("ivybridge"));
- break;
- case 0x3c:
- case 0x3f:
- case 0x45:
- case 0x46:
- /* Haswell. */
- assert (__builtin_cpu_is ("corei7"));
- assert (__builtin_cpu_is ("haswell"));
- break;
- case 0x3d:
- case 0x47:
- case 0x4f:
- case 0x56:
- /* Broadwell. */
- assert (__builtin_cpu_is ("corei7"));
- assert (__builtin_cpu_is ("broadwell"));
- break;
- case 0x4e:
- case 0x5e:
- /* Skylake. */
- case 0x8e:
- case 0x9e:
- /* Kaby Lake. */
- assert (__builtin_cpu_is ("corei7"));
- assert (__builtin_cpu_is ("skylake"));
- break;
- case 0x55:
- {
- unsigned int eax, ebx, ecx, edx;
- __cpuid_count (7, 0, eax, ebx, ecx, edx);
- assert (__builtin_cpu_is ("corei7"));
- if (ecx & bit_AVX512VNNI)
- /* Cascade Lake. */
- assert (__builtin_cpu_is ("cascadelake"));
- else
- /* Skylake with AVX-512 support. */
- assert (__builtin_cpu_is ("skylake-avx512"));
- break;
- }
- case 0x66:
- /* Cannon Lake. */
- assert (__builtin_cpu_is ("cannonlake"));
- break;
- case 0x17:
- case 0x1d:
- /* Penryn. */
- case 0x0f:
- /* Merom. */
- assert (__builtin_cpu_is ("core2"));
- break;
- default:
- break;
- }
- break;
- default:
- /* We have no idea. */
- break;
- }
- }
-}
-
-/* Check if the AMD CPU model and sub-model are identified. */
-static void
-check_amd_cpu_model (unsigned int family, unsigned int model)
-{
- switch (family)
- {
- /* AMD Family 10h. */
- case 0x10:
- switch (model)
- {
- case 0x2:
- /* Barcelona. */
- assert (__builtin_cpu_is ("amdfam10h"));
- assert (__builtin_cpu_is ("barcelona"));
- break;
- case 0x4:
- /* Shanghai. */
- assert (__builtin_cpu_is ("amdfam10h"));
- assert (__builtin_cpu_is ("shanghai"));
- break;
- case 0x8:
- /* Istanbul. */
- assert (__builtin_cpu_is ("amdfam10h"));
- assert (__builtin_cpu_is ("istanbul"));
- break;
- default:
- break;
- }
- break;
- /* AMD Family 15h. */
- case 0x15:
- assert (__builtin_cpu_is ("amdfam15h"));
- /* Bulldozer version 1. */
- if ( model <= 0xf)
- assert (__builtin_cpu_is ("bdver1"));
- /* Bulldozer version 2. */
- if (model >= 0x10 && model <= 0x1f)
- assert (__builtin_cpu_is ("bdver2"));
- break;
- default:
- break;
- }
-}
+#define CHECK___builtin_cpu_is(cpu) assert (__builtin_cpu_is (cpu))
+#define gcc_assert(a) assert (a)
+#define gcc_unreachable() abort ()
+#define inline
+#include "../../../common/config/i386/i386-cpuinfo.h"
+#include "../../../common/config/i386/cpuinfo.h"
/* Check if the ISA features are identified. */
static void
-check_features (unsigned int ecx, unsigned int edx,
- int max_cpuid_level)
+check_features (struct __processor_model *cpu_model,
+ unsigned int *cpu_features2)
{
- unsigned int eax, ebx;
- unsigned int ext_level;
-
- if (edx & bit_CMOV)
- assert (__builtin_cpu_supports ("cmov"));
- if (edx & bit_MMX)
- assert (__builtin_cpu_supports ("mmx"));
- if (edx & bit_SSE)
- assert (__builtin_cpu_supports ("sse"));
- if (edx & bit_SSE2)
- assert (__builtin_cpu_supports ("sse2"));
- if (ecx & bit_POPCNT)
- assert (__builtin_cpu_supports ("popcnt"));
- if (ecx & bit_AES)
- assert (__builtin_cpu_supports ("aes"));
- if (ecx & bit_PCLMUL)
- assert (__builtin_cpu_supports ("pclmul"));
- if (ecx & bit_SSE3)
- assert (__builtin_cpu_supports ("sse3"));
- if (ecx & bit_SSSE3)
- assert (__builtin_cpu_supports ("ssse3"));
- if (ecx & bit_SSE4_1)
- assert (__builtin_cpu_supports ("sse4.1"));
- if (ecx & bit_SSE4_2)
- assert (__builtin_cpu_supports ("sse4.2"));
- if (ecx & bit_AVX)
- assert (__builtin_cpu_supports ("avx"));
- if (ecx & bit_FMA)
- assert (__builtin_cpu_supports ("fma"));
-
- /* Get advanced features at level 7 (eax = 7, ecx = 0). */
- if (max_cpuid_level >= 7)
- {
- __cpuid_count (7, 0, eax, ebx, ecx, edx);
- if (ebx & bit_BMI)
- assert (__builtin_cpu_supports ("bmi"));
- if (ebx & bit_AVX2)
- assert (__builtin_cpu_supports ("avx2"));
- if (ebx & bit_BMI2)
- assert (__builtin_cpu_supports ("bmi2"));
- if (ebx & bit_AVX512F)
- assert (__builtin_cpu_supports ("avx512f"));
- if (ebx & bit_AVX512VL)
- assert (__builtin_cpu_supports ("avx512vl"));
- if (ebx & bit_AVX512BW)
- assert (__builtin_cpu_supports ("avx512bw"));
- if (ebx & bit_AVX512DQ)
- assert (__builtin_cpu_supports ("avx512dq"));
- if (ebx & bit_AVX512CD)
- assert (__builtin_cpu_supports ("avx512cd"));
- if (ebx & bit_AVX512PF)
- assert (__builtin_cpu_supports ("avx512pf"));
- if (ebx & bit_AVX512ER)
- assert (__builtin_cpu_supports ("avx512er"));
- if (ebx & bit_AVX512IFMA)
- assert (__builtin_cpu_supports ("avx512ifma"));
- if (ecx & bit_AVX512VBMI)
- assert (__builtin_cpu_supports ("avx512vbmi"));
- if (ecx & bit_AVX512VBMI2)
- assert (__builtin_cpu_supports ("avx512vbmi2"));
- if (ecx & bit_GFNI)
- assert (__builtin_cpu_supports ("gfni"));
- if (ecx & bit_VPCLMULQDQ)
- assert (__builtin_cpu_supports ("vpclmulqdq"));
- if (ecx & bit_AVX512VNNI)
- assert (__builtin_cpu_supports ("avx512vnni"));
- if (ecx & bit_AVX512BITALG)
- assert (__builtin_cpu_supports ("avx512bitalg"));
- if (ecx & bit_AVX512VPOPCNTDQ)
- assert (__builtin_cpu_supports ("avx512vpopcntdq"));
- if (edx & bit_AVX5124VNNIW)
- assert (__builtin_cpu_supports ("avx5124vnniw"));
- if (edx & bit_AVX5124FMAPS)
- assert (__builtin_cpu_supports ("avx5124fmaps"));
-
- __cpuid_count (7, 1, eax, ebx, ecx, edx);
- if (eax & bit_AVX512BF16)
- assert (__builtin_cpu_supports ("avx512bf16"));
- }
-
- /* Check cpuid level of extended features. */
- __cpuid (0x80000000, ext_level, ebx, ecx, edx);
-
- if (ext_level >= 0x80000001)
- {
- __cpuid (0x80000001, eax, ebx, ecx, edx);
-
- if (ecx & bit_SSE4a)
- assert (__builtin_cpu_supports ("sse4a"));
- if (ecx & bit_FMA4)
- assert (__builtin_cpu_supports ("fma4"));
- if (ecx & bit_XOP)
- assert (__builtin_cpu_supports ("xop"));
- }
-}
-
-static int __attribute__ ((noinline))
-__get_cpuid_output (unsigned int __level,
- unsigned int *__eax, unsigned int *__ebx,
- unsigned int *__ecx, unsigned int *__edx)
-{
- return __get_cpuid (__level, __eax, __ebx, __ecx, __edx);
+#define has_feature(f) \
+ has_cpu_feature (cpu_model, cpu_features2, f)
+#define ISA_NAMES_TABLE_START
+#define ISA_NAMES_TABLE_END
+#define ISA_NAMES_TABLE_ENTRY(name, feature, priority, option) \
+ assert (!!has_feature (feature) == !!__builtin_cpu_supports (name));
+#include "../../../common/config/i386/i386-isas.h"
}
static int
check_detailed ()
{
- unsigned int eax, ebx, ecx, edx;
-
- int max_level;
- unsigned int vendor;
- unsigned int model, family, brand_id;
- unsigned int extended_model, extended_family;
-
- /* Assume cpuid insn present. Run in level 0 to get vendor id. */
- if (!__get_cpuid_output (0, &eax, &ebx, &ecx, &edx))
- return 0;
+ struct __processor_model cpu_model = { 0 };
+ struct __processor_model2 cpu_model2 = { 0 };
+ unsigned int cpu_features2[SIZE_OF_CPU_FEATURES] = { 0 };
- vendor = ebx;
- max_level = eax;
-
- if (max_level < 1)
- return 0;
-
- if (!__get_cpuid_output (1, &eax, &ebx, &ecx, &edx))
+ if (cpu_indicator_init (&cpu_model, &cpu_model2, cpu_features2) != 0)
return 0;
- model = (eax >> 4) & 0x0f;
- family = (eax >> 8) & 0x0f;
- brand_id = ebx & 0xff;
- extended_model = (eax >> 12) & 0xf0;
- extended_family = (eax >> 20) & 0xff;
+ check_features (&cpu_model, cpu_features2);
- if (vendor == signature_INTEL_ebx)
+ switch (cpu_model.__cpu_vendor)
{
+ case VENDOR_INTEL:
assert (__builtin_cpu_is ("intel"));
- /* Adjust family and model for Intel CPUs. */
- if (family == 0x0f)
- {
- family += extended_family;
- model += extended_model;
- }
- else if (family == 0x06)
- model += extended_model;
- check_intel_cpu_model (family, model, brand_id);
- check_features (ecx, edx, max_level);
- }
- else if (vendor == signature_AMD_ebx)
- {
+ get_intel_cpu (&cpu_model, &cpu_model2, cpu_features2);
+ break;
+ case VENDOR_AMD:
assert (__builtin_cpu_is ("amd"));
- /* Adjust model and family for AMD CPUS. */
- if (family == 0x0f)
- {
- family += extended_family;
- model += (extended_model << 4);
- }
- check_amd_cpu_model (family, model);
- check_features (ecx, edx, max_level);
+ get_amd_cpu (&cpu_model, &cpu_model2, cpu_features2);
+ break;
+ default:
+ break;
}
return 0;
diff --git a/gcc/testsuite/gcc.target/i386/endbr_immediate.c b/gcc/testsuite/gcc.target/i386/endbr_immediate.c
new file mode 100644
index 00000000000..3015512aa0e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/endbr_immediate.c
@@ -0,0 +1,198 @@
+/* PR target/96350 */
+/* { dg-do compile } */
+/* { dg-options "-fcf-protection -O2" } */
+/* { dg-final { scan-assembler-not "$-81915917" { target { ia32 } } } } */
+/* { dg-final { scan-assembler-not "$-98693133" { target { ! ia32 } } } } *
+/* { dg-final { scan-assembler-not "$-423883778574778368" { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler "\[ \t\]*-81915917" { target { ia32 } } } } */
+/* { dg-final { scan-assembler "\[ \t\]*-98693133" { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler "\[ \t\]*-423883778574778368" { target { ! ia32 } } } } */
+
+
+#ifdef __x86_64__
+#define ENDBR_IMMEDIATE 0xfa1e0ff3
+#define EXTEND_ENDBR_IMMEDIATE 0xfa1e0ff300000000
+#else
+#define ENDBR_IMMEDIATE 0xfb1e0ff3
+#define EXTEND_ENDBR_IMMEDIATE 0xfffb1e0ff300
+#endif
+
+int
+foo (int a)
+{
+ return a + ENDBR_IMMEDIATE;
+}
+
+int
+foo2 (int a)
+{
+ return a - ENDBR_IMMEDIATE;
+}
+
+int
+foo3 (int a)
+{
+ return a * ENDBR_IMMEDIATE;
+}
+
+int
+foo4 (int a)
+{
+ return a | ENDBR_IMMEDIATE;
+}
+
+int
+foo5 (int a)
+{
+ return a ^ ENDBR_IMMEDIATE;
+}
+
+int
+foo6 (int a)
+{
+ return a & ENDBR_IMMEDIATE;
+}
+
+int
+foo7 (int a)
+{
+ return a > ENDBR_IMMEDIATE;
+}
+
+int
+foo8 (int a)
+{
+ return ENDBR_IMMEDIATE;
+}
+
+int
+foo9 (int* p)
+{
+ return *(p + ENDBR_IMMEDIATE);
+}
+
+int
+foo10 (int* p)
+{
+ return *(int*) ENDBR_IMMEDIATE;
+}
+
+long long
+foo11 (long long a)
+{
+ return a + EXTEND_ENDBR_IMMEDIATE;
+}
+
+long long
+foo12 (long long a)
+{
+ return a - EXTEND_ENDBR_IMMEDIATE;
+}
+
+long long
+foo13 (long long a)
+{
+ return a * EXTEND_ENDBR_IMMEDIATE;
+}
+
+long long
+foo14 (long long a)
+{
+ return a | EXTEND_ENDBR_IMMEDIATE;
+}
+
+long long
+foo15 (long long a)
+{
+ return a ^ EXTEND_ENDBR_IMMEDIATE;
+}
+
+long long
+foo16 (long long a)
+{
+ return a & EXTEND_ENDBR_IMMEDIATE;
+}
+
+long long
+foo17 (long long a)
+{
+ return a > EXTEND_ENDBR_IMMEDIATE;
+}
+
+long long
+foo18 (long long a)
+{
+ return EXTEND_ENDBR_IMMEDIATE;
+}
+
+long long
+foo19 (long long* p)
+{
+ return *(p + EXTEND_ENDBR_IMMEDIATE);
+}
+
+long long
+foo20 (long long* p)
+{
+ return *(long long*) EXTEND_ENDBR_IMMEDIATE;
+}
+
+long long
+foo21 (int a)
+{
+ return a + ENDBR_IMMEDIATE;
+}
+
+long long
+foo22 (int a)
+{
+ return a - ENDBR_IMMEDIATE;
+}
+
+long long
+foo23 (long long a)
+{
+ return a * ENDBR_IMMEDIATE;
+}
+
+long long
+foo24 (int a)
+{
+ return a | ENDBR_IMMEDIATE;
+}
+
+long long
+foo25 (int a)
+{
+ return a ^ ENDBR_IMMEDIATE;
+}
+
+long long
+foo26 (int a)
+{
+ return a & ENDBR_IMMEDIATE;
+}
+
+long long
+foo27 (int a)
+{
+ return a > ENDBR_IMMEDIATE;
+}
+
+long long
+foo28 (int a)
+{
+ return ENDBR_IMMEDIATE;
+}
+
+long long
+foo29 (int* p)
+{
+ return *(p + ENDBR_IMMEDIATE);
+}
+
+long long
+foo30 (int* p)
+{
+ return *(long long*) ENDBR_IMMEDIATE;
+}
diff --git a/gcc/testsuite/gcc.target/i386/fma_double_1.c b/gcc/testsuite/gcc.target/i386/fma_double_1.c
index c3aa3e83c02..767ee5ca63e 100644
--- a/gcc/testsuite/gcc.target/i386/fma_double_1.c
+++ b/gcc/testsuite/gcc.target/i386/fma_double_1.c
@@ -8,11 +8,9 @@
#include "fma_1.h"
-/* { dg-final { scan-assembler-times "vfmadd132sd" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd132sd" 8 } } */
/* { dg-final { scan-assembler-times "vfmadd231sd" 4 } } */
-/* { dg-final { scan-assembler-times "vfmsub132sd" 4 } } */
+/* { dg-final { scan-assembler-times "vfmsub132sd" 8 } } */
/* { dg-final { scan-assembler-times "vfmsub231sd" 4 } } */
-/* { dg-final { scan-assembler-times "vfnmadd132sd" 4 } } */
/* { dg-final { scan-assembler-times "vfnmadd231sd" 4 } } */
-/* { dg-final { scan-assembler-times "vfnmsub132sd" 4 } } */
/* { dg-final { scan-assembler-times "vfnmsub231sd" 4 } } */
diff --git a/gcc/testsuite/gcc.target/i386/fma_double_2.c b/gcc/testsuite/gcc.target/i386/fma_double_2.c
index 843eff0a158..f15fb3b2cfa 100644
--- a/gcc/testsuite/gcc.target/i386/fma_double_2.c
+++ b/gcc/testsuite/gcc.target/i386/fma_double_2.c
@@ -8,7 +8,7 @@
#include "fma_2.h"
-/* { dg-final { scan-assembler-times "vfmadd132sd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub132sd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd132sd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub132sd" 8 } } */
+/* { dg-final { scan-assembler-times "vfmadd132sd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub132sd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd132sd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub132sd" 4 } } */
diff --git a/gcc/testsuite/gcc.target/i386/fma_double_3.c b/gcc/testsuite/gcc.target/i386/fma_double_3.c
index 3a04777c6bf..6b67774ca91 100644
--- a/gcc/testsuite/gcc.target/i386/fma_double_3.c
+++ b/gcc/testsuite/gcc.target/i386/fma_double_3.c
@@ -8,7 +8,7 @@
#include "fma_3.h"
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[132\]+sd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[132\]+sd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[132\]+sd" 8 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[132\]+sd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[132\]+sd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[132\]+sd" 4 } } */
diff --git a/gcc/testsuite/gcc.target/i386/fma_double_4.c b/gcc/testsuite/gcc.target/i386/fma_double_4.c
index 51fc111adb2..267f6fd2d16 100644
--- a/gcc/testsuite/gcc.target/i386/fma_double_4.c
+++ b/gcc/testsuite/gcc.target/i386/fma_double_4.c
@@ -8,7 +8,7 @@
#include "fma_4.h"
-/* { dg-final { scan-assembler-times "vfmadd132sd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub132sd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd132sd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub132sd" 8 } } */
+/* { dg-final { scan-assembler-times "vfmadd132sd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub132sd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd132sd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub132sd" 4 } } */
diff --git a/gcc/testsuite/gcc.target/i386/fma_double_5.c b/gcc/testsuite/gcc.target/i386/fma_double_5.c
index 640b552b0f0..fd7fcabe5b5 100644
--- a/gcc/testsuite/gcc.target/i386/fma_double_5.c
+++ b/gcc/testsuite/gcc.target/i386/fma_double_5.c
@@ -8,7 +8,7 @@
#include "fma_5.h"
-/* { dg-final { scan-assembler-times "vfmadd\[132\]+sd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[132\]+sd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[132\]+sd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[132\]+sd" 8 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[132\]+sd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[132\]+sd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[132\]+sd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[132\]+sd" 4 } } */
diff --git a/gcc/testsuite/gcc.target/i386/fma_double_6.c b/gcc/testsuite/gcc.target/i386/fma_double_6.c
index 7b75a224f11..f7ab1ce5b75 100644
--- a/gcc/testsuite/gcc.target/i386/fma_double_6.c
+++ b/gcc/testsuite/gcc.target/i386/fma_double_6.c
@@ -8,7 +8,7 @@
#include "fma_6.h"
-/* { dg-final { scan-assembler-times "vfmadd132sd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub132sd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd132sd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub132sd" 8 } } */
+/* { dg-final { scan-assembler-times "vfmadd132sd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub132sd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd132sd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub132sd" 4 } } */
diff --git a/gcc/testsuite/gcc.target/i386/fma_float_1.c b/gcc/testsuite/gcc.target/i386/fma_float_1.c
index 67b1f3fe7cb..a4ac2cbbe00 100644
--- a/gcc/testsuite/gcc.target/i386/fma_float_1.c
+++ b/gcc/testsuite/gcc.target/i386/fma_float_1.c
@@ -8,11 +8,9 @@
#include "fma_1.h"
-/* { dg-final { scan-assembler-times "vfmadd132ss" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd132ss" 8 } } */
/* { dg-final { scan-assembler-times "vfmadd231ss" 4 } } */
-/* { dg-final { scan-assembler-times "vfmsub132ss" 4 } } */
+/* { dg-final { scan-assembler-times "vfmsub132ss" 8 } } */
/* { dg-final { scan-assembler-times "vfmsub231ss" 4 } } */
-/* { dg-final { scan-assembler-times "vfnmadd132ss" 4 } } */
/* { dg-final { scan-assembler-times "vfnmadd231ss" 4 } } */
-/* { dg-final { scan-assembler-times "vfnmsub132ss" 4 } } */
/* { dg-final { scan-assembler-times "vfnmsub231ss" 4 } } */
diff --git a/gcc/testsuite/gcc.target/i386/fma_float_2.c b/gcc/testsuite/gcc.target/i386/fma_float_2.c
index a54644d0c70..a7509116b81 100644
--- a/gcc/testsuite/gcc.target/i386/fma_float_2.c
+++ b/gcc/testsuite/gcc.target/i386/fma_float_2.c
@@ -8,7 +8,7 @@
#include "fma_2.h"
-/* { dg-final { scan-assembler-times "vfmadd132ss" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub132ss" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd132ss" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub132ss" 8 } } */
+/* { dg-final { scan-assembler-times "vfmadd132ss" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub132ss" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd132ss" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub132ss" 4 } } */
diff --git a/gcc/testsuite/gcc.target/i386/fma_float_3.c b/gcc/testsuite/gcc.target/i386/fma_float_3.c
index 7986ce4ee76..d88a3bfcd25 100644
--- a/gcc/testsuite/gcc.target/i386/fma_float_3.c
+++ b/gcc/testsuite/gcc.target/i386/fma_float_3.c
@@ -8,7 +8,7 @@
#include "fma_3.h"
-/* { dg-final { scan-assembler-times "vfmadd\[132\]+ss" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[132\]+ss" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[132\]+ss" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[132\]+ss" 8 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[132\]+ss" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[132\]+ss" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[132\]+ss" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[132\]+ss" 4 } } */
diff --git a/gcc/testsuite/gcc.target/i386/fma_float_4.c b/gcc/testsuite/gcc.target/i386/fma_float_4.c
index d9689d9a7af..cb1a81cbb26 100644
--- a/gcc/testsuite/gcc.target/i386/fma_float_4.c
+++ b/gcc/testsuite/gcc.target/i386/fma_float_4.c
@@ -8,7 +8,7 @@
#include "fma_4.h"
-/* { dg-final { scan-assembler-times "vfmadd132ss" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub132ss" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd132ss" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub132ss" 8 } } */
+/* { dg-final { scan-assembler-times "vfmadd132ss" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub132ss" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd132ss" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub132ss" 4 } } */
diff --git a/gcc/testsuite/gcc.target/i386/fma_float_5.c b/gcc/testsuite/gcc.target/i386/fma_float_5.c
index 2105ae627f0..3a62590d2a2 100644
--- a/gcc/testsuite/gcc.target/i386/fma_float_5.c
+++ b/gcc/testsuite/gcc.target/i386/fma_float_5.c
@@ -8,7 +8,7 @@
#include "fma_5.h"
-/* { dg-final { scan-assembler-times "vfmadd\[132\]+ss" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[132\]+ss" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[132\]+ss" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[132\]+ss" 8 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[132\]+ss" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[132\]+ss" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[132\]+ss" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[132\]+ss" 4 } } */
diff --git a/gcc/testsuite/gcc.target/i386/fma_float_6.c b/gcc/testsuite/gcc.target/i386/fma_float_6.c
index c7580736834..30d8283bde3 100644
--- a/gcc/testsuite/gcc.target/i386/fma_float_6.c
+++ b/gcc/testsuite/gcc.target/i386/fma_float_6.c
@@ -8,7 +8,7 @@
#include "fma_6.h"
-/* { dg-final { scan-assembler-times "vfmadd132ss" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub132ss" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd132ss" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub132ss" 8 } } */
+/* { dg-final { scan-assembler-times "vfmadd132ss" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub132ss" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd132ss" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub132ss" 4 } } */
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-56.inc b/gcc/testsuite/gcc.target/i386/funcspec-56.inc
index 200d27220df..94ffbb64c75 100644
--- a/gcc/testsuite/gcc.target/i386/funcspec-56.inc
+++ b/gcc/testsuite/gcc.target/i386/funcspec-56.inc
@@ -66,6 +66,11 @@ extern void test_clwb (void) __attribute__((__target__("clwb")));
extern void test_cld (void) __attribute__((__target__("cld")));
extern void test_recip (void) __attribute__((__target__("recip")));
+extern void test_serialize (void) __attribute__((__target__("serialize")));
+extern void test_tsxldtrk (void) __attribute__((__target__("tsxldtrk")));
+extern void test_enqcmd (void) __attribute__((__target__("enqcmd")));
+extern void test_avx512bf16 (void) __attribute__((__target__("avx512bf16")));
+extern void test_avx512vp2intersect (void) __attribute__((__target__("avx512vp2intersect")));
extern void test_no_sgx (void) __attribute__((__target__("no-sgx")));
extern void test_no_avx5124fmaps(void) __attribute__((__target__("no-avx5124fmaps")));
@@ -133,6 +138,11 @@ extern void test_no_clwb (void) __attribute__((__target__("no-clwb")));
extern void test_no_cld (void) __attribute__((__target__("no-cld")));
extern void test_no_recip (void) __attribute__((__target__("no-recip")));
+extern void test_no_serialize (void) __attribute__((__target__("no-serialize")));
+extern void test_no_tsxldtrk (void) __attribute__((__target__("no-tsxldtrk")));
+extern void test_no_enqcmd (void) __attribute__((__target__("no-enqcmd")));
+extern void test_no_avx512bf16 (void) __attribute__((__target__("no-avx512bf16")));
+extern void test_no_avx512vp2intersect (void) __attribute__((__target__("no-avx512vp2intersect")));
extern void test_arch_nocona (void) __attribute__((__target__("arch=nocona")));
extern void test_arch_core2 (void) __attribute__((__target__("arch=core2")));
@@ -153,6 +163,8 @@ extern void test_arch_icelake_server (void) __attribute__((__target__("arch=icel
extern void test_arch_cascadelake (void) __attribute__((__target__("arch=cascadelake")));
extern void test_arch_tigerlake (void) __attribute__((__target__("arch=tigerlake")));
extern void test_arch_cooperlake (void) __attribute__((__target__("arch=cooperlake")));
+extern void test_arch_sapphirerapids (void) __attribute__((__target__("arch=sapphirerapids")));
+extern void test_arch_alderlake (void) __attribute__((__target__("arch=alderlake")));
extern void test_arch_k8 (void) __attribute__((__target__("arch=k8")));
extern void test_arch_k8_sse3 (void) __attribute__((__target__("arch=k8-sse3")));
extern void test_arch_opteron (void) __attribute__((__target__("arch=opteron")));
diff --git a/gcc/testsuite/gcc.target/i386/l_fma_double_1.c b/gcc/testsuite/gcc.target/i386/l_fma_double_1.c
index aa7c1307238..5089874faa5 100644
--- a/gcc/testsuite/gcc.target/i386/l_fma_double_1.c
+++ b/gcc/testsuite/gcc.target/i386/l_fma_double_1.c
@@ -11,11 +11,11 @@ typedef double adouble __attribute__((aligned(sizeof (double))));
#include "l_fma_1.h"
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 32 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 16 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 16 } } */
diff --git a/gcc/testsuite/gcc.target/i386/l_fma_double_2.c b/gcc/testsuite/gcc.target/i386/l_fma_double_2.c
index c59a89156bc..e4696204299 100644
--- a/gcc/testsuite/gcc.target/i386/l_fma_double_2.c
+++ b/gcc/testsuite/gcc.target/i386/l_fma_double_2.c
@@ -11,11 +11,11 @@ typedef double adouble __attribute__((aligned(sizeof (double))));
#include "l_fma_2.h"
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 32 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 16 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 16 } } */
diff --git a/gcc/testsuite/gcc.target/i386/l_fma_double_3.c b/gcc/testsuite/gcc.target/i386/l_fma_double_3.c
index c508d64d2e7..df986d0a633 100644
--- a/gcc/testsuite/gcc.target/i386/l_fma_double_3.c
+++ b/gcc/testsuite/gcc.target/i386/l_fma_double_3.c
@@ -11,11 +11,11 @@ typedef double adouble __attribute__((aligned(sizeof (double))));
#include "l_fma_3.h"
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 32 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 16 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 16 } } */
diff --git a/gcc/testsuite/gcc.target/i386/l_fma_double_4.c b/gcc/testsuite/gcc.target/i386/l_fma_double_4.c
index fec33e490af..ae065590f62 100644
--- a/gcc/testsuite/gcc.target/i386/l_fma_double_4.c
+++ b/gcc/testsuite/gcc.target/i386/l_fma_double_4.c
@@ -11,11 +11,11 @@ typedef double adouble __attribute__((aligned(sizeof (double))));
#include "l_fma_4.h"
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 32 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 16 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 16 } } */
diff --git a/gcc/testsuite/gcc.target/i386/l_fma_double_5.c b/gcc/testsuite/gcc.target/i386/l_fma_double_5.c
index 8bcfe4e68db..5d31abaa5a7 100644
--- a/gcc/testsuite/gcc.target/i386/l_fma_double_5.c
+++ b/gcc/testsuite/gcc.target/i386/l_fma_double_5.c
@@ -11,11 +11,11 @@ typedef double adouble __attribute__((aligned(sizeof (double))));
#include "l_fma_5.h"
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 32 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 16 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 16 } } */
diff --git a/gcc/testsuite/gcc.target/i386/l_fma_double_6.c b/gcc/testsuite/gcc.target/i386/l_fma_double_6.c
index 15da66b44cc..ff857fb02f1 100644
--- a/gcc/testsuite/gcc.target/i386/l_fma_double_6.c
+++ b/gcc/testsuite/gcc.target/i386/l_fma_double_6.c
@@ -11,11 +11,11 @@ typedef double adouble __attribute__((aligned(sizeof (double))));
#include "l_fma_6.h"
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 32 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 16 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 16 } } */
diff --git a/gcc/testsuite/gcc.target/i386/l_fma_float_1.c b/gcc/testsuite/gcc.target/i386/l_fma_float_1.c
index 29eb77fc162..daef8767a5d 100644
--- a/gcc/testsuite/gcc.target/i386/l_fma_float_1.c
+++ b/gcc/testsuite/gcc.target/i386/l_fma_float_1.c
@@ -10,11 +10,11 @@
#include "l_fma_1.h"
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 64 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 32 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 32 } } */
diff --git a/gcc/testsuite/gcc.target/i386/l_fma_float_2.c b/gcc/testsuite/gcc.target/i386/l_fma_float_2.c
index 2943b2c68b2..ffa5c6f1b39 100644
--- a/gcc/testsuite/gcc.target/i386/l_fma_float_2.c
+++ b/gcc/testsuite/gcc.target/i386/l_fma_float_2.c
@@ -10,11 +10,11 @@
#include "l_fma_2.h"
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 64 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 32 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 32 } } */
diff --git a/gcc/testsuite/gcc.target/i386/l_fma_float_3.c b/gcc/testsuite/gcc.target/i386/l_fma_float_3.c
index c144dc1861a..a05ef5912f4 100644
--- a/gcc/testsuite/gcc.target/i386/l_fma_float_3.c
+++ b/gcc/testsuite/gcc.target/i386/l_fma_float_3.c
@@ -10,11 +10,11 @@
#include "l_fma_3.h"
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 64 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 32 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 32 } } */
diff --git a/gcc/testsuite/gcc.target/i386/l_fma_float_4.c b/gcc/testsuite/gcc.target/i386/l_fma_float_4.c
index a940dfd72f9..b0a37baafeb 100644
--- a/gcc/testsuite/gcc.target/i386/l_fma_float_4.c
+++ b/gcc/testsuite/gcc.target/i386/l_fma_float_4.c
@@ -10,11 +10,11 @@
#include "l_fma_4.h"
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 64 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 32 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 32 } } */
diff --git a/gcc/testsuite/gcc.target/i386/l_fma_float_5.c b/gcc/testsuite/gcc.target/i386/l_fma_float_5.c
index e7a12d47ea5..598275c54af 100644
--- a/gcc/testsuite/gcc.target/i386/l_fma_float_5.c
+++ b/gcc/testsuite/gcc.target/i386/l_fma_float_5.c
@@ -10,11 +10,11 @@
#include "l_fma_5.h"
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 64 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 32 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 32 } } */
diff --git a/gcc/testsuite/gcc.target/i386/l_fma_float_6.c b/gcc/testsuite/gcc.target/i386/l_fma_float_6.c
index 82397a9d04f..1e7a2162c07 100644
--- a/gcc/testsuite/gcc.target/i386/l_fma_float_6.c
+++ b/gcc/testsuite/gcc.target/i386/l_fma_float_6.c
@@ -10,11 +10,11 @@
#include "l_fma_6.h"
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 64 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 32 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 32 } } */
diff --git a/gcc/testsuite/gcc.target/i386/memcpy-pr95886.c b/gcc/testsuite/gcc.target/i386/memcpy-pr95886.c
new file mode 100644
index 00000000000..0699146296a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/memcpy-pr95886.c
@@ -0,0 +1,107 @@
+/* PR middle-end/95886 - suboptimal memcpy with embedded zero bytes
+ { dg-do compile { target { ! ia32 } } }
+ { dg-options "-O2 -Wall -fdump-rtl-expand" } */
+
+const char a1234567890[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+
+void cpy_123456789 (void *d)
+{
+ /* Expands into:
+ movabsq $578437695752307201, %rax
+ movb $9, 8(%rdi)
+ movq %rax, (%rdi) */
+ __builtin_memcpy (d, a1234567890, 9);
+}
+
+const char a1234567800[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 0 };
+
+void cpy_1234567800 (void *d)
+{
+ /* Expands into:
+ movabsq $578437695752307201, %rax
+ movb $0, 8(%rdi)
+ movq %rax, (%rdi) */
+ __builtin_memcpy (d, a1234567800, 9);
+}
+
+/* { dg-final { scan-rtl-dump-times "const_int 578437695752307201" 2 "expand"} } */
+
+
+const char a0234567890[10] = { 0, 2, 3, 4, 5, 6, 7, 8, 9 };
+
+void cpy_023456789 (void *d)
+{
+ __builtin_memcpy (d, a0234567890, 9);
+}
+
+/* { dg-final { scan-rtl-dump-times "const_int 578437695752307200" 1 "expand"} } */
+
+
+const char a1034567890[10] = { 1, 0, 3, 4, 5, 6, 7, 8, 9 };
+
+void cpy_103456789 (void *d)
+{
+ __builtin_memcpy (d, a1034567890, 9);
+}
+
+/* { dg-final { scan-rtl-dump-times "const_int 578437695752306689" 1 "expand"} } */
+
+
+const char a1204567890[10] = { 1, 2, 0, 4, 5, 6, 7, 8, 9 };
+
+void cpy_120456789 (void *d)
+{
+ __builtin_memcpy (d, a1204567890, 9);
+}
+
+/* { dg-final { scan-rtl-dump-times "const_int 578437695752110593" 1 "expand"} } */
+
+
+const char a1230567890[10] = { 1, 2, 3, 0, 5, 6, 7, 8, 9 };
+
+void cpy_123056789 (void *d)
+{
+ __builtin_memcpy (d, a1230567890, 9);
+}
+
+/* { dg-final { scan-rtl-dump-times "const_int 578437695685198337" 1 "expand"} } */
+
+
+const char a1234067890[10] = { 1, 2, 3, 4, 0, 6, 7, 8, 9 };
+
+void cpy_123406789 (void *d)
+{
+ __builtin_memcpy (d, a1234067890, 9);
+}
+
+/* { dg-final { scan-rtl-dump-times "const_int 578437695685198337" 1 "expand"} } */
+
+
+const char a1234507890[10] = { 1, 2, 3, 4, 5, 0, 7, 8, 9 };
+
+void cpy_123450789 (void *d)
+{
+ __builtin_memcpy (d, a1234507890, 9);
+}
+
+/* { dg-final { scan-rtl-dump-times "const_int 578431098682540545" 1 "expand"} } */
+
+
+const char a1234560890[10] = { 1, 2, 3, 4, 5, 6, 0, 8, 9 };
+
+void cpy_123456089 (void *d)
+{
+ __builtin_memcpy (d, a1234560890, 9);
+}
+
+/* { dg-final { scan-rtl-dump-times "const_int 576467370915332609" 1 "expand"} } */
+
+
+const char a1234567090[10] = { 1, 2, 3, 4, 5, 6, 7, 0, 9 };
+
+void cpy_123456709 (void *d)
+{
+ __builtin_memcpy (d, a1234567090, 9);
+}
+
+/* { dg-final { scan-rtl-dump-times "const_int 1976943448883713" 1 "expand"} } */
diff --git a/gcc/testsuite/gcc.target/i386/minmax-10.c b/gcc/testsuite/gcc.target/i386/minmax-10.c
new file mode 100644
index 00000000000..b044462c5a9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/minmax-10.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#define max(a,b) (((a) > (b))? (a) : (b))
+#define min(a,b) (((a) < (b))? (a) : (b))
+
+int smax1(int x)
+{
+ return max(x,1);
+}
+
+int smin1(int x)
+{
+ return min(x,1);
+}
+
+int smaxm1(int x)
+{
+ return max(x,-1);
+}
+
+int sminm1(int x)
+{
+ return min(x,-1);
+}
+
+unsigned int umax1(unsigned int x)
+{
+ return max(x,1);
+}
+
+unsigned int umin1(unsigned int x)
+{
+ return min(x,1);
+}
+
+/* { dg-final { scan-assembler-times "test" 6 } } */
+/* { dg-final { scan-assembler-not "cmp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/minmax-11.c b/gcc/testsuite/gcc.target/i386/minmax-11.c
new file mode 100644
index 00000000000..a8c2df54754
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/minmax-11.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-reassoc" } */
+
+#define max(a,b) (((a) > (b))? (a) : (b))
+
+int foo(int x)
+{
+ int y = max(x,12345);
+ return max(y,87654);
+}
+
+/* { dg-final { scan-assembler-not "12345" } } */
diff --git a/gcc/testsuite/gcc.target/i386/minmax-12.c b/gcc/testsuite/gcc.target/i386/minmax-12.c
new file mode 100644
index 00000000000..40efe541e30
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/minmax-12.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O2 -march=i386 -mtune=generic" } */
+
+#define min(a,b) (((a) < (b))? (a) : (b))
+
+int foo(int x)
+{
+ return min(x,0);
+}
+
+signed char bar(signed char x)
+{
+ return min(x,0);
+}
+
+/* { dg-final { scan-assembler "cltd" } } */
+/* { dg-final { scan-assembler "sarb" } } */
diff --git a/gcc/testsuite/gcc.target/i386/minmax-8.c b/gcc/testsuite/gcc.target/i386/minmax-8.c
new file mode 100644
index 00000000000..1f7e4667e49
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/minmax-8.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+
+#define max(a,b) (((a) > (b))? (a) : (b))
+#define min(a,b) (((a) < (b))? (a) : (b))
+
+int foo(int x)
+{
+ return max(x,12345);
+}
+
+int bar(int x)
+{
+ return min(x,87654);
+}
+
+/* { dg-final { scan-assembler-times "12345" 1 } } */
+/* { dg-final { scan-assembler-times "87654" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/minmax-9.c b/gcc/testsuite/gcc.target/i386/minmax-9.c
new file mode 100644
index 00000000000..058d2a99350
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/minmax-9.c
@@ -0,0 +1,23 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-Os" } */
+
+#define max(a,b) (((a) > (b))? (a) : (b))
+#define min(a,b) (((a) < (b))? (a) : (b))
+
+int foo(int x)
+{
+ return max(x,0);
+}
+
+int bar(int x)
+{
+ return min(x,0);
+}
+
+unsigned int baz(unsigned int x)
+{
+ return min(x,1);
+}
+
+/* { dg-final { scan-assembler-times "xor" 3 } } */
+/* { dg-final { scan-assembler-times "test" 3 } } */
diff --git a/gcc/testsuite/gcc.target/i386/parity-3.c b/gcc/testsuite/gcc.target/i386/parity-3.c
new file mode 100644
index 00000000000..6b72591aad1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/parity-3.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=core-avx2 -mno-popcnt" } */
+/* { dg-final { scan-assembler "setp" } } */
+/* { dg-final { scan-assembler "jnp" } } */
+/* { dg-final { scan-assembler "jp" } } */
+
+void dummy(void);
+
+int foo(unsigned int x)
+{
+ return !__builtin_parity(x);
+}
+
+void bar(unsigned int x)
+{
+ if (__builtin_parity(x))
+ dummy();
+}
+
+void baz(unsigned int x)
+{
+ if (!__builtin_parity(x))
+ dummy();
+}
diff --git a/gcc/testsuite/gcc.target/i386/parity-4.c b/gcc/testsuite/gcc.target/i386/parity-4.c
new file mode 100644
index 00000000000..48384c23ea1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/parity-4.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=core-avx2 -mno-popcnt" } */
+/* { dg-final { scan-assembler "setp" } } */
+/* { dg-final { scan-assembler "jnp" } } */
+/* { dg-final { scan-assembler "jp" } } */
+
+void dummy(void);
+
+int foo(unsigned long long x)
+{
+ return !__builtin_parityll(x);
+}
+
+void bar(unsigned long long x)
+{
+ if (__builtin_parityll(x))
+ dummy();
+}
+
+void baz(unsigned long long x)
+{
+ if (!__builtin_parityll(x))
+ dummy();
+}
diff --git a/gcc/testsuite/gcc.target/i386/parity-5.c b/gcc/testsuite/gcc.target/i386/parity-5.c
new file mode 100644
index 00000000000..d19ed265b61
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/parity-5.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=core-avx2" } */
+/* { dg-final { scan-assembler "popcnt" } } */
+/* { dg-final { scan-assembler "and" } } */
+
+int foo(unsigned int x)
+{
+ return __builtin_parity(x);
+}
diff --git a/gcc/testsuite/gcc.target/i386/parity-6.c b/gcc/testsuite/gcc.target/i386/parity-6.c
new file mode 100644
index 00000000000..33918e121d7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/parity-6.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=core-avx2" } */
+/* { dg-final { scan-assembler "popcnt" } } */
+/* { dg-final { scan-assembler "and" } } */
+
+int foo(unsigned long long x)
+{
+ return __builtin_parityll(x);
+}
diff --git a/gcc/testsuite/gcc.target/i386/parity-7.c b/gcc/testsuite/gcc.target/i386/parity-7.c
new file mode 100644
index 00000000000..ed9357f47db
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/parity-7.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=core-avx2 -mno-popcnt" } */
+/* { dg-additional-options "-mregparm=1" { target ia32 } } */
+/* { dg-final { scan-assembler-times "test" 2 } } */
+/* { dg-final { scan-assembler-not "shr" } } */
+
+int foo(unsigned char x)
+{
+ return __builtin_parity(x);
+}
+
+int bar(unsigned char x)
+{
+ return __builtin_parityll(x);
+}
diff --git a/gcc/testsuite/gcc.target/i386/parity-8.c b/gcc/testsuite/gcc.target/i386/parity-8.c
new file mode 100644
index 00000000000..a87845583ff
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/parity-8.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=core-avx2 -mno-popcnt" } */
+/* { dg-final { scan-assembler-not "shr" } } */
+
+int foo(unsigned short x)
+{
+ return __builtin_parity(x);
+}
+
+int bar(unsigned short x)
+{
+ return __builtin_parityll(x);
+}
diff --git a/gcc/testsuite/gcc.target/i386/parity-9.c b/gcc/testsuite/gcc.target/i386/parity-9.c
new file mode 100644
index 00000000000..9d6cfe26a24
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/parity-9.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=core-avx2" } */
+/* { dg-additional-options "-mregparm=1" { target ia32 } } */
+/* { dg-final { scan-assembler-not "popcnt" } } */
+/* { dg-final { scan-assembler-not "shr" } } */
+/* { dg-final { scan-assembler-times "jp" 2 } } */
+/* { dg-final { scan-assembler-times "jnp" 2 } } */
+
+void dummy(void);
+
+void pos8(unsigned char x)
+{
+ if (__builtin_parity(x))
+ dummy();
+}
+
+void neg8(unsigned char x)
+{
+ if (!__builtin_parity(x))
+ dummy();
+}
+
+void pos16(unsigned short x)
+{
+ if (__builtin_parity(x))
+ dummy();
+}
+
+void neg16(unsigned short x)
+{
+ if (!__builtin_parity(x))
+ dummy();
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr60473.c b/gcc/testsuite/gcc.target/i386/pr60473.c
new file mode 100644
index 00000000000..d81962e7b67
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr60473.c
@@ -0,0 +1,12 @@
+/* PR rtl-optimization/60473 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2" } */
+
+unsigned long long foo()
+{
+ unsigned long long h,l;
+ asm volatile ("rdtsc": "=a" (l), "=d" (h));
+ return l | (h << 32);
+}
+
+/* { dg-final { scan-assembler-not "mov" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr67609.c b/gcc/testsuite/gcc.target/i386/pr67609.c
index 518071bdd86..398cdba5d5f 100644
--- a/gcc/testsuite/gcc.target/i386/pr67609.c
+++ b/gcc/testsuite/gcc.target/i386/pr67609.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
/* { dg-require-effective-target lp64 } */
-/* { dg-final { scan-assembler "movdqa" } } */
+/* { dg-final { scan-assembler "movq\t%xmm0" } } */
#include <emmintrin.h>
__m128d reg;
diff --git a/gcc/testsuite/gcc.target/i386/pr70314.c b/gcc/testsuite/gcc.target/i386/pr70314.c
new file mode 100644
index 00000000000..aad8dd9b57e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70314.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-march=skylake-avx512 -O2" } */
+/* { dg-final { scan-assembler-times "cmp" 2 } } */
+/* { dg-final { scan-assembler-not "and" } } */
+
+typedef long vec __attribute__((vector_size(16)));
+vec f(vec x, vec y){
+ return (x < 5) & (y < 8);
+}
+
+/* On x86_64, currently
+ vpcmpq $2, .LC1(%rip), %xmm1, %k1
+ vpcmpq $2, .LC0(%rip), %xmm0, %k0{%k1}
+ vpmovm2q %k0, %xmm0
+*/
diff --git a/gcc/testsuite/gcc.target/i386/pr71321.c b/gcc/testsuite/gcc.target/i386/pr71321.c
index 86ad81250e6..24d144b2812 100644
--- a/gcc/testsuite/gcc.target/i386/pr71321.c
+++ b/gcc/testsuite/gcc.target/i386/pr71321.c
@@ -12,5 +12,4 @@ unsigned cvt_to_2digit_ascii(uint8_t i)
{
return cvt_to_2digit(i, 10) + 0x0a3030;
}
-/* { dg-final { scan-assembler-times "lea.\t\\(%\[0-9a-z\]+,%\[0-9a-z\]+,4" 3 } } */
-/* { dg-final { scan-assembler-times "lea.\t\\(%\[0-9a-z\]+,%\[0-9a-z\]+,8" 1 } } */
+/* { dg-final { scan-assembler-not "lea.*0" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr78904-1a.c b/gcc/testsuite/gcc.target/i386/pr78904-1a.c
new file mode 100644
index 00000000000..7746477d745
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78904-1a.c
@@ -0,0 +1,47 @@
+/* PR target/78904 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -masm=att" } */
+/* { dg-final { scan-assembler-not "movzbl" } } */
+/* { dg-final { scan-assembler-not "movb" } } */
+
+struct S1
+{
+ unsigned char pad1;
+ unsigned char val;
+};
+
+struct S1 test_and (struct S1 a, struct S1 b)
+{
+ a.val &= b.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]andb" } } */
+
+struct S1 test_or (struct S1 a, struct S1 b)
+{
+ a.val |= b.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]orb" } } */
+
+struct S1 test_xor (struct S1 a, struct S1 b)
+{
+ a.val ^= b.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]xorb" } } */
+
+struct S1 test_add (struct S1 a, struct S1 b)
+{
+ a.val += b.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]addb" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr78904-1b.c b/gcc/testsuite/gcc.target/i386/pr78904-1b.c
new file mode 100644
index 00000000000..20b677252ab
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78904-1b.c
@@ -0,0 +1,49 @@
+/* PR target/78904 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -masm=att" } */
+/* { dg-final { scan-assembler-not "movzbl" } } */
+/* { dg-final { scan-assembler-not "movb" } } */
+
+struct S1
+{
+ unsigned char pad1;
+ unsigned char val;
+ unsigned short pad2;
+ unsigned int pad3;
+};
+
+struct S1 test_and (struct S1 a, struct S1 b)
+{
+ a.val &= b.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]andb" } } */
+
+struct S1 test_or (struct S1 a, struct S1 b)
+{
+ a.val |= b.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]orb" } } */
+
+struct S1 test_xor (struct S1 a, struct S1 b)
+{
+ a.val ^= b.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]xorb" } } */
+
+struct S1 test_add (struct S1 a, struct S1 b)
+{
+ a.val += b.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]addb" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr78904-2a.c b/gcc/testsuite/gcc.target/i386/pr78904-2a.c
new file mode 100644
index 00000000000..41eaa259158
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78904-2a.c
@@ -0,0 +1,48 @@
+/* PR target/78904 */
+/* { dg-do compile } */
+/* { dg-require-effective-target nonpic } */
+/* { dg-options "-O2 -masm=att" } */
+
+struct S1
+{
+ unsigned char pad1;
+ unsigned char val;
+};
+
+extern struct S1 t;
+
+struct S1 test_and (struct S1 a)
+{
+ a.val &= t.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]andb\[ \t\]+t\[^\n\r]*, %.h" } } */
+
+struct S1 test_or (struct S1 a)
+{
+ a.val |= t.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]orb\[ \t\]+t\[^\n\r]*, %.h" } } */
+
+struct S1 test_xor (struct S1 a)
+{
+ a.val ^= t.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]xorb\[ \t\]+t\[^\n\r]*, %.h" } } */
+
+struct S1 test_add (struct S1 a)
+{
+ a.val += t.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]addb\[ \t\]+t\[^\n\r]*, %.h" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr78904-2b.c b/gcc/testsuite/gcc.target/i386/pr78904-2b.c
new file mode 100644
index 00000000000..23e975ac93e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78904-2b.c
@@ -0,0 +1,50 @@
+/* PR target/78904 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-require-effective-target nonpic } */
+/* { dg-options "-O2 -masm=att" } */
+
+struct S1
+{
+ unsigned char pad1;
+ unsigned char val;
+ unsigned short pad2;
+ unsigned int pad3;
+};
+
+extern struct S1 t;
+
+struct S1 test_and (struct S1 a)
+{
+ a.val &= t.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]andb\[ \t\]+t\[^\n\r]*, %.h" } } */
+
+struct S1 test_or (struct S1 a)
+{
+ a.val |= t.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]orb\[ \t\]+t\[^\n\r]*, %.h" } } */
+
+struct S1 test_xor (struct S1 a)
+{
+ a.val ^= t.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]xorb\[ \t\]+t\[^\n\r]*, %.h" } } */
+
+struct S1 test_add (struct S1 a)
+{
+ a.val += t.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]addb\[ \t\]+t\[^\n\r]*, %.h" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr78904-3a.c b/gcc/testsuite/gcc.target/i386/pr78904-3a.c
new file mode 100644
index 00000000000..2827b380b6c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78904-3a.c
@@ -0,0 +1,42 @@
+/* PR target/78904 */
+/* { dg-do assemble } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+struct S1
+{
+ unsigned char pad1;
+ unsigned char val;
+ unsigned short pad2;
+};
+
+extern struct S1 t[256];
+
+struct S1 test_and (struct S1 a, size_t i)
+{
+ a.val &= t[i].val;
+
+ return a;
+}
+
+struct S1 test_or (struct S1 a, size_t i)
+{
+ a.val |= t[i].val;
+
+ return a;
+}
+
+struct S1 test_xor (struct S1 a, size_t i)
+{
+ a.val ^= t[i].val;
+
+ return a;
+}
+
+struct S1 test_add (struct S1 a, size_t i)
+{
+ a.val += t[i].val;
+
+ return a;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr78904-3b.c b/gcc/testsuite/gcc.target/i386/pr78904-3b.c
new file mode 100644
index 00000000000..0c73cbc2ec9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78904-3b.c
@@ -0,0 +1,43 @@
+/* PR target/78904 */
+/* { dg-do assemble { target { ! ia32 } } } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+struct S1
+{
+ unsigned char pad1;
+ unsigned char val;
+ unsigned short pad2;
+ unsigned int pad3;
+};
+
+extern struct S1 t[256];
+
+struct S1 test_and (struct S1 a, size_t i)
+{
+ a.val &= t[i].val;
+
+ return a;
+}
+
+struct S1 test_or (struct S1 a, size_t i)
+{
+ a.val |= t[i].val;
+
+ return a;
+}
+
+struct S1 test_xor (struct S1 a, size_t i)
+{
+ a.val ^= t[i].val;
+
+ return a;
+}
+
+struct S1 test_add (struct S1 a, size_t i)
+{
+ a.val += t[i].val;
+
+ return a;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr78904-4a.c b/gcc/testsuite/gcc.target/i386/pr78904-4a.c
new file mode 100644
index 00000000000..5e6159a7648
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78904-4a.c
@@ -0,0 +1,21 @@
+/* PR target/78904 */
+/* { dg-do compile } */
+/* { dg-require-effective-target nonpic } */
+/* { dg-options "-O2 -masm=att" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+struct S1
+{
+ unsigned char pad1;
+ unsigned char val;
+};
+
+extern unsigned char t[256];
+
+void foo (struct S1 a, size_t i)
+{
+ t[i] = a.val;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]movb\[\t \]+%.h, t" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr78904-4b.c b/gcc/testsuite/gcc.target/i386/pr78904-4b.c
new file mode 100644
index 00000000000..ab7434f3de4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78904-4b.c
@@ -0,0 +1,23 @@
+/* PR target/78904 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-require-effective-target nonpic } */
+/* { dg-options "-O2 -masm=att" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+struct S1
+{
+ unsigned char pad1;
+ unsigned char val;
+ unsigned short pad2;
+ unsigned int pad3;
+};
+
+extern unsigned char t[256];
+
+void foo (struct S1 a, size_t i)
+{
+ t[i] = a.val;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]movb\[\t \]+%.h, t" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr78904-5a.c b/gcc/testsuite/gcc.target/i386/pr78904-5a.c
new file mode 100644
index 00000000000..d078d79b73a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78904-5a.c
@@ -0,0 +1,21 @@
+/* PR target/78904 */
+/* { dg-do assemble { target { ! ia32 } } } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+struct S1
+{
+ unsigned char pad1;
+ unsigned char val;
+};
+
+extern unsigned char t[256];
+
+void foo (struct S1 a, size_t i)
+{
+ register size_t _i __asm ("r10") = i;
+
+ asm volatile ("" : "+r" (_i));
+ t[_i] = a.val;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr78904-5b.c b/gcc/testsuite/gcc.target/i386/pr78904-5b.c
new file mode 100644
index 00000000000..9490030d772
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78904-5b.c
@@ -0,0 +1,23 @@
+/* PR target/78904 */
+/* { dg-do assemble { target { ! ia32 } } } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+struct S1
+{
+ unsigned char pad1;
+ unsigned char val;
+ unsigned short pad2;
+ unsigned int pad3;
+};
+
+extern unsigned char t[256];
+
+void foo (struct S1 a, size_t i)
+{
+ register size_t _i __asm ("r10") = i;
+
+ asm volatile ("" : "+r" (_i));
+ t[_i] = a.val;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr78904-6a.c b/gcc/testsuite/gcc.target/i386/pr78904-6a.c
new file mode 100644
index 00000000000..ab296a2e173
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78904-6a.c
@@ -0,0 +1,21 @@
+/* PR target/78904 */
+/* { dg-do compile } */
+/* { dg-require-effective-target nonpic } */
+/* { dg-options "-O2 -masm=att" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+struct S1
+{
+ char pad1;
+ char val;
+};
+
+extern char t[256];
+
+void foo (struct S1 a, size_t i)
+{
+ t[i] = a.val;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]movb\[\t \]*%.h, t" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr78904-6b.c b/gcc/testsuite/gcc.target/i386/pr78904-6b.c
new file mode 100644
index 00000000000..235bfe7d042
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78904-6b.c
@@ -0,0 +1,23 @@
+/* PR target/78904 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-require-effective-target nonpic } */
+/* { dg-options "-O2 -masm=att" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+struct S1
+{
+ char pad1;
+ char val;
+ short pad2;
+ int pad3;
+};
+
+extern char t[256];
+
+void foo (struct S1 a, size_t i)
+{
+ t[i] = a.val;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]movb\[\t \]*%.h, t" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr78967-1a.c b/gcc/testsuite/gcc.target/i386/pr78967-1a.c
new file mode 100644
index 00000000000..007c50646b6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78967-1a.c
@@ -0,0 +1,20 @@
+/* PR target/78967 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -masm=att" } */
+/* { dg-additional-options "-mregparm=3" { target ia32 } } */
+/* { dg-final { scan-assembler-not "movzbl" } } */
+
+struct S1
+{
+ unsigned char pad1;
+ unsigned char val;
+};
+
+struct S1 foo (struct S1 a, struct S1 b)
+{
+ a.val = b.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]movb\[ \t\]+%.h, %.h" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr78967-1b.c b/gcc/testsuite/gcc.target/i386/pr78967-1b.c
new file mode 100644
index 00000000000..7e7144379f3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78967-1b.c
@@ -0,0 +1,21 @@
+/* PR target/78967 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -masm=att" } */
+/* { dg-final { scan-assembler-not "movzbl" } } */
+
+struct S1
+{
+ unsigned char pad1;
+ unsigned char val;
+ unsigned short pad2;
+ unsigned int pad3;
+};
+
+struct S1 foo (struct S1 a, struct S1 b)
+{
+ a.val = b.val;
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]movb\[ \t\]+%.h, %.h" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr78967-2a.c b/gcc/testsuite/gcc.target/i386/pr78967-2a.c
new file mode 100644
index 00000000000..ce61cabf414
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78967-2a.c
@@ -0,0 +1,24 @@
+/* PR target/78967 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -masm=att" } */
+/* { dg-require-effective-target nonpic } */
+/* { dg-final { scan-assembler-not "movzbl" } } */
+
+typedef __SIZE_TYPE__ size_t;
+
+struct S1
+{
+ unsigned char pad1;
+ unsigned char val;
+};
+
+extern unsigned char t[256];
+
+struct S1 foo (struct S1 a, size_t i)
+{
+ a.val = t[i];
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]movb\[ \t\]+t\[^\n\r]*, %.h" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr78967-2b.c b/gcc/testsuite/gcc.target/i386/pr78967-2b.c
new file mode 100644
index 00000000000..ce38ac4d0bf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr78967-2b.c
@@ -0,0 +1,26 @@
+/* PR target/78967 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -masm=att" } */
+/* { dg-require-effective-target nonpic } */
+/* { dg-final { scan-assembler-not "movzbl" } } */
+
+typedef __SIZE_TYPE__ size_t;
+
+struct S1
+{
+ unsigned char pad1;
+ unsigned char val;
+ unsigned short pad2;
+ unsigned int pad3;
+};
+
+extern unsigned char t[256];
+
+struct S1 foo (struct S1 a, size_t i)
+{
+ a.val = t[i];
+
+ return a;
+}
+
+/* { dg-final { scan-assembler "\[ \t\]movb\[ \t\]+t\[^\n\r]*, %.h" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr88240.c b/gcc/testsuite/gcc.target/i386/pr88240.c
new file mode 100644
index 00000000000..5ee02f3193c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr88240.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -mno-sse" } */
+
+int flag;
+union { double f; unsigned long long i; } u;
+void __attribute__((noinline))
+init ()
+{
+ flag = 1;
+ u.i = 18442936822990639076ULL;
+}
+unsigned long long __attribute__((noinline))
+test ()
+{
+ if (flag)
+ return u.i;
+ else
+ return u.f;
+}
+int main()
+{
+ init ();
+ if (test () != 18442936822990639076ULL)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr88713-1.c b/gcc/testsuite/gcc.target/i386/pr88713-1.c
new file mode 100644
index 00000000000..26a0da57a41
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr88713-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast -mno-avx512f -mfma" } */
+
+extern float sqrtf (float);
+
+void
+rsqrt (float* restrict r, float* restrict a)
+{
+ for (int i = 0; i < 64; i++)
+ r[i] = sqrtf(a[i]);
+}
+
+/* { dg-final { scan-assembler "\tvfmadd\[123\]+ps" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr88713-2.c b/gcc/testsuite/gcc.target/i386/pr88713-2.c
new file mode 100644
index 00000000000..8b55dfcf924
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr88713-2.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast -march=skylake-avx512 -mno-fma" } */
+
+#include "pr88713-1.c"
+
+/* { dg-final { scan-assembler "\tvfmadd\[123\]+ps" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr88713-3.c b/gcc/testsuite/gcc.target/i386/pr88713-3.c
new file mode 100644
index 00000000000..85b6cf87a02
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr88713-3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast -mno-avx512er -march=skylake-avx512" } */
+
+#include <math.h>
+
+double square(double d[3], double rad)
+{
+ double res[3];
+
+ for (int i = 0; i < 3; i++)
+ {
+ res[i] = d[i] * d[i];
+ res[i] *= rad/sqrt(res[i]);
+ }
+
+ return res[0];
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr92645-4.c b/gcc/testsuite/gcc.target/i386/pr92645-4.c
index 788a97ed117..5d459040846 100644
--- a/gcc/testsuite/gcc.target/i386/pr92645-4.c
+++ b/gcc/testsuite/gcc.target/i386/pr92645-4.c
@@ -47,10 +47,10 @@ void f(char *dst, char *src, unsigned long n, unsigned c)
}
}
-/* { dg-final { scan-tree-dump-times "vec_unpack_lo" 3 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\(vector\\(16\\) short unsigned int\\)" 3 "optimized" } } */
/* We're missing an opportunity to, after later optimizations, combine
- a uniform CTOR with a vec_unpack_lo_expr to a CTOR on a converted
+ a uniform CTOR with a vector promotion to a CTOR on a promoted
element. */
-/* { dg-final { scan-tree-dump-times "vec_unpack_lo" 2 "optimized" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "\\(vector\\(16\\) short unsigned int\\)" 2 "optimized" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "VEC_PACK_TRUNC" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "BIT_FIELD_REF" 2 "optimized" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr92658-avx2.c b/gcc/testsuite/gcc.target/i386/pr92658-avx2.c
new file mode 100644
index 00000000000..21fa3e5530f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr92658-avx2.c
@@ -0,0 +1,192 @@
+/* PR target/92658 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -mavx2" } */
+
+typedef unsigned char v32qi __attribute__((vector_size (32)));
+typedef unsigned short v16hi __attribute__((vector_size (32)));
+typedef unsigned int v8si __attribute__((vector_size (32)));
+typedef unsigned long long v4di __attribute__((vector_size (32)));
+
+void
+foo_u8_u16 (v16hi * dst, v32qi * __restrict src)
+{
+ unsigned short tem[16];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ tem[8] = (*src)[8];
+ tem[9] = (*src)[9];
+ tem[10] = (*src)[10];
+ tem[11] = (*src)[11];
+ tem[12] = (*src)[12];
+ tem[13] = (*src)[13];
+ tem[14] = (*src)[14];
+ tem[15] = (*src)[15];
+ dst[0] = *(v16hi *) tem;
+}
+
+void
+bar_u8_u16 (v16hi * dst, v32qi src)
+{
+ unsigned short tem[16];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ tem[2] = src[2];
+ tem[3] = src[3];
+ tem[4] = src[4];
+ tem[5] = src[5];
+ tem[6] = src[6];
+ tem[7] = src[7];
+ tem[8] = src[8];
+ tem[9] = src[9];
+ tem[10] = src[10];
+ tem[11] = src[11];
+ tem[12] = src[12];
+ tem[13] = src[13];
+ tem[14] = src[14];
+ tem[15] = src[15];
+ dst[0] = *(v16hi *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxbw" 2 } } */
+
+void
+foo_u8_u32 (v8si * dst, v32qi * __restrict src)
+{
+ unsigned int tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ dst[0] = *(v8si *) tem;
+}
+
+void
+bar_u8_u32 (v8si * dst, v32qi src)
+{
+ unsigned int tem[8];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ tem[2] = src[2];
+ tem[3] = src[3];
+ tem[4] = src[4];
+ tem[5] = src[5];
+ tem[6] = src[6];
+ tem[7] = src[7];
+ dst[0] = *(v8si *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxbd" 2 } } */
+
+void
+foo_u8_u64 (v4di * dst, v32qi * __restrict src)
+{
+ unsigned long long tem[4];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ dst[0] = *(v4di *) tem;
+}
+
+void
+bar_u8_u64 (v4di * dst, v32qi src)
+{
+ unsigned long long tem[4];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ tem[2] = src[2];
+ tem[3] = src[3];
+ dst[0] = *(v4di *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxbq" 2 { xfail *-*-* } } } */
+
+void
+foo_u16_u32 (v8si * dst, v16hi * __restrict src)
+{
+ unsigned int tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ dst[0] = *(v8si *) tem;
+}
+
+void
+bar_u16_u32 (v8si * dst, v16hi src)
+{
+ unsigned int tem[8];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ tem[2] = src[2];
+ tem[3] = src[3];
+ tem[4] = src[4];
+ tem[5] = src[5];
+ tem[6] = src[6];
+ tem[7] = src[7];
+ dst[0] = *(v8si *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxwd" 2 } } */
+
+void
+foo_u16_u64 (v4di * dst, v16hi * __restrict src)
+{
+ unsigned long long tem[4];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ dst[0] = *(v4di *) tem;
+}
+
+void
+bar_u16_u64 (v4di * dst, v16hi src)
+{
+ unsigned long long tem[4];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ tem[2] = src[2];
+ tem[3] = src[3];
+ dst[0] = *(v4di *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxwq" 2 } } */
+
+void
+foo_u32_u64 (v4di * dst, v8si * __restrict src)
+{
+ unsigned long long tem[4];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ dst[0] = *(v4di *) tem;
+}
+
+void
+bar_u32_u64 (v4di * dst, v8si src)
+{
+ unsigned long long tem[4];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ tem[2] = src[2];
+ tem[3] = src[3];
+ dst[0] = *(v4di *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxdq" 2 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr92658-avx512bw-trunc.c b/gcc/testsuite/gcc.target/i386/pr92658-avx512bw-trunc.c
new file mode 100644
index 00000000000..1f5ea63b08a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr92658-avx512bw-trunc.c
@@ -0,0 +1,90 @@
+/* PR target/92658 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -mavx512bw -mavx512vl" } */
+
+typedef unsigned char v8qi __attribute__((vector_size (8)));
+typedef unsigned char v16qi __attribute__((vector_size (16)));
+typedef unsigned char v32qi __attribute__((vector_size (32)));
+typedef unsigned short v8hi __attribute__((vector_size (16)));
+typedef unsigned short v16hi __attribute__((vector_size (32)));
+typedef unsigned short v32hi __attribute__((vector_size (64)));
+
+
+void
+truncwb_512 (v32qi * dst, v32hi * __restrict src)
+{
+ unsigned char tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ tem[8] = (*src)[8];
+ tem[9] = (*src)[9];
+ tem[10] = (*src)[10];
+ tem[11] = (*src)[11];
+ tem[12] = (*src)[12];
+ tem[13] = (*src)[13];
+ tem[14] = (*src)[14];
+ tem[15] = (*src)[15];
+ tem[16] = (*src)[16];
+ tem[17] = (*src)[17];
+ tem[18] = (*src)[18];
+ tem[19] = (*src)[19];
+ tem[20] = (*src)[20];
+ tem[21] = (*src)[21];
+ tem[22] = (*src)[22];
+ tem[23] = (*src)[23];
+ tem[24] = (*src)[24];
+ tem[25] = (*src)[25];
+ tem[26] = (*src)[26];
+ tem[27] = (*src)[27];
+ tem[28] = (*src)[28];
+ tem[29] = (*src)[29];
+ tem[30] = (*src)[30];
+ tem[31] = (*src)[31];
+ dst[0] = *(v32qi *) tem;
+}
+
+void
+truncwb_256 (v16qi * dst, v16hi * __restrict src)
+{
+ unsigned char tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ tem[8] = (*src)[8];
+ tem[9] = (*src)[9];
+ tem[10] = (*src)[10];
+ tem[11] = (*src)[11];
+ tem[12] = (*src)[12];
+ tem[13] = (*src)[13];
+ tem[14] = (*src)[14];
+ tem[15] = (*src)[15];
+ dst[0] = *(v16qi *) tem;
+}
+
+void
+truncwb_128 (v16qi * dst, v8hi * __restrict src)
+{
+ unsigned char tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ dst[0] = *(v16qi *) tem;
+}
+
+/* { dg-final { scan-assembler-times "vpmovwb" 3 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr92658-avx512bw.c b/gcc/testsuite/gcc.target/i386/pr92658-avx512bw.c
new file mode 100644
index 00000000000..b1d54d24a81
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr92658-avx512bw.c
@@ -0,0 +1,280 @@
+/* PR target/92658 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -mavx512bw" } */
+
+typedef unsigned char v64qi __attribute__((vector_size (64)));
+typedef unsigned short v32hi __attribute__((vector_size (64)));
+typedef unsigned int v16si __attribute__((vector_size (64)));
+typedef unsigned long long v8di __attribute__((vector_size (64)));
+
+void
+foo_u8_u16 (v32hi * dst, v64qi * __restrict src)
+{
+ unsigned short tem[32];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ tem[8] = (*src)[8];
+ tem[9] = (*src)[9];
+ tem[10] = (*src)[10];
+ tem[11] = (*src)[11];
+ tem[12] = (*src)[12];
+ tem[13] = (*src)[13];
+ tem[14] = (*src)[14];
+ tem[15] = (*src)[15];
+ tem[16] = (*src)[16];
+ tem[17] = (*src)[17];
+ tem[18] = (*src)[18];
+ tem[19] = (*src)[19];
+ tem[20] = (*src)[20];
+ tem[21] = (*src)[21];
+ tem[22] = (*src)[22];
+ tem[23] = (*src)[23];
+ tem[24] = (*src)[24];
+ tem[25] = (*src)[25];
+ tem[26] = (*src)[26];
+ tem[27] = (*src)[27];
+ tem[28] = (*src)[28];
+ tem[29] = (*src)[29];
+ tem[30] = (*src)[30];
+ tem[31] = (*src)[31];
+ dst[0] = *(v32hi *) tem;
+}
+
+void
+bar_u8_u16 (v32hi * dst, v64qi src)
+{
+ unsigned short tem[32];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ tem[2] = src[2];
+ tem[3] = src[3];
+ tem[4] = src[4];
+ tem[5] = src[5];
+ tem[6] = src[6];
+ tem[7] = src[7];
+ tem[8] = src[8];
+ tem[9] = src[9];
+ tem[10] = src[10];
+ tem[11] = src[11];
+ tem[12] = src[12];
+ tem[13] = src[13];
+ tem[14] = src[14];
+ tem[15] = src[15];
+ tem[16] = src[16];
+ tem[17] = src[17];
+ tem[18] = src[18];
+ tem[19] = src[19];
+ tem[20] = src[20];
+ tem[21] = src[21];
+ tem[22] = src[22];
+ tem[23] = src[23];
+ tem[24] = src[24];
+ tem[25] = src[25];
+ tem[26] = src[26];
+ tem[27] = src[27];
+ tem[28] = src[28];
+ tem[29] = src[29];
+ tem[30] = src[30];
+ tem[31] = src[31];
+ dst[0] = *(v32hi *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxbw" 2 } } */
+
+void
+foo_u8_u32 (v16si * dst, v64qi * __restrict src)
+{
+ unsigned int tem[16];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ tem[8] = (*src)[8];
+ tem[9] = (*src)[9];
+ tem[10] = (*src)[10];
+ tem[11] = (*src)[11];
+ tem[12] = (*src)[12];
+ tem[13] = (*src)[13];
+ tem[14] = (*src)[14];
+ tem[15] = (*src)[15];
+ dst[0] = *(v16si *) tem;
+}
+
+void
+bar_u8_u32 (v16si * dst, v64qi src)
+{
+ unsigned int tem[16];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ tem[2] = src[2];
+ tem[3] = src[3];
+ tem[4] = src[4];
+ tem[5] = src[5];
+ tem[6] = src[6];
+ tem[7] = src[7];
+ tem[8] = src[8];
+ tem[9] = src[9];
+ tem[10] = src[10];
+ tem[11] = src[11];
+ tem[12] = src[12];
+ tem[13] = src[13];
+ tem[14] = src[14];
+ tem[15] = src[15];
+ dst[0] = *(v16si *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxbd" 2 } } */
+
+void
+foo_u8_u64 (v8di * dst, v64qi * __restrict src)
+{
+ unsigned long long tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ dst[0] = *(v8di *) tem;
+}
+
+void
+bar_u8_u64 (v8di * dst, v64qi src)
+{
+ unsigned long long tem[8];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ tem[2] = src[2];
+ tem[3] = src[3];
+ tem[4] = src[4];
+ tem[5] = src[5];
+ tem[6] = src[6];
+ tem[7] = src[7];
+ dst[0] = *(v8di *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxbq" 2 } } */
+
+void
+foo_u16_u32 (v16si * dst, v32hi * __restrict src)
+{
+ unsigned int tem[16];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ tem[8] = (*src)[8];
+ tem[9] = (*src)[9];
+ tem[10] = (*src)[10];
+ tem[11] = (*src)[11];
+ tem[12] = (*src)[12];
+ tem[13] = (*src)[13];
+ tem[14] = (*src)[14];
+ tem[15] = (*src)[15];
+ dst[0] = *(v16si *) tem;
+}
+
+void
+bar_u16_u32 (v16si * dst, v32hi src)
+{
+ unsigned int tem[16];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ tem[2] = src[2];
+ tem[3] = src[3];
+ tem[4] = src[4];
+ tem[5] = src[5];
+ tem[6] = src[6];
+ tem[7] = src[7];
+ tem[8] = src[8];
+ tem[9] = src[9];
+ tem[10] = src[10];
+ tem[11] = src[11];
+ tem[12] = src[12];
+ tem[13] = src[13];
+ tem[14] = src[14];
+ tem[15] = src[15];
+ dst[0] = *(v16si *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxwd" 2 } } */
+
+void
+foo_u16_u64 (v8di * dst, v32hi * __restrict src)
+{
+ unsigned long long tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ dst[0] = *(v8di *) tem;
+}
+
+void
+bar_u16_u64 (v8di * dst, v32hi src)
+{
+ unsigned long long tem[8];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ tem[2] = src[2];
+ tem[3] = src[3];
+ tem[4] = src[4];
+ tem[5] = src[5];
+ tem[6] = src[6];
+ tem[7] = src[7];
+ dst[0] = *(v8di *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxwq" 2 } } */
+
+void
+foo_u32_u64 (v8di * dst, v16si * __restrict src)
+{
+ unsigned long long tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ dst[0] = *(v8di *) tem;
+}
+
+void
+bar_u32_u64 (v8di * dst, v16si src)
+{
+ unsigned long long tem[8];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ tem[2] = src[2];
+ tem[3] = src[3];
+ tem[4] = src[4];
+ tem[5] = src[5];
+ tem[6] = src[6];
+ tem[7] = src[7];
+ dst[0] = *(v8di *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxdq" 2 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr92658-avx512f.c b/gcc/testsuite/gcc.target/i386/pr92658-avx512f.c
new file mode 100644
index 00000000000..2ba29074a81
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr92658-avx512f.c
@@ -0,0 +1,106 @@
+/* PR target/92658 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -mavx512f" } */
+
+typedef unsigned char v8qi __attribute__((vector_size (8)));
+typedef unsigned char v16qi __attribute__((vector_size (16)));
+typedef unsigned short v8hi __attribute__((vector_size (16)));
+typedef unsigned short v16hi __attribute__((vector_size (32)));
+typedef unsigned int v8si __attribute__((vector_size (32)));
+typedef unsigned int v16si __attribute__((vector_size (64)));
+typedef unsigned long long v8di __attribute__((vector_size (64)));
+
+void
+truncqd (v8si * dst, v8di * __restrict src)
+{
+ unsigned tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ dst[0] = *(v8si *) tem;
+}
+
+void
+truncqw (v8hi * dst, v8di * __restrict src)
+{
+ unsigned short tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ dst[0] = *(v8hi *) tem;
+}
+
+void
+truncqb (v8qi * dst, v8di * __restrict src)
+{
+ unsigned char tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ dst[0] = *(v8qi *) tem;
+}
+
+void
+truncdw (v16hi * dst, v16si * __restrict src)
+{
+ unsigned short tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ tem[8] = (*src)[8];
+ tem[9] = (*src)[9];
+ tem[10] = (*src)[10];
+ tem[11] = (*src)[11];
+ tem[12] = (*src)[12];
+ tem[13] = (*src)[13];
+ tem[14] = (*src)[14];
+ tem[15] = (*src)[15];
+ dst[0] = *(v16hi *) tem;
+}
+
+
+void
+truncdb (v16qi * dst, v16si * __restrict src)
+{
+ unsigned char tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ tem[8] = (*src)[8];
+ tem[9] = (*src)[9];
+ tem[10] = (*src)[10];
+ tem[11] = (*src)[11];
+ tem[12] = (*src)[12];
+ tem[13] = (*src)[13];
+ tem[14] = (*src)[14];
+ tem[15] = (*src)[15];
+ dst[0] = *(v16qi *) tem;
+}
+
+/* { dg-final { scan-assembler-times "vpmovqd" 1 } } */
+/* { dg-final { scan-assembler-times "vpmovqw" 1 } } */
+/* { dg-final { scan-assembler-times "vpmovqb" 1 { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-times "vpmovdw" 1 } } */
+/* { dg-final { scan-assembler-times "vpmovdb" 1 } } */
+
diff --git a/gcc/testsuite/gcc.target/i386/pr92658-avx512vl.c b/gcc/testsuite/gcc.target/i386/pr92658-avx512vl.c
new file mode 100644
index 00000000000..dc50084119b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr92658-avx512vl.c
@@ -0,0 +1,129 @@
+/* PR target/92658 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -mavx512f -mavx512vl" } */
+
+typedef unsigned char v16qi __attribute__((vector_size (16)));
+typedef unsigned short v8hi __attribute__((vector_size (16)));
+typedef unsigned int v4si __attribute__((vector_size (16)));
+typedef unsigned int v8si __attribute__((vector_size (32)));
+typedef unsigned long long v2di __attribute__((vector_size (16)));
+typedef unsigned long long v4di __attribute__((vector_size (32)));
+
+void
+truncqd_256 (v4si * dst, v4di * __restrict src)
+{
+ unsigned tem[4];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ dst[0] = *(v4si *) tem;
+}
+
+void
+truncqw_256 (v8hi * dst, v4di * __restrict src)
+{
+ unsigned short tem[4];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ dst[0] = *(v8hi *) tem;
+}
+
+void
+truncqb_256 (v16qi * dst, v4di * __restrict src)
+{
+ unsigned char tem[4];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ dst[0] = *(v16qi *) tem;
+}
+
+void
+truncqd_128 (v4si * dst, v2di * __restrict src)
+{
+ unsigned tem[4];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ dst[0] = *(v4si *) tem;
+}
+
+void
+truncqw_128 (v8hi * dst, v2di * __restrict src)
+{
+ unsigned short tem[4];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ dst[0] = *(v8hi *) tem;
+}
+
+void
+truncqb_128 (v16qi * dst, v2di * __restrict src)
+{
+ unsigned char tem[4];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ dst[0] = *(v16qi *) tem;
+}
+
+void
+truncdw_256 (v8hi * dst, v8si * __restrict src)
+{
+ unsigned short tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ dst[0] = *(v8hi *) tem;
+}
+
+void
+truncdb_256 (v16qi * dst, v8si * __restrict src)
+{
+ unsigned char tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ dst[0] = *(v16qi *) tem;
+}
+
+void
+truncdw_128 (v8hi * dst, v4si * __restrict src)
+{
+ unsigned short tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ dst[0] = *(v8hi *) tem;
+}
+
+void
+truncdb_128 (v16qi * dst, v4si * __restrict src)
+{
+ unsigned char tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ dst[0] = *(v16qi *) tem;
+}
+
+/* { dg-final { scan-assembler-times "vpmovqd" 2 } } */
+/* { dg-final { scan-assembler-times "vpmovqw" 2 { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-times "vpmovqb" 2 { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-times "vpmovdw" 1 } } */
+/* { dg-final { scan-assembler-times "vpmovdw" 2 { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-times "vpmovdb" 2 { xfail *-*-* } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr92658-sse4.c b/gcc/testsuite/gcc.target/i386/pr92658-sse4.c
new file mode 100644
index 00000000000..e4626292e95
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr92658-sse4.c
@@ -0,0 +1,148 @@
+/* PR target/92658 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -msse4.1" } */
+
+typedef unsigned char v16qi __attribute__((vector_size (16)));
+typedef unsigned short v8hi __attribute__((vector_size (16)));
+typedef unsigned int v4si __attribute__((vector_size (16)));
+typedef unsigned long long v2di __attribute__((vector_size (16)));
+
+void
+foo_u8_u16 (v8hi * dst, v16qi * __restrict src)
+{
+ unsigned short tem[8];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ tem[4] = (*src)[4];
+ tem[5] = (*src)[5];
+ tem[6] = (*src)[6];
+ tem[7] = (*src)[7];
+ dst[0] = *(v8hi *) tem;
+}
+
+void
+bar_u8_u16 (v8hi * dst, v16qi src)
+{
+ unsigned short tem[8];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ tem[2] = src[2];
+ tem[3] = src[3];
+ tem[4] = src[4];
+ tem[5] = src[5];
+ tem[6] = src[6];
+ tem[7] = src[7];
+ dst[0] = *(v8hi *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxbw" 2 } } */
+
+void
+foo_u8_u32 (v4si * dst, v16qi * __restrict src)
+{
+ unsigned int tem[4];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ dst[0] = *(v4si *) tem;
+}
+
+void
+bar_u8_u32 (v4si * dst, v16qi src)
+{
+ unsigned int tem[4];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ tem[2] = src[2];
+ tem[3] = src[3];
+ dst[0] = *(v4si *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxbd" 2 { xfail *-*-* } } } */
+
+void
+foo_u8_u64 (v2di * dst, v16qi * __restrict src)
+{
+ unsigned long long tem[2];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ dst[0] = *(v2di *) tem;
+}
+
+void
+bar_u8_u64 (v2di * dst, v16qi src)
+{
+ unsigned long long tem[2];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ dst[0] = *(v2di *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxbq" 2 { xfail *-*-* } } } */
+
+void
+foo_u16_u32 (v4si * dst, v8hi * __restrict src)
+{
+ unsigned int tem[4];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ tem[2] = (*src)[2];
+ tem[3] = (*src)[3];
+ dst[0] = *(v4si *) tem;
+}
+
+void
+bar_u16_u32 (v4si * dst, v8hi src)
+{
+ unsigned int tem[4];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ tem[2] = src[2];
+ tem[3] = src[3];
+ dst[0] = *(v4si *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxwd" 2 } } */
+
+void
+foo_u16_u64 (v2di * dst, v8hi * __restrict src)
+{
+ unsigned long long tem[2];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ dst[0] = *(v2di *) tem;
+}
+
+void
+bar_u16_u64 (v2di * dst, v8hi src)
+{
+ unsigned long long tem[2];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ dst[0] = *(v2di *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxwq" 2 { xfail *-*-* } } } */
+
+void
+foo_u32_u64 (v2di * dst, v4si * __restrict src)
+{
+ unsigned long long tem[2];
+ tem[0] = (*src)[0];
+ tem[1] = (*src)[1];
+ dst[0] = *(v2di *) tem;
+}
+
+void
+bar_u32_u64 (v2di * dst, v4si src)
+{
+ unsigned long long tem[2];
+ tem[0] = src[0];
+ tem[1] = src[1];
+ dst[0] = *(v2di *) tem;
+}
+
+/* { dg-final { scan-assembler-times "pmovzxdq" 2 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr92807-1.c b/gcc/testsuite/gcc.target/i386/pr92807-1.c
index 00f92930af9..02a0654dd5e 100644
--- a/gcc/testsuite/gcc.target/i386/pr92807-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr92807-1.c
@@ -8,4 +8,4 @@ abs2 (unsigned int a)
return (a+s)^s;
}
-/* { dg-final { scan-assembler-not "leal" } } */
+/* { dg-final { scan-assembler-not "leal\[\t \]*\[^(\]*\\((.*),\\1\\)" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr92865-1.c b/gcc/testsuite/gcc.target/i386/pr92865-1.c
index 49b5778a067..8aeab608626 100644
--- a/gcc/testsuite/gcc.target/i386/pr92865-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr92865-1.c
@@ -1,12 +1,12 @@
/* PR target/92865 */
/* { dg-do compile } */
-/* { dg-options "-Ofast -mavx512f -mavx512bw -mxop" } */
+/* { dg-options "-Ofast -mavx512bw -mxop" } */
/* { dg-final { scan-assembler-times "vpcmp\[bwdq\]\[\t ]" 4 } } */
/* { dg-final { scan-assembler-times "vpcmpu\[bwdq\]\[\t ]" 4 } } */
-/* { dg-final { scan-assembler-times "vmovdq\[au\]8\[\t ]" 4 } } */
-/* { dg-final { scan-assembler-times "vmovdq\[au\]16\[\t ]" 4 } } *
-/* { dg-final { scan-assembler-times "vmovdq\[au\]32\[\t ]" 4 } } */
-/* { dg-final { scan-assembler-times "vmovdq\[au\]64\[\t ]" 4 } } */
+/* { dg-final { scan-assembler-times "vmovdq\[au\]8\[\t ]" 6 } } */
+/* { dg-final { scan-assembler-times "vmovdq\[au\]16\[\t ]" 6 } } *
+/* { dg-final { scan-assembler-times "vmovdq\[au\]32\[\t ]" 6 } } */
+/* { dg-final { scan-assembler-times "vmovdq\[au\]64\[\t ]" 6 } } */
extern char arraysb[64];
extern short arraysw[32];
diff --git a/gcc/testsuite/gcc.target/i386/pr93492-1.c b/gcc/testsuite/gcc.target/i386/pr93492-1.c
new file mode 100644
index 00000000000..7a82d0c68e1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr93492-1.c
@@ -0,0 +1,73 @@
+/* { dg-do "compile" { target *-*-linux* } } */
+/* { dg-options "-O1 -fcf-protection -mmanual-endbr" } */
+/* { dg-final { check-function-bodies "**" "" } } */
+
+/* Note: this test only checks the instructions in the function bodies,
+ not the placement of the patch label or nops before the function. */
+
+/*
+**f10_none:
+** nop
+** ret
+*/
+void
+__attribute__ ((nocf_check,patchable_function_entry (1, 0)))
+f10_none (void)
+{
+}
+
+/*
+**f10_endbr:
+** endbr(32|64)
+** nop
+** ret
+*/
+void
+__attribute__ ((cf_check,patchable_function_entry (1, 0)))
+f10_endbr (void)
+{
+}
+
+/*
+**f11_none:
+** ret
+*/
+void
+__attribute__ ((nocf_check,patchable_function_entry (1, 1)))
+f11_none (void)
+{
+}
+
+/*
+**f11_endbr:
+** endbr(32|64)
+** ret
+*/
+void
+__attribute__ ((cf_check,patchable_function_entry (1, 1)))
+f11_endbr (void)
+{
+}
+
+/*
+**f21_none:
+** nop
+** ret
+*/
+void
+__attribute__ ((nocf_check,patchable_function_entry (2, 1)))
+f21_none (void)
+{
+}
+
+/*
+**f21_endbr:
+** endbr(32|64)
+** nop
+** ret
+*/
+void
+__attribute__ ((cf_check,patchable_function_entry (2, 1)))
+f21_endbr (void)
+{
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr93492-2.c b/gcc/testsuite/gcc.target/i386/pr93492-2.c
new file mode 100644
index 00000000000..3d67095fd10
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr93492-2.c
@@ -0,0 +1,12 @@
+/* { dg-do "compile" { target *-*-linux* } } */
+/* { dg-options "-O1 -fcf-protection -mmanual-endbr -fasynchronous-unwind-tables" } */
+
+/* Test the placement of the .LPFE1 label. */
+
+void
+__attribute__ ((cf_check,patchable_function_entry (1, 0)))
+f10_endbr (void)
+{
+}
+
+/* { dg-final { scan-assembler "\t\.cfi_startproc\n\tendbr(32|64)\n.*\.LPFE1:\n\tnop\n\tret\n" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr93492-3.c b/gcc/testsuite/gcc.target/i386/pr93492-3.c
new file mode 100644
index 00000000000..52a19e51513
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr93492-3.c
@@ -0,0 +1,13 @@
+/* { dg-do "compile" { target *-*-linux* } } */
+/* { dg-require-effective-target mfentry } */
+/* { dg-options "-O1 -fcf-protection -mmanual-endbr -mfentry -pg -fasynchronous-unwind-tables" } */
+
+/* Test the placement of the .LPFE1 label. */
+
+void
+__attribute__ ((cf_check,patchable_function_entry (1, 0)))
+f10_endbr (void)
+{
+}
+
+/* { dg-final { scan-assembler "\t\.cfi_startproc\n\tendbr(32|64)\n.*\.LPFE1:\n\tnop\n1:\tcall\t__fentry__\n\tret\n" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr93492-4.c b/gcc/testsuite/gcc.target/i386/pr93492-4.c
new file mode 100644
index 00000000000..8f205c345b8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr93492-4.c
@@ -0,0 +1,11 @@
+/* { dg-do "compile" { target *-*-linux* } } */
+/* { dg-options "-O1 -fpatchable-function-entry=1 -fasynchronous-unwind-tables" } */
+
+/* Test the placement of the .LPFE1 label. */
+
+void
+foo (void)
+{
+}
+
+/* { dg-final { scan-assembler "\t\.cfi_startproc\n.*\.LPFE1:\n\tnop\n\tret\n" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr93492-5.c b/gcc/testsuite/gcc.target/i386/pr93492-5.c
new file mode 100644
index 00000000000..fcf4ad43aa2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr93492-5.c
@@ -0,0 +1,11 @@
+/* { dg-do "compile" { target *-*-linux* } } */
+/* { dg-options "-O1 -fpatchable-function-entry=1 -mfentry -pg -fasynchronous-unwind-tables" } */
+
+/* Test the placement of the .LPFE1 label. */
+
+void
+foo (void)
+{
+}
+
+/* { dg-final { scan-assembler "\t\.cfi_startproc\n.*\.LPFE1:\n\tnop\n1:\tcall\t__fentry__\n\tret\n" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr94857.c b/gcc/testsuite/gcc.target/i386/pr94857.c
new file mode 100644
index 00000000000..f84ee22b922
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr94857.c
@@ -0,0 +1,13 @@
+/* PR target/94857 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mtune=skylake -masm=att" } */
+/* { dg-additional-options "-mregparm=2" { target ia32 } } */
+/* { dg-final { scan-assembler "\taddl\t%\[a-z0-9]\*, \\\(" } } */
+
+int
+foo (unsigned *p, unsigned x)
+{
+ unsigned u = *p;
+ *p += x;
+ return u > *p;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr94913-1.c b/gcc/testsuite/gcc.target/i386/pr94913-1.c
new file mode 100644
index 00000000000..f21032d4522
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr94913-1.c
@@ -0,0 +1,21 @@
+/* PR target/94913 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+char fooc (unsigned char x, unsigned char y)
+{
+ return (unsigned char) ~x < y;
+}
+
+short foos (unsigned short x, unsigned short y)
+{
+ return (unsigned short) ~x < y;
+}
+
+long fooi (unsigned long x, unsigned long y)
+{
+ return (unsigned long) ~x < y;
+}
+
+/* { dg-final { scan-assembler-not "cmp" } } */
+/* { dg-final { scan-assembler-times "add" 3 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr94913-2.c b/gcc/testsuite/gcc.target/i386/pr94913-2.c
new file mode 100644
index 00000000000..22bca2bf27b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr94913-2.c
@@ -0,0 +1,24 @@
+/* PR target/94913 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void f1 (void);
+void f2 (void);
+
+void fooc (unsigned char x, unsigned char y)
+{
+ if ((unsigned char) ~x < y) f1 (); else f2 ();
+}
+
+void foos (unsigned short x, unsigned short y)
+{
+ if ((unsigned short) ~x < y) f1 (); else f2 ();
+}
+
+void fooi (unsigned long x, unsigned long y)
+{
+ if ((unsigned long) ~x < y) f1 (); else f2 ();
+}
+
+/* { dg-final { scan-assembler-not "cmp" } } */
+/* { dg-final { scan-assembler-times "add" 3 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr94956.c b/gcc/testsuite/gcc.target/i386/pr94956.c
new file mode 100644
index 00000000000..cc27b451136
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr94956.c
@@ -0,0 +1,28 @@
+/* PR tree-optimization/94956 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not "\tcmovne\t" } } */
+/* { dg-final { scan-assembler-not "\tsete\t" } } */
+
+int
+foo (unsigned x)
+{
+ if (x == 0) __builtin_unreachable ();
+ return __builtin_ffs (x) - 1;
+}
+
+int
+bar (unsigned long x)
+{
+ if (x == 0) __builtin_unreachable ();
+ return __builtin_ffsl (x) - 1;
+}
+
+#ifdef __x86_64__
+int
+baz (unsigned long long x)
+{
+ if (x == 0) __builtin_unreachable ();
+ return __builtin_ffsll (x) - 1;
+}
+#endif
diff --git a/gcc/testsuite/gcc.target/i386/pr94980.c b/gcc/testsuite/gcc.target/i386/pr94980.c
new file mode 100644
index 00000000000..488f94abec9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr94980.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-mavx512vl" } */
+
+int __attribute__((__vector_size__(16))) v;
+
+void
+foo(void)
+{
+ 0 <= (0 != v) >= 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr95021-1.c b/gcc/testsuite/gcc.target/i386/pr95021-1.c
new file mode 100644
index 00000000000..a0b9a262a87
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95021-1.c
@@ -0,0 +1,27 @@
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O2 -msse2 -mstv -W" } */
+/* { dg-final { scan-assembler "movq\[ \t\]%xmm\[0-9\]+, \\(%esp\\)" } } */
+/* { dg-final { scan-assembler-not "psrlq" } } */
+
+#include <setjmp.h>
+
+extern jmp_buf buf;
+
+extern long long *target_p;
+extern long long *c;
+
+extern void foo (long long);
+
+__attribute__ ((noclone, noinline))
+void
+bar (void)
+{
+ if (setjmp (buf))
+ {
+ long long target = *target_p;
+ *c = target;
+ foo (target);
+ }
+ else
+ foo (0);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr95021-2.c b/gcc/testsuite/gcc.target/i386/pr95021-2.c
new file mode 100644
index 00000000000..53247e52784
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95021-2.c
@@ -0,0 +1,39 @@
+/* { dg-do run { target ia32 } } */
+/* { dg-require-effective-target sse2_runtime } */
+/* { dg-options "-O2 -msse2 -mstv -W" } */
+
+#include <stdlib.h>
+#include "pr95021-1.c"
+
+jmp_buf buf;
+
+long long *target_p;
+long long *c;
+
+int count;
+
+__attribute__ ((noclone, noinline))
+void
+foo (long long x)
+{
+ if (x != *c)
+ abort ();
+ if (!count)
+ {
+ count++;
+ longjmp (buf, 1);
+ }
+}
+
+int
+main ()
+{
+ long long val = 30;
+ long long local = 0;
+ target_p = &val;
+ c = &local;
+ bar ();
+ if (val != local)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr95021-3.c b/gcc/testsuite/gcc.target/i386/pr95021-3.c
new file mode 100644
index 00000000000..1748161a77c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95021-3.c
@@ -0,0 +1,5 @@
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O2 -msse2 -mstv -mregparm=3 -W" } */
+/* { dg-final { scan-assembler "movq\[ \t\]+\[^\n\]*, %xmm" } } */
+
+#include "pr95021-1.c"
diff --git a/gcc/testsuite/gcc.target/i386/pr95021-4.c b/gcc/testsuite/gcc.target/i386/pr95021-4.c
new file mode 100644
index 00000000000..d5bb28cc01a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95021-4.c
@@ -0,0 +1,28 @@
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-O2 -msse2 -mstv -W" } */
+/* { dg-final { scan-assembler "(movaps|vmovdqa)\[ \t\]%xmm\[0-9\]+, \\(%rsp\\)" } } */
+
+#include <setjmp.h>
+
+extern jmp_buf buf;
+
+extern __int128 *target_p;
+__int128 *c;
+
+extern int count;
+
+extern void foo (__int128, __int128, __int128, __int128);
+
+__attribute__ ((noclone, noinline))
+void
+bar (void)
+{
+ if (setjmp (buf))
+ {
+ __int128 target = *target_p;
+ *c = target;
+ foo (0xbadbeef1, 0x2badbeef, 0xbad3beef, target);
+ }
+ else
+ foo (0xbadbeef1, 0x2badbeef, 0xbad3beef, 0);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr95021-5.c b/gcc/testsuite/gcc.target/i386/pr95021-5.c
new file mode 100644
index 00000000000..d8658095bc8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95021-5.c
@@ -0,0 +1,45 @@
+/* { dg-do run { target int128 } } */
+/* { dg-require-effective-target sse2_runtime } */
+/* { dg-options "-O2 -msse2 -mstv -W" } */
+
+#include <stdlib.h>
+#include "pr95021-4.c"
+
+jmp_buf buf;
+
+__int128 *target_p;
+__int128 *c;
+
+int count;
+
+__attribute__ ((noclone, noinline))
+void
+foo (__int128 i1, __int128 i2, __int128 i3, __int128 x)
+{
+ if (i1 != 0xbadbeef1)
+ abort ();
+ if (i2 != 0x2badbeef)
+ abort ();
+ if (i3 != 0xbad3beef)
+ abort ();
+ if (x != *c)
+ abort ();
+ if (!count)
+ {
+ count++;
+ longjmp (buf, 1);
+ }
+}
+
+int
+main ()
+{
+ __int128 val = 30;
+ __int128 local = 0;
+ target_p = &val;
+ c = &local;
+ bar ();
+ if (val != local)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr95046-1.c b/gcc/testsuite/gcc.target/i386/pr95046-1.c
new file mode 100644
index 00000000000..bcc8bb5bfab
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95046-1.c
@@ -0,0 +1,62 @@
+/* PR target/95046 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O3 -ffast-math -msse2" } */
+
+
+float r[2], a[2], b[2];
+
+void
+test_plus (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = a[i] + b[i];
+}
+
+/* { dg-final { scan-assembler "\tv?addps" } } */
+
+void
+test_minus (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = a[i] - b[i];
+}
+
+/* { dg-final { scan-assembler "\tv?subps" } } */
+
+void
+test_mult (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = a[i] * b[i];
+}
+
+/* { dg-final { scan-assembler "\tv?mulps" } } */
+
+void
+test_min (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = a[i] < b[i] ? a[i] : b[i];
+}
+
+/* { dg-final { scan-assembler "\tv?minps" } } */
+
+void
+test_max (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = a[i] > b[i] ? a[i] : b[i];
+}
+
+/* { dg-final { scan-assembler "\tv?maxps" } } */
+
+float sqrtf (float);
+
+void
+test_sqrt (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = sqrtf (a[i]);
+}
+
+/* { dg-final { scan-assembler "\tv?sqrtps" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95046-2.c b/gcc/testsuite/gcc.target/i386/pr95046-2.c
new file mode 100644
index 00000000000..277cc2d2e58
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95046-2.c
@@ -0,0 +1,35 @@
+/* PR target/95046 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O3 -msse2" } */
+
+
+float r[2], a[2];
+
+float fabsf (float);
+
+void
+test_abs (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = fabsf (a[i]);
+}
+
+/* { dg-final { scan-assembler "\tv?andps" } } */
+
+void
+test_neg (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = -a[i];
+}
+
+/* { dg-final { scan-assembler "\tv?xorps" } } */
+
+void
+test_nabs (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = -fabsf (a[i]);
+}
+
+/* { dg-final { scan-assembler "\tv?orps" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95046-3.c b/gcc/testsuite/gcc.target/i386/pr95046-3.c
new file mode 100644
index 00000000000..7d15b39e5af
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95046-3.c
@@ -0,0 +1,42 @@
+/* PR target/95046 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O3 -mfma" } */
+
+
+float r[2], a[2], b[2], c[2];
+
+void
+test_fma (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = a[i] * b[i] + c[i];
+}
+
+/* { dg-final { scan-assembler "\tvfmadd\[123\]+ps" } } */
+
+void
+test_fms (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = a[i] * b[i] - c[i];
+}
+
+/* { dg-final { scan-assembler "\tvfmsub\[123\]+ps" } } */
+
+void
+test_fnma (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = -(a[i] * b[i]) + c[i];
+}
+
+/* { dg-final { scan-assembler "\tvfnmadd\[123\]+ps" } } */
+
+void
+test_fnms (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = -(a[i] * b[i]) - c[i];
+}
+
+/* { dg-final { scan-assembler "\tvfnmsub\[123\]+ps" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95046-4.c b/gcc/testsuite/gcc.target/i386/pr95046-4.c
new file mode 100644
index 00000000000..5a85045b095
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95046-4.c
@@ -0,0 +1,39 @@
+/* PR target/95046 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O3 -msse2" } */
+
+
+float r[2], a[2], b[2];
+
+float copysignf (float, float);
+
+void
+test_copysign (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = copysignf (a[i], b[i]);
+}
+
+/* { dg-final { scan-assembler "\tv?andnps" } } */
+
+void
+test_xorsign (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = a[i] * copysignf (1.0f, b[i]);
+}
+
+/* { dg-final { scan-assembler "\tv?xorps" } } */
+
+int s[2];
+
+int signbitf (float);
+
+void
+test_signbitf (void)
+{
+ for (int i = 0; i < 2; i++)
+ s[i] = signbitf (a[i]);
+}
+
+/* { dg-final { scan-assembler "\tv?psrld" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95046-5.c b/gcc/testsuite/gcc.target/i386/pr95046-5.c
new file mode 100644
index 00000000000..bff55ddef31
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95046-5.c
@@ -0,0 +1,44 @@
+/* PR target/95046 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O3 -mavx512vl" } */
+
+
+float r[2];
+int s[2];
+unsigned int u[2];
+
+void
+test_float (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = s[i];
+}
+
+/* { dg-final { scan-assembler "\tvcvtdq2ps" } } */
+
+void
+test_ufloat (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = u[i];
+}
+
+/* { dg-final { scan-assembler "\tvcvtudq2ps" } } */
+
+void
+test_fix (void)
+{
+ for (int i = 0; i < 2; i++)
+ s[i] = r[i];
+}
+
+/* { dg-final { scan-assembler "\tvcvttps2dq" } } */
+
+void
+test_ufix (void)
+{
+ for (int i = 0; i < 2; i++)
+ u[i] = r[i];
+}
+
+/* { dg-final { scan-assembler "\tvcvttps2udq" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95046-6.c b/gcc/testsuite/gcc.target/i386/pr95046-6.c
new file mode 100644
index 00000000000..dcc8999c446
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95046-6.c
@@ -0,0 +1,44 @@
+/* PR target/95046 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O3 -mavx512vl" } */
+
+
+double r[2];
+int s[2];
+unsigned int u[2];
+
+void
+test_float (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = s[i];
+}
+
+/* { dg-final { scan-assembler "\tvcvtdq2pd" } } */
+
+void
+test_ufloat (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = u[i];
+}
+
+/* { dg-final { scan-assembler "\tvcvtudq2pd" } } */
+
+void
+test_fix (void)
+{
+ for (int i = 0; i < 2; i++)
+ s[i] = r[i];
+}
+
+/* { dg-final { scan-assembler "\tvcvttpd2dqx" } } */
+
+void
+test_ufix (void)
+{
+ for (int i = 0; i < 2; i++)
+ u[i] = r[i];
+}
+
+/* { dg-final { scan-assembler "\tvcvttpd2udqx" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95046-7.c b/gcc/testsuite/gcc.target/i386/pr95046-7.c
new file mode 100644
index 00000000000..b3702a5d761
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95046-7.c
@@ -0,0 +1,25 @@
+/* PR target/95046 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O3 -msse2" } */
+
+
+float f[2];
+double d[2];
+
+void
+test_float_truncate (void)
+{
+ for (int i = 0; i < 2; i++)
+ f[i] = d[i];
+}
+
+/* { dg-final { scan-assembler "\tv?cvtpd2psx?" } } */
+
+void
+test_float_extend (void)
+{
+ for (int i = 0; i < 2; i++)
+ d[i] = f[i];
+}
+
+/* { dg-final { scan-assembler "\tv?cvtps2pd" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95046-8.c b/gcc/testsuite/gcc.target/i386/pr95046-8.c
new file mode 100644
index 00000000000..e164fd4ea37
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95046-8.c
@@ -0,0 +1,22 @@
+/* PR target/95046 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -msse3" } */
+
+
+typedef float __v2sf __attribute__ ((__vector_size__ (8)));
+
+float
+foo (__v2sf a)
+{
+ return a[0] + a[1];
+}
+
+/* { dg-final { scan-assembler "\tv?haddps" } } */
+
+float
+bar (__v2sf a)
+{
+ return a[0] - a[1];
+}
+
+/* { dg-final { scan-assembler "\tv?hsubps" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95052.c b/gcc/testsuite/gcc.target/i386/pr95052.c
new file mode 100644
index 00000000000..1bbfd7ea305
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95052.c
@@ -0,0 +1,20 @@
+/* PR middle-end/95052 */
+/* { dg-do compile } */
+/* { dg-options "-Os -mtune=skylake" } */
+/* Verify we don't waste almost 2 megabytes of .rodata. */
+/* { dg-final { scan-assembler-not "\.zero\t1048\[0-9]\[0-9]\[0-9]" } } */
+extern void foo (char *, unsigned);
+
+int
+main ()
+{
+ char str[1024 * 1024] =
+ "fooiuhluhpiuhliuhliyfyukyfklyugkiuhpoipoipoipoipoipoipoipoipoipoipoipoipoimipoipiuhoulouihnliuhl";
+ char arr[1024 * 1024] =
+ { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 6, 2, 3,
+ 4, 5, 6, 7, 8, 9, 0, 3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6,
+ 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
+ foo (str, sizeof (str));
+ foo (arr, sizeof (arr));
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr95125-avx.c b/gcc/testsuite/gcc.target/i386/pr95125-avx.c
new file mode 100644
index 00000000000..3cd1a08e5ed
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95125-avx.c
@@ -0,0 +1,27 @@
+/* PR target/92125 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -mavx" } */
+
+extern float f[4];
+extern double d[4];
+
+void
+float_truncate_256 (void)
+{
+ f[0] = d[0];
+ f[1] = d[1];
+ f[2] = d[2];
+ f[3] = d[3];
+}
+
+void
+float_extend_256 (void)
+{
+ d[0] = f[0];
+ d[1] = f[1];
+ d[2] = f[2];
+ d[3] = f[3];
+}
+
+/* { dg-final { scan-assembler-times "vcvtps2pd" 1 } } */
+/* { dg-final { scan-assembler-times "vcvtpd2ps" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95125-avx512f.c b/gcc/testsuite/gcc.target/i386/pr95125-avx512f.c
new file mode 100644
index 00000000000..109278ccf21
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95125-avx512f.c
@@ -0,0 +1,37 @@
+/* PR target/95125 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -mavx512f -mprefer-vector-width=512 " } */
+
+extern float f[8];
+extern double d[8];
+
+void
+float_truncate_512 (void)
+{
+ f[0] = d[0];
+ f[1] = d[1];
+ f[2] = d[2];
+ f[3] = d[3];
+ f[4] = d[4];
+ f[5] = d[5];
+ f[6] = d[6];
+ f[7] = d[7];
+}
+
+void
+float_extend_512 (void)
+{
+ d[0] = f[0];
+ d[1] = f[1];
+ d[2] = f[2];
+ d[3] = f[3];
+ d[4] = f[4];
+ d[5] = f[5];
+ d[6] = f[6];
+ d[7] = f[7];
+}
+
+
+
+/* { dg-final { scan-assembler-times "vcvtps2pd" 1 } } */
+/* { dg-final { scan-assembler-times "vcvtpd2ps" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95169.c b/gcc/testsuite/gcc.target/i386/pr95169.c
new file mode 100644
index 00000000000..91411744228
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95169.c
@@ -0,0 +1,28 @@
+/* PR target/95169 */
+/* { dg-do run { target ia32 } } */
+/* { dg-options "-O0 -march=i386 -mtune=generic" } */
+/* { dg-require-effective-target fenv_exceptions } */
+
+#include <fenv.h>
+
+void
+f (double y)
+{
+ if (__builtin_expect (y == 0.0, 0))
+ __builtin_abort ();
+}
+
+int
+main (void)
+{
+ double y = __builtin_nan ("");
+
+ feclearexcept (FE_INVALID);
+
+ f (y);
+
+ if (fetestexcept (FE_INVALID))
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr95211.c b/gcc/testsuite/gcc.target/i386/pr95211.c
new file mode 100644
index 00000000000..dc10f8f4659
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95211.c
@@ -0,0 +1,38 @@
+/* PR target/95211 target/95256 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -ftree-slp-vectorize -march=skylake-avx512" } */
+
+extern float f[4];
+extern long long l[2];
+extern long long ul[2];
+
+void
+fix_128 (void)
+{
+ l[0] = f[0];
+ l[1] = f[1];
+}
+
+void
+fixuns_128 (void)
+{
+ ul[0] = f[0];
+ ul[1] = f[1];
+}
+
+void
+float_128 (void)
+{
+ f[0] = l[0];
+ f[1] = l[1];
+}
+
+void
+floatuns_128 (void)
+{
+ f[0] = ul[0];
+ f[1] = ul[1];
+}
+
+/* { dg-final { scan-assembler-times "vcvttps2qq" 2 } } */
+/* { dg-final { scan-assembler-times "vcvtqq2ps" 2 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95255.c b/gcc/testsuite/gcc.target/i386/pr95255.c
new file mode 100644
index 00000000000..5b731941f72
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95255.c
@@ -0,0 +1,8 @@
+/* PR target/95255 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse2 -mno-sse4.1 -mfpmath=both" } */
+
+double foo (double x)
+{
+ return __builtin_roundeven (x);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr95355.c b/gcc/testsuite/gcc.target/i386/pr95355.c
new file mode 100644
index 00000000000..3e4faba19f2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95355.c
@@ -0,0 +1,20 @@
+/* PR target/95355 */
+/* { dg-do assemble { target avx512dq } } */
+/* { dg-require-effective-target int128 } */
+/* { dg-require-effective-target masm_intel } */
+/* { dg-options "-O -fno-tree-dominator-opts -fno-tree-fre -ftree-slp-vectorize -fno-tree-ter -mavx512dq -masm=intel" } */
+
+typedef int __attribute__((__vector_size__(64))) U;
+typedef __int128 __attribute__((__vector_size__(32))) V;
+
+U i;
+V j;
+
+int
+foo(unsigned char l)
+{
+ V m = j % 999;
+ U n = l <= i;
+ V o = ((union { U a; V b[2]; }) n).b[0] + m;
+ return o[0];
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr95356.c b/gcc/testsuite/gcc.target/i386/pr95356.c
new file mode 100644
index 00000000000..fdd917ba5e7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95356.c
@@ -0,0 +1,125 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -mavx512dq" } */
+
+extern void abort (void);
+long long a[16];
+
+__attribute__((noinline, noclone)) void
+f1 (void)
+{
+ long long a0, a1, a2, a3;
+ a0 = a[0];
+ a1 = a[1];
+ a2 = a[2];
+ a3 = a[3];
+ a0 = a0 << 2;
+ a1 = a1 << 3;
+ a2 = a2 << 4;
+ a3 = a3 << 5;
+ a[0] = a0;
+ a[1] = a1;
+ a[2] = a2;
+ a[3] = a3;
+}
+
+__attribute__((noinline, noclone)) void
+f2 (void)
+{
+ long long a0, a1, a2, a3;
+ a0 = a[0];
+ a1 = a[1];
+ a2 = a[2];
+ a3 = a[3];
+ a0 = a0 << 2;
+ a1 = a1 << 2;
+ a2 = a2 << 2;
+ a3 = a3 << 2;
+ a[0] = a0;
+ a[1] = a1;
+ a[2] = a2;
+ a[3] = a3;
+}
+
+__attribute__((noinline, noclone)) void
+f2a (int x)
+{
+ long long a0, a1, a2, a3;
+ a0 = a[0];
+ a1 = a[1];
+ a2 = a[2];
+ a3 = a[3];
+ a0 = a0 << x;
+ a1 = a1 << 2;
+ a2 = a2 << 2;
+ a3 = a3 << 2;
+ a[0] = a0;
+ a[1] = a1;
+ a[2] = a2;
+ a[3] = a3;
+}
+
+__attribute__((noinline, noclone)) void
+f2b (int x)
+{
+ long long a0, a1, a2, a3;
+ a0 = a[0];
+ a1 = a[1];
+ a2 = a[2];
+ a3 = a[3];
+ a0 = a0 << 2;
+ a1 = a1 << 2;
+ a2 = a2 << x;
+ a3 = a3 << 2;
+ a[0] = a0;
+ a[1] = a1;
+ a[2] = a2;
+ a[3] = a3;
+}
+
+__attribute__((noinline, noclone)) void
+f3 (int x)
+{
+ long long a0, a1, a2, a3;
+ a0 = a[0];
+ a1 = a[1];
+ a2 = a[2];
+ a3 = a[3];
+ a0 = a0 << x;
+ a1 = a1 << x;
+ a2 = a2 << x;
+ a3 = a3 << x;
+ a[0] = a0;
+ a[1] = a1;
+ a[2] = a2;
+ a[3] = a3;
+}
+
+int
+main ()
+{
+ a[0] = 4LL;
+ a[1] = 3LL;
+ a[2] = 2LL;
+ a[3] = 1LL;
+ f1 ();
+ if (a[0] != (4LL << 2) || a[1] != (3LL << 3)
+ || a[2] != (2LL << 4) || a[3] != (1LL << 5))
+ abort ();
+ f2 ();
+ if (a[0] != (4LL << 4) || a[1] != (3LL << 5)
+ || a[2] != (2LL << 6) || a[3] != (1LL << 7))
+ abort ();
+ f3 (3);
+ if (a[0] != (4LL << 7) || a[1] != (3LL << 8)
+ || a[2] != (2LL << 9) || a[3] != (1LL << 10))
+ abort ();
+ f2a (3);
+ if (a[0] != (4LL << 10) || a[1] != (3LL << 10)
+ || a[2] != (2LL << 11) || a[3] != (1LL << 12))
+ abort ();
+ f2b (3);
+ if (a[0] != (4LL << 12) || a[1] != (3LL << 12)
+ || a[2] != (2LL << 14) || a[3] != (1LL << 14))
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr95443-1.c b/gcc/testsuite/gcc.target/i386/pr95443-1.c
new file mode 100644
index 00000000000..698dfa02189
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95443-1.c
@@ -0,0 +1,130 @@
+/* { dg-do run { target mmap } } */
+/* { dg-options "-O2 -minline-all-stringops" } */
+
+#include <stdint.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#ifndef MAP_ANON
+#define MAP_ANON 0
+#endif
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
+uint8_t shift[256];
+
+static size_t
+__attribute__ ((noclone, noinline))
+hash2(const unsigned char *p)
+{
+ return (((size_t)(p)[0] - ((size_t)(p)[-1] << 3)) % sizeof (shift));
+}
+
+char *
+simple_strstr (const char *haystack, const char *needle)
+{
+ const unsigned char *hs = (const unsigned char *) haystack;
+ const unsigned char *ne = (const unsigned char *) needle;
+ size_t ne_len = strlen ((const char*)ne);
+ size_t hs_len = strnlen ((const char*)hs, ne_len | 512);
+
+ if (hs_len < ne_len)
+ return NULL;
+
+ if (memcmp (hs, ne, ne_len) == 0)
+ return (char *) hs;
+
+ const unsigned char *end = hs + hs_len - ne_len;
+ size_t tmp, shift1;
+ size_t m1 = ne_len - 1;
+ size_t offset = 0;
+
+ memset (shift, 0, sizeof (shift));
+ for (int i = 1; i < m1; i++)
+ shift[hash2 (ne + i)] = i;
+ shift1 = m1 - shift[hash2 (ne + m1)];
+ shift[hash2 (ne + m1)] = m1;
+
+ while (1)
+ {
+ if (__builtin_expect (hs > end, 0))
+ {
+ end += strnlen ((const char*)end + m1 + 1, 2048);
+ if (hs > end)
+ return NULL;
+ }
+
+ do
+ {
+ hs += m1;
+ tmp = shift[hash2 (hs)];
+ }
+ while (tmp == 0 && hs <= end);
+
+ hs -= tmp;
+ if (tmp < m1)
+ continue;
+
+ if (m1 < 15 || memcmp (hs + offset, ne + offset, 8) == 0)
+ {
+ if (memcmp (hs, ne, m1) == 0)
+ return (void *) hs;
+
+ offset = (offset >= 8 ? offset : m1) - 8;
+ }
+
+ hs += shift1;
+ }
+}
+
+static int
+check_result (const char *s1, const char *s2,
+ char *exp_result)
+{
+ char *result = simple_strstr (s1, s2);
+ if (result != exp_result)
+ return -1;
+
+ return 0;
+}
+
+void
+__attribute__ ((noclone, noinline))
+check1 (void)
+{
+ const char s1[] =
+ "F_BD_CE_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_88_20_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_A7_20_EF_BF_BD";
+ const char s2[] = "_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD";
+ char *exp_result;
+
+ exp_result = simple_strstr (s1, s2);
+ if (check_result (s1, s2, exp_result) != 0)
+ abort ();
+}
+
+int
+main (void)
+{
+ unsigned char *buf1, *buf2;
+ size_t page_size = 2 * sysconf(_SC_PAGESIZE);
+ buf1 = mmap (0, (1 + 1) * page_size, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (buf1 == MAP_FAILED)
+ return -1;
+ if (mprotect (buf1 + 1 * page_size, page_size, PROT_NONE))
+ return -1;
+ buf2 = mmap (0, 2 * page_size, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (buf2 == MAP_FAILED)
+ return -1;
+ if (mprotect (buf2 + page_size, page_size, PROT_NONE))
+ return -1;
+
+ memset (buf1, 0xa5, 1 * page_size);
+ memset (buf2, 0x5a, page_size);
+
+ check1 ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr95443-2.c b/gcc/testsuite/gcc.target/i386/pr95443-2.c
new file mode 100644
index 00000000000..23bb13ab7ff
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95443-2.c
@@ -0,0 +1,79 @@
+/* { dg-do run { target mmap } } */
+/* { dg-options "-O2 -minline-all-stringops" } */
+
+#include <stdint.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#ifndef MAP_ANON
+#define MAP_ANON 0
+#endif
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
+int ret;
+
+static void
+do_one_test (char *dst, char *src, const char *orig_src, unsigned int len)
+{
+ __builtin_memcpy (src, orig_src, len);
+ __builtin_memmove (dst, src, len);
+
+ if (__builtin_memcmp (dst, orig_src, len) != 0)
+ {
+ ret = 1;
+ return;
+ }
+}
+
+void
+do_test (char *s1, char *s2, int n, unsigned int len)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ do_one_test (s2, s2, s1, len);
+}
+
+int
+main (void)
+{
+ unsigned char *buf1, *buf2;
+ size_t page_size = 2 * sysconf(_SC_PAGESIZE);
+
+ buf1 = mmap (0, (1 + 1) * page_size, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (buf1 == MAP_FAILED)
+ return -1;
+ if (mprotect (buf1 + 1 * page_size, page_size, PROT_NONE))
+ return -1;
+ buf2 = mmap (0, 2 * page_size, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (buf2 == MAP_FAILED)
+ return -1;
+ if (mprotect (buf2 + page_size, page_size, PROT_NONE))
+ return -1;
+
+ memset (buf1, 0xa5, 1 * page_size);
+ memset (buf2, 0x5a, page_size);
+
+ char *s1 = (char *) buf1;
+ char *s2 = (char *) buf2;
+
+ size_t len;
+ size_t i, j;
+ len = 1 << 2;
+ for (i = 0, j = 1; i < len; i++, j += 23)
+ s1[i] = j;
+
+ do_test (s1, s2, 10, 1 << 2);
+
+ len = 1 << 4;
+ for (i = 0, j = 1; i < len; i++, j += 23)
+ s1[i] = j;
+
+ do_test (s1, s2, 10, 1 << 4);
+
+ return ret;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr95464.c b/gcc/testsuite/gcc.target/i386/pr95464.c
new file mode 100644
index 00000000000..33a8290e0cf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95464.c
@@ -0,0 +1,64 @@
+/* { dg-options "-O2" } */
+/* { dg-do run { target { { *-*-linux* } && { ! ia32 } } } } */
+
+struct S { unsigned a:1, b:1, c:1, d:1, e:14, f:14; };
+
+__attribute__((noipa)) int
+foo (struct S x)
+{
+ if (x.a != 0 || x.b != 1 || x.c != 0 || x.d != 1
+ || x.e != 7239 || x.f != 6474)
+ __builtin_abort ();
+}
+
+__attribute__((noipa)) void
+bar (struct S x, struct S y)
+{
+ if (x.a != 0 || x.b != 1 || x.c != 0 || x.d != 1
+ || x.e != 7239 || x.f != 6474)
+ __builtin_abort ();
+ if (y.a != 0 || y.b != 1 || y.c != 1 || y.d != 1
+ || y.e != 16320 || y.f != 7315)
+ __builtin_abort ();
+}
+
+__attribute__((noipa)) void
+baz (struct S x)
+{
+ if (x.a != 1 || x.b != 1 || x.c != 1 || x.d != 1
+ || x.e != 16320 || x.f != 7315)
+ __builtin_abort ();
+}
+
+__attribute__((noipa)) void
+qux (struct S x, struct S y, unsigned z)
+{
+ struct S a = x, b;
+ for (unsigned i = 0; i < z; ++i)
+ foo (x);
+ if (x.a && x.e == 16)
+ a.e = 32;
+ b = a;
+ b.c = y.c;
+ b.e = y.e;
+ b.f = y.f;
+ bar (a, b);
+ a = b;
+ __asm volatile ("" : : : "ax", "bx", "cx", "dx", "si", "di",
+#ifdef __OPTIMIZE__
+ "bp",
+#endif
+ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15");
+ a.a = 1;
+ a.c = 1;
+ baz (a);
+}
+
+int
+main ()
+{
+ struct S x = { 0, 1, 0, 1, 7239, 6474 };
+ struct S y = { 1, 0, 1, 0, 16320, 7315 };
+ qux (x, y, 1);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr95535-1.c b/gcc/testsuite/gcc.target/i386/pr95535-1.c
new file mode 100644
index 00000000000..df847ffc673
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95535-1.c
@@ -0,0 +1,54 @@
+/* PR target/95535 */
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-O2 -mbmi" } */
+/* { dg-final { scan-assembler-not "cltq" } } */
+
+unsigned int foo (void);
+
+unsigned long
+f1 (unsigned int x)
+{
+ return __builtin_ctz (x);
+}
+
+unsigned long
+f2 (unsigned int x)
+{
+ return (unsigned) __builtin_ctz (x);
+}
+
+unsigned long
+f3 (unsigned int x)
+{
+ return __builtin_ctz (x) & 63ULL;
+}
+
+unsigned long
+f4 (unsigned int x)
+{
+ return __builtin_ctz (x) & 1023ULL;
+}
+
+unsigned long
+f5 (void)
+{
+ return __builtin_ctz (foo ());
+}
+
+unsigned long
+f6 (void)
+{
+ return (unsigned) __builtin_ctz (foo ());
+}
+
+unsigned long
+f7 (void)
+{
+ return __builtin_ctz (foo ()) & 63ULL;
+}
+
+unsigned long
+f8 (void)
+{
+ return __builtin_ctz (foo ()) & 1023ULL;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr95535-2.c b/gcc/testsuite/gcc.target/i386/pr95535-2.c
new file mode 100644
index 00000000000..670ef162740
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95535-2.c
@@ -0,0 +1,54 @@
+/* PR target/95535 */
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-O2 -mlzcnt" } */
+/* { dg-final { scan-assembler-not "cltq" } } */
+
+unsigned int foo (void);
+
+unsigned long
+f1 (unsigned int x)
+{
+ return __builtin_clz (x);
+}
+
+unsigned long
+f2 (unsigned int x)
+{
+ return (unsigned) __builtin_clz (x);
+}
+
+unsigned long
+f3 (unsigned int x)
+{
+ return __builtin_clz (x) & 63ULL;
+}
+
+unsigned long
+f4 (unsigned int x)
+{
+ return __builtin_clz (x) & 1023ULL;
+}
+
+unsigned long
+f5 (void)
+{
+ return __builtin_clz (foo ());
+}
+
+unsigned long
+f6 (void)
+{
+ return (unsigned) __builtin_clz (foo ());
+}
+
+unsigned long
+f7 (void)
+{
+ return __builtin_clz (foo ()) & 63ULL;
+}
+
+unsigned long
+f8 (void)
+{
+ return __builtin_clz (foo ()) & 1023ULL;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr95750.c b/gcc/testsuite/gcc.target/i386/pr95750.c
new file mode 100644
index 00000000000..c47108fb796
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95750.c
@@ -0,0 +1,19 @@
+/* PR target/95750 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=core2" } */
+
+void
+foo (void)
+{
+ __atomic_thread_fence (__ATOMIC_SEQ_CST);
+}
+
+int x;
+
+void
+bar (void)
+{
+ __atomic_store_n (&x, -1, __ATOMIC_SEQ_CST);
+}
+
+/* { dg-final { scan-assembler-not "mfence" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95778-1.c b/gcc/testsuite/gcc.target/i386/pr95778-1.c
new file mode 100644
index 00000000000..3238303d696
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95778-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O3 -fPIC -fno-asynchronous-unwind-tables" } */
+/* { dg-require-ifunc "" } */
+
+__attribute__((target_clones("default,avx2")))
+static int
+f2(int *p)
+{
+ asm volatile ("" :: "r"(p) : "memory");
+ return *p;
+}
+
+__attribute__((target_clones("default,avx2")))
+int
+g2(int *p)
+{
+ return f2(p);
+}
+
+/* { dg-final { scan-assembler "g2.default.1:\n\tjmp\tf2.default.1\n" } } */
+/* { dg-final { scan-assembler "g2.avx2.0:\n\tjmp\tf2.avx2.0\n" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95778-2.c b/gcc/testsuite/gcc.target/i386/pr95778-2.c
new file mode 100644
index 00000000000..e88702d2b82
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95778-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O3 -fPIC -fno-asynchronous-unwind-tables" } */
+/* { dg-require-ifunc "" } */
+
+__attribute__((visibility("internal"),target_clones("default,avx2")))
+int
+f2(int *p)
+{
+ asm volatile ("" :: "r"(p) : "memory");
+ return *p;
+}
+
+__attribute__((target_clones("default,avx2")))
+int
+g2(int *p)
+{
+ return f2(p);
+}
+
+/* { dg-final { scan-assembler "g2.default.1:\n\tjmp\tf2.default.1\n" } } */
+/* { dg-final { scan-assembler "g2.avx2.0:\n\tjmp\tf2.avx2.0\n" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95791.c b/gcc/testsuite/gcc.target/i386/pr95791.c
new file mode 100644
index 00000000000..26a96d47354
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95791.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -mavx512f -mvzeroupper" } */
+
+void
+f(void)
+{
+ __asm__ __volatile__("" ::: "zmm16");
+}
+
+/* { dg-final { scan-assembler-not "vzeroupper" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95866-1.c b/gcc/testsuite/gcc.target/i386/pr95866-1.c
new file mode 100644
index 00000000000..991370cf669
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95866-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-slp2-details -msse2" } */
+
+int x[4];
+void foo(int i)
+{
+ int j = (i+1) & 31;
+ x[0] = (x[0] << j) + j;
+ x[1] = (x[1] << j) + j;
+ x[2] = (x[2] << j) + j;
+ x[3] = (x[3] << j) + j;
+}
+
+/* We should not use vector operations for i + 1 and (i + 1) & 31 but
+ instead use { j, j, j, j }. */
+/* { dg-final { scan-tree-dump-times "Building parent vector operands from scalars" 2 "slp2" } } */
+/* { dg-final { scan-tree-dump-not " = \{i_" "slp2" } } */
+/* { dg-final { scan-tree-dump-times " = \{j_" 1 "slp2" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95973.c b/gcc/testsuite/gcc.target/i386/pr95973.c
new file mode 100644
index 00000000000..08c7dba8f46
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95973.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -Wall" } */
+
+#include <cpuid.h>
+#include <cpuid.h>
+
+int
+main ()
+{
+ unsigned int eax, ebx, ecx, edx;
+ int cpuid_info[4];
+
+ if (!__get_cpuid_count (7, 0, &eax, &ebx, &ecx, &edx))
+ return 0;
+
+ __cpuidex (cpuid_info, 7, 0);
+
+ if (cpuid_info[0] != eax
+ || cpuid_info[1] != ebx
+ || cpuid_info[2] != ecx
+ || cpuid_info[3] != edx)
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr96176.c b/gcc/testsuite/gcc.target/i386/pr96176.c
new file mode 100644
index 00000000000..b8df136034b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr96176.c
@@ -0,0 +1,13 @@
+/* PR target/96176 */
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not "\tmovzbl\t" } } */
+
+unsigned char v;
+
+void
+foo (unsigned char *x, unsigned char y, unsigned char z)
+{
+ __atomic_compare_exchange_n (x, &y, z, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
+ v = y;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr96189-1.c b/gcc/testsuite/gcc.target/i386/pr96189-1.c
new file mode 100644
index 00000000000..fd95cb23794
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr96189-1.c
@@ -0,0 +1,24 @@
+/* PR target/96176 */
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-Os" } */
+/* { dg-final { scan-assembler-not "\tcmpb\t" } } */
+
+_Bool
+foo (short *x, short z)
+{
+ short y = 0;
+ __atomic_compare_exchange_n (x, &y, z, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
+ return y == 0;
+}
+
+/* { dg-final { scan-assembler-not "\ttestw\t" } } */
+
+_Bool
+bar (short *x, short z)
+{
+ short y = -1;
+ __atomic_compare_exchange_n (x, &y, z, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
+ return y == -1;
+}
+
+/* { dg-final { scan-assembler-not "\tincw\t" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr96189.c b/gcc/testsuite/gcc.target/i386/pr96189.c
new file mode 100644
index 00000000000..1505e483b94
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr96189.c
@@ -0,0 +1,12 @@
+/* PR target/96176 */
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not "\tcmpb\t" } } */
+
+_Bool
+foo (unsigned char *x, unsigned char y, unsigned char z)
+{
+ unsigned char y_old = y;
+ __atomic_compare_exchange_n (x, &y, z, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
+ return y == y_old;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr96203-1.c b/gcc/testsuite/gcc.target/i386/pr96203-1.c
new file mode 100644
index 00000000000..332911fc931
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr96203-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcf-protection=check" } */
+/* { dg-final { scan-assembler-not "endbr" } } */
+
+extern int x;
+
+static void
+__attribute__ ((noinline, noclone))
+test (int i)
+{
+ x = i;
+}
+
+void
+bar (int i)
+{
+ test (i);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr96203-2.c b/gcc/testsuite/gcc.target/i386/pr96203-2.c
new file mode 100644
index 00000000000..1141cf2b51f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr96203-2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcf-protection=check -mmanual-endbr" } */
+/* { dg-final { scan-assembler-not "endbr" } } */
+
+extern void bar (void) __attribute__((__cf_check__));
+
+void
+foo (void)
+{
+ bar ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr96539.c b/gcc/testsuite/gcc.target/i386/pr96539.c
new file mode 100644
index 00000000000..fc164f8b889
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr96539.c
@@ -0,0 +1,16 @@
+/* PR rtl-optimization/96539 */
+/* { dg-do compile } *
+/* { dg-options "-Os" } */
+/* { dg-final { scan-assembler-not "rep\[^\n\r]\*movs" } } */
+
+struct A { int a, b, c, d, e, f; void *g, *h, *i, *j, *k, *l, *m; };
+
+int bar (int a);
+int baz (int a, int b, int c, void *p, struct A s);
+
+int
+foo (int a, int b, int c, void *p, struct A s)
+{
+ bar (a);
+ return baz (a, b, c, p, s);
+}
diff --git a/gcc/testsuite/gcc.target/i386/serialize-1.c b/gcc/testsuite/gcc.target/i386/serialize-1.c
new file mode 100644
index 00000000000..29512b85d34
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/serialize-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mserialize" } */
+/* { dg-final { scan-assembler-times "\tserialize" 1 } } */
+
+#include <x86intrin.h>
+
+void
+foo (void)
+{
+ _serialize ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/sse-12.c b/gcc/testsuite/gcc.target/i386/sse-12.c
index 6be531d88bf..b1690d7204f 100644
--- a/gcc/testsuite/gcc.target/i386/sse-12.c
+++ b/gcc/testsuite/gcc.target/i386/sse-12.c
@@ -3,7 +3,7 @@
popcntintrin.h gfniintrin.h and mm_malloc.h are usable
with -O -std=c89 -pedantic-errors. */
/* { dg-do compile } */
-/* { dg-options "-O -std=c89 -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512bw -mavx512dq -mavx512vl -mavx512vbmi -mavx512vbmi2 -mavx512ifma -mavx5124fmaps -mavx5124vnniw -mavx512vpopcntdq -mclwb -mmwaitx -mclzero -mpku -msgx -mrdpid -mgfni -mavx512bitalg -mpconfig -mwbnoinvd -mavx512bf16 -menqcmd -mavx512vp2intersect" } */
+/* { dg-options "-O -std=c89 -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512bw -mavx512dq -mavx512vl -mavx512vbmi -mavx512vbmi2 -mavx512ifma -mavx5124fmaps -mavx5124vnniw -mavx512vpopcntdq -mclwb -mmwaitx -mclzero -mpku -msgx -mrdpid -mgfni -mavx512bitalg -mpconfig -mwbnoinvd -mavx512bf16 -menqcmd -mavx512vp2intersect -mserialize -mtsxldtrk" } */
#include <x86intrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse-13.c b/gcc/testsuite/gcc.target/i386/sse-13.c
index c2b192d72f6..3a6404707c4 100644
--- a/gcc/testsuite/gcc.target/i386/sse-13.c
+++ b/gcc/testsuite/gcc.target/i386/sse-13.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512vl -mavx512dq -mavx512bw -mavx512vbmi -mavx512vbmi2 -mavx512ifma -mavx5124fmaps -mavx5124vnniw -mavx512vpopcntdq -mavx512vp2intersect -mclwb -mmwaitx -mclzero -mpku -msgx -mrdpid -mgfni -mavx512bitalg -mpconfig -mwbnoinvd -mavx512bf16 -menqcmd" } */
+/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512vl -mavx512dq -mavx512bw -mavx512vbmi -mavx512vbmi2 -mavx512ifma -mavx5124fmaps -mavx5124vnniw -mavx512vpopcntdq -mavx512vp2intersect -mclwb -mmwaitx -mclzero -mpku -msgx -mrdpid -mgfni -mavx512bitalg -mpconfig -mwbnoinvd -mavx512bf16 -menqcmd -mserialize -mtsxldtrk" } */
/* { dg-add-options bind_pic_locally } */
#include <mm_malloc.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse-14.c b/gcc/testsuite/gcc.target/i386/sse-14.c
index 0d2b8b3cba0..edaa2aa8ad4 100644
--- a/gcc/testsuite/gcc.target/i386/sse-14.c
+++ b/gcc/testsuite/gcc.target/i386/sse-14.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512dq -mavx512bw -mavx512vl -mavx512ifma -mavx512vbmi -mavx512vbmi2 -mavx5124fmaps -mavx5124vnniw -mavx512vpopcntdq -mclwb -mmwaitx -mclzero -mpku -msgx -mrdpid -mgfni -mpconfig -mwbnoinvd -mavx512vl -mavx512bf16 -menqcmd -mavx512vp2intersect" } */
+/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512dq -mavx512bw -mavx512vl -mavx512ifma -mavx512vbmi -mavx512vbmi2 -mavx5124fmaps -mavx5124vnniw -mavx512vpopcntdq -mclwb -mmwaitx -mclzero -mpku -msgx -mrdpid -mgfni -mpconfig -mwbnoinvd -mavx512vl -mavx512bf16 -menqcmd -mavx512vp2intersect -mserialize -mtsxldtrk" } */
/* { dg-add-options bind_pic_locally } */
#include <mm_malloc.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse-22.c b/gcc/testsuite/gcc.target/i386/sse-22.c
index 9be7f2d5a58..7364b2ff337 100644
--- a/gcc/testsuite/gcc.target/i386/sse-22.c
+++ b/gcc/testsuite/gcc.target/i386/sse-22.c
@@ -8,7 +8,7 @@
/* Test that the intrinsics compile with optimization. All of them
are defined as inline functions in {,x,e,p,t,s,w,a,b,i}mmintrin.h,
mm3dnow.h, fma4intrin.h, xopintrin.h, abmintrin.h, bmiintrin.h,
- tbmintrin.h, lwpintrin.h, popcntintrin.h, fmaintrin.h,
+ tbmintrin.h, lwpintrin.h, popcntintrin.h, fmaintrin.h, tsxldtrkintrin.h,
avx5124fmapsintrin.h, avx5124vnniwintrin.h, avx512vpopcntdqintrin.h,
avx512bitalgintrin.h, avx512vp2intersectintrin.h,
avx512vp2intersectvlintrin.h and mm_malloc.h that reference the proper
@@ -102,7 +102,7 @@
#ifndef DIFFERENT_PRAGMAS
-#pragma GCC target ("sse4a,3dnow,avx,avx2,fma4,xop,aes,pclmul,popcnt,abm,lzcnt,bmi,bmi2,tbm,lwp,fsgsbase,rdrnd,f16c,rtm,rdseed,prfchw,adx,fxsr,xsaveopt,avx512f,avx512er,avx512cd,avx512pf,sha,prefetchwt1,avx512vl,avx512bw,avx512dq,avx512vbmi,avx512vbmi2,avx512ifma,avx5124fmaps,avx5124vnniw,avx512vpopcntdq,gfni,avx512bitalg,avx512bf16,avx512vp2intersect")
+#pragma GCC target ("sse4a,3dnow,avx,avx2,fma4,xop,aes,pclmul,popcnt,abm,lzcnt,bmi,bmi2,tbm,lwp,fsgsbase,rdrnd,f16c,rtm,rdseed,prfchw,adx,fxsr,xsaveopt,avx512f,avx512er,avx512cd,avx512pf,sha,prefetchwt1,avx512vl,avx512bw,avx512dq,avx512vbmi,avx512vbmi2,avx512ifma,avx5124fmaps,avx5124vnniw,avx512vpopcntdq,gfni,avx512bitalg,avx512bf16,avx512vp2intersect,serialize,tsxldtrk")
#endif
/* Following intrinsics require immediate arguments. They
@@ -219,7 +219,7 @@ test_4 (_mm_cmpestrz, int, __m128i, int, __m128i, int, 1)
/* immintrin.h (AVX/AVX2/RDRND/FSGSBASE/F16C/RTM/AVX512F/SHA) */
#ifdef DIFFERENT_PRAGMAS
-#pragma GCC target ("avx,avx2,rdrnd,fsgsbase,f16c,rtm,avx512f,avx512er,avx512cd,avx512pf,sha,avx512vl,avx512bw,avx512dq,avx512ifma,avx512vbmi,avx512vbmi2,avx5124fmaps,avx5124vnniw,avx512vpopcntdq,gfni,avx512bitalg,avx512bf16,avx512vp2intersect")
+#pragma GCC target ("avx,avx2,rdrnd,fsgsbase,f16c,rtm,avx512f,avx512er,avx512cd,avx512pf,sha,avx512vl,avx512bw,avx512dq,avx512ifma,avx512vbmi,avx512vbmi2,avx5124fmaps,avx5124vnniw,avx512vpopcntdq,gfni,avx512bitalg,avx512bf16,avx512vp2intersect,serialize,tsxldtrk")
#endif
#include <immintrin.h>
test_1 (_cvtss_sh, unsigned short, float, 1)
diff --git a/gcc/testsuite/gcc.target/i386/sse-23.c b/gcc/testsuite/gcc.target/i386/sse-23.c
index e98c7693ef7..eaadebef187 100644
--- a/gcc/testsuite/gcc.target/i386/sse-23.c
+++ b/gcc/testsuite/gcc.target/i386/sse-23.c
@@ -7,7 +7,7 @@
/* Test that the intrinsics compile with optimization. All of them
are defined as inline functions in {,x,e,p,t,s,w,a,b,i}mmintrin.h,
mm3dnow.h, fma4intrin.h, xopintrin.h, abmintrin.h, bmiintrin.h,
- tbmintrin.h, lwpintrin.h, popcntintrin.h, fmaintrin.h,
+ tbmintrin.h, lwpintrin.h, popcntintrin.h, fmaintrin.h, tsxtrkintrin.h,
avx5124fmapsintrin.h, avx5124vnniwintrin.h, avx512vpopcntdqintrin.h,
avx512bitalgintrin.h, avx512vp2intersectintrin.h,
avx512vp2intersectvlintrin.h and mm_malloc.h that reference the proper
@@ -697,6 +697,6 @@
#define __builtin_ia32_vpclmulqdq_v2di(A, B, C) __builtin_ia32_vpclmulqdq_v2di(A, B, 1)
#define __builtin_ia32_vpclmulqdq_v8di(A, B, C) __builtin_ia32_vpclmulqdq_v8di(A, B, 1)
-#pragma GCC target ("sse4a,3dnow,avx,avx2,fma4,xop,aes,pclmul,popcnt,abm,lzcnt,bmi,bmi2,tbm,lwp,fsgsbase,rdrnd,f16c,fma,rtm,rdseed,prfchw,adx,fxsr,xsaveopt,avx512f,avx512er,avx512cd,avx512pf,sha,prefetchwt1,xsavec,xsaves,clflushopt,avx512bw,avx512dq,avx512vl,avx512vbmi,avx512ifma,avx5124fmaps,avx5124vnniw,avx512vpopcntdq,clwb,mwaitx,clzero,pku,sgx,rdpid,gfni,avx512vbmi2,vpclmulqdq,avx512bitalg,pconfig,wbnoinvd,avx512bf16,enqcmd,avx512vp2intersect")
+#pragma GCC target ("sse4a,3dnow,avx,avx2,fma4,xop,aes,pclmul,popcnt,abm,lzcnt,bmi,bmi2,tbm,lwp,fsgsbase,rdrnd,f16c,fma,rtm,rdseed,prfchw,adx,fxsr,xsaveopt,avx512f,avx512er,avx512cd,avx512pf,sha,prefetchwt1,xsavec,xsaves,clflushopt,avx512bw,avx512dq,avx512vl,avx512vbmi,avx512ifma,avx5124fmaps,avx5124vnniw,avx512vpopcntdq,clwb,mwaitx,clzero,pku,sgx,rdpid,gfni,avx512vbmi2,vpclmulqdq,avx512bitalg,pconfig,wbnoinvd,avx512bf16,enqcmd,avx512vp2intersect,serialize,tsxldtrk")
#include <x86intrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse2-mmx-18a.c b/gcc/testsuite/gcc.target/i386/sse2-mmx-18a.c
index 3505a5c0cf4..d08da8b4377 100644
--- a/gcc/testsuite/gcc.target/i386/sse2-mmx-18a.c
+++ b/gcc/testsuite/gcc.target/i386/sse2-mmx-18a.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { ! ia32 } } } */
-/* { dg-options "-O2 -msse2 -mno-mmx -mno-avx512vl" } */
+/* { dg-options "-O2 -msse2 -mno-mmx" } */
/* { dg-final { scan-assembler-times "pshufd" 1 } } */
/* { dg-final { scan-assembler-times "movd" 1 } } */
/* { dg-final { scan-assembler-not "movl" } } */
diff --git a/gcc/testsuite/gcc.target/i386/sse2-mmx-18b.c b/gcc/testsuite/gcc.target/i386/sse2-mmx-18b.c
deleted file mode 100644
index 9b267b17346..00000000000
--- a/gcc/testsuite/gcc.target/i386/sse2-mmx-18b.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/* { dg-do compile { target { ! ia32 } } } */
-/* { dg-options "-O2 -mno-mmx -mavx512bw -mavx512vl" } */
-/* { dg-final { scan-assembler-times "pbroadcastd" 1 } } */
-/* { dg-final { scan-assembler-not "movd" } } */
-/* { dg-final { scan-assembler-not "movl" } } */
-
-#include "sse2-mmx-18a.c"
diff --git a/gcc/testsuite/gcc.target/i386/sse2-mmx-18c.c b/gcc/testsuite/gcc.target/i386/sse2-mmx-18c.c
deleted file mode 100644
index 394f05b6b49..00000000000
--- a/gcc/testsuite/gcc.target/i386/sse2-mmx-18c.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/* { dg-do compile { target { ! ia32 } } } */
-/* { dg-options "-O2 -mno-mmx -mavx512bw -mno-avx512vl" } */
-/* { dg-final { scan-assembler-times "pshufd" 1 } } */
-/* { dg-final { scan-assembler-times "movd" 1 } } */
-/* { dg-final { scan-assembler-not "movl" } } */
-
-#include "sse2-mmx-18a.c"
diff --git a/gcc/testsuite/gcc.target/i386/sse2-mmx-19a.c b/gcc/testsuite/gcc.target/i386/sse2-mmx-19a.c
index 9715ace241f..7f8b8b26196 100644
--- a/gcc/testsuite/gcc.target/i386/sse2-mmx-19a.c
+++ b/gcc/testsuite/gcc.target/i386/sse2-mmx-19a.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { ! ia32 } } } */
-/* { dg-options "-O2 -msse2 -mno-mmx -mno-avx -mtune=intel" } */
+/* { dg-options "-O2 -msse2 -mno-mmx -mtune=intel" } */
/* { dg-final { scan-assembler-times "pshuflw" 1 } } */
/* { dg-final { scan-assembler-times "movd" 1 } } */
/* { dg-final { scan-assembler-not "movl" } } */
diff --git a/gcc/testsuite/gcc.target/i386/sse2-mmx-19b.c b/gcc/testsuite/gcc.target/i386/sse2-mmx-19b.c
deleted file mode 100644
index a6d42313336..00000000000
--- a/gcc/testsuite/gcc.target/i386/sse2-mmx-19b.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/* { dg-do compile { target { ! ia32 } } } */
-/* { dg-options "-O2 -mno-mmx -mavx512bw -mavx512vl" } */
-/* { dg-final { scan-assembler-times "pbroadcastw" 1 } } */
-/* { dg-final { scan-assembler-not "movd" } } */
-/* { dg-final { scan-assembler-not "movl" } } */
-
-#include "sse2-mmx-19a.c"
diff --git a/gcc/testsuite/gcc.target/i386/sse2-mmx-19c.c b/gcc/testsuite/gcc.target/i386/sse2-mmx-19c.c
deleted file mode 100644
index b02dc8c2ffd..00000000000
--- a/gcc/testsuite/gcc.target/i386/sse2-mmx-19c.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/* { dg-do compile { target { ! ia32 } } } */
-/* { dg-options "-O2 -mno-mmx -mavx -mno-avx2 -mtune=intel" } */
-/* { dg-final { scan-assembler-times "pshuflw" 1 } } */
-/* { dg-final { scan-assembler-times "movd" 1 } } */
-/* { dg-final { scan-assembler-not "movl" } } */
-
-#include "sse2-mmx-19a.c"
diff --git a/gcc/testsuite/gcc.target/i386/sse2-mmx-19d.c b/gcc/testsuite/gcc.target/i386/sse2-mmx-19d.c
deleted file mode 100644
index 54691883c9c..00000000000
--- a/gcc/testsuite/gcc.target/i386/sse2-mmx-19d.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/* { dg-do compile { target { ! ia32 } } } */
-/* { dg-options "-O2 -mno-mmx -mavx512bw -mno-avx512vl -mtune=intel" } */
-/* { dg-final { scan-assembler-times "pbroadcastw" 1 } } */
-/* { dg-final { scan-assembler-times "movd" 1 } } */
-/* { dg-final { scan-assembler-not "movl" } } */
-
-#include "sse2-mmx-19a.c"
diff --git a/gcc/testsuite/gcc.target/i386/sse2-mmx-19e.c b/gcc/testsuite/gcc.target/i386/sse2-mmx-19e.c
deleted file mode 100644
index 8be973cc4fc..00000000000
--- a/gcc/testsuite/gcc.target/i386/sse2-mmx-19e.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/* { dg-do compile { target { ! ia32 } } } */
-/* { dg-options "-O2 -mno-mmx -mavx2 -mno-avx512f -mtune=intel" } */
-/* { dg-final { scan-assembler-times "pbroadcastw" 1 } } */
-/* { dg-final { scan-assembler-times "movd" 1 } } */
-/* { dg-final { scan-assembler-not "movl" } } */
-
-#include "sse2-mmx-19a.c"
diff --git a/gcc/testsuite/gcc.target/i386/sse2-shiftqihi-constant-1.c b/gcc/testsuite/gcc.target/i386/sse2-shiftqihi-constant-1.c
new file mode 100644
index 00000000000..f1c68cb2972
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/sse2-shiftqihi-constant-1.c
@@ -0,0 +1,31 @@
+/* PR target/95524 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse2" } */
+/* { dg-final { scan-assembler-times "pand\[^\n\]*%xmm" 3 { xfail *-*-* } } } */
+typedef char v16qi __attribute__ ((vector_size (16)));
+typedef unsigned char v16uqi __attribute__ ((vector_size (16)));
+
+__attribute__((noipa)) v16qi
+foo_ashiftrt_128 (v16qi a)
+{
+ return a >> 2;
+}
+/* { dg-final { scan-assembler-times "psraw\[^\n\]*%xmm" 1 } } */
+/* { dg-final { scan-assembler-times "pxor\[^\n\]*%xmm" 1 } } */
+/* { dg-final { scan-assembler-times "psubb\[^\n\]*%xmm" 1 } } */
+
+__attribute__((noipa)) v16qi
+foo_ashift_128 (v16qi a)
+{
+ return a << 7;
+}
+
+/* { dg-final { scan-assembler-times "psllw\[^\n\]*%xmm" 1 { xfail *-*-* } } } */
+
+__attribute__((noipa)) v16uqi
+foo_lshiftrt_128 (v16uqi a)
+{
+ return a >> 2;
+}
+
+/* { dg-final { scan-assembler-times "psrlw\[^\n\]*%xmm" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/sse2-shiftqihi-constant-2.c b/gcc/testsuite/gcc.target/i386/sse2-shiftqihi-constant-2.c
new file mode 100644
index 00000000000..d95171f7a47
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/sse2-shiftqihi-constant-2.c
@@ -0,0 +1,62 @@
+/* PR target/95524 */
+/* { dg-do run } */
+/* { dg-options "-O2 -msse2 -Wno-shift-count-overflow" } */
+
+#ifndef CHECK
+#define CHECK "sse2-check.h"
+#endif
+
+#include CHECK
+
+#ifndef TEST
+#define TEST sse2_test
+#endif
+
+typedef char v16qi __attribute__ ((vector_size (16)));
+typedef unsigned char v16uqi __attribute__ ((vector_size (16)));
+
+#define TEST_SHIFT(N) \
+ do \
+ { \
+ int i; \
+ for (i = 0; i < 16; i++) \
+ exp1.a[i] = op1.a[i] << N; \
+ res1.x = (__m128i) (((v16qi) op1.x) << N); \
+ if (check_union128i_b (res1, exp1.a)) \
+ abort (); \
+ \
+ for (i = 0; i < 16; i++) \
+ exp1.a[i] = op1.a[i] >> N; \
+ res1.x = (__m128i) (((v16qi) op1.x) >> N); \
+ if (check_union128i_b (res1, exp1.a)) \
+ abort (); \
+ \
+ for (i = 0; i < 16; i++) \
+ exp2.a[i] = op2.a[i] >> N; \
+ res2.x = (__m128i) (((v16uqi) op2.x >> N)); \
+ if (check_union128i_ub (res2, exp2.a)) \
+ abort (); \
+ } \
+ while (0)
+
+static void
+TEST (void)
+{
+ union128i_b op1, exp1, res1;
+ union128i_ub op2, exp2, res2;
+ for (int i = 0; i != 16; i++)
+ {
+ op2.a[i] = i * i;
+ op1.a[i] = i * i + 200 * i;
+ }
+ TEST_SHIFT (0);
+ TEST_SHIFT (1);
+ TEST_SHIFT (2);
+ TEST_SHIFT (3);
+ TEST_SHIFT (4);
+ TEST_SHIFT (5);
+ TEST_SHIFT (6);
+ TEST_SHIFT (7);
+ TEST_SHIFT (8);
+}
+
diff --git a/gcc/testsuite/gcc.target/i386/strncmp-1.c b/gcc/testsuite/gcc.target/i386/strncmp-1.c
new file mode 100644
index 00000000000..044fc5cc5fa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/strncmp-1.c
@@ -0,0 +1,47 @@
+/* { dg-do run { target mmap } } */
+/* { dg-options "-O2" } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/mman.h>
+
+#ifndef MAP_ANONYMOUS
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+
+int
+__attribute__ ((noclone, noinline))
+compare (char *d, char *s, unsigned int l)
+{
+ return __builtin_strncmp (d, s, l);
+}
+
+int
+main ()
+{
+ size_t page_size = sysconf(_SC_PAGESIZE);
+ char *buf = mmap (0, 2 * page_size, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ if (buf == MAP_FAILED)
+ {
+ perror ("mmap");
+ abort ();
+ }
+
+ if (mprotect (buf + page_size, page_size, PROT_NONE))
+ {
+ perror ("mprotect");
+ abort ();
+ }
+
+ char *src1 = buf + page_size - sizeof ("foo");
+ char *src2 = buf;
+ memcpy (src1, "foo", sizeof ("foo"));
+ memcpy (src2, "foo", sizeof ("foo"));
+ int result = compare (src1, src2, sizeof ("foo") + 16);
+ if (result != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/tsxldtrk-1.c b/gcc/testsuite/gcc.target/i386/tsxldtrk-1.c
new file mode 100644
index 00000000000..c197b9f1143
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/tsxldtrk-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mtsxldtrk" } */
+/* { dg-final { scan-assembler "xsusldtrk" } } */
+/* { dg-final { scan-assembler "xresldtrk" } } */
+
+#include <immintrin.h>
+
+void
+foo (void)
+{
+ _xsusldtrk ();
+ _xresldtrk ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/vect-pr67800.c b/gcc/testsuite/gcc.target/i386/vect-pr67800.c
index 324510858ff..8bd308c83f6 100644
--- a/gcc/testsuite/gcc.target/i386/vect-pr67800.c
+++ b/gcc/testsuite/gcc.target/i386/vect-pr67800.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details" } */
-/* { dg-additional-options "-msse4.2" } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -msse4.2" } */
#define ubyte unsigned char
#define byte char
diff --git a/gcc/testsuite/gcc.target/i386/vperm-v2sf.c b/gcc/testsuite/gcc.target/i386/vperm-v2sf.c
new file mode 100644
index 00000000000..7bf6defb0f1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/vperm-v2sf.c
@@ -0,0 +1,41 @@
+/* { dg-do run { target { ! ia32 } } } */
+/* { dg-options "-O -msse2" } */
+/* { dg-require-effective-target sse2 } */
+
+#include "isa-check.h"
+#include "sse-os-support.h"
+
+typedef float S;
+typedef float V __attribute__((vector_size(8)));
+typedef int IV __attribute__((vector_size(8)));
+typedef union { S s[2]; V v; } U;
+
+static U i[2], b, c;
+
+extern int memcmp (const void *, const void *, __SIZE_TYPE__);
+#define assert(T) ((T) || (__builtin_trap (), 0))
+
+#define TEST(E0, E1) \
+ b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){E0, E1}); \
+ c.s[0] = i[0].s[E0]; \
+ c.s[1] = i[0].s[E1]; \
+ __asm__("" : : : "memory"); \
+ assert (memcmp (&b, &c, sizeof(c)) == 0);
+
+#include "vperm-2-2.inc"
+
+int main()
+{
+ check_isa ();
+
+ if (!sse_os_support ())
+ exit (0);
+
+ i[0].s[0] = 0;
+ i[0].s[1] = 1;
+ i[0].s[2] = 2;
+ i[0].s[3] = 3;
+
+ check();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/vperm-v2si.c b/gcc/testsuite/gcc.target/i386/vperm-v2si.c
new file mode 100644
index 00000000000..5b38b316e3b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/vperm-v2si.c
@@ -0,0 +1,41 @@
+/* { dg-do run { target { ! ia32 } } } */
+/* { dg-options "-O -msse2" } */
+/* { dg-require-effective-target sse2 } */
+
+#include "isa-check.h"
+#include "sse-os-support.h"
+
+typedef int S;
+typedef int V __attribute__((vector_size(8)));
+typedef int IV __attribute__((vector_size(8)));
+typedef union { S s[2]; V v; } U;
+
+static U i[2], b, c;
+
+extern int memcmp (const void *, const void *, __SIZE_TYPE__);
+#define assert(T) ((T) || (__builtin_trap (), 0))
+
+#define TEST(E0, E1) \
+ b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){E0, E1}); \
+ c.s[0] = i[0].s[E0]; \
+ c.s[1] = i[0].s[E1]; \
+ __asm__("" : : : "memory"); \
+ assert (memcmp (&b, &c, sizeof(c)) == 0);
+
+#include "vperm-2-2.inc"
+
+int main()
+{
+ check_isa ();
+
+ if (!sse_os_support ())
+ exit (0);
+
+ i[0].s[0] = 0;
+ i[0].s[1] = 1;
+ i[0].s[2] = 2;
+ i[0].s[3] = 3;
+
+ check();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/vperm-v4hi.c b/gcc/testsuite/gcc.target/i386/vperm-v4hi.c
new file mode 100644
index 00000000000..bff6512672d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/vperm-v4hi.c
@@ -0,0 +1,47 @@
+/* { dg-do run { target { ! ia32 } } } */
+/* { dg-options "-O -msse2" } */
+/* { dg-require-effective-target sse2 } */
+
+#include "isa-check.h"
+#include "sse-os-support.h"
+
+typedef short S;
+typedef short V __attribute__((vector_size(8)));
+typedef short IV __attribute__((vector_size(8)));
+typedef union { S s[4]; V v; } U;
+
+static U i[2], b, c;
+
+extern int memcmp (const void *, const void *, __SIZE_TYPE__);
+#define assert(T) ((T) || (__builtin_trap (), 0))
+
+#define TEST(E0, E1, E2, E3) \
+ b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){E0, E1, E2, E3}); \
+ c.s[0] = i[0].s[E0]; \
+ c.s[1] = i[0].s[E1]; \
+ c.s[2] = i[0].s[E2]; \
+ c.s[3] = i[0].s[E3]; \
+ __asm__("" : : : "memory"); \
+ assert (memcmp (&b, &c, sizeof(c)) == 0);
+
+#include "vperm-4-2.inc"
+
+int main()
+{
+ check_isa ();
+
+ if (!sse_os_support ())
+ exit (0);
+
+ i[0].s[0] = 0;
+ i[0].s[1] = 1;
+ i[0].s[2] = 2;
+ i[0].s[3] = 3;
+ i[0].s[4] = 4;
+ i[0].s[5] = 5;
+ i[0].s[6] = 6;
+ i[0].s[7] = 7;
+
+ check();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c
index 9fd75c98773..bf22f064288 100644
--- a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c
+++ b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips" } */
-/* { dg-additional-options "-fno-inline -fipa-ra -mcompact-branches=never" } */
+/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips -fno-inline -fipa-ra -mcompact-branches=never" } */
/* { dg-skip-if "needs codesize optimization" { *-*-* } { "-O0" "-O1" "-O2" "-O3" } { "" } } */
static int foo (void* p) { __asm__ (""::"r"(p):"$t0"); return 0; }
diff --git a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c
index 580c6ec069d..805b31af9f0 100644
--- a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c
+++ b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips" } */
-/* { dg-additional-options "-fno-inline -fipa-ra -mcompact-branches=never" } */
+/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips -fno-inline -fipa-ra -mcompact-branches=never" } */
/* { dg-skip-if "needs codesize optimization" { *-*-* } { "-O0" "-O1" "-O2" "-O3" } { "" } } */
static int foo (void* p) { return 0; }
diff --git a/gcc/testsuite/gcc.target/msp430/region-attribute-misuse.c b/gcc/testsuite/gcc.target/msp430/region-attribute-misuse.c
index a108e274123..2b5107f0b8c 100644
--- a/gcc/testsuite/gcc.target/msp430/region-attribute-misuse.c
+++ b/gcc/testsuite/gcc.target/msp430/region-attribute-misuse.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-mcpu=msp430" "-mlarge" "-mcode-region=*" "-mdata-region=*" } { "" } } */
-/* { dg-final { scan-assembler-not ".section.*bss" } } */
/* { dg-final { scan-assembler ".section.*upper.data" } } */
/* { dg-final { scan-assembler ".section.*lower.data" } } */
/* { dg-final { scan-assembler ".section.*either.data" } } */
diff --git a/gcc/testsuite/gcc.target/nvptx/cvt.c b/gcc/testsuite/gcc.target/nvptx/cvt.c
new file mode 100644
index 00000000000..279ec16b14c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/cvt.c
@@ -0,0 +1,13 @@
+/* { dg-do assemble } */
+/* { dg-options "-O2 -save-temps" } */
+
+signed short s;
+signed char c;
+
+void
+foo (void)
+{
+ s = c;
+}
+
+/* { dg-final { scan-assembler "(?n)cvt\\.s16\\.s8.*%r" } } */
diff --git a/gcc/testsuite/gcc.target/nvptx/ia64-sync-1.c b/gcc/testsuite/gcc.target/nvptx/ia64-sync-1.c
new file mode 100644
index 00000000000..7685a799642
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/ia64-sync-1.c
@@ -0,0 +1,2 @@
+/* { dg-do run } */
+#include "../../gcc.dg/ia64-sync-1.c"
diff --git a/gcc/testsuite/gcc.target/nvptx/ia64-sync-2.c b/gcc/testsuite/gcc.target/nvptx/ia64-sync-2.c
new file mode 100644
index 00000000000..d229b5f9181
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/ia64-sync-2.c
@@ -0,0 +1,2 @@
+/* { dg-do run } */
+#include "../../gcc.dg/ia64-sync-2.c"
diff --git a/gcc/testsuite/gcc.target/nvptx/ia64-sync-3.c b/gcc/testsuite/gcc.target/nvptx/ia64-sync-3.c
new file mode 100644
index 00000000000..353fd74da57
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/ia64-sync-3.c
@@ -0,0 +1,2 @@
+/* { dg-do run } */
+#include "../../gcc.dg/ia64-sync-3.c"
diff --git a/gcc/testsuite/gcc.target/nvptx/ia64-sync-4.c b/gcc/testsuite/gcc.target/nvptx/ia64-sync-4.c
new file mode 100644
index 00000000000..3547429fe09
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/ia64-sync-4.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -finline-functions" } */
+#include "../../gcc.dg/ia64-sync-4.c"
diff --git a/gcc/testsuite/gcc.target/nvptx/ia64-sync-5.c b/gcc/testsuite/gcc.target/nvptx/ia64-sync-5.c
new file mode 100644
index 00000000000..ec40f2ca7a9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/ia64-sync-5.c
@@ -0,0 +1,2 @@
+/* { dg-do run } */
+#include "../../gcc.dg/ia64-sync-5.c"
diff --git a/gcc/testsuite/gcc.target/nvptx/mul-hi.c b/gcc/testsuite/gcc.target/nvptx/mul-hi.c
new file mode 100644
index 00000000000..c66fa38623b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/mul-hi.c
@@ -0,0 +1,15 @@
+/* { dg-do assemble } */
+/* { dg-options "-O2 -save-temps" } */
+
+short smulhi3_highpart(short x, short y)
+{
+ return ((int)x * (int)y) >> 16;
+}
+
+int smulsi3_highpart(int x, int y)
+{
+ return ((long)x * (long)y) >> 32;
+}
+
+/* { dg-final { scan-assembler-times "mul.hi.s16" 1 } } */
+/* { dg-final { scan-assembler-times "mul.hi.s32" 1 } } */
diff --git a/gcc/testsuite/gcc.target/nvptx/mul-wide.c b/gcc/testsuite/gcc.target/nvptx/mul-wide.c
new file mode 100644
index 00000000000..d84ec2e7aab
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/mul-wide.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int mulhisi3(short x, short y)
+{
+ return (int)x * (int)y;
+}
+
+long mulsidi3(int x, int y)
+{
+ return (long)x * (long)y;
+}
+
+/* { dg-final { scan-assembler-times "mul.wide.s16" 1 } } */
+/* { dg-final { scan-assembler-times "mul.wide.s32" 1 } } */
+
diff --git a/gcc/testsuite/gcc.target/nvptx/popc-1.c b/gcc/testsuite/gcc.target/nvptx/popc-1.c
new file mode 100644
index 00000000000..40e8cfd226a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/popc-1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+unsigned int foo(unsigned int x)
+{
+ return __builtin_popcount(x);
+}
+
+/* { dg-final { scan-assembler-times "popc.b32" 1 } } */
diff --git a/gcc/testsuite/gcc.target/nvptx/popc-2.c b/gcc/testsuite/gcc.target/nvptx/popc-2.c
new file mode 100644
index 00000000000..90bda4ad452
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/popc-2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+unsigned long foo(unsigned long x)
+{
+ return __builtin_popcountl(x);
+}
+
+/* { dg-final { scan-assembler-times "popc.b64" 1 } } */
+/* { dg-final { scan-assembler-times "cvt.s64.s32" 1 } } */
+
diff --git a/gcc/testsuite/gcc.target/nvptx/popc-3.c b/gcc/testsuite/gcc.target/nvptx/popc-3.c
new file mode 100644
index 00000000000..d5d4e159bdf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/popc-3.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+unsigned int foo(unsigned long x)
+{
+ return __builtin_popcountl(x);
+}
+
+/* { dg-final { scan-assembler-times "popc.b64" 1 } } */
+/* { dg-final { scan-assembler-times "cvt.s64.s32" 0 } } */
+
diff --git a/gcc/testsuite/gcc.target/nvptx/recip-1.c b/gcc/testsuite/gcc.target/nvptx/recip-1.c
new file mode 100644
index 00000000000..18127876046
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/recip-1.c
@@ -0,0 +1,18 @@
+/* { dg-do assemble } */
+/* { dg-options "-O2 -save-temps" } */
+
+double
+foo (double x)
+{
+ return 1.0 / x;
+}
+
+float
+foof (float x)
+{
+ return 1.0f / x;
+}
+
+/* { dg-final { scan-assembler-times "rcp.rn.f64" 1 } } */
+/* { dg-final { scan-assembler-times "rcp.rn.f32" 1 } } */
+
diff --git a/gcc/testsuite/gcc.target/nvptx/shift16.c b/gcc/testsuite/gcc.target/nvptx/shift16.c
new file mode 100644
index 00000000000..185aa62fa9a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/shift16.c
@@ -0,0 +1,30 @@
+/* { dg-do assemble } */
+/* { dg-options "-O2 -save-temps" } */
+
+void
+foo (unsigned short u)
+{
+ volatile unsigned short u2 = u << 5;
+}
+
+void
+foo2 (short s)
+{
+ volatile unsigned short s2 = s << 5;
+}
+
+void
+foo3 (unsigned short u)
+{
+ volatile unsigned short u2 = u >> 5;
+}
+
+void
+foo4 (signed short s)
+{
+ volatile signed short s2 = s >> 5;
+}
+
+/* { dg-final { scan-assembler-times "(?n)shl\\.b16.*%r" 2 } } */
+/* { dg-final { scan-assembler "(?n)shr\\.u16.*%r" } } */
+/* { dg-final { scan-assembler "(?n)shr\\.s16.*%r" } } */
diff --git a/gcc/testsuite/gcc.target/nvptx/umul-hi.c b/gcc/testsuite/gcc.target/nvptx/umul-hi.c
new file mode 100644
index 00000000000..3b35d6b50ec
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/umul-hi.c
@@ -0,0 +1,15 @@
+/* { dg-do assemble } */
+/* { dg-options "-O2 -save-temps" } */
+
+unsigned short umulhi3_highpart(unsigned short x, unsigned short y)
+{
+ return ((unsigned int)x * (unsigned int)y) >> 16;
+}
+
+unsigned int umulsi3_highpart(unsigned int x, unsigned int y)
+{
+ return ((unsigned long)x * (unsigned long)y) >> 32;
+}
+
+/* { dg-final { scan-assembler-times "mul.hi.u16" 1 } } */
+/* { dg-final { scan-assembler-times "mul.hi.u32" 1 } } */
diff --git a/gcc/testsuite/gcc.target/nvptx/umul-wide.c b/gcc/testsuite/gcc.target/nvptx/umul-wide.c
new file mode 100644
index 00000000000..cc9f20d329f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/umul-wide.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+unsigned int umulhisi3(unsigned short x, unsigned short y)
+{
+ return (unsigned int)x * (unsigned int)y;
+}
+
+unsigned long umulsidi3(unsigned int x, unsigned int y)
+{
+ return (unsigned long)x * (unsigned long)y;
+}
+
+/* { dg-final { scan-assembler-times "mul.wide.u16" 1 } } */
+/* { dg-final { scan-assembler-times "mul.wide.u32" 1 } } */
+
diff --git a/gcc/testsuite/gcc.target/nvptx/v2si-cvt.c b/gcc/testsuite/gcc.target/nvptx/v2si-cvt.c
index 73f86bcfa9e..35b9fc3ce26 100644
--- a/gcc/testsuite/gcc.target/nvptx/v2si-cvt.c
+++ b/gcc/testsuite/gcc.target/nvptx/v2si-cvt.c
@@ -3,37 +3,25 @@
typedef int __v2si __attribute__((__vector_size__(8)));
-int __attribute__((unused))
+__v2si __attribute__((unused))
vector_cvt (__v2si arg)
{
- __v2si val4 = arg;
- char *p = (char*)&val4;
+ unsigned short *p = (unsigned short*)&arg;
- if (p[0] != 1)
- return 1;
- if (p[1] != 2)
- return 1;
- if (p[2] != 3)
- return 1;
+ volatile unsigned short s = p[0];
- return 0;
+ return arg;
}
-int
-vector_cvt_2 (__v2si val, __v2si val2)
+__v2si __attribute__((unused))
+vector_cvt_2 (__v2si arg)
{
- char *p = (char*)&val;
- char *p2 = (char*)&val2;
+ unsigned char *p = (unsigned char*)&arg;
- if (p[0] != p2[0])
- return 1;
- if (p[4] != p2[4])
- return 1;
+ volatile unsigned char s = p[0];
- return 0;
+ return arg;
}
-/* We want to test for 'mov.t' here, but given PR80845 we test for cvt.t.t
- instead.
- { dg-final { scan-assembler "(?n)cvt\\.u32\\.u32.*\\.x" } } */
-/* { dg-final { scan-assembler "(?n)cvt\\.u16\\.u32.*\\.x" } } */
+/* Todo: We'd like to generate insns with .x operands to access the v2si
+ operands, but that's currently not done, see PR96403. */
diff --git a/gcc/testsuite/gcc.target/nvptx/v2si-vec-set-extract.c b/gcc/testsuite/gcc.target/nvptx/v2si-vec-set-extract.c
new file mode 100644
index 00000000000..a0709e50718
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/v2si-vec-set-extract.c
@@ -0,0 +1,25 @@
+/* { dg-do assemble } */
+/* { dg-options "-O2 -save-temps" } */
+
+typedef int __v2si __attribute__((__vector_size__(8)));
+
+int
+foo (__v2si arg)
+{
+ return arg[0] + arg[1];
+}
+
+__v2si
+foo2 (unsigned int a, unsigned int b)
+{
+ __v2si res;
+ res[0] = a;
+ res[1] = b;
+ return res;
+}
+
+/* { dg-final { scan-assembler "mov.u32.*\\.x;" } } */
+/* { dg-final { scan-assembler "mov.u32.*\\.y;" } } *
+
+/* { dg-final { scan-assembler "mov.u32\[\t\]%r\[0-9\]\[0-9\]*\\.x, " } } */
+/* { dg-final { scan-assembler "mov.u32\[\t\]%r\[0-9\]\[0-9\]*\\.y, " } } */
diff --git a/gcc/testsuite/gcc.target/nvptx/vadd_add.c b/gcc/testsuite/gcc.target/nvptx/vadd_add.c
new file mode 100644
index 00000000000..dcb23942f36
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/vadd_add.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int foo(int x, int y, int z)
+{
+ return x + y + z;
+}
+
+unsigned int bar(unsigned int x, unsigned int y, unsigned int z)
+{
+ return x + y + z;
+}
+
+/* { dg-final { scan-assembler-times "vadd.u32.u32.u32.add" 2 } } */
+
diff --git a/gcc/testsuite/gcc.target/nvptx/vsub_add.c b/gcc/testsuite/gcc.target/nvptx/vsub_add.c
new file mode 100644
index 00000000000..3f632c9ba82
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/vsub_add.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int foo(int x, int y, int z)
+{
+ return (x - y) + z;
+}
+
+int bar(int x, int y, int z)
+{
+ return x + (y - z);
+}
+
+unsigned int ufoo(unsigned int x, unsigned int y, unsigned int z)
+{
+ return (x - y) + z;
+}
+
+unsigned int ubar(unsigned int x, unsigned int y, unsigned int z)
+{
+ return x + (y - z);
+}
+
+/* { dg-final { scan-assembler-times "vsub.u32.u32.u32.add" 4 } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/20030218-1.c b/gcc/testsuite/gcc.target/powerpc/20030218-1.c
deleted file mode 100644
index 6783052029c..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/20030218-1.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=8540 -mspe -mabi=spe -mfloat-gprs=single" } */
-/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } } */
-
-/* Test vectors that can interconvert without a cast. */
-
-__ev64_opaque__ opp;
-int vint __attribute__((vector_size (8)));
-short vshort __attribute__((vector_size (8)));
-float vfloat __attribute__((vector_size (8)));
-
-int
-main (void)
-{
- __ev64_opaque__ george = { 1, 2 }; /* { dg-error "opaque vector types cannot be initialized" } */
-
- opp = vfloat;
- vshort = opp;
- vfloat = vshort; /* { dg-error "incompatible types when assigning" } */
-
- /* Just because this is a V2SI, it doesn't make it an opaque. */
- vint = vshort; /* { dg-message "note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts" } */
- /* { dg-error "incompatible types when assigning" "" { target *-*-* } .-1 } */
-
- return 0;
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/20030505.c b/gcc/testsuite/gcc.target/powerpc/20030505.c
deleted file mode 100644
index bd7994654a0..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/20030505.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-W -mdejagnu-cpu=8540 -mspe -mabi=spe -mfloat-gprs=single" } */
-/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } } */
-
-#define __vector __attribute__((vector_size(8)))
-
-typedef float __vector __ev64_fs__;
-
-__ev64_opaque__ *p1;
-__ev64_fs__ *p2;
-int *x;
-
-extern void f (__ev64_opaque__ *); /* { dg-message "expected.*but argument is of type" } */
-
-int main ()
-{
- f (x); /* { dg-warning "incompatible pointer type" } */
- f (p1);
- f (p2);
- return 0;
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/20081204-1.c b/gcc/testsuite/gcc.target/powerpc/20081204-1.c
deleted file mode 100644
index 98332ec9673..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/20081204-1.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/* Test for ICE arising from inconsistent use of TARGET_E500 versus
- TARGET_HARD_FLOAT && !TARGET_FPRS. */
-/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=750 -mfloat-gprs=single" } */
-/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } } */
-
-static int comp(const void *a,const void *b){
- return (*(float *)a<*(float *)b)-(*(float *)a>*(float *)b);
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/bcd-1.c b/gcc/testsuite/gcc.target/powerpc/bcd-1.c
index 1a086eb3620..00a6f84c3d8 100644
--- a/gcc/testsuite/gcc.target/powerpc/bcd-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/bcd-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile { target { powerpc*-*-linux* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mdejagnu-cpu=power7 -O2" } */
/* { dg-final { scan-assembler-times "cdtbcd " 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/bcd-2.c b/gcc/testsuite/gcc.target/powerpc/bcd-2.c
index b623064b90a..2f51dee257f 100644
--- a/gcc/testsuite/gcc.target/powerpc/bcd-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/bcd-2.c
@@ -1,6 +1,5 @@
/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
/* { dg-final { scan-assembler-times "bcdadd\[.\] " 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/bcd-3.c b/gcc/testsuite/gcc.target/powerpc/bcd-3.c
index d77170fe85d..1b20841ae1c 100644
--- a/gcc/testsuite/gcc.target/powerpc/bcd-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/bcd-3.c
@@ -1,6 +1,5 @@
/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
/* { dg-final { scan-assembler-times "bcdadd\[.\] " 4 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/bswap-brd.c b/gcc/testsuite/gcc.target/powerpc/bswap-brd.c
new file mode 100644
index 00000000000..876129eb633
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/bswap-brd.c
@@ -0,0 +1,23 @@
+/* { dg-do compile { target { lp64 } } } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* This tests whether GCC generates the ISA 3.1 BRW byte swap instruction for
+ GPR data, but generates XXBRW for data in a vector register. */
+
+unsigned long long
+bswap_ll (unsigned long long a)
+{
+ return __builtin_bswap64 (a); /* { dg-final { scan-assembler {\mbrd\M} } } */
+}
+
+double
+bswap_ll_dbl (unsigned long long a)
+{
+ unsigned int b = a;
+ /* Force the value to be loaded into a vector register. */
+ __asm__ (" # %x0" : "+wa" (b));
+
+ /* { dg-final { scan-assembler {\mxxbrd\M} } } */
+ return (double) __builtin_bswap64 (b);
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/bswap-brh.c b/gcc/testsuite/gcc.target/powerpc/bswap-brh.c
new file mode 100644
index 00000000000..4dbab12891b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/bswap-brh.c
@@ -0,0 +1,11 @@
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* This tests whether GCC generates the ISA 3.1 16-bit byte swap
+ instruction BRH. */
+
+unsigned short
+bswap_short (unsigned short a)
+{
+ return __builtin_bswap16 (a); /* { dg-final { scan-assembler {\mbrh\M} } } */
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/bswap-brw.c b/gcc/testsuite/gcc.target/powerpc/bswap-brw.c
new file mode 100644
index 00000000000..b3f923eea84
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/bswap-brw.c
@@ -0,0 +1,22 @@
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* This tests whether GCC generates the ISA 3.1 BRW byte swap instruction for
+ GPR data, but generates XXBRW for data in a vector register. */
+
+unsigned int
+bswap_int (unsigned int a)
+{
+ return __builtin_bswap32 (a); /* { dg-final { scan-assembler {\mbrw\M} } } */
+}
+
+double
+bswap_int_dbl (unsigned int a)
+{
+ unsigned int b = a;
+ /* Force the value to be loaded into a vector register. */
+ __asm__ (" # %x0" : "+wa" (b));
+
+ /* { dg-final { scan-assembler {\mxxbrw\M} } } */
+ return (double) __builtin_bswap32 (b);
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-1-p9-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-1-p9-runnable.c
index 0e4ab48f555..711e3d0eeaa 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-1-p9-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-1-p9-runnable.c
@@ -1,25 +1,50 @@
-/* { dg-do run { target { powerpc*-*-linux* && { lp64 && p9vector_hw } } } } */
-/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-do run } */
+/* { dg-require-effective-target p9vector_hw } */
/* { dg-options "-O2 -mdejagnu-cpu=power9" } */
#include <altivec.h>
+#include <stdio.h>
void abort (void);
int main() {
int i;
vector float vfa, vfb;
- vector unsigned short vur, vuexpt;
+ vector unsigned short vresult, vexpected;
- vfa = (vector float){3.4, 5.0, 20.0, 50.9 };
- vfb = (vector float){10.0, 40.0, 70.0, 100.0 };
- vuexpt = (vector unsigned short){ 3, 5, 20, 50,
- 10, 40, 70, 100};
+ vfa = (vector float){0.4, 1.6, 20.0, 99.9 };
+ vfb = (vector float){10.0, -2.0, 70.0, 999.0 };
- vur = vec_pack_to_short_fp32 (vfa, vfb);
+ /* Expected results. */
+ vexpected = (vector unsigned short) { 0x3666, 0x3e66, 0x4d00, 0x563e,
+ 0x4900, 0xc000, 0x5460, 0x63ce};
+
+/*
+ vresult = vec_pack_to_short_fp32 (vfa, vfb);
+ This built-in converts a pair of vector floats into a single vector of
+ packed half-precision (F16) values. The result type is a vector of
+ signed shorts.
+ The expected codegen for this builtin is
+ xvcvsphp t, vfa
+ xvcvsphp u, vfb
+ if (little endian)
+ vpkuwum vresult, t, u
+ else
+ vpkuwum vresult, u, t
+*/
+
+ vresult = vec_pack_to_short_fp32 (vfa, vfb);
+
+#ifdef DEBUG
+ for(i = 0; i< 4; i++) { printf("i=[%d] %f \n",i,vfa[i]); }
+ for(i = 0; i< 4; i++) { printf("i=[%d] %f \n",i+4,vfb[i]); }
+ for(i = 0; i< 8; i++) { printf("i=[%d] %d \n",i,vresult[i]); }
+#endif
for(i = 0; i< 8; i++) {
- if (vur[i] != vuexpt[i])
+ if (vresult[i] != vexpected[i]) {
+ printf("i=[%d] 0x%x != 0x%x \n",i,vresult[i],vexpected[i]);
abort();
+ }
}
}
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-1.c b/gcc/testsuite/gcc.target/powerpc/builtins-1.c
index 73f8fb54cff..83aed5a5141 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-1.c
@@ -1,4 +1,5 @@
-/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-mdejagnu-cpu=power8 -O0 -mno-fold-gimple -dp" } */
/* { dg-prune-output "gimple folding of rs6000 builtins has been disabled." } */
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-2-p9-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-2-p9-runnable.c
index a971d158108..3ceae159cf2 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-2-p9-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-2-p9-runnable.c
@@ -1,5 +1,6 @@
-/* { dg-do run { target { powerpc64*-*-* && { lp64 && p9vector_hw } } } } */
-/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-do run } */
+/* { dg-require-effective-target p9vector_hw } */
+/* { dg-require-effective-target int128 } */
/* { dg-options "-mdejagnu-cpu=power9 -O2" } */
#include <altivec.h> // vector
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-2.c b/gcc/testsuite/gcc.target/powerpc/builtins-2.c
index 0fa60b277f6..2aa23a37799 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-2.c
@@ -1,5 +1,5 @@
-/* { dg-do run { target { powerpc*-*-* } } } */
-/* { dg-require-effective-target vsx_hw } */
+/* { dg-do run } */
+/* { dg-require-effective-target p8vector_hw } */
/* { dg-options "-mdejagnu-cpu=power8 " } */
#include <altivec.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3-p9-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-3-p9-runnable.c
index 7926f80f98b..44c0397c49a 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-3-p9-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-p9-runnable.c
@@ -1,4 +1,5 @@
-/* { dg-do run { target { powerpc64*-*-* && { lp64 && p9vector_hw } } } } */
+/* { dg-do run } */
+/* { dg-require-effective-target p9vector_hw } */
/* { dg-options "-mdejagnu-cpu=power9 -O2" } */
#ifdef DEBUG
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c b/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c
index 5b4cdd81e35..5818361169f 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { le } } } */
+/* { dg-do compile { target { le } } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
/* { dg-options "-mdejagnu-cpu=power9 -O1" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable-p8.c b/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable-p8.c
index 1ad6f82480b..32e8aa3ecae 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable-p8.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable-p8.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target { powerpc*-*-linux* && { p8vector_hw } } } } */
+/* { dg-do run } */
/* { dg-require-effective-target p8vector_hw } */
/* { dg-options "-mdejagnu-cpu=power8" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3.c b/gcc/testsuite/gcc.target/powerpc/builtins-3.c
index fc4fd6003de..e048e8b2355 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-3.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-do compile } */
/* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-options "-maltivec" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-4-p9-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-4-p9-runnable.c
index ab8e030e6cf..3d744772278 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-4-p9-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-4-p9-runnable.c
@@ -1,4 +1,5 @@
-/* { dg-do run { target { powerpc*-*-* && { p9vector_hw } } } } */
+/* { dg-do run } */
+/* { dg-require-effective-target p9vector_hw } */
/* { dg-options "-mdejagnu-cpu=power9 -O2 " } */
#include <altivec.h> // vector
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-4.c b/gcc/testsuite/gcc.target/powerpc/builtins-4.c
index 66bfaf1210f..4e3b543f242 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-4.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-do compile } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mvsx" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-5-p9-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-5-p9-runnable.c
index ba2736fe98d..0fe62064cbe 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-5-p9-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-5-p9-runnable.c
@@ -1,4 +1,5 @@
-/* { dg-do run { target { powerpc*-*-* && p9vector_hw } } } */
+/* { dg-do run } */
+/* { dg-require-effective-target p9vector_hw } */
/* { dg-options "-mdejagnu-cpu=power9 -O2" } */
#include <stdint.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-5.c b/gcc/testsuite/gcc.target/powerpc/builtins-5.c
index c5f5c31b45f..9c25329fb1e 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-5.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-5.c
@@ -1,4 +1,5 @@
-/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-mdejagnu-cpu=power8 -O0 -mno-fold-gimple -dp" } */
/* { dg-prune-output "gimple folding of rs6000 builtins has been disabled." } */
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-6-p9-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-6-p9-runnable.c
index 7c6275fecda..20fdd3bb4ec 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-6-p9-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-6-p9-runnable.c
@@ -1,4 +1,6 @@
-/* { dg-do run { target { powerpc*-*-* && p9vector_hw } } } */
+/* { dg-do run } */
+/* { dg-require-effective-target p9vector_hw } */
+/* { dg-require-effective-target int128 } */
/* { dg-options "-mdejagnu-cpu=power9 -O2" } */
#include <stdint.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-6-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-6-runnable.c
index 10f5ba086b6..05ae2482825 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-6-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-6-runnable.c
@@ -1,4 +1,6 @@
-/* { dg-do run { target { powerpc*-*-* && { lp64 && p8vector_hw } } } } */
+/* { dg-do run } */
+/* { dg-require-effective-target p8vector_hw } */
+/* { dg-require-effective-target int128 } */
/* { dg-options "-mdejagnu-cpu=power8 -O3" } */
#include <stdint.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-7-p9-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-7-p9-runnable.c
index 2f1ce7666cb..1333d01abaa 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-7-p9-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-7-p9-runnable.c
@@ -1,5 +1,5 @@
-/* { dg-do run { target { powerpc*-*-* && p9vector_hw } } } */
-/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-do run } */
+/* { dg-require-effective-target p9vector_hw } */
/* { dg-options "-mdejagnu-cpu=power9 -O2" } */
#include <altivec.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-7-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-7-runnable.c
index 9c58111d4b3..52371e18832 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-7-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-7-runnable.c
@@ -1,4 +1,5 @@
-/* { dg-do run { target { powerpc*-*-* && p8vector_hw } } } */
+/* { dg-do run } */
+/* { dg-require-effective-target p8vector_hw } */
/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
#include <stdint.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-8-p9-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-8-p9-runnable.c
index b2f7dc855e8..f4809e6afff 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-8-p9-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-8-p9-runnable.c
@@ -1,4 +1,5 @@
-/* { dg-do run { target { powerpc*-*-* && p9vector_hw } } } */
+/* { dg-do run } */
+/* { dg-require-effective-target p9vector_hw } */
/* { dg-options "-mdejagnu-cpu=power9 -O2" } */
#include <stdint.h>
@@ -103,6 +104,31 @@ int main() {
The element index in natural element order is returned for the
first match or the number of elements if there is no match. */
/* char */
+ char_src1 = (vector signed char) { 0x40, 0, 0x40, 0x40,
+ 0x40, 0x40, 0x40, 0x40,
+ 0x40, 0x40, 0x40, 0x40,
+ 0x40, 0x40, 0x40, 0x40 };
+
+ char_src2 = (vector signed char) {0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0};
+ expected_result = 1;
+
+ result = vec_first_match_index (char_src1, char_src2);
+
+#ifdef DEBUG2
+ print_signed_char("src1", char_src1);
+ print_signed_char("src2", char_src2);
+ printf(" vec_first_match_index = %d\n\n", result);
+#endif
+
+ if (result != expected_result)
+#ifdef DEBUG
+ printf("Error: char first match result (%d) does not match expected result (%d)\n",
+ result, expected_result);
+#else
+ abort();
+#endif
+
char_src1 = (vector signed char) {-1, 2, 3, 4, -5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16};
char_src2 = (vector signed char) {-1, 2, 3, 20, -5, 6, 7, 8,
@@ -367,6 +393,50 @@ int main() {
The element index in BE order is returned for the first mismatch
or the number of elements if there is no match. */
/* char */
+ char_src1 = (vector signed char) {1, 2, 0, 4, -5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16};
+ char_src2 = (vector signed char) {1, 2, 0, 20, -5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16};
+ expected_result = 3;
+
+ result = vec_first_mismatch_index (char_src1, char_src2);
+
+#ifdef DEBUG2
+ print_signed_char("src1", char_src1);
+ print_signed_char("src2", char_src2);
+ printf("vec_first_mismatch_index = %d\n\n", result);
+#endif
+
+ if (result != expected_result)
+#ifdef DEBUG
+ printf("Error: char first mismatch result (%d) does not match expected result (%d)\n",
+ result, expected_result);
+#else
+ abort();
+#endif
+
+ char_src1 = (vector signed char) {0, 2, 3, 4, -5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16};
+ char_src2 = (vector signed char) {0, 2, 3, 20, -5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16};
+ expected_result = 3;
+
+ result = vec_first_mismatch_index (char_src1, char_src2);
+
+#ifdef DEBUG2
+ print_signed_char("src1", char_src1);
+ print_signed_char("src2", char_src2);
+ printf("vec_first_mismatch_index = %d\n\n", result);
+#endif
+
+ if (result != expected_result)
+#ifdef DEBUG
+ printf("Error: char first mismatch result (%d) does not match expected result (%d)\n",
+ result, expected_result);
+#else
+ abort();
+#endif
+
char_src1 = (vector signed char) {-1, 2, 3, 4, -5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16};
char_src2 = (vector signed char) {-1, 2, 3, 20, -5, 6, 7, 8,
@@ -673,6 +743,33 @@ int main() {
The element index in BE order is returned for the first match
or the number of elements if there is no match. */
/* char */
+ char_src1 = (vector signed char) { 0x40, 0, 0x40, 0x40,
+ 0x40, 0x40, 0x40, 0x40,
+ 0x40, 0x40, 0x40, 0x40,
+ 0x40, 0x40, 0x40, 0x40 };
+
+ char_src2 = (vector signed char) { 0x41, 0, 0x43, 0x44,
+ 0x45, 0x46, 0x47, 0x40,
+ 0x40, 0x40, 0x40, 0x40,
+ 0x40, 0x40, 0x40, 0x40 };
+ expected_result = 1;
+
+ result = vec_first_match_or_eos_index (char_src1, char_src2);
+
+#ifdef DEBUG2
+ print_signed_char("src1", char_src1);
+ print_signed_char("src2", char_src2);
+ printf("vec_first_match_or_eos_index = %d\n\n", result);
+#endif
+
+ if (result != expected_result)
+#ifdef DEBUG
+ printf("Error: char first match result (%d) does not match expected result (%d)\n",
+ result, expected_result);
+#else
+ abort();
+#endif
+
char_src1 = (vector signed char) {-1, 2, 3, 4, -5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16};
char_src2 = (vector signed char) {-1, 2, 3, 20, -5, 6, 7, 8,
@@ -1065,6 +1162,28 @@ int main() {
The element index in BE order is returned for the first mismatch
or the number of elements if there is no match. */
/* char */
+ char_src1 = (vector signed char) {1, 2, 0, 4, -5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16};
+ char_src2 = (vector signed char) {1, 2, 0, 20, -5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16};
+ expected_result = 2;
+
+ result = vec_first_mismatch_or_eos_index (char_src1, char_src2);
+
+#ifdef DEBUG2
+ print_signed_char("src1", char_src1);
+ print_signed_char("src2", char_src2);
+ printf("vec_first_mismatch_or_eos_index = %d\n\n", result);
+#endif
+
+ if (result != expected_result)
+#ifdef DEBUG
+ printf("Error: char first mismatch or EOS result (%d) does not match expected result (%d)\n",
+ result, expected_result);
+#else
+ abort();
+#endif
+
char_src1 = (vector signed char) {-1, 2, 3, 4, -5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16};
char_src2 = (vector signed char) {-1, 2, 3, 20, -5, 6, 7, 8,
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-8-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-8-runnable.c
index ad835c7b4c8..38a1390d18e 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-8-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-8-runnable.c
@@ -1,4 +1,5 @@
-/* { dg-do run { target { powerpc*-*-* && { p8vector_hw } } } } */
+/* { dg-do run } */
+/* { dg-require-effective-target p8vector_hw } */
/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
#include <stdint.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-msum-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-msum-runnable.c
new file mode 100644
index 00000000000..0fa5c319b6d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-msum-runnable.c
@@ -0,0 +1,74 @@
+/* { dg-do run { target { p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2" } */
+
+#include <altivec.h>
+
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+void abort (void);
+
+int
+main()
+{
+ vector __uint128_t arg_uint128, result_uint128, expected_uint128;
+ vector __int128_t arg_int128, result_int128, expected_int128;
+
+ arg_uint128[0] = 0x1627384950617243;
+ arg_uint128[0] = arg_uint128[0] << 64;
+ arg_uint128[0] |= 0x9405182930415263;
+ expected_uint128[0] = 0x1627384950617243;
+ expected_uint128[0] = expected_uint128[0] << 64;
+ expected_uint128[0] |= 0xb6b07e42a570e5fe;
+ vector unsigned long long arg_vull2 = {0x12345678,0x44445555};
+ vector unsigned long long arg_vull3 = {0x6789abcd,0x66667777};
+ result_uint128 = vec_msum (arg_vull2, arg_vull3, arg_uint128);
+
+ if (result_uint128[0] != expected_uint128[0])
+ {
+#ifdef DEBUG
+ printf("result_uint128[0] doesn't match expected_u128[0]\n");
+ printf("arg_vull2 %llx %llx \n", arg_vull2[0], arg_vull2[1]);
+ printf("arg_vull3 %llx %llx \n", arg_vull3[0], arg_vull3[1]);
+ printf("arg_uint128[0] = %llx ", arg_uint128[0] >> 64);
+ printf(" %llx\n", arg_uint128[0] & 0xFFFFFFFFFFFFFFFF);
+
+ printf("result_uint128[0] = %llx ", result_uint128[0] >> 64);
+ printf(" %llx\n", result_uint128[0] & 0xFFFFFFFFFFFFFFFF);
+
+ printf("expected_uint128[0] = %llx ", expected_uint128[0] >> 64);
+ printf(" %llx\n", expected_uint128[0] & 0xFFFFFFFFFFFFFFFF);
+#else
+ abort();
+#endif
+ }
+
+ arg_int128[0] = 0x1627384950617283;
+ arg_int128[0] = arg_int128[0] << 64;
+ arg_int128[0] |= 0x9405182930415263;
+ expected_int128[0] = 0x1627384950617283;
+ expected_int128[0] = expected_int128[0] << 64;
+ expected_int128[0] |= 0xd99f35969c11cbfa;
+ vector signed long long arg_vll2 = { 0x567890ab, 0x1233456 };
+ vector signed long long arg_vll3 = { 0xcdef0123, 0x9873451 };
+ result_int128 = vec_msum (arg_vll2, arg_vll3, arg_int128);
+
+ if (result_int128[0] != expected_int128[0])
+ {
+#ifdef DEBUG
+ printf("result_int128[0] doesn't match expected128[0]\n");
+ printf("arg_int128[0] = %llx ", arg_int128[0] >> 64);
+ printf(" %llx\n", arg_int128[0] & 0xFFFFFFFFFFFFFFFF);
+
+ printf("result_int128[0] = %llx ", result_int128[0] >> 64);
+ printf(" %llx\n", result_int128[0] & 0xFFFFFFFFFFFFFFFF);
+
+ printf("expected_int128[0] = %llx ", expected_int128[0] >> 64);
+ printf(" %llx\n", expected_int128[0] & 0xFFFFFFFFFFFFFFFF);
+#else
+ abort();
+#endif
+ }
+}
+
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-revb-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-revb-runnable.c
index f2a004a21fc..6bfa22b856c 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-revb-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-revb-runnable.c
@@ -1,4 +1,6 @@
-/* { dg-do run { target { powerpc*-*-* && { lp64 && p8vector_hw } } } } */
+/* { dg-do run } */
+/* { dg-require-effective-target p8vector_hw } */
+/* { dg-require-effective-target int128 } */
/* { dg-options "-mdejagnu-cpu=power8 -O3" } */
#include <altivec.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/cfuged-0.c b/gcc/testsuite/gcc.target/powerpc/cfuged-0.c
new file mode 100644
index 00000000000..7295f033a5b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/cfuged-0.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+extern void abort (void);
+
+unsigned long long int
+do_cfuged (unsigned long long int source, unsigned long long int mask)
+{
+ return __builtin_cfuged (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ unsigned long long int sources [4], masks [4];
+ unsigned long long int results [4][4] = {
+ /* sources[0] with each of masks [0 .. 3] */
+ {0x7e3ca5f0ll, 0xa5f07e3cll, 0xaf7350ecll, 0x50ecaf73ll },
+ /* sources[1] with each of masks [0 .. 3] */
+ { 0xa5f07e3cll, 0x7e3ca5f0ll, 0x73afec50ll, 0xec5073afll },
+ /* sources[2] with each of masks [0 .. 3] */
+ { 0xf07e3ca5ll, 0x3ca5f07ell, 0x3af7c50ell, 0xc50e3af7ll },
+ /* sources[3] with each of masks [0 .. 3] */
+ { 0xe7c35a0fll, 0x5a0fe7c3ll, 0x50ecaf73ll, 0xaf7350ecll },
+ };
+
+ sources[0] = 0xa5f07e3cll;
+ sources[1] = 0x7e3ca5f0ll;
+ sources[2] = 0x3ca5f07ell;
+ sources[3] = 0x5a0fe7c3ll;
+
+ masks[0] = 0xffff0000ll;
+ masks[1] = 0x0000ffffll;
+ masks[2] = 0x0f0f0f0fll;
+ masks[3] = 0xf0f0f0f0ll;
+
+ unsigned long long int result;
+
+ for (int i = 0; i < 4; i++)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ if (do_cfuged (sources[i], masks[j]) != results [i][j])
+ abort ();
+ }
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mcfuged\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/cfuged-1.c b/gcc/testsuite/gcc.target/powerpc/cfuged-1.c
new file mode 100644
index 00000000000..198d541ef05
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/cfuged-1.c
@@ -0,0 +1,50 @@
+/* { dg-do run } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+extern void abort (void);
+
+unsigned long long int
+do_cfuged (unsigned long long int source, unsigned long long int mask)
+{
+ return __builtin_cfuged (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ unsigned long long int sources [4], masks [4];
+ unsigned long long int results [4][4] = {
+ /* sources[0] with each of masks [0 .. 3] */
+ {0x7e3ca5f0ll, 0xa5f07e3cll, 0xaf7350ecll, 0x50ecaf73ll },
+ /* sources[1] with each of masks [0 .. 3] */
+ { 0xa5f07e3cll, 0x7e3ca5f0ll, 0x73afec50ll, 0xec5073afll },
+ /* sources[2] with each of masks [0 .. 3] */
+ { 0xf07e3ca5ll, 0x3ca5f07ell, 0x3af7c50ell, 0xc50e3af7ll },
+ /* sources[3] with each of masks [0 .. 3] */
+ { 0xe7c35a0fll, 0x5a0fe7c3ll, 0x50ecaf73ll, 0xaf7350ecll },
+ };
+
+ sources[0] = 0xa5f07e3cll;
+ sources[1] = 0x7e3ca5f0ll;
+ sources[2] = 0x3ca5f07ell;
+ sources[3] = 0x5a0fe7c3ll;
+
+ masks[0] = 0xffff0000ll;
+ masks[1] = 0x0000ffffll;
+ masks[2] = 0x0f0f0f0fll;
+ masks[3] = 0xf0f0f0f0ll;
+
+ unsigned long long int result;
+
+ for (int i = 0; i < 4; i++)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ if (do_cfuged (sources[i], masks[j]) != results [i][j])
+ abort ();
+ }
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/clone3.c b/gcc/testsuite/gcc.target/powerpc/clone3.c
new file mode 100644
index 00000000000..911b88b781d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/clone3.c
@@ -0,0 +1,33 @@
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-require-effective-target ppc_cpu_supports_hw } */
+
+/* Power9 (aka, ISA 3.0) has a MODSD instruction to do modulus, while Power8
+ (aka, ISA 2.07) has to do modulus with divide and multiply. Make sure
+ both clone functions are generated.
+
+ FUTURE has pc-relative instructions to access static values, while earlier
+ systems used TOC addressing.
+
+ Restrict ourselves to Linux, since IFUNC might not be supported in other
+ operating systems. */
+
+static long s;
+long *p = &s;
+
+__attribute__((target_clones("cpu=power10,cpu=power9,default")))
+long mod_func (long a, long b)
+{
+ return (a % b) + s;
+}
+
+long mod_func_or (long a, long b, long c)
+{
+ return mod_func (a, b) | c;
+}
+
+/* { dg-final { scan-assembler-times {\mdivd\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mmulld\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mmodsd\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpld\M} 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/cntlzdm-0.c b/gcc/testsuite/gcc.target/powerpc/cntlzdm-0.c
new file mode 100644
index 00000000000..c11800d9bee
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/cntlzdm-0.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+extern void abort (void);
+
+unsigned long long int
+do_cntlzdm (unsigned long long int source, unsigned long long int mask)
+{
+ return __builtin_cntlzdm (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ unsigned long long int sources [4], masks [4];
+ unsigned long long int intermediates [4][4] = {
+ /* sources[0] with each of masks [0 .. 3] */
+ { 0x0000a5f0ll, 0x00007e3cll, 0x000050ecll, 0x0000af73ll },
+ /* sources[1] with each of masks [0 .. 3] */
+ { 0x00007e3cll, 0x0000a5f0ll, 0x0000ec50ll, 0x000073afll },
+ /* sources[2] with each of masks [0 .. 3] */
+ { 0x00003ca5ll, 0x0000f07ell, 0x0000c50ell, 0x00003af7ll },
+ /* sources[3] with each of masks [0 .. 3] */
+ { 0x00005a0fll, 0x0000e7c3ll, 0x0000af73ll, 0x000050ecll },
+ };
+ unsigned long long int results [4][4] = {
+ { 0, 1, 1, 0 },
+ { 1, 0, 0, 1 },
+ { 2, 0, 0, 2 },
+ { 1, 0, 0, 1 },
+ };
+
+ sources[0] = 0xa5f07e3cll;
+ sources[1] = 0x7e3ca5f0ll;
+ sources[2] = 0x3ca5f07ell;
+ sources[3] = 0x5a0fe7c3ll;
+
+ masks[0] = 0xffff0000ll;
+ masks[1] = 0x0000ffffll;
+ masks[2] = 0x0f0f0f0fll;
+ masks[3] = 0xf0f0f0f0ll;
+
+ unsigned long long int result;
+
+ for (int i = 0; i < 4; i++)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ if (do_cntlzdm (sources[i], masks[j]) != results [i][j])
+ abort ();
+ }
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mcntlzdm\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/cntlzdm-1.c b/gcc/testsuite/gcc.target/powerpc/cntlzdm-1.c
new file mode 100644
index 00000000000..e9ee8354b59
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/cntlzdm-1.c
@@ -0,0 +1,56 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+extern void abort (void);
+
+unsigned long long int
+do_cntlzdm (unsigned long long int source, unsigned long long int mask)
+{
+ return __builtin_cntlzdm (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ unsigned long long int sources [4], masks [4];
+ unsigned long long int intermediates [4][4] = {
+ /* sources[0] with each of masks [0 .. 3] */
+ { 0x0000a5f0ll, 0x00007e3cll, 0x000050ecll, 0x0000af73ll },
+ /* sources[1] with each of masks [0 .. 3] */
+ { 0x00007e3cll, 0x0000a5f0ll, 0x0000ec50ll, 0x000073afll },
+ /* sources[2] with each of masks [0 .. 3] */
+ { 0x00003ca5ll, 0x0000f07ell, 0x0000c50ell, 0x00003af7ll },
+ /* sources[3] with each of masks [0 .. 3] */
+ { 0x00005a0fll, 0x0000e7c3ll, 0x0000af73ll, 0x000050ecll },
+ };
+ unsigned long long int results [4][4] = {
+ { 0, 1, 1, 0 },
+ { 1, 0, 0, 1 },
+ { 2, 0, 0, 2 },
+ { 1, 0, 0, 1 },
+ };
+
+ sources[0] = 0xa5f07e3cll;
+ sources[1] = 0x7e3ca5f0ll;
+ sources[2] = 0x3ca5f07ell;
+ sources[3] = 0x5a0fe7c3ll;
+
+ masks[0] = 0xffff0000ll;
+ masks[1] = 0x0000ffffll;
+ masks[2] = 0x0f0f0f0fll;
+ masks[3] = 0xf0f0f0f0ll;
+
+ unsigned long long int result;
+
+ for (int i = 0; i < 4; i++)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ if (do_cntlzdm (sources[i], masks[j]) != results [i][j])
+ abort ();
+ }
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/cnttzdm-0.c b/gcc/testsuite/gcc.target/powerpc/cnttzdm-0.c
new file mode 100644
index 00000000000..80b4f15bab4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/cnttzdm-0.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+extern void abort (void);
+
+unsigned long long int
+do_cnttzdm (unsigned long long int source, unsigned long long int mask) {
+ return __builtin_cnttzdm (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ unsigned long long int sources [4], masks [4];
+ unsigned long long int intermediates [4][4] = {
+ /* sources[0] with each of masks [0 .. 3] */
+ { 0x0000a5f0ll, 0x00007e3cll, 0x000050ecll, 0x0000af73ll },
+ /* sources[1] with each of masks [0 .. 3] */
+ { 0x00007e3cll, 0x0000a5f0ll, 0x0000ec50ll, 0x000073afll },
+ /* sources[2] with each of masks [0 .. 3] */
+ { 0x00003ca5ll, 0x0000f07ell, 0x0000c50ell, 0x00003af7ll },
+ /* sources[3] with each of masks [0 .. 3] */
+ { 0x00005a0fll, 0x0000e7c3ll, 0x0000af73ll, 0x000050ecll },
+ };
+ unsigned long long int results [4][4] = {
+ { 4, 2, 2, 0 },
+ { 2, 4, 4, 0 },
+ { 0, 1, 1, 0 },
+ { 0, 0, 0, 2 },
+ };
+
+ sources[0] = 0xa5f07e3cll;
+ sources[1] = 0x7e3ca5f0ll;
+ sources[2] = 0x3ca5f07ell;
+ sources[3] = 0x5a0fe7c3ll;
+
+ masks[0] = 0xffff0000ll;
+ masks[1] = 0x0000ffffll;
+ masks[2] = 0x0f0f0f0fll;
+ masks[3] = 0xf0f0f0f0ll;
+
+ for (int i = 0; i < 4; i++)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ if (do_cnttzdm (sources[i], masks[j]) != results [i][j])
+ abort ();
+ }
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mcnttzdm\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/cnttzdm-1.c b/gcc/testsuite/gcc.target/powerpc/cnttzdm-1.c
new file mode 100644
index 00000000000..4c05c1bc65d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/cnttzdm-1.c
@@ -0,0 +1,53 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+extern void abort (void);
+
+unsigned long long int
+do_cnttzdm (unsigned long long int source, unsigned long long int mask) {
+ return __builtin_cnttzdm (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ unsigned long long int sources [4], masks [4];
+ unsigned long long int intermediates [4][4] = {
+ /* sources[0] with each of masks [0 .. 3] */
+ { 0x0000a5f0ll, 0x00007e3cll, 0x000050ecll, 0x0000af73ll },
+ /* sources[1] with each of masks [0 .. 3] */
+ { 0x00007e3cll, 0x0000a5f0ll, 0x0000ec50ll, 0x000073afll },
+ /* sources[2] with each of masks [0 .. 3] */
+ { 0x00003ca5ll, 0x0000f07ell, 0x0000c50ell, 0x00003af7ll },
+ /* sources[3] with each of masks [0 .. 3] */
+ { 0x00005a0fll, 0x0000e7c3ll, 0x0000af73ll, 0x000050ecll },
+ };
+ unsigned long long int results [4][4] = {
+ { 4, 2, 2, 0 },
+ { 2, 4, 4, 0 },
+ { 0, 1, 1, 0 },
+ { 0, 0, 0, 2 },
+ };
+
+ sources[0] = 0xa5f07e3cll;
+ sources[1] = 0x7e3ca5f0ll;
+ sources[2] = 0x3ca5f07ell;
+ sources[3] = 0x5a0fe7c3ll;
+
+ masks[0] = 0xffff0000ll;
+ masks[1] = 0x0000ffffll;
+ masks[2] = 0x0f0f0f0fll;
+ masks[3] = 0xf0f0f0f0ll;
+
+ for (int i = 0; i < 4; i++)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ if (do_cnttzdm (sources[i], masks[j]) != results [i][j])
+ abort ();
+ }
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/conv-vectorize-1.c b/gcc/testsuite/gcc.target/powerpc/conv-vectorize-1.c
index d96db146864..8b8c88befd5 100644
--- a/gcc/testsuite/gcc.target/powerpc/conv-vectorize-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/conv-vectorize-1.c
@@ -1,5 +1,5 @@
/* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-O2 -ftree-vectorize -mvsx" } */
+/* { dg-options "-O2 -ftree-vectorize -mvsx -fno-vect-cost-model" } */
/* Test vectorizer can exploit vector conversion instructions to convert
unsigned/signed long long to float. */
diff --git a/gcc/testsuite/gcc.target/powerpc/conv-vectorize-2.c b/gcc/testsuite/gcc.target/powerpc/conv-vectorize-2.c
index 5dd5deabdd3..06ae4e2d5ce 100644
--- a/gcc/testsuite/gcc.target/powerpc/conv-vectorize-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/conv-vectorize-2.c
@@ -1,5 +1,5 @@
/* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-O2 -ftree-vectorize -mvsx" } */
+/* { dg-options "-O2 -ftree-vectorize -mvsx -fno-vect-cost-model" } */
/* Test vectorizer can exploit vector conversion instructions to convert
float to unsigned/signed long long. */
diff --git a/gcc/testsuite/gcc.target/powerpc/convert-fp-128.c b/gcc/testsuite/gcc.target/powerpc/convert-fp-128.c
index 67896d92c86..69f4a0293af 100644
--- a/gcc/testsuite/gcc.target/powerpc/convert-fp-128.c
+++ b/gcc/testsuite/gcc.target/powerpc/convert-fp-128.c
@@ -34,8 +34,8 @@ conv2
/* { dg-final { scan-assembler-times {\mbl\M} 24 { target { ! hard_dfp } } } } */
/* { dg-final { scan-assembler-times {\mbl\M} 19 { target { hard_dfp && { ! ppc_float128 } } } } } */
-/* { dg-final { scan-assembler-times {\mbl\M} 31 { target { hard_dfp && { ppc_float128 && { ! ppc_float128_insns } } } } } } */
-/* { dg-final { scan-assembler-times {\mbl\M} 27 { target { hard_dfp && { ppc_float128 && { ppc_float128_insns } } } } } } */
+/* { dg-final { scan-assembler-times {\mbl\M} 30 { target { hard_dfp && { ppc_float128 && { ! ppc_float128_insns } } } } } } */
+/* { dg-final { scan-assembler-times {\mbl\M} 26 { target { hard_dfp && { ppc_float128 && { ppc_float128_insns } } } } } } */
/* { dg-final { scan-assembler-times {\mbl __extendsfkf2\M} 1 { target { ppc_float128 && { ! ppc_float128_insns } } } } } */
@@ -60,20 +60,20 @@ conv2
/* { dg-final { scan-assembler-times {\mbl __dpd_extendsddf\M} 1 } } */
/* { dg-final { scan-assembler-times {\mbl __dpd_extendsdtf\M} 1 } } */
/* { dg-final { scan-assembler-times {\mbl __dpd_extendsdkf\M} 1 { target { ppc_float128 } } } } */
-/* { dg-final { scan-assembler-times {\mbl __dpd_extendsddd2\M} 1 { target { ! dfp } } } } */
-/* { dg-final { scan-assembler-times {\mbl __dpd_extendsdtd2\M} 1 { target { ! dfp } } } } */
+/* { dg-final { scan-assembler-times {\mbl __dpd_extendsddd2\M} 1 { target { ! hard_dfp } } } } */
+/* { dg-final { scan-assembler-times {\mbl __dpd_extendsdtd2\M} 1 { target { ! hard_dfp } } } } */
/* { dg-final { scan-assembler-times {\mbl __dpd_truncddsf\M} 1 } } */
/* { dg-final { scan-assembler-times {\mbl __dpd_truncdddf\M} 1 } } */
/* { dg-final { scan-assembler-times {\mbl __dpd_extendddtf\M} 1 } } */
/* { dg-final { scan-assembler-times {\mbl __dpd_extendddkf\M} 1 { target { ppc_float128 } } } } */
-/* { dg-final { scan-assembler-times {\mbl __dpd_truncddsd2\M} 1 { target { ! dfp } } } } */
-/* { dg-final { scan-assembler-times {\mbl __dpd_extendddtd2\M} 1 { target { ! dfp } } } } */
+/* { dg-final { scan-assembler-times {\mbl __dpd_truncddsd2\M} 1 { target { ! hard_dfp } } } } */
+/* { dg-final { scan-assembler-times {\mbl __dpd_extendddtd2\M} 1 { target { ! hard_dfp } } } } */
/* { dg-final { scan-assembler-times {\mbl __dpd_trunctdsf\M} 1 } } */
/* { dg-final { scan-assembler-times {\mbl __dpd_trunctddf\M} 1 } } */
/* { dg-final { scan-assembler-times {\mbl __dpd_trunctdtf\M} 1 } } */
/* { dg-final { scan-assembler-times {\mbl __dpd_trunctdkf\M} 1 { target { ppc_float128 } } } } */
-/* { dg-final { scan-assembler-times {\mbl __dpd_trunctdsd2\M} 1 } } */
-/* { dg-final { scan-assembler-times {\mbl __dpd_trunctddd2\M} 1 { target { ! dfp } } } } */
+/* { dg-final { scan-assembler-times {\mbl __dpd_trunctdsd2\M} 1 { target { ! hard_dfp } } } } */
+/* { dg-final { scan-assembler-times {\mbl __dpd_trunctddd2\M} 1 { target { ! hard_dfp } } } } */
/* { dg-final { scan-assembler-times {\mfrsp|xsrsp\M} 2 { target { ! ppc_float128_insns } } } } */
@@ -88,8 +88,8 @@ conv2
/* { dg-final { scan-assembler-times {\mxxlor|xscpsgndp\M} 3 { target { ppc_float128_insns } } } } */
-/* { dg-final { scan-assembler-times {\mdrsp\M} 1 { target { hard_dfp } } } } */
-/* { dg-final { scan-assembler-times {\mdrdpq\M} 1 { target { hard_dfp } } } } */
+/* { dg-final { scan-assembler-times {\mdrsp\M} 2 { target { hard_dfp } } } } */
+/* { dg-final { scan-assembler-times {\mdrdpq\M} 2 { target { hard_dfp } } } } */
/* { dg-final { scan-assembler-times {\mdctdp\M} 2 { target { hard_dfp } } } } */
/* { dg-final { scan-assembler-times {\mdctqpq\M} 2 { target { hard_dfp } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c b/gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c
index 960e7fb4f5f..280c9971c80 100644
--- a/gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-do compile } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
void
@@ -24,6 +24,7 @@ use_cpu_is_builtins (unsigned int *p)
p[12] = __builtin_cpu_is ("ppc440");
p[13] = __builtin_cpu_is ("ppc405");
p[14] = __builtin_cpu_is ("ppc-cell-be");
+ p[15] = __builtin_cpu_is ("power10");
#else
p[0] = 0;
#endif
@@ -74,6 +75,8 @@ use_cpu_supports_builtins (unsigned int *p)
p[38] = __builtin_cpu_supports ("darn");
p[39] = __builtin_cpu_supports ("scv");
p[40] = __builtin_cpu_supports ("htm-no-suspend");
+ p[41] = __builtin_cpu_supports ("arch_3_1");
+ p[42] = __builtin_cpu_supports ("mma");
#else
p[0] = 0;
#endif
diff --git a/gcc/testsuite/gcc.target/powerpc/cpu-future.c b/gcc/testsuite/gcc.target/powerpc/cpu-future.c
index ae406d08b23..723a8fb88ff 100644
--- a/gcc/testsuite/gcc.target/powerpc/cpu-future.c
+++ b/gcc/testsuite/gcc.target/powerpc/cpu-future.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
-/* { dg-require-effective-target powerpc_future_ok } */
-/* { dg-options "-mdejagnu-cpu=future -O2" } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */
-/* Ensure -mcpu=future compiles cleanly. */
+/* Ensure -mcpu=power10 compiles cleanly. */
void x (void) { }
diff --git a/gcc/testsuite/gcc.target/powerpc/dg-future-0.c b/gcc/testsuite/gcc.target/powerpc/dg-future-0.c
new file mode 100644
index 00000000000..cc068cff36a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/dg-future-0.c
@@ -0,0 +1,13 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+/* This tests that power10_ok works. */
+
+extern void abort (void);
+
+int futurity (void) {
+ long int e = -1;
+ asm ("pli %0,%1": "+r" (e) : "n" (0x12345));
+ return (e == 0x12345);
+}
+
+/* { dg-final { scan-assembler {\mpli\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/dg-future-1.c b/gcc/testsuite/gcc.target/powerpc/dg-future-1.c
new file mode 100644
index 00000000000..0dbfb06fa32
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/dg-future-1.c
@@ -0,0 +1,19 @@
+/* { dg-do run { target { powerpc*-*-* } } } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+/* This tests that power10_hw works. */
+
+extern void abort (void);
+
+int futurity (void) {
+ long int e = -1;
+ asm ("pli %0,%1": "+r" (e) : "n" (0x12345));
+ return (e == 0x12345);
+}
+
+int main (int argc, char *argv [])
+{
+ if (!futurity ())
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-double1.c b/gcc/testsuite/gcc.target/powerpc/direct-move-double1.c
index 13f01921869..e75daec2456 100644
--- a/gcc/testsuite/gcc.target/powerpc/direct-move-double1.c
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-double1.c
@@ -1,6 +1,5 @@
-/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
/* { dg-final { scan-assembler "mtvsrd" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-double2.c b/gcc/testsuite/gcc.target/powerpc/direct-move-double2.c
index 23e3423ead7..8e42abab6e0 100644
--- a/gcc/testsuite/gcc.target/powerpc/direct-move-double2.c
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-double2.c
@@ -1,6 +1,5 @@
-/* { dg-do run { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-do run } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target p8vector_hw } */
/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-float1.c b/gcc/testsuite/gcc.target/powerpc/direct-move-float1.c
index 63ab59167c8..285aca65ca4 100644
--- a/gcc/testsuite/gcc.target/powerpc/direct-move-float1.c
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-float1.c
@@ -1,6 +1,5 @@
-/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
/* { dg-final { scan-assembler {\mmtvsrd\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-float2.c b/gcc/testsuite/gcc.target/powerpc/direct-move-float2.c
index 666b2921fdc..a2fb604994a 100644
--- a/gcc/testsuite/gcc.target/powerpc/direct-move-float2.c
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-float2.c
@@ -1,6 +1,5 @@
-/* { dg-do run { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-do run } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target p8vector_hw } */
/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-float3.c b/gcc/testsuite/gcc.target/powerpc/direct-move-float3.c
index 6e294aabdf7..f6c5f23808a 100644
--- a/gcc/testsuite/gcc.target/powerpc/direct-move-float3.c
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-float3.c
@@ -1,6 +1,5 @@
-/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-mpower8-vector -O2" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-long1.c b/gcc/testsuite/gcc.target/powerpc/direct-move-long1.c
index 1a9bdd8eba2..ad90b2ed232 100644
--- a/gcc/testsuite/gcc.target/powerpc/direct-move-long1.c
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-long1.c
@@ -1,6 +1,5 @@
-/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
/* { dg-final { scan-assembler "mtvsrd" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-long2.c b/gcc/testsuite/gcc.target/powerpc/direct-move-long2.c
index d0a4cfec71c..854faa22b0f 100644
--- a/gcc/testsuite/gcc.target/powerpc/direct-move-long2.c
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-long2.c
@@ -1,6 +1,5 @@
-/* { dg-do run { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-do run { target lp64 } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target p8vector_hw } */
/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-vint1.c b/gcc/testsuite/gcc.target/powerpc/direct-move-vint1.c
index fa9d6606242..2db8dbcfd86 100644
--- a/gcc/testsuite/gcc.target/powerpc/direct-move-vint1.c
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-vint1.c
@@ -1,6 +1,5 @@
-/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
/* { dg-final { scan-assembler "mtvsrd" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-vint2.c b/gcc/testsuite/gcc.target/powerpc/direct-move-vint2.c
index b813ad4e2f6..e4ca7423bb8 100644
--- a/gcc/testsuite/gcc.target/powerpc/direct-move-vint2.c
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-vint2.c
@@ -1,6 +1,5 @@
-/* { dg-do run { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-do run } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target p8vector_hw } */
/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/doloop-2.c b/gcc/testsuite/gcc.target/powerpc/doloop-2.c
new file mode 100644
index 00000000000..3199fe56d35
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/doloop-2.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-unroll-loops" } */
+
+unsigned int
+foo1 (unsigned int l, int *a)
+{
+ unsigned int i;
+ for(i = 0;i < l; i++)
+ a[i] = i;
+ return l;
+}
+
+int
+foo2 (int l, int *a)
+{
+ int i;
+ for(i = 0;i < l; i++)
+ a[i] = i;
+ return l;
+}
+
+/* The place where we were getting an extra -1 is when converting from 32bits
+ to 64bits as the ctr register is used as 64bits on powerpc64. We should be
+ able to do this loop without "add -1/zero_ext/add 1" to the l to get the
+ number of iterations of this loop still doing a do-loop. */
+
+/* { dg-final { scan-assembler-not {(?n)\maddi .*,.*,-1$} } } */
+/* { dg-final { scan-assembler-times "bdnz" 2 } } */
+/* { dg-final { scan-assembler-times "mtctr" 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/extend-divide-1.c b/gcc/testsuite/gcc.target/powerpc/extend-divide-1.c
index 35efb25fa65..b648efd8a40 100644
--- a/gcc/testsuite/gcc.target/powerpc/extend-divide-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/extend-divide-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile { target { powerpc*-*-linux* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mdejagnu-cpu=power7 -O2" } */
/* { dg-final { scan-assembler-times "divwe " 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/extend-divide-2.c b/gcc/testsuite/gcc.target/powerpc/extend-divide-2.c
index 623a5dee066..5b1aaa71e93 100644
--- a/gcc/testsuite/gcc.target/powerpc/extend-divide-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/extend-divide-2.c
@@ -1,6 +1,5 @@
/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mdejagnu-cpu=power7 -O2" } */
/* { dg-final { scan-assembler-times "divde " 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-fma1.c b/gcc/testsuite/gcc.target/powerpc/float128-fma1.c
index 9bc538ed859..5c90e7eac48 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-fma1.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-fma1.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target float128 } */
/* { dg-options "-mpower9-vector -O2" } */
__float128
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-hw.c b/gcc/testsuite/gcc.target/powerpc/float128-hw.c
index 929c6ddabe0..8c9beafa90a 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-hw.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-hw.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target float128 } */
/* { dg-options "-mpower9-vector -O2" } */
#ifndef TYPE
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-hw10.c b/gcc/testsuite/gcc.target/powerpc/float128-hw10.c
index eb4bed60c47..539337c7879 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-hw10.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-hw10.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target float128 } */
/* { dg-options "-mpower9-vector -O2" } */
extern _Float128 floorf128 (_Float128);
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-hw11.c b/gcc/testsuite/gcc.target/powerpc/float128-hw11.c
index 7bd9b81427a..dc78cf2f616 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-hw11.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-hw11.c
@@ -1,5 +1,6 @@
-/* { dg-do run { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do run { target lp64 } } */
/* { dg-require-effective-target p9vector_hw } */
+/* { dg-require-effective-target float128 } */
/* { dg-options "-mpower9-vector -O2" } */
#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-hw2.c b/gcc/testsuite/gcc.target/powerpc/float128-hw2.c
index 118bed62537..1e3408b3757 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-hw2.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-hw2.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target float128 } */
/* { dg-options "-mpower9-vector -O2 -ffast-math -std=gnu11" } */
/* Test to make sure the compiler handles the standard _Float128 functions that
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-hw3.c b/gcc/testsuite/gcc.target/powerpc/float128-hw3.c
index e63099dde08..b3bbeb25678 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-hw3.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-hw3.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target float128 } */
/* { dg-options "-mpower9-vector -O2 -ffast-math -std=c11" } */
/* Test to make sure the compiler calls the external function instead of doing
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-hw4.c b/gcc/testsuite/gcc.target/powerpc/float128-hw4.c
index be5d0d6eef4..fc149169bc6 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-hw4.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-hw4.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target float128 } */
/* { dg-options "-mpower9-vector -O2 -mabi=ieeelongdouble -Wno-psabi" } */
/* Insure that the ISA 3.0 IEEE 128-bit floating point built-in functions can
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-hw5.c b/gcc/testsuite/gcc.target/powerpc/float128-hw5.c
index 8621bd869da..b0edafbd3f4 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-hw5.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-hw5.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target float128 } */
/* { dg-options "-mpower9-vector -O2 -ffast-math" } */
extern _Float128 copysignf128 (_Float128, _Float128);
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-hw6.c b/gcc/testsuite/gcc.target/powerpc/float128-hw6.c
index 89bb93ce690..a96edc8b1b6 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-hw6.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-hw6.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target float128 } */
/* { dg-options "-mpower9-vector -O2" } */
extern _Float128 fabsf128 (_Float128);
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-hw7.c b/gcc/testsuite/gcc.target/powerpc/float128-hw7.c
index ca417165a47..ffed847095c 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-hw7.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-hw7.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target float128 } */
/* { dg-options "-mpower9-vector -O2" } */
extern _Float128 fabsf128 (_Float128);
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-hw8.c b/gcc/testsuite/gcc.target/powerpc/float128-hw8.c
index 62f4eae93d1..23f9ec23577 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-hw8.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-hw8.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target float128 } */
/* { dg-options "-mpower9-vector -O2" } */
extern _Float128 fminf128 (_Float128, _Float128);
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-hw9.c b/gcc/testsuite/gcc.target/powerpc/float128-hw9.c
index ca46e151aa9..e37fd1b6397 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-hw9.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-hw9.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target float128 } */
/* { dg-options "-mpower9-vector -O2 -ffast-math" } */
extern _Float128 sqrtf128 (_Float128);
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-minmax.c b/gcc/testsuite/gcc.target/powerpc/float128-minmax.c
index f8b025d66fe..fe397518f2f 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-minmax.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-minmax.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target float128 } */
/* { dg-options "-mpower9-vector -O2 -ffast-math" } */
#ifndef TYPE
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-odd.c b/gcc/testsuite/gcc.target/powerpc/float128-odd.c
index 68c151059bc..8c8a34c74ca 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-odd.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-odd.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target float128 } */
/* { dg-options "-mpower9-vector -O2" } */
/* Test the generation of the round to odd instructions. */
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-sqrt1.c b/gcc/testsuite/gcc.target/powerpc/float128-sqrt1.c
index 792aa05e030..7020664e4fd 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-sqrt1.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-sqrt1.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile { target lp64 } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target float128 } */
/* { dg-options "-mpower9-vector -O2" } */
__float128
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-char.c
index d907eaedf3d..56a89f3f79b 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-char.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-char.c
@@ -28,4 +28,4 @@ testuc (vector unsigned char vuc2, vector unsigned char vuc3,
return vec_perm (vuc2, vuc3, vuc);
}
-/* { dg-final { scan-assembler-times "vperm" 3 } } */
+/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 3 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-double.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-double.c
index 7ceca9ec26b..c982bc2232f 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-double.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-double.c
@@ -14,4 +14,4 @@ testd (vector double vd2, vector double vd3, vector unsigned char vuc)
return vec_perm (vd2, vd3, vuc);
}
-/* { dg-final { scan-assembler-times "vperm" 1 } } */
+/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-float.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-float.c
index c9cfb0ded9d..64b8ac78dea 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-float.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-float.c
@@ -13,4 +13,4 @@ testf (vector float vf2, vector float vf3, vector unsigned char vuc)
return vec_perm (vf2, vf3, vuc);
}
-/* { dg-final { scan-assembler-times "vperm" 1 } } */
+/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-int.c
index a2fdc26e5e3..a6dd59524cb 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-int.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-int.c
@@ -28,4 +28,4 @@ testui (vector unsigned int vui2, vector unsigned int vui3,
return vec_perm (vui2, vui3, vuc);
}
-/* { dg-final { scan-assembler-times "vperm" 3 } } */
+/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 3 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-longlong.c
index 1333d882e0e..3cc757da564 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-longlong.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-longlong.c
@@ -29,4 +29,4 @@ testul (vector unsigned long long vul2, vector unsigned long long vul3,
return vec_perm (vul2, vul3, vuc);
}
-/* { dg-final { scan-assembler-times "vperm" 3 } } */
+/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 3 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-pixel.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-pixel.c
index 0d3cb0aa123..54fccd26e01 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-pixel.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-pixel.c
@@ -13,4 +13,4 @@ testpx (vector pixel px2, vector pixel px3, vector unsigned char vuc)
return vec_perm (px2, px3, vuc);
}
-/* { dg-final { scan-assembler-times "vperm" 1 } } */
+/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-short.c
index de5303a8b4d..6a5d1a7df96 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-short.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-short.c
@@ -26,4 +26,4 @@ testus (vector unsigned short vus2, vector unsigned short vus3, vector unsigned
return vec_perm (vus2, vus3, vuc);
}
-/* { dg-final { scan-assembler-times "vperm" 3 } } */
+/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 3 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/localentry-1.c b/gcc/testsuite/gcc.target/powerpc/localentry-1.c
index 068b0c080bb..c3c51680cfe 100644
--- a/gcc/testsuite/gcc.target/powerpc/localentry-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/localentry-1.c
@@ -1,10 +1,10 @@
/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=future -O2 -mpcrel" } */
+/* { dg-options "-mdejagnu-cpu=power10 -O2 -mpcrel" } */
/* { dg-require-effective-target powerpc_elfv2 } */
-/* { dg-require-effective-target powerpc_future_ok } */
+/* { dg-require-effective-target power10_ok } */
/* Ensure we generate ".localentry fn,1" for both leaf and non-leaf functions.
- At present, -mcpu=future does not enable pc-relative mode, so make sure we
+ At present, -mcpu=power10 does not enable pc-relative mode, so make sure we
enable it to be able to check for .localentry. */
extern int y (int);
diff --git a/gcc/testsuite/gcc.target/powerpc/localentry-detect-1.c b/gcc/testsuite/gcc.target/powerpc/localentry-detect-1.c
index e67e7f824f8..9023b318bd4 100644
--- a/gcc/testsuite/gcc.target/powerpc/localentry-detect-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/localentry-detect-1.c
@@ -1,11 +1,11 @@
/* { dg-do compile } */
/* { dg-require-effective-target powerpc_elfv2 } */
-/* { dg-require-effective-target powerpc_future_ok } */
-/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
-/* At present, -mcpu=future does not enable pc-relative mode. Enable it here
+/* At present, -mcpu=power10 does not enable pc-relative mode. Enable it here
explicitly until it is turned on by default. */
-#pragma GCC target ("cpu=future,pcrel")
+#pragma GCC target ("cpu=power10,pcrel")
int localentry1 () { return 5; }
#pragma GCC target ("cpu=power9,no-pcrel")
diff --git a/gcc/testsuite/gcc.target/powerpc/lsbb-runnable.c b/gcc/testsuite/gcc.target/powerpc/lsbb-runnable.c
new file mode 100644
index 00000000000..7da530c8e6e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/lsbb-runnable.c
@@ -0,0 +1,65 @@
+/*
+ Test the least significant bit by byte instruction
+ xvtlsbb BF,XB
+ Using the builtins
+ int vec_test_lsbb_all_zeros (vector unsigned char);
+ int vec_test_lsbb_all_ones (vector unsigned char);
+ */
+
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-fno-inline -mdejagnu-cpu=power10 -O2" } */
+
+#include <altivec.h>
+#include <stdio.h>
+
+void abort (void);
+
+#define ITERS 7
+vector char input_vec[ITERS] = {
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
+ {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1},
+ {1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0},
+ {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
+ {0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe},
+ {0xfe, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9}
+};
+
+int expected_allzeros_results[ITERS] = {1, 0, 0, 0, 0, 1, 0};
+int expected_allones_results[ITERS] = {0, 1, 0, 0, 1, 0, 0};
+
+int test_for_zeros(vector char vc) {
+ return vec_test_lsbb_all_zeros(vc);
+}
+
+int test_for_ones(vector char vc) {
+ return vec_test_lsbb_all_ones(vc);
+}
+
+int main ()
+{
+int allzeros,allones;
+int iter;
+int failcount=0;
+vector char srcvec;
+
+for (iter=0;iter<ITERS;iter++) {
+ srcvec = input_vec[iter];
+ allzeros = test_for_zeros(srcvec);
+ allones = test_for_ones(srcvec);
+ if (allzeros != expected_allzeros_results[iter]) {
+ printf("fail on allzero check. iter %d, result was %d \n", iter, allzeros);
+ failcount++;
+ }
+ if (allones != expected_allones_results[iter]) {
+ printf("fail on allones check. iter %d, result was %d \n", iter, allones);
+ failcount++;
+ }
+}
+
+if (failcount)
+ abort();
+return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/powerpc/lsbb.c b/gcc/testsuite/gcc.target/powerpc/lsbb.c
new file mode 100644
index 00000000000..b5c037094a5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/lsbb.c
@@ -0,0 +1,24 @@
+/*
+ Test the least significant bit by byte instruction
+ xvtlsbb BF,XB
+ Using the builtins
+ int vec_test_lsbb_all_zeros (vector unsigned char);
+ int vec_test_lsbb_all_ones (vector unsigned char);
+ */
+
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-fno-inline -mdejagnu-cpu=power10 -O2" } */
+
+/* { dg-final { scan-assembler-times {\mxvtlsbb\M} 2 } } */
+/* { dg-final { scan-assembler-times {\msetbc\M} 2 } } */
+
+#include <altivec.h>
+
+int test_for_zeros(vector char vc) {
+ return vec_test_lsbb_all_zeros(vc);
+}
+
+int test_for_ones(vector char vc) {
+ return vec_test_lsbb_all_ones(vc);
+}
+
diff --git a/gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c b/gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c
index 6a7baf31b43..93843c09f35 100644
--- a/gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c
+++ b/gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c
@@ -7,7 +7,7 @@
/* { dg-final { scan-assembler-times "lvsl" 2 } } */
/* { dg-final { scan-assembler-times "lvsr" 2 } } */
/* { dg-final { scan-assembler-times {\mlxvd2x\M|\mlxv\M} 2 } } */
-/* { dg-final { scan-assembler-times "vperm" 2 } } */
+/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 2 } } */
#include <altivec.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/mma-builtin-1.c b/gcc/testsuite/gcc.target/powerpc/mma-builtin-1.c
new file mode 100644
index 00000000000..69ee826e1be
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/mma-builtin-1.c
@@ -0,0 +1,313 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-Wno-psabi -mdejagnu-cpu=power10 -O2" } */
+
+typedef unsigned char vec_t __attribute__((vector_size(16)));
+
+void
+foo0 (__vector_quad *dst, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ __builtin_mma_xvi4ger8 (&acc, vec0, vec1);
+ __builtin_mma_xvi4ger8pp (&acc, vec0, vec1);
+ dst[0] = acc;
+}
+
+void
+foo1 (__vector_quad *dst, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ __builtin_mma_xvi8ger4 (&acc, vec0, vec1);
+ __builtin_mma_xvi8ger4pp (&acc, vec0, vec1);
+ __builtin_mma_xvi8ger4spp(&acc, vec0, vec1);
+ dst[1] = acc;
+}
+
+void
+foo2 (__vector_quad *dst, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ __builtin_mma_xvi16ger2 (&acc, vec0, vec1);
+ __builtin_mma_xvi16ger2pp (&acc, vec0, vec1);
+ dst[2] = acc;
+}
+
+void
+foo3 (__vector_quad *dst, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ __builtin_mma_xvi16ger2s (&acc, vec0, vec1);
+ __builtin_mma_xvi16ger2spp (&acc, vec0, vec1);
+ dst[3] = acc;
+}
+
+void
+foo4 (__vector_quad *dst, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ __builtin_mma_xvf16ger2 (&acc, vec0, vec1);
+ __builtin_mma_xvf16ger2pp (&acc, vec0, vec1);
+ __builtin_mma_xvf16ger2pn (&acc, vec0, vec1);
+ dst[4] = acc;
+}
+
+void
+foo4b (__vector_quad *dst, __vector_quad *src, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ acc = src[0];
+ __builtin_mma_xvf16ger2np (&acc, vec0, vec1);
+ __builtin_mma_xvf16ger2nn (&acc, vec0, vec1);
+ dst[4] = acc;
+}
+
+void
+foo5 (__vector_quad *dst, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ __builtin_mma_xvbf16ger2 (&acc, vec0, vec1);
+ __builtin_mma_xvbf16ger2pp (&acc, vec0, vec1);
+ __builtin_mma_xvbf16ger2pn (&acc, vec0, vec1);
+ dst[5] = acc;
+}
+
+void
+foo5b (__vector_quad *dst, __vector_quad *src, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ acc = src[0];
+ __builtin_mma_xvbf16ger2np (&acc, vec0, vec1);
+ __builtin_mma_xvbf16ger2nn (&acc, vec0, vec1);
+ dst[5] = acc;
+}
+
+void
+foo6 (__vector_quad *dst, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ __builtin_mma_xvf32ger (&acc, vec0, vec1);
+ __builtin_mma_xvf32gerpp (&acc, vec0, vec1);
+ __builtin_mma_xvf32gerpn (&acc, vec0, vec1);
+ dst[6] = acc;
+}
+
+void
+foo6b (__vector_quad *dst, __vector_quad *src, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ acc = src[0];
+ __builtin_mma_xvf32gernp (&acc, vec0, vec1);
+ __builtin_mma_xvf32gernn (&acc, vec0, vec1);
+ dst[6] = acc;
+}
+
+void
+foo7 (__vector_quad *dst, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ __builtin_mma_pmxvi4ger8 (&acc, vec0, vec1, 15, 15, 255);
+ __builtin_mma_pmxvi4ger8pp (&acc, vec0, vec1, 15, 15, 255);
+ dst[7] = acc;
+}
+
+void
+foo8 (__vector_quad *dst, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ __builtin_mma_pmxvi8ger4 (&acc, vec0, vec1, 15, 15, 15);
+ __builtin_mma_pmxvi8ger4pp (&acc, vec0, vec1, 15, 15, 15);
+ __builtin_mma_pmxvi8ger4spp(&acc, vec0, vec1, 15, 15, 15);
+ dst[8] = acc;
+}
+
+void
+foo9 (__vector_quad *dst, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ __builtin_mma_pmxvi16ger2 (&acc, vec0, vec1, 15, 15, 3);
+ __builtin_mma_pmxvi16ger2pp (&acc, vec0, vec1, 15, 15, 3);
+ dst[9] = acc;
+}
+
+void
+foo10 (__vector_quad *dst, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ __builtin_mma_pmxvi16ger2s (&acc, vec0, vec1, 15, 15, 3);
+ __builtin_mma_pmxvi16ger2spp (&acc, vec0, vec1, 15, 15, 3);
+ dst[10] = acc;
+}
+
+void
+foo11 (__vector_quad *dst, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ __builtin_mma_pmxvf16ger2 (&acc, vec0, vec1, 15, 15, 3);
+ __builtin_mma_pmxvf16ger2pp (&acc, vec0, vec1, 15, 15, 3);
+ __builtin_mma_pmxvf16ger2pn (&acc, vec0, vec1, 15, 15, 3);
+ dst[11] = acc;
+}
+
+void
+foo11b (__vector_quad *dst, __vector_quad *src, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ acc = src[0];
+ __builtin_mma_pmxvf16ger2np (&acc, vec0, vec1, 15, 15, 3);
+ __builtin_mma_pmxvf16ger2nn (&acc, vec0, vec1, 15, 15, 3);
+ dst[11] = acc;
+}
+
+void
+foo12 (__vector_quad *dst, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ __builtin_mma_pmxvbf16ger2 (&acc, vec0, vec1, 15, 15, 3);
+ __builtin_mma_pmxvbf16ger2pp (&acc, vec0, vec1, 15, 15, 3);
+ __builtin_mma_pmxvbf16ger2pn (&acc, vec0, vec1, 15, 15, 3);
+ dst[12] = acc;
+}
+
+void
+foo12b (__vector_quad *dst, __vector_quad *src, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ acc = src[0];
+ __builtin_mma_pmxvbf16ger2np (&acc, vec0, vec1, 15, 15, 3);
+ __builtin_mma_pmxvbf16ger2nn (&acc, vec0, vec1, 15, 15, 3);
+ dst[12] = acc;
+}
+
+void
+foo13 (__vector_quad *dst, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ __builtin_mma_pmxvf32ger (&acc, vec0, vec1, 15, 15);
+ __builtin_mma_pmxvf32gerpp (&acc, vec0, vec1, 15, 15);
+ __builtin_mma_pmxvf32gerpn (&acc, vec0, vec1, 15, 15);
+ dst[13] = acc;
+}
+
+void
+foo13b (__vector_quad *dst, __vector_quad *src, vec_t *vec)
+{
+ __vector_quad acc;
+ vec_t vec0 = vec[0];
+ vec_t vec1 = vec[1];
+
+ acc = src[0];
+ __builtin_mma_pmxvf32gernp (&acc, vec0, vec1, 15, 15);
+ __builtin_mma_pmxvf32gernn (&acc, vec0, vec1, 15, 15);
+ dst[13] = acc;
+}
+
+/* { dg-final { scan-assembler-times {\mlxv\M} 40 } } */
+/* { dg-final { scan-assembler-times {\mlxvp\M} 12 } } */
+/* { dg-final { scan-assembler-times {\mstxvp\M} 40 } } */
+/* { dg-final { scan-assembler-times {\mxxmfacc\M} 20 } } */
+/* { dg-final { scan-assembler-times {\mxxmtacc\M} 6 } } */
+/* { dg-final { scan-assembler-times {\mxvbf16ger2\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvbf16ger2nn\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvbf16ger2np\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvbf16ger2pn\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvbf16ger2pp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvf16ger2\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvf16ger2nn\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvf16ger2np\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvf16ger2pn\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvf16ger2pp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvf32ger\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvf32gernn\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvf32gernp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvf32gerpn\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvf32gerpp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvi16ger2\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvi16ger2pp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvi16ger2s\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvi16ger2spp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvi4ger8\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvi4ger8pp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvi8ger4\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvi8ger4pp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvi8ger4spp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvbf16ger2\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvbf16ger2nn\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvbf16ger2np\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvbf16ger2pn\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvbf16ger2pp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvf16ger2\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvf16ger2nn\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvf16ger2np\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvf16ger2pn\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvf16ger2pp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvf32ger\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvf32gernn\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvf32gernp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvf32gerpn\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvf32gerpp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvi16ger2\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvi16ger2pp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvi16ger2s\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvi16ger2spp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvi4ger8\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvi4ger8pp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvi8ger4\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvi8ger4pp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvi8ger4spp\M} 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/mma-builtin-2.c b/gcc/testsuite/gcc.target/powerpc/mma-builtin-2.c
new file mode 100644
index 00000000000..0230d727657
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/mma-builtin-2.c
@@ -0,0 +1,72 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-Wno-psabi -mdejagnu-cpu=power10 -O2" } */
+
+typedef unsigned char vec_t __attribute__((vector_size(16)));
+
+void
+foo0 (__vector_quad *dst, vec_t *vec, __vector_pair *pvecp)
+{
+ __vector_quad acc;
+ __vector_pair vecp0 = *pvecp;
+ vec_t vec1 = vec[1];
+
+ __builtin_mma_xvf64ger (&acc, vecp0, vec1);
+ __builtin_mma_xvf64gerpp (&acc, vecp0, vec1);
+ __builtin_mma_xvf64gerpn (&acc, vecp0, vec1);
+ dst[0] = acc;
+}
+
+void
+foo1 (__vector_quad *dst, __vector_quad *src, vec_t *vec, __vector_pair *pvecp)
+{
+ __vector_quad acc;
+ __vector_pair vecp0 = *pvecp;
+ vec_t vec1 = vec[1];
+
+ acc = src[0];
+ __builtin_mma_xvf64gernp (&acc, vecp0, vec1);
+ __builtin_mma_xvf64gernn (&acc, vecp0, vec1);
+ dst[0] = acc;
+}
+
+void
+foo2 (__vector_quad *dst, vec_t *vec, __vector_pair *pvecp)
+{
+ __vector_quad acc;
+ __vector_pair vecp0 = *pvecp;
+ vec_t vec1 = vec[1];
+ __builtin_mma_pmxvf64ger (&acc, vecp0, vec1, 15, 3);
+ __builtin_mma_pmxvf64gerpp (&acc, vecp0, vec1, 15, 3);
+ __builtin_mma_pmxvf64gerpn (&acc, vecp0, vec1, 15, 3);
+ dst[1] = acc;
+}
+
+void
+foo3 (__vector_quad *dst, __vector_quad *src, vec_t *vec, __vector_pair *pvecp)
+{
+ __vector_quad acc;
+ __vector_pair vecp0 = *pvecp;
+ vec_t vec1 = vec[1];
+
+ acc = src[0];
+ __builtin_mma_pmxvf64gernp (&acc, vecp0, vec1, 15, 3);
+ __builtin_mma_pmxvf64gernn (&acc, vecp0, vec1, 15, 3);
+ dst[1] = acc;
+}
+
+/* { dg-final { scan-assembler-times {\mxxmfacc\M} 4 } } */
+/* { dg-final { scan-assembler-times {\mxxmtacc\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mlxv\M} 4 } } */
+/* { dg-final { scan-assembler-times {\mlxvp\M} 8 } } */
+/* { dg-final { scan-assembler-times {\mstxvp\M} 8 } } */
+/* { dg-final { scan-assembler-times {\mxvf64ger\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvf64gerpp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvf64gerpn\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvf64gernp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvf64gernn\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvf64ger\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvf64gerpp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvf64gerpn\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvf64gernp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpmxvf64gernn\M} 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/mma-builtin-3.c b/gcc/testsuite/gcc.target/powerpc/mma-builtin-3.c
new file mode 100644
index 00000000000..29eb2754999
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/mma-builtin-3.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-Wno-psabi -mdejagnu-cpu=power10 -O2" } */
+
+void
+foo0 (void)
+{
+ __vector_quad acc;
+ asm ("#..." : "=d" (acc));
+ __builtin_mma_xxmtacc (&acc);
+ __builtin_mma_xxmfacc (&acc);
+ asm ("#..." :: "d" (acc));
+}
+
+typedef unsigned char vec_t __attribute__((vector_size(16)));
+
+void
+foo1 (vec_t *vec)
+{
+ vec[1] = __builtin_vsx_xvcvspbf16 (vec[0]);
+ vec[3] = __builtin_vsx_xvcvbf16sp (vec[2]);
+}
+
+/* { dg-final { scan-assembler-times {\mxxmtacc\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxxmfacc\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mlxv\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mstxv\M} 2 } } */
+/* { dg-final { scan-assembler-not {\mlxvp\M} } } */
+/* { dg-final { scan-assembler-not {\mstxvp\M} } } */
+/* { dg-final { scan-assembler-times {\mxvcvspbf16\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxvcvbf16sp\M} 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/mma-builtin-4.c b/gcc/testsuite/gcc.target/powerpc/mma-builtin-4.c
new file mode 100644
index 00000000000..f3a857bb8c1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/mma-builtin-4.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-Wno-psabi -mdejagnu-cpu=power10 -O2" } */
+
+typedef unsigned char vec_t __attribute__((vector_size(16)));
+
+void
+foo (__vector_pair *dst, vec_t *src)
+{
+ __vector_pair pair;
+ __builtin_mma_assemble_pair (&pair, src[0], src[4]);
+ *dst = pair;
+}
+
+void
+bar (vec_t *dst, __vector_pair *src)
+{
+ vec_t res[2];
+ __builtin_mma_disassemble_pair (res, src);
+ dst[0] = res[0];
+ dst[4] = res[1];
+}
+
+/* { dg-final { scan-assembler-times {\mlxv\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mlxvp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mstxv\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mstxvp\M} 1 } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/mma-builtin-5.c b/gcc/testsuite/gcc.target/powerpc/mma-builtin-5.c
new file mode 100644
index 00000000000..43b6d3ac91e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/mma-builtin-5.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-Wno-psabi -mdejagnu-cpu=power10 -O2" } */
+
+typedef unsigned char vec_t __attribute__((vector_size(16)));
+
+void
+foo (__vector_quad *dst, vec_t *src)
+{
+ __vector_quad acc;
+ __builtin_mma_assemble_acc (&acc, src[0], src[4], src[8], src[12]);
+ *dst = acc;
+}
+
+void
+bar (vec_t *dst, __vector_quad *src)
+{
+ vec_t res[4];
+ __builtin_mma_disassemble_acc (res, src);
+ dst[0] = res[0];
+ dst[4] = res[1];
+ dst[8] = res[2];
+ dst[12] = res[3];
+}
+
+/* { dg-final { scan-assembler-times {\mlxv\M} 4 } } */
+/* { dg-final { scan-assembler-times {\mlxvp\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mstxv\M} 4 } } */
+/* { dg-final { scan-assembler-times {\mstxvp\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mxxmfacc\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mxxmtacc\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/mma-builtin-6.c b/gcc/testsuite/gcc.target/powerpc/mma-builtin-6.c
new file mode 100644
index 00000000000..0c6517211e3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/mma-builtin-6.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-Wno-psabi -mdejagnu-cpu=power10 -O2" } */
+
+void
+foo (__vector_quad *dst)
+{
+ __vector_quad acc;
+ __builtin_mma_xxsetaccz (&acc);
+ *dst = acc;
+}
+
+/* { dg-final { scan-assembler-not {\mlxv\M} } } */
+/* { dg-final { scan-assembler-not {\mlxvp\M} } } */
+/* { dg-final { scan-assembler-not {\mxxmtacc\M} } } */
+/* { dg-final { scan-assembler-times {\mxxsetaccz\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxxmfacc\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mstxvp\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/mma-double-test.c b/gcc/testsuite/gcc.target/powerpc/mma-double-test.c
new file mode 100755
index 00000000000..044a288ebcc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/mma-double-test.c
@@ -0,0 +1,186 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-require-effective-target ppc_mma_hw } */
+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <altivec.h>
+
+typedef unsigned char vec_t __attribute__ ((vector_size (16)));
+typedef double v4sf_t __attribute__ ((vector_size (16)));
+#define SAVE_ACC(ACC, ldc, J) \
+ __builtin_mma_disassemble_acc (result, ACC); \
+ rowC = (v4sf_t *) &CO[0*ldc+J]; \
+ rowC[0] += result[0]; \
+ rowC = (v4sf_t *) &CO[1*ldc+J]; \
+ rowC[0] += result[1]; \
+ rowC = (v4sf_t *) &CO[2*ldc+J]; \
+ rowC[0] += result[2]; \
+ rowC = (v4sf_t *) &CO[3*ldc+J]; \
+ rowC[0] += result[3];
+
+void
+MMA (int m, int n, int k, double *A, double *B, double *C)
+{
+ __vector_quad acc0, acc1, acc2, acc3, acc4, acc5, acc6, acc7;
+ v4sf_t result[4];
+ v4sf_t *rowC;
+ for (int l = 0; l < n; l += 4)
+ {
+ double *CO;
+ double *AO;
+ AO = A;
+ CO = C;
+ C += m * 4;
+ for (int j = 0; j < m; j += 16)
+ {
+ double *BO = B;
+ __builtin_mma_xxsetaccz (&acc0);
+ __builtin_mma_xxsetaccz (&acc1);
+ __builtin_mma_xxsetaccz (&acc2);
+ __builtin_mma_xxsetaccz (&acc3);
+ __builtin_mma_xxsetaccz (&acc4);
+ __builtin_mma_xxsetaccz (&acc5);
+ __builtin_mma_xxsetaccz (&acc6);
+ __builtin_mma_xxsetaccz (&acc7);
+ unsigned long i;
+
+ for (i = 0; i < k; i++)
+ {
+ vec_t *rowA = (vec_t *) & AO[i * 16];
+ __vector_pair rowB;
+ vec_t *rb = (vec_t *) & BO[i * 4];
+ __builtin_mma_assemble_pair (&rowB, rb[1], rb[0]);
+ __builtin_mma_xvf64gerpp (&acc0, rowB, rowA[0]);
+ __builtin_mma_xvf64gerpp (&acc1, rowB, rowA[1]);
+ __builtin_mma_xvf64gerpp (&acc2, rowB, rowA[2]);
+ __builtin_mma_xvf64gerpp (&acc3, rowB, rowA[3]);
+ __builtin_mma_xvf64gerpp (&acc4, rowB, rowA[4]);
+ __builtin_mma_xvf64gerpp (&acc5, rowB, rowA[5]);
+ __builtin_mma_xvf64gerpp (&acc6, rowB, rowA[6]);
+ __builtin_mma_xvf64gerpp (&acc7, rowB, rowA[7]);
+ }
+ SAVE_ACC (&acc0, m, 0);
+ SAVE_ACC (&acc2, m, 4);
+ SAVE_ACC (&acc1, m, 2);
+ SAVE_ACC (&acc3, m, 6);
+ SAVE_ACC (&acc4, m, 8);
+ SAVE_ACC (&acc6, m, 12);
+ SAVE_ACC (&acc5, m, 10);
+ SAVE_ACC (&acc7, m, 14);
+ AO += k * 16;
+ BO += k * 4;
+ CO += 16;
+ }
+ B += k * 4;
+ }
+}
+
+void
+init (double *matrix, int row, int column)
+{
+ for (int j = 0; j < column; j++)
+ {
+ for (int i = 0; i < row; i++)
+ {
+ matrix[j * row + i] = (i * 16 + 2 + j) / 0.123;
+ }
+ }
+}
+
+void
+init0 (double *matrix, double *matrix1, int row, int column)
+{
+ for (int j = 0; j < column; j++)
+ for (int i = 0; i < row; i++)
+ matrix[j * row + i] = matrix1[j * row + i] = 0;
+}
+
+
+void
+print (const char *name, const double *matrix, int row, int column)
+{
+ printf ("Matrix %s has %d rows and %d columns:\n", name, row, column);
+ for (int i = 0; i < row; i++)
+ {
+ for (int j = 0; j < column; j++)
+ {
+ printf ("%f ", matrix[j * row + i]);
+ }
+ printf ("\n");
+ }
+ printf ("\n");
+}
+
+int
+main (int argc, char *argv[])
+{
+ int rowsA, colsB, common;
+ int i, j, k;
+ int ret = 0;
+
+ for (int t = 16; t <= 128; t += 16)
+ {
+ for (int t1 = 4; t1 <= 16; t1 += 4)
+ {
+ rowsA = t;
+ colsB = t1;
+ common = 1;
+ /* printf ("Running test for rows = %d,cols = %d\n", t, t1); */
+ double A[rowsA * common];
+ double B[common * colsB];
+ double C[rowsA * colsB];
+ double D[rowsA * colsB];
+
+
+ init (A, rowsA, common);
+ init (B, common, colsB);
+ init0 (C, D, rowsA, colsB);
+ MMA (rowsA, colsB, common, A, B, C);
+
+ for (i = 0; i < colsB; i++)
+ {
+ for (j = 0; j < rowsA; j++)
+ {
+ D[i * rowsA + j] = 0;
+ for (k = 0; k < common; k++)
+ {
+ D[i * rowsA + j] +=
+ A[k * rowsA + j] * B[k + common * i];
+ }
+ }
+ }
+ for (i = 0; i < colsB; i++)
+ {
+ for (j = 0; j < rowsA; j++)
+ {
+ for (k = 0; k < common; k++)
+ {
+ if (D[i * rowsA + j] != C[i * rowsA + j])
+ {
+ printf ("Error %d,%d,%d\n",i,j,k);
+ ret++;
+ }
+ }
+ }
+ }
+ if (ret)
+ {
+ print ("A", A, rowsA, common);
+ print ("B", B, common, colsB);
+ print ("C", C, rowsA, colsB);
+ print ("D", D, rowsA, colsB);
+ }
+ }
+ }
+
+#ifdef VERBOSE
+ if (ret)
+ printf ("MMA double test fail: %d errors\n",ret);
+ else
+ printf ("MMA single test success: 0 MMA errors\n");
+#endif
+
+ return ret;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/mma-single-test.c b/gcc/testsuite/gcc.target/powerpc/mma-single-test.c
new file mode 100755
index 00000000000..7e628df45b7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/mma-single-test.c
@@ -0,0 +1,194 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-require-effective-target ppc_mma_hw } */
+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <altivec.h>
+
+typedef unsigned char vec_t __attribute__ ((vector_size (16)));
+typedef float v4sf_t __attribute__ ((vector_size (16)));
+#define SAVE_ACC(ACC, ldc,J) \
+ __builtin_mma_disassemble_acc (result, ACC); \
+ rowC = (v4sf_t *) &CO[0*ldc+J]; \
+ rowC[0] += result[0]; \
+ rowC = (v4sf_t *) &CO[1*ldc+J]; \
+ rowC[0] += result[1]; \
+ rowC = (v4sf_t *) &CO[2*ldc+J]; \
+ rowC[0] += result[2]; \
+ rowC = (v4sf_t *) &CO[3*ldc+J]; \
+ rowC[0] += result[3];
+
+#define SAVE_ACC1(ACC,ldc, J) \
+ __builtin_mma_disassemble_acc (result, ACC); \
+ rowC = (v4sf_t *) &CO[4* ldc+J]; \
+ rowC[0] += result[0]; \
+ rowC = (v4sf_t *) &CO[5*ldc+J]; \
+ rowC[0] += result[1]; \
+ rowC = (v4sf_t *) &CO[6*ldc+J]; \
+ rowC[0] += result[2]; \
+ rowC = (v4sf_t *) &CO[7*ldc+J]; \
+ rowC[0] += result[3];
+void
+MMA (int m, int n, int k, float *A, float *B, float *C)
+{
+ __vector_quad acc0, acc1, acc2, acc3, acc4, acc5, acc6, acc7;
+ v4sf_t result[4];
+ v4sf_t *rowC;
+ for (int l = 0; l < n; l += 8)
+ {
+ float *CO;
+ float *AO;
+ AO = A;
+ CO = C;
+ C += m * 8;
+ for (int j = 0; j < m; j += 16)
+ {
+ float *BO = B;
+ __builtin_mma_xxsetaccz (&acc0);
+ __builtin_mma_xxsetaccz (&acc1);
+ __builtin_mma_xxsetaccz (&acc2);
+ __builtin_mma_xxsetaccz (&acc3);
+ __builtin_mma_xxsetaccz (&acc4);
+ __builtin_mma_xxsetaccz (&acc5);
+ __builtin_mma_xxsetaccz (&acc6);
+ __builtin_mma_xxsetaccz (&acc7);
+ unsigned long i;
+
+ for (i = 0; i < k; i++)
+ {
+ vec_t *rowA = (vec_t *) & AO[i * 16];
+ vec_t *rowB = (vec_t *) & BO[i * 8];
+ __builtin_mma_xvf32gerpp (&acc0, rowB[0], rowA[0]);
+ __builtin_mma_xvf32gerpp (&acc1, rowB[1], rowA[0]);
+ __builtin_mma_xvf32gerpp (&acc2, rowB[0], rowA[1]);
+ __builtin_mma_xvf32gerpp (&acc3, rowB[1], rowA[1]);
+ __builtin_mma_xvf32gerpp (&acc4, rowB[0], rowA[2]);
+ __builtin_mma_xvf32gerpp (&acc5, rowB[1], rowA[2]);
+ __builtin_mma_xvf32gerpp (&acc6, rowB[0], rowA[3]);
+ __builtin_mma_xvf32gerpp (&acc7, rowB[1], rowA[3]);
+ }
+ SAVE_ACC (&acc0, m, 0);
+ SAVE_ACC (&acc2, m, 4);
+ SAVE_ACC1 (&acc1, m, 0);
+ SAVE_ACC1 (&acc3, m, 4);
+ SAVE_ACC (&acc4, m, 8);
+ SAVE_ACC (&acc6, m, 12);
+ SAVE_ACC1 (&acc5, m, 8);
+ SAVE_ACC1 (&acc7, m, 12);
+ AO += k * 16;
+ BO += k * 8;
+ CO += 16;
+ }
+ B += k * 8;
+ }
+}
+
+void
+init (float *matrix, int row, int column)
+{
+ for (int j = 0; j < column; j++)
+ {
+ for (int i = 0; i < row; i++)
+ {
+ matrix[j * row + i] = (i * 16 + 2 + j) / 0.123;
+ }
+ }
+}
+
+void
+init0 (float *matrix, float *matrix1, int row, int column)
+{
+ for (int j = 0; j < column; j++)
+ for (int i = 0; i < row; i++)
+ matrix[j * row + i] = matrix1[j * row + i] = 0;
+}
+
+
+void
+print (const char *name, const float *matrix, int row, int column)
+{
+ printf ("Matrix %s has %d rows and %d columns:\n", name, row, column);
+ for (int i = 0; i < row; i++)
+ {
+ for (int j = 0; j < column; j++)
+ {
+ printf ("%f ", matrix[j * row + i]);
+ }
+ printf ("\n");
+ }
+ printf ("\n");
+}
+
+int
+main (int argc, char *argv[])
+{
+ int rowsA, colsB, common;
+ int i, j, k;
+ int ret = 0;
+
+ for (int t = 16; t <= 128; t += 16)
+ {
+ for (int t1 = 8; t1 <= 16; t1 += 8)
+ {
+ rowsA = t;
+ colsB = t1;
+ common = 1;
+ /* printf ("Running test for rows = %d,cols = %d\n", t, t1); */
+ float A[rowsA * common];
+ float B[common * colsB];
+ float C[rowsA * colsB];
+ float D[rowsA * colsB];
+
+
+ init (A, rowsA, common);
+ init (B, common, colsB);
+ init0 (C, D, rowsA, colsB);
+ MMA (rowsA, colsB, common, A, B, C);
+
+ for (i = 0; i < colsB; i++)
+ {
+ for (j = 0; j < rowsA; j++)
+ {
+ D[i * rowsA + j] = 0;
+ for (k = 0; k < common; k++)
+ {
+ D[i * rowsA + j] +=
+ A[k * rowsA + j] * B[k + common * i];
+ }
+ }
+ }
+ for (i = 0; i < colsB; i++)
+ {
+ for (j = 0; j < rowsA; j++)
+ {
+ for (k = 0; k < common; k++)
+ {
+ if (D[i * rowsA + j] != C[i * rowsA + j])
+ {
+ printf ("Error %d,%d,%d\n",i,j,k);
+ ret++;
+ }
+ }
+ }
+ }
+ if (ret)
+ {
+ print ("A", A, rowsA, common);
+ print ("B", B, common, colsB);
+ print ("C", C, rowsA, colsB);
+ print ("D", D, rowsA, colsB);
+ }
+ }
+ }
+
+#ifdef VERBOSE
+ if (ret)
+ printf ("MMA single test fail: %d errors\n",ret);
+ else
+ printf ("MMA single test success: 0 MMA errors\n");
+#endif
+
+ return ret;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/mma-supported.c b/gcc/testsuite/gcc.target/powerpc/mma-supported.c
new file mode 100644
index 00000000000..92d9a7f4686
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/mma-supported.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ppc_mma_hw } */
+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */
+
+/* This test will only run when the ppc_mma_hw test passes. If that
+ test passes, then we expect to see that mma feature is supported.
+ If this is not the case, then the test environment has problems. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main (int argc, char *argv[])
+{
+#ifdef __BUILTIN_CPU_SUPPORTS__
+ if ( !__builtin_cpu_supports ("mma"))
+ {
+#ifdef DEBUG
+ printf ("Error: __builtin_cpu_supports says mma not supported, but ppc_mma_hw test passed.\n");
+#endif
+ abort();
+ }
+#endif
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/notoc-direct-1.c b/gcc/testsuite/gcc.target/powerpc/notoc-direct-1.c
index 8603ff7706b..74187e1d5dc 100644
--- a/gcc/testsuite/gcc.target/powerpc/notoc-direct-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/notoc-direct-1.c
@@ -1,10 +1,10 @@
/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=future -O2 -mpcrel" } */
+/* { dg-options "-mdejagnu-cpu=power10 -O2 -mpcrel" } */
/* { dg-require-effective-target powerpc_elfv2 } */
-/* { dg-require-effective-target powerpc_future_ok } */
+/* { dg-require-effective-target power10_ok } */
/* Test that calls generated from PC-relative code are annotated with @notoc.
- At present, -mcpu=future does not enable pc-relative mode. Enable it here
+ At present, -mcpu=power10 does not enable pc-relative mode. Enable it here
explicitly until it is turned on by default. */
extern int yy0 (int);
diff --git a/gcc/testsuite/gcc.target/powerpc/p10-arch31.c b/gcc/testsuite/gcc.target/powerpc/p10-arch31.c
new file mode 100644
index 00000000000..a9a75ec83f6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p10-arch31.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */
+
+/* This test will only run when the power10_hw_available test passes.
+ If that test passes, then we expect to see that ISA 3.1 is
+ supported. If this is not the case, then the test environment has
+ problems. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main (int argc, char *argv[])
+{
+ int ret = 0;
+#ifdef __BUILTIN_CPU_SUPPORTS__
+ if ( !__builtin_cpu_supports ("arch_3_1"))
+ {
+ printf ("Error: __builtin_cpu_supports says arch_3_1 not supported, but power10_hw test passed.\n");
+ ret++;
+ }
+#endif
+ return ret;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/p10-identify.c b/gcc/testsuite/gcc.target/powerpc/p10-identify.c
new file mode 100644
index 00000000000..85326976a5d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p10-identify.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */
+
+/* This test will only run when the power10_hw_available test passes.
+ If that test passes, then we expect to see that the cpu is Power10.
+ If this is not the case, then the test environment has problems.
+ If in the future there are cpus that pass the power10_hw test but
+ are not power10, they will need to be added to this check. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main (int argc, char *argv[])
+{
+ int ret = 0;
+#ifdef __BUILTIN_CPU_SUPPORTS__
+ if ( !__builtin_cpu_is ("power10"))
+ {
+ printf ("Error: __builtin_cpu_is says this is not power10, but power10_hw test passed.\n");
+ ret++;
+ }
+#endif
+ return ret;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/p8vector-int128-1.c b/gcc/testsuite/gcc.target/powerpc/p8vector-int128-1.c
index d91157b9556..28b148c692c 100644
--- a/gcc/testsuite/gcc.target/powerpc/p8vector-int128-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/p8vector-int128-1.c
@@ -1,6 +1,7 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-require-effective-target int128 } */
/* { dg-options "-mdejagnu-cpu=power8 -O3" } */
#include <altivec.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/p8vector-int128-2.c b/gcc/testsuite/gcc.target/powerpc/p8vector-int128-2.c
index d9b2d8d9d4f..72358d616b1 100644
--- a/gcc/testsuite/gcc.target/powerpc/p8vector-int128-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/p8vector-int128-2.c
@@ -1,7 +1,7 @@
-/* { dg-do run { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-do run } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target p8vector_hw } */
+/* { dg-require-effective-target int128 } */
/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
#include <stddef.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-1.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-1.h
new file mode 100644
index 00000000000..50da5817013
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-1.h
@@ -0,0 +1,18 @@
+#include "p9-vec-length.h"
+
+/* Test the case loop iteration is known. */
+
+#define N 127
+
+#define test(TYPE) \
+ extern TYPE a_##TYPE[N]; \
+ extern TYPE b_##TYPE[N]; \
+ extern TYPE c_##TYPE[N]; \
+ void __attribute__ ((noinline, noclone)) test##TYPE () \
+ { \
+ unsigned int i = 0; \
+ for (i = 0; i < N; i++) \
+ c_##TYPE[i] = a_##TYPE[i] + b_##TYPE[i]; \
+ }
+
+TEST_ALL (test)
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-2.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-2.h
new file mode 100644
index 00000000000..b275dba0fde
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-2.h
@@ -0,0 +1,17 @@
+#include "p9-vec-length.h"
+
+/* Test the case loop iteration is unknown. */
+#define N 255
+
+#define test(TYPE) \
+ extern TYPE a_##TYPE[N]; \
+ extern TYPE b_##TYPE[N]; \
+ extern TYPE c_##TYPE[N]; \
+ void __attribute__ ((noinline, noclone)) test##TYPE (unsigned int n) \
+ { \
+ unsigned int i = 0; \
+ for (i = 0; i < n; i++) \
+ c_##TYPE[i] = a_##TYPE[i] + b_##TYPE[i]; \
+ }
+
+TEST_ALL (test)
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-3.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-3.h
new file mode 100644
index 00000000000..c79b9b30910
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-3.h
@@ -0,0 +1,31 @@
+#include "p9-vec-length.h"
+
+/* Test the case loop iteration less than VF. */
+
+/* For char. */
+#define N_uint8_t 15
+#define N_int8_t 15
+/* For short. */
+#define N_uint16_t 6
+#define N_int16_t 6
+/* For int/float. */
+#define N_uint32_t 3
+#define N_int32_t 3
+#define N_float 3
+/* For long/double. */
+#define N_uint64_t 1
+#define N_int64_t 1
+#define N_double 1
+
+#define test(TYPE) \
+ extern TYPE a_##TYPE[N_##TYPE]; \
+ extern TYPE b_##TYPE[N_##TYPE]; \
+ extern TYPE c_##TYPE[N_##TYPE]; \
+ void __attribute__ ((noinline, noclone)) test##TYPE () \
+ { \
+ unsigned int i = 0; \
+ for (i = 0; i < N_##TYPE; i++) \
+ c_##TYPE[i] = a_##TYPE[i] + b_##TYPE[i]; \
+ }
+
+TEST_ALL (test)
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-4.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-4.h
new file mode 100644
index 00000000000..0ee7fc84502
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-4.h
@@ -0,0 +1,24 @@
+#include "p9-vec-length.h"
+
+/* Test the case that the loop which has multiple vectors (concatenated vectors)
+ but with same vector type. */
+
+#define test(TYPE) \
+ void __attribute__ ((noinline, noclone)) \
+ test_mv_##TYPE (TYPE *restrict a, TYPE *restrict b, TYPE *restrict c, \
+ int n) \
+ { \
+ for (int i = 0; i < n; ++i) \
+ { \
+ a[i] += 1; \
+ b[i * 2] += 2; \
+ b[i * 2 + 1] += 3; \
+ c[i * 4] += 4; \
+ c[i * 4 + 1] += 5; \
+ c[i * 4 + 2] += 6; \
+ c[i * 4 + 3] += 7; \
+ } \
+ }
+
+TEST_ALL (test)
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-5.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-5.h
new file mode 100644
index 00000000000..406daaa3d3e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-5.h
@@ -0,0 +1,29 @@
+#include "p9-vec-length.h"
+
+/* Test the case that the loop which has multiple vectors (concatenated vectors)
+ with different types. */
+
+#define test(TYPE1, TYPE2) \
+ void __attribute__ ((noinline, noclone)) \
+ test_mv_##TYPE1##TYPE2 (TYPE1 *restrict a, TYPE2 *restrict b, int n) \
+ { \
+ for (int i = 0; i < n; ++i) \
+ { \
+ a[i * 2] += 1; \
+ a[i * 2 + 1] += 2; \
+ b[i * 2] += 3; \
+ b[i * 2 + 1] += 4; \
+ } \
+ }
+
+#define TEST_ALL2(T) \
+ T (int8_t, uint16_t) \
+ T (uint8_t, int16_t) \
+ T (int16_t, uint32_t) \
+ T (uint16_t, int32_t) \
+ T (int32_t, double) \
+ T (uint32_t, int64_t) \
+ T (float, uint64_t)
+
+TEST_ALL2 (test)
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-6.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-6.h
new file mode 100644
index 00000000000..58b151e18f8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-6.h
@@ -0,0 +1,32 @@
+#include "p9-vec-length.h"
+
+/* Test the case that the loop which has the same concatenated vectors (same
+ size per iteration) but from different types. */
+
+#define test(TYPE1, TYPE2) \
+ void __attribute__ ((noinline, noclone)) \
+ test_mv_##TYPE1##TYPE2 (TYPE1 *restrict a, TYPE2 *restrict b, int n) \
+ { \
+ for (int i = 0; i < n; i++) \
+ { \
+ a[i * 2] += 1; \
+ a[i * 2 + 1] += 2; \
+ b[i * 4] += 3; \
+ b[i * 4 + 1] += 4; \
+ b[i * 4 + 2] += 5; \
+ b[i * 4 + 3] += 6; \
+ } \
+ }
+
+#define TEST_ALL2(T) \
+ T (int16_t, uint8_t) \
+ T (uint16_t, int8_t) \
+ T (int32_t, uint16_t) \
+ T (uint32_t, int16_t) \
+ T (float, uint16_t) \
+ T (int64_t, float) \
+ T (uint64_t, int32_t) \
+ T (double, uint32_t)
+
+TEST_ALL2 (test)
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-7.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-7.h
new file mode 100644
index 00000000000..4ef8f974a04
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-7.h
@@ -0,0 +1,20 @@
+#include "p9-vec-length.h"
+
+/* Test the case that the loop requires to have peeled prologues for
+ alignment. */
+
+#define N 64
+#define START 1
+#define END 59
+
+#define test(TYPE) \
+ TYPE x_##TYPE[N] __attribute__((aligned(16))); \
+ void __attribute__((noinline, noclone)) test_npeel_##TYPE() { \
+ TYPE v = 0; \
+ for (unsigned int i = START; i < END; i++) { \
+ x_##TYPE[i] = v; \
+ v += 1; \
+ } \
+ }
+
+TEST_ALL (test)
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-8.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-8.h
new file mode 100644
index 00000000000..09d0e369f11
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-8.h
@@ -0,0 +1,14 @@
+#include "p9-vec-length.h"
+
+/* Test the case that the loop requires to peel for gaps. */
+
+#define N 200
+
+#define test(TYPE) \
+ void __attribute__((noinline, noclone)) \
+ test_##TYPE(TYPE *restrict dest, TYPE *restrict src) { \
+ for (unsigned int i = 0; i < N; ++i) \
+ dest[i] += src[i * 2]; \
+ }
+
+TEST_ALL(test)
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-1.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-1.c
new file mode 100644
index 00000000000..ebb2f45c917
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Test for that only vectorize the epilogue with vector access with length,
+ the main body still use normal vector load/store. */
+
+#include "p9-vec-length-1.h"
+
+/* { dg-final { scan-assembler-times {\mlxvx?\M} 20 } } */
+/* { dg-final { scan-assembler-times {\mstxvx?\M} 10 } } */
+/* { dg-final { scan-assembler-times {\mlxvl\M} 20 } } */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 10 } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-2.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-2.c
new file mode 100644
index 00000000000..9f78a447ec7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-2.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Test for that only vectorize the epilogue with vector access with length,
+ the main body still use normal vector load/store. */
+
+#include "p9-vec-length-2.h"
+
+/* { dg-final { scan-assembler-times {\mlxvx?\M} 20 } } */
+/* { dg-final { scan-assembler-times {\mstxvx?\M} 10 } } */
+/* { dg-final { scan-assembler-times {\mlxvl\M} 20 } } */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 10 } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-3.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-3.c
new file mode 100644
index 00000000000..a08797fcbca
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-3.c
@@ -0,0 +1,18 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Test for that only vectorize the epilogue with vector access with length,
+ the main body still use normal vector load/store. */
+
+#include "p9-vec-length-3.h"
+
+/* { dg-final { scan-assembler-not {\mlxv\M} } } */
+/* { dg-final { scan-assembler-not {\mstxv\M} } } */
+/* { dg-final { scan-assembler-not {\mlxvx\M} } } */
+/* { dg-final { scan-assembler-not {\mstxvx\M} } } */
+/* 64bit types get completely unrolled, so only check the others. */
+/* { dg-final { scan-assembler-times {\mlxvl\M} 14 } } */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 7 } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-4.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-4.c
new file mode 100644
index 00000000000..ad051fb1cef
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-4.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Test for that only vectorize the epilogue with vector access with length,
+ the main body still use normal vector load/store. */
+
+#include "p9-vec-length-4.h"
+
+/* { dg-final { scan-assembler-times {\mlxvx?\M} 120 } } */
+/* { dg-final { scan-assembler-times {\mstxvx?\M} 70 } } */
+/* { dg-final { scan-assembler-times {\mlxvl\M} 70 } } */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 70 } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-5.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-5.c
new file mode 100644
index 00000000000..a24c30feeba
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-5.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Test for that only vectorize the epilogue with vector access with length,
+ the main body still use normal vector load/store. */
+
+#include "p9-vec-length-5.h"
+
+/* { dg-final { scan-assembler-times {\mlxvx?\M} 49 } } */
+/* { dg-final { scan-assembler-times {\mstxvx?\M} 21 } } */
+/* { dg-final { scan-assembler-times {\mlxvl\M} 21 } } */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 21 } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-6.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-6.c
new file mode 100644
index 00000000000..4eaeb3b005f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-6.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Test for that only vectorize the epilogue with vector access with length,
+ the main body still use normal vector load/store. */
+
+#include "p9-vec-length-6.h"
+
+/* { dg-final { scan-assembler-times {\mlxvx?\M} 42 } } */
+/* { dg-final { scan-assembler-times {\mstxvx?\M} 16 } } */
+/* 64bit/32bit pairs don't have the epilogues. */
+/* { dg-final { scan-assembler-times {\mlxvl\M} 10 } } */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 10 } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-7.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-7.c
new file mode 100644
index 00000000000..9d403287923
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-7.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops -ffast-math" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Test for that only vectorize the epilogue with vector access with length,
+ the main body still use normal vector load/store. */
+
+#include "p9-vec-length-7.h"
+
+/* { dg-final { scan-assembler-times {\mstxvl\M} 10 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-8.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-8.c
new file mode 100644
index 00000000000..6b54a29efaa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-8.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Test for that only vectorize the epilogue with vector access with length,
+ the main body still use normal vector load/store. */
+
+#include "p9-vec-length-8.h"
+
+/* { dg-final { scan-assembler-times {\mlxvl\M} 30 } } */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 10 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-1.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-1.c
new file mode 100644
index 00000000000..d1cd67f0c4d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-1.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Check whether it runs successfully if we only vectorize the epilogue
+ with vector access with length. */
+
+#include "p9-vec-length-run-1.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-2.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-2.c
new file mode 100644
index 00000000000..815867b51d0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-2.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Check whether it runs successfully if we only vectorize the epilogue
+ with vector access with length. */
+
+#include "p9-vec-length-run-2.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-3.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-3.c
new file mode 100644
index 00000000000..5378d02c269
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-3.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Check whether it runs successfully if we only vectorize the epilogue
+ with vector access with length. */
+
+#include "p9-vec-length-run-3.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-4.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-4.c
new file mode 100644
index 00000000000..daed9a7774e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-4.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Check whether it runs successfully if we only vectorize the epilogue
+ with vector access with length. */
+
+#include "p9-vec-length-run-4.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-5.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-5.c
new file mode 100644
index 00000000000..b5f24e68d84
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-5.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Check whether it runs successfully if we only vectorize the epilogue
+ with vector access with length. */
+
+#include "p9-vec-length-run-5.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-6.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-6.c
new file mode 100644
index 00000000000..a3e63673847
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-6.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Check whether it runs successfully if we only vectorize the epilogue
+ with vector access with length. */
+
+#include "p9-vec-length-run-6.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-7.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-7.c
new file mode 100644
index 00000000000..f0b69d462a1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-7.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -ffast-math" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Check whether it runs successfully if we only vectorize the epilogue
+ with vector access with length. */
+
+#include "p9-vec-length-run-7.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-8.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-8.c
new file mode 100644
index 00000000000..84abecf3f69
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-8.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+
+/* Check whether it runs successfully if we only vectorize the epilogue
+ with vector access with length. */
+
+#include "p9-vec-length-run-8.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-1.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-1.c
new file mode 100644
index 00000000000..3336752edbb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Test for fully with length, the loop body uses vector access with length,
+ there should not be any epilogues. */
+
+#include "p9-vec-length-1.h"
+
+/* { dg-final { scan-assembler-not {\mlxv\M} } } */
+/* { dg-final { scan-assembler-not {\mstxv\M} } } */
+/* { dg-final { scan-assembler-not {\mlxvx\M} } } */
+/* { dg-final { scan-assembler-not {\mstxvx\M} } } */
+/* { dg-final { scan-assembler-times {\mlxvl\M} 20 } } */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 10 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-2.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-2.c
new file mode 100644
index 00000000000..98abf8b33b1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-2.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Test for fully with length, the loop body uses vector access with length,
+ there should not be any epilogues. */
+
+#include "p9-vec-length-2.h"
+
+/* { dg-final { scan-assembler-not {\mlxv\M} } } */
+/* { dg-final { scan-assembler-not {\mstxv\M} } } */
+/* { dg-final { scan-assembler-not {\mlxvx\M} } } */
+/* { dg-final { scan-assembler-not {\mstxvx\M} } } */
+/* { dg-final { scan-assembler-times {\mlxvl\M} 20 } } */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 10 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-3.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-3.c
new file mode 100644
index 00000000000..0881d1a960a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Test for fully with length, the loop body uses vector access with length,
+ there should not be any epilogues. */
+
+#include "p9-vec-length-3.h"
+
+/* { dg-final { scan-assembler-not {\mlxv\M} } } */
+/* { dg-final { scan-assembler-not {\mstxv\M} } } */
+/* { dg-final { scan-assembler-not {\mlxvx\M} } } */
+/* { dg-final { scan-assembler-not {\mstxvx\M} } } */
+/* 64bit types get completely unrolled, so only check the others. */
+/* { dg-final { scan-assembler-times {\mlxvl\M} 14 } } */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 7 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-4.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-4.c
new file mode 100644
index 00000000000..8ce3dc19a60
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-4.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Test for fully with length, the loop body uses vector access with length,
+ there should not be any epilogues. */
+
+#include "p9-vec-length-4.h"
+
+/* It can use normal vector load for constant vector load. */
+/* { dg-final { scan-assembler-not {\mstxv\M} } } */
+/* { dg-final { scan-assembler-not {\mlxvx\M} } } */
+/* { dg-final { scan-assembler-not {\mstxvx\M} } } */
+/* { dg-final { scan-assembler-times {\mlxvl\M} 70 } } */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 70 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-5.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-5.c
new file mode 100644
index 00000000000..f9f58ba11f5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-5.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Test for fully with length, the loop body uses vector access with length,
+ there should not be any epilogues. */
+
+#include "p9-vec-length-5.h"
+
+/* It can use normal vector load for constant vector load. */
+/* { dg-final { scan-assembler-not {\mstxv\M} } } */
+/* { dg-final { scan-assembler-not {\mlxvx\M} } } */
+/* { dg-final { scan-assembler-not {\mstxvx\M} } } */
+/* { dg-final { scan-assembler-times {\mlxvl\M} 21 } } */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 21 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-6.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-6.c
new file mode 100644
index 00000000000..cfae9bbc927
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-6.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Test for fully with length, the loop body uses vector access with length,
+ there should not be any epilogues. */
+
+#include "p9-vec-length-6.h"
+
+/* It can use normal vector load for constant vector load. */
+/* { dg-final { scan-assembler-not {\mstxv\M} } } */
+/* { dg-final { scan-assembler-not {\mlxvx\M} } } */
+/* { dg-final { scan-assembler-not {\mstxvx\M} } } */
+/* { dg-final { scan-assembler-times {\mlxvl\M} 16 } } */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 16 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-7.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-7.c
new file mode 100644
index 00000000000..89ff38443e7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-7.c
@@ -0,0 +1,13 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops -ffast-math" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Test for fully with length, the loop body uses vector access with length,
+ there should not be any epilogues. */
+
+#include "p9-vec-length-7.h"
+
+/* Each type has one stxvl excepting for int8 and uint8, that have two due to
+ rtl pass bbro duplicating the block which has one stxvl. */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 12 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-8.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-8.c
new file mode 100644
index 00000000000..1fc2af1e753
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-8.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { lp64 && powerpc_p9vector_ok } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Test for fully with length, the loop body uses vector access with length,
+ there should not be any epilogues. */
+
+#include "p9-vec-length-8.h"
+
+/* { dg-final { scan-assembler-times {\mlxvl\M} 30 } } */
+/* { dg-final { scan-assembler-times {\mstxvl\M} 10 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-1.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-1.c
new file mode 100644
index 00000000000..4e9bd0fbad3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-1.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Check whether it runs successfully if we vectorize the loop fully
+ with vector access with length. */
+
+#include "p9-vec-length-run-1.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-2.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-2.c
new file mode 100644
index 00000000000..8e06b1b9304
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-2.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Check whether it runs successfully if we vectorize the loop fully
+ with vector access with length. */
+
+#include "p9-vec-length-run-2.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-3.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-3.c
new file mode 100644
index 00000000000..0b86f62834f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-3.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Check whether it runs successfully if we vectorize the loop fully
+ with vector access with length. */
+
+#include "p9-vec-length-run-3.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-4.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-4.c
new file mode 100644
index 00000000000..359f31c9ed5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-4.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Check whether it runs successfully if we vectorize the loop fully
+ with vector access with length. */
+
+#include "p9-vec-length-run-4.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-5.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-5.c
new file mode 100644
index 00000000000..7aa468e5b4e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-5.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Check whether it runs successfully if we vectorize the loop fully
+ with vector access with length. */
+
+#include "p9-vec-length-run-5.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-6.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-6.c
new file mode 100644
index 00000000000..53a2ad07fb3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-6.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Check whether it runs successfully if we vectorize the loop fully
+ with vector access with length. */
+
+#include "p9-vec-length-run-6.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-7.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-7.c
new file mode 100644
index 00000000000..0c21d137b9d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-7.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -ffast-math" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Check whether it runs successfully if we vectorize the loop fully
+ with vector access with length. */
+
+#include "p9-vec-length-run-7.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-8.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-8.c
new file mode 100644
index 00000000000..91078426067
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-8.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target { lp64 && p9vector_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model" } */
+
+/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+
+/* Check whether it runs successfully if we vectorize the loop fully
+ with vector access with length. */
+
+#include "p9-vec-length-run-8.h"
+
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-1.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-1.h
new file mode 100644
index 00000000000..b397fd1ac30
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-1.h
@@ -0,0 +1,34 @@
+#include "p9-vec-length-1.h"
+
+#define decl(TYPE) \
+ TYPE a_##TYPE[N]; \
+ TYPE b_##TYPE[N]; \
+ TYPE c_##TYPE[N];
+
+#define run(TYPE) \
+ { \
+ unsigned int i = 0; \
+ for (i = 0; i < N; i++) \
+ { \
+ a_##TYPE[i] = i * 2 + 1; \
+ b_##TYPE[i] = i % 2 - 2; \
+ } \
+ test##TYPE (); \
+ for (i = 0; i < N; i++) \
+ { \
+ TYPE a1 = i * 2 + 1; \
+ TYPE b1 = i % 2 - 2; \
+ TYPE exp_c = a1 + b1; \
+ if (c_##TYPE[i] != exp_c) \
+ __builtin_abort (); \
+ } \
+ }
+
+TEST_ALL (decl)
+
+int
+main (void)
+{
+ TEST_ALL (run)
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-2.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-2.h
new file mode 100644
index 00000000000..a0f2d6ccb23
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-2.h
@@ -0,0 +1,36 @@
+#include "p9-vec-length-2.h"
+
+#define decl(TYPE) \
+ TYPE a_##TYPE[N]; \
+ TYPE b_##TYPE[N]; \
+ TYPE c_##TYPE[N];
+
+#define N1 195
+
+#define run(TYPE) \
+ { \
+ unsigned int i = 0; \
+ for (i = 0; i < N; i++) \
+ { \
+ a_##TYPE[i] = i * 2 + 1; \
+ b_##TYPE[i] = i % 2 - 2; \
+ } \
+ test##TYPE (N1); \
+ for (i = 0; i < N1; i++) \
+ { \
+ TYPE a1 = i * 2 + 1; \
+ TYPE b1 = i % 2 - 2; \
+ TYPE exp_c = a1 + b1; \
+ if (c_##TYPE[i] != exp_c) \
+ __builtin_abort (); \
+ } \
+ }
+
+TEST_ALL (decl)
+
+int
+main (void)
+{
+ TEST_ALL (run)
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-3.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-3.h
new file mode 100644
index 00000000000..5d2f5c34b6a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-3.h
@@ -0,0 +1,34 @@
+#include "p9-vec-length-3.h"
+
+#define decl(TYPE) \
+ TYPE a_##TYPE[N_##TYPE]; \
+ TYPE b_##TYPE[N_##TYPE]; \
+ TYPE c_##TYPE[N_##TYPE];
+
+#define run(TYPE) \
+ { \
+ unsigned int i = 0; \
+ for (i = 0; i < N_##TYPE; i++) \
+ { \
+ a_##TYPE[i] = i * 2 + 1; \
+ b_##TYPE[i] = i % 2 - 2; \
+ } \
+ test##TYPE (); \
+ for (i = 0; i < N_##TYPE; i++) \
+ { \
+ TYPE a1 = i * 2 + 1; \
+ TYPE b1 = i % 2 - 2; \
+ TYPE exp_c = a1 + b1; \
+ if (c_##TYPE[i] != exp_c) \
+ __builtin_abort (); \
+ } \
+ }
+
+TEST_ALL (decl)
+
+int
+main (void)
+{
+ TEST_ALL (run)
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-4.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-4.h
new file mode 100644
index 00000000000..2f3b911d0d1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-4.h
@@ -0,0 +1,62 @@
+#include "p9-vec-length-4.h"
+
+/* Check more to ensure vector access with out of bound. */
+#define N 144
+/* Array size used for test function actually. */
+#define NF 123
+
+#define run(TYPE) \
+ { \
+ unsigned int i = 0; \
+ TYPE a[N], b[N * 2], c[N * 4]; \
+ for (i = 0; i < N; i++) \
+ { \
+ a[i] = i + i % 2; \
+ b[i * 2] = i * 2 + i % 3; \
+ b[i * 2 + 1] = i * 3 + i % 4; \
+ c[i * 4] = i * 4 + i % 5; \
+ c[i * 4 + 1] = i * 5 + i % 6; \
+ c[i * 4 + 2] = i * 6 + i % 7; \
+ c[i * 4 + 3] = i * 7 + i % 8; \
+ } \
+ test_mv_##TYPE (a, b, c, NF); \
+ for (i = 0; i < N; i++) \
+ { \
+ TYPE a1 = i + i % 2; \
+ TYPE b1 = i * 2 + i % 3; \
+ TYPE b2 = i * 3 + i % 4; \
+ TYPE c1 = i * 4 + i % 5; \
+ TYPE c2 = i * 5 + i % 6; \
+ TYPE c3 = i * 6 + i % 7; \
+ TYPE c4 = i * 7 + i % 8; \
+ \
+ TYPE exp_a = a1; \
+ TYPE exp_b1 = b1; \
+ TYPE exp_b2 = b2; \
+ TYPE exp_c1 = c1; \
+ TYPE exp_c2 = c2; \
+ TYPE exp_c3 = c3; \
+ TYPE exp_c4 = c4; \
+ if (i < NF) \
+ { \
+ exp_a += 1; \
+ exp_b1 += 2; \
+ exp_b2 += 3; \
+ exp_c1 += 4; \
+ exp_c2 += 5; \
+ exp_c3 += 6; \
+ exp_c4 += 7; \
+ } \
+ if (a[i] != exp_a || b[i * 2] != exp_b1 || b[i * 2 + 1] != exp_b2 \
+ || c[i * 4] != exp_c1 || c[i * 4 + 1] != exp_c2 \
+ || c[i * 4 + 2] != exp_c3 || c[i * 4 + 3] != exp_c4) \
+ __builtin_abort (); \
+ } \
+ }
+
+int
+main (void)
+{
+ TEST_ALL (run)
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-5.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-5.h
new file mode 100644
index 00000000000..ca4b3d56351
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-5.h
@@ -0,0 +1,45 @@
+#include "p9-vec-length-5.h"
+
+/* Check more to ensure vector access with out of bound. */
+#define N 155
+/* Array size used for test function actually. */
+#define NF 127
+
+#define run(TYPE1, TYPE2) \
+ { \
+ unsigned int i = 0; \
+ TYPE1 a[N * 2]; \
+ TYPE2 b[N * 2]; \
+ for (i = 0; i < N; i++) \
+ { \
+ a[i * 2] = i * 2 + i % 3; \
+ a[i * 2 + 1] = i * 3 + i % 4; \
+ b[i * 2] = i * 7 + i / 5; \
+ b[i * 2 + 1] = i * 8 + i / 6; \
+ } \
+ test_mv_##TYPE1##TYPE2 (a, b, NF); \
+ for (i = 0; i < N; i++) \
+ { \
+ TYPE1 exp_a1 = i * 2 + i % 3; \
+ TYPE1 exp_a2 = i * 3 + i % 4; \
+ TYPE2 exp_b1 = i * 7 + i / 5; \
+ TYPE2 exp_b2 = i * 8 + i / 6; \
+ if (i < NF) \
+ { \
+ exp_a1 += 1; \
+ exp_a2 += 2; \
+ exp_b1 += 3; \
+ exp_b2 += 4; \
+ } \
+ if (a[i * 2] != exp_a1 || a[i * 2 + 1] != exp_a2 || b[i * 2] != exp_b1 \
+ || b[i * 2 + 1] != exp_b2) \
+ __builtin_abort (); \
+ } \
+ }
+
+int
+main (void)
+{
+ TEST_ALL2 (run)
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-6.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-6.h
new file mode 100644
index 00000000000..814e4059bdf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-6.h
@@ -0,0 +1,52 @@
+#include "p9-vec-length-6.h"
+
+/* Check more to ensure vector access with out of bound. */
+#define N 275
+/* Array size used for test function actually. */
+#define NF 255
+
+#define run(TYPE1, TYPE2) \
+ { \
+ unsigned int i = 0; \
+ TYPE1 a[N * 2]; \
+ TYPE2 b[N * 4]; \
+ for (i = 0; i < N; i++) \
+ { \
+ a[i * 2] = i * 2 + i % 3; \
+ a[i * 2 + 1] = i * 3 + i % 4; \
+ b[i * 4] = i * 4 + i / 5; \
+ b[i * 4 + 1] = i * 5 + i / 6; \
+ b[i * 4 + 2] = i * 6 + i / 7; \
+ b[i * 4 + 3] = i * 7 + i / 8; \
+ } \
+ test_mv_##TYPE1##TYPE2 (a, b, NF); \
+ for (i = 0; i < N; i++) \
+ { \
+ TYPE1 exp_a1 = i * 2 + i % 3; \
+ TYPE1 exp_a2 = i * 3 + i % 4; \
+ TYPE2 exp_b1 = i * 4 + i / 5; \
+ TYPE2 exp_b2 = i * 5 + i / 6; \
+ TYPE2 exp_b3 = i * 6 + i / 7; \
+ TYPE2 exp_b4 = i * 7 + i / 8; \
+ if (i < NF) \
+ { \
+ exp_a1 += 1; \
+ exp_a2 += 2; \
+ exp_b1 += 3; \
+ exp_b2 += 4; \
+ exp_b3 += 5; \
+ exp_b4 += 6; \
+ } \
+ if (a[i * 2] != exp_a1 || a[i * 2 + 1] != exp_a2 || b[i * 4] != exp_b1 \
+ || b[i * 4 + 1] != exp_b2 || b[i * 4 + 2] != exp_b3 \
+ || b[i * 4 + 3] != exp_b4) \
+ __builtin_abort (); \
+ } \
+ }
+
+int
+main (void)
+{
+ TEST_ALL2 (run)
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-7.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-7.h
new file mode 100644
index 00000000000..31280bf8a16
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-7.h
@@ -0,0 +1,16 @@
+#include "p9-vec-length-7.h"
+
+#define run(TYPE) \
+ { \
+ unsigned int i = 0; \
+ test_npeel_##TYPE(); \
+ for (int i = 0; i < N; ++i) { \
+ if (x_##TYPE[i] != (i < START || i >= END ? 0 : (i - START))) \
+ __builtin_abort(); \
+ } \
+ }
+
+int main() {
+ TEST_ALL(run)
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-8.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-8.h
new file mode 100644
index 00000000000..aedbc3df3aa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-run-8.h
@@ -0,0 +1,27 @@
+#include "p9-vec-length-8.h"
+
+#define run(TYPE) \
+ { \
+ unsigned int i = 0; \
+ \
+ TYPE out_##TYPE[N]; \
+ TYPE in_##TYPE[N * 2]; \
+ for (int i = 0; i < N; ++i) { \
+ out_##TYPE[i] = i * 7 / 2; \
+ } \
+ for (int i = 0; i < N * 2; ++i) { \
+ in_##TYPE[i] = i * 9 / 2; \
+ } \
+ \
+ test_##TYPE(out_##TYPE, in_##TYPE); \
+ for (int i = 0; i < N; ++i) { \
+ TYPE expected = i * 7 / 2 + in_##TYPE[i * 2]; \
+ if (out_##TYPE[i] != expected) \
+ __builtin_abort(); \
+ } \
+ }
+
+int main(void) {
+ TEST_ALL(run)
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length.h b/gcc/testsuite/gcc.target/powerpc/p9-vec-length.h
new file mode 100644
index 00000000000..83418b0b641
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length.h
@@ -0,0 +1,14 @@
+#include <stdint.h>
+
+#define TEST_ALL(T) \
+ T (int8_t) \
+ T (uint8_t) \
+ T (int16_t) \
+ T (uint16_t) \
+ T (int32_t) \
+ T (uint32_t) \
+ T (int64_t) \
+ T (uint64_t) \
+ T (float) \
+ T (double)
+
diff --git a/gcc/testsuite/gcc.target/powerpc/pack01.c b/gcc/testsuite/gcc.target/powerpc/pack01.c
index bc4c03b1524..fc1dd505951 100644
--- a/gcc/testsuite/gcc.target/powerpc/pack01.c
+++ b/gcc/testsuite/gcc.target/powerpc/pack01.c
@@ -1,6 +1,5 @@
/* { dg-do run { target { powerpc*-*-linux* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target p8vector_hw } */
/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pack02.c b/gcc/testsuite/gcc.target/powerpc/pack02.c
index 2cc2396235b..07d3ba0c390 100644
--- a/gcc/testsuite/gcc.target/powerpc/pack02.c
+++ b/gcc/testsuite/gcc.target/powerpc/pack02.c
@@ -1,6 +1,5 @@
/* { dg-do run { target { powerpc*-*-linux* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target powerpc_fprs } */
/* { dg-require-effective-target longdouble128 } */
/* { dg-options "-O2 -mhard-float" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pack03.c b/gcc/testsuite/gcc.target/powerpc/pack03.c
index f6e994388c0..0295a974cfb 100644
--- a/gcc/testsuite/gcc.target/powerpc/pack03.c
+++ b/gcc/testsuite/gcc.target/powerpc/pack03.c
@@ -1,6 +1,5 @@
/* { dg-do run { target { powerpc*-*-linux* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target dfp_hw } */
/* { dg-options "-O2 -mhard-dfp" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-sibcall-1.c b/gcc/testsuite/gcc.target/powerpc/pcrel-sibcall-1.c
index 0cb40d45ace..dfcf8183ccd 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-sibcall-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-sibcall-1.c
@@ -1,14 +1,14 @@
/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=future -O2" } */
+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */
/* { dg-require-effective-target powerpc_elfv2 } */
-/* { dg-require-effective-target powerpc_future_ok } */
+/* { dg-require-effective-target power10_ok } */
/* Test that potential sibcalls are not generated when the caller preserves the
- TOC and the callee doesn't, or vice versa. At present, -mcpu=future does
+ TOC and the callee doesn't, or vice versa. At present, -mcpu=power10 does
not enable pc-relative mode. Enable it here explicitly until it is turned
on by default. */
-#pragma GCC target ("cpu=future,pcrel")
+#pragma GCC target ("cpu=power10,pcrel")
int x (void) __attribute__((noinline));
int y (void) __attribute__((noinline));
int xx (void) __attribute__((noinline));
@@ -39,7 +39,7 @@ int xx (void)
return 1;
}
-#pragma GCC target ("cpu=future,pcrel")
+#pragma GCC target ("cpu=power10,pcrel")
int notoc_call (void)
{
return xx ();
diff --git a/gcc/testsuite/gcc.target/powerpc/pdep-0.c b/gcc/testsuite/gcc.target/powerpc/pdep-0.c
new file mode 100644
index 00000000000..490a4ace930
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pdep-0.c
@@ -0,0 +1,48 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+extern void abort (void);
+
+unsigned long long int
+do_pdepd (unsigned long long int source, unsigned long long int mask) {
+ return __builtin_pdepd (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ unsigned long long int sources [4], masks [4];
+ unsigned long long int results [4][4] = {
+ /* sources [0] with each of masks [0..3] */
+ { 0x7e3c0000ll, 0x00007e3cll, 0x070e030cll, 0x70e030c0ll },
+ /* sources [1] with each of masks [0..3] */
+ { 0xa5f00000ll, 0x0000a5f0ll, 0x0a050f00ll, 0xa050f000ll },
+ /* sources [2] with each of masks [0..3] */
+ { 0xf07e0000ll, 0x0000f07ell, 0x0f00070ell, 0xf00070e0ll },
+ /* sources [3] with each of masks [0..3] */
+ { 0xe7c30000ll, 0x0000e7c3ll, 0x0e070c03ll, 0xe070c030ll },
+ };
+
+ sources[0] = 0xa5f07e3cll;
+ sources[1] = 0x7e3ca5f0ll;
+ sources[2] = 0x3ca5f07ell;
+ sources[3] = 0x5a0fe7c3ll;
+
+ masks[0] = 0xffff0000ll;
+ masks[1] = 0x0000ffffll;
+ masks[2] = 0x0f0f0f0fll;
+ masks[3] = 0xf0f0f0f0ll;
+
+ for (int i = 0; i < 4; i++)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ if (do_pdepd (sources[i], masks[j]) != results [i][j])
+ abort ();
+ }
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mpdepd\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pdep-1.c b/gcc/testsuite/gcc.target/powerpc/pdep-1.c
new file mode 100644
index 00000000000..ab0efd25b09
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pdep-1.c
@@ -0,0 +1,48 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+extern void abort (void);
+
+unsigned long long int
+do_pdepd (unsigned long long int source, unsigned long long int mask) {
+ return __builtin_pdepd (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ unsigned long long int sources [4], masks [4];
+ unsigned long long int results [4][4] = {
+ /* sources [0] with each of masks [0..3] */
+ { 0x7e3c0000ll, 0x00007e3cll, 0x070e030cll, 0x70e030c0ll },
+ /* sources [1] with each of masks [0..3] */
+ { 0xa5f00000ll, 0x0000a5f0ll, 0x0a050f00ll, 0xa050f000ll },
+ /* sources [2] with each of masks [0..3] */
+ { 0xf07e0000ll, 0x0000f07ell, 0x0f00070ell, 0xf00070e0ll },
+ /* sources [3] with each of masks [0..3] */
+ { 0xe7c30000ll, 0x0000e7c3ll, 0x0e070c03ll, 0xe070c030ll },
+ };
+
+ sources[0] = 0xa5f07e3cll;
+ sources[1] = 0x7e3ca5f0ll;
+ sources[2] = 0x3ca5f07ell;
+ sources[3] = 0x5a0fe7c3ll;
+
+ masks[0] = 0xffff0000ll;
+ masks[1] = 0x0000ffffll;
+ masks[2] = 0x0f0f0f0fll;
+ masks[3] = 0xf0f0f0f0ll;
+
+ for (int i = 0; i < 4; i++)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ if (do_pdepd (sources[i], masks[j]) != results [i][j])
+ abort ();
+ }
+ }
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/powerpc/pextd-0.c b/gcc/testsuite/gcc.target/powerpc/pextd-0.c
new file mode 100644
index 00000000000..5be9f9e7a33
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pextd-0.c
@@ -0,0 +1,50 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+extern void abort (void);
+
+unsigned long long int
+do_pextd (unsigned long long int source, unsigned long long int mask) {
+ return __builtin_pextd (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ unsigned long long int sources [4], masks [4];
+ unsigned long long int results [4][4] = {
+ /* sources [0] with each of masks [0..3] */
+ { 0x0000a5f0ll, 0x00007e3cll, 0x000050ecll, 0x0000af73ll },
+ /* sources [1] with each of masks [0..3] */
+ { 0x00007e3cll, 0x0000a5f0ll, 0x0000ec50ll, 0x000073afll },
+ /* sources [2] with each of masks [0..3] */
+ { 0x00003ca5ll, 0x0000f07ell, 0x0000c50ell, 0x00003af7ll },
+ /* sources [3] with each of masks [0..3] */
+ { 0x00005a0fll, 0x0000e7c3ll, 0x0000af73ll, 0x000050ecll },
+ };
+
+ sources[0] = 0xa5f07e3cll;
+ sources[1] = 0x7e3ca5f0ll;
+ sources[2] = 0x3ca5f07ell;
+ sources[3] = 0x5a0fe7c3ll;
+
+ masks[0] = 0xffff0000ll;
+ masks[1] = 0x0000ffffll;
+ masks[2] = 0x0f0f0f0fll;
+ masks[3] = 0xf0f0f0f0ll;
+
+ unsigned long long int result;
+
+ for (int i = 0; i < 4; i++)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ if (do_pextd (sources[i], masks[j]) != results [i][j])
+ abort ();
+ }
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mpextd\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pextd-1.c b/gcc/testsuite/gcc.target/powerpc/pextd-1.c
new file mode 100644
index 00000000000..ab081423a95
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pextd-1.c
@@ -0,0 +1,49 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+extern void abort (void);
+
+unsigned long long int
+do_pextd (unsigned long long int source, unsigned long long int mask) {
+ return __builtin_pextd (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ unsigned long long int sources [4], masks [4];
+ unsigned long long int results [4][4] = {
+ /* sources [0] with each of masks [0..3] */
+ { 0x0000a5f0ll, 0x00007e3cll, 0x000050ecll, 0x0000af73ll },
+ /* sources [1] with each of masks [0..3] */
+ { 0x00007e3cll, 0x0000a5f0ll, 0x0000ec50ll, 0x000073afll },
+ /* sources [2] with each of masks [0..3] */
+ { 0x00003ca5ll, 0x0000f07ell, 0x0000c50ell, 0x00003af7ll },
+ /* sources [3] with each of masks [0..3] */
+ { 0x00005a0fll, 0x0000e7c3ll, 0x0000af73ll, 0x000050ecll },
+ };
+
+ sources[0] = 0xa5f07e3cll;
+ sources[1] = 0x7e3ca5f0ll;
+ sources[2] = 0x3ca5f07ell;
+ sources[3] = 0x5a0fe7c3ll;
+
+ masks[0] = 0xffff0000ll;
+ masks[1] = 0x0000ffffll;
+ masks[2] = 0x0f0f0f0fll;
+ masks[3] = 0xf0f0f0f0ll;
+
+ unsigned long long int result;
+
+ for (int i = 0; i < 4; i++)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ if (do_pextd (sources[i], masks[j]) != results [i][j])
+ abort ();
+ }
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-spe.c b/gcc/testsuite/gcc.target/powerpc/ppc-spe.c
deleted file mode 100644
index 92ace1cf029..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/ppc-spe.c
+++ /dev/null
@@ -1,663 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=8540 -mspe -mabi=spe -mfloat-gprs=single -O0" } */
-/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } } */
-
-/* (Test with -O0 so we don't optimize any of them away). */
-
-#include <spe.h>
-
-/* Test PowerPC SPE extensions. */
-
-#define vector __attribute__((vector_size(8)))
-
-vector int a, b, c, *ap;
-vector float f, g, h;
-unsigned int *uip;
-unsigned short *usp;
-int i, j, *ip;
-uint64_t ull;
-int64_t sll;
-unsigned ui;
-float fl;
-uint16_t u16;
-int16_t s16;
-
-/* These are the only documented/supported accessor functions for the
- SPE builtins. */
-void
-test_api ()
-{
- c = __ev_addw (a, b);
- c = __ev_addiw (a, 8);
- c = __ev_subfw (a, b);
- c = __ev_subifw (8, a);
- c = __ev_abs (a);
- c = __ev_neg (a);
- c = __ev_extsb (a);
- c = __ev_extsh (a);
- c = __ev_and (a, b);
- c = __ev_or (a, b);
- c = __ev_xor (a, b);
- c = __ev_nand (a, b);
- c = __ev_nor (a, b);
- c = __ev_eqv (a, b);
- c = __ev_andc (a, b);
- c = __ev_orc (a, b);
- c = __ev_rlw (a, b);
- c = __ev_rlwi (a, 8);
- c = __ev_slw (a, b);
- c = __ev_slwi (a, 8);
- c = __ev_srws (a, b);
- c = __ev_srwu (a, b);
- c = __ev_srwis (a, 8);
- c = __ev_srwiu (a, 8);
- c = __ev_cntlzw (a);
- c = __ev_cntlsw (a);
- c = __ev_rndw (a);
- c = __ev_mergehi (a, b);
- c = __ev_mergelo (a, b);
- c = __ev_mergelohi (a, b);
- c = __ev_mergehilo (a, b);
- c = __ev_splati (5);
- c = __ev_splatfi (6);
- c = __ev_divws (a, b);
- c = __ev_divwu (a, b);
- c = __ev_mra (a);
- i = __brinc (5, 6);
-
- /* Loads. */
- c = __ev_lddx (ap, i);
- c = __ev_ldwx (ap, i);
- c = __ev_ldhx (ap, i);
-
- c = __ev_lwhex (uip, i);
- c = __ev_lwhoux (uip, i);
- c = __ev_lwhosx (uip, i);
- c = __ev_lwwsplatx (uip, i);
- c = __ev_lwhsplatx (uip, i);
-
- c = __ev_lhhesplatx (usp, i);
- c = __ev_lhhousplatx (usp, i);
- c = __ev_lhhossplatx (usp, i);
-
- c = __ev_ldd (ap, 5);
- c = __ev_ldw (ap, 6);
- c = __ev_ldh (ap, 7);
- c = __ev_lwhe (uip, 6);
- c = __ev_lwhou (uip, 6);
- c = __ev_lwhos (uip, 7);
- c = __ev_lwwsplat (uip, 7);
- c = __ev_lwhsplat (uip, 7);
- c = __ev_lhhesplat (usp, 7);
- c = __ev_lhhousplat (usp, 7);
- c = __ev_lhhossplat (usp, 7);
-
- /* Stores. */
- __ev_stddx (a, ap, 9);
- __ev_stdwx (a, ap, 9);
- __ev_stdhx (a, ap, 9);
- __ev_stwwex (a, uip, 9);
- __ev_stwwox (a, uip, 9);
- __ev_stwhex (a, uip, 9);
- __ev_stwhox (a, uip, 9);
- __ev_stdd (a, ap, 9);
- __ev_stdw (a, ap, 9);
- __ev_stdh (a, ap, 9);
- __ev_stwwe (a, uip, 9);
- __ev_stwwo (a, uip, 9);
- __ev_stwhe (a, uip, 9);
- __ev_stwho (a, uip, 9);
-
- /* Fixed point complex. */
- c = __ev_mhossf (a, b);
- c = __ev_mhosmf (a, b);
- c = __ev_mhosmi (a, b);
- c = __ev_mhoumi (a, b);
- c = __ev_mhessf (a, b);
- c = __ev_mhesmf (a, b);
- c = __ev_mhesmi (a, b);
- c = __ev_mheumi (a, b);
- c = __ev_mhossfa (a, b);
- c = __ev_mhosmfa (a, b);
- c = __ev_mhosmia (a, b);
- c = __ev_mhoumia (a, b);
- c = __ev_mhessfa (a, b);
- c = __ev_mhesmfa (a, b);
- c = __ev_mhesmia (a, b);
- c = __ev_mheumia (a, b);
-
- c = __ev_mhoumf (a, b);
- c = __ev_mheumf (a, b);
- c = __ev_mhoumfa (a, b);
- c = __ev_mheumfa (a, b);
-
- c = __ev_mhossfaaw (a, b);
- c = __ev_mhossiaaw (a, b);
- c = __ev_mhosmfaaw (a, b);
- c = __ev_mhosmiaaw (a, b);
- c = __ev_mhousiaaw (a, b);
- c = __ev_mhoumiaaw (a, b);
- c = __ev_mhessfaaw (a, b);
- c = __ev_mhessiaaw (a, b);
- c = __ev_mhesmfaaw (a, b);
- c = __ev_mhesmiaaw (a, b);
- c = __ev_mheusiaaw (a, b);
- c = __ev_mheumiaaw (a, b);
-
- c = __ev_mhousfaaw (a, b);
- c = __ev_mhoumfaaw (a, b);
- c = __ev_mheusfaaw (a, b);
- c = __ev_mheumfaaw (a, b);
-
- c = __ev_mhossfanw (a, b);
- c = __ev_mhossianw (a, b);
- c = __ev_mhosmfanw (a, b);
- c = __ev_mhosmianw (a, b);
- c = __ev_mhousianw (a, b);
- c = __ev_mhoumianw (a, b);
- c = __ev_mhessfanw (a, b);
- c = __ev_mhessianw (a, b);
- c = __ev_mhesmfanw (a, b);
- c = __ev_mhesmianw (a, b);
- c = __ev_mheusianw (a, b);
- c = __ev_mheumianw (a, b);
-
- c = __ev_mhousfanw (a, b);
- c = __ev_mhoumfanw (a, b);
- c = __ev_mheusfanw (a, b);
- c = __ev_mheumfanw (a, b);
-
- c = __ev_mhogsmfaa (a, b);
- c = __ev_mhogsmiaa (a, b);
- c = __ev_mhogumiaa (a, b);
- c = __ev_mhegsmfaa (a, b);
- c = __ev_mhegsmiaa (a, b);
- c = __ev_mhegumiaa (a, b);
-
- c = __ev_mhogumfaa (a, b);
- c = __ev_mhegumfaa (a, b);
-
- c = __ev_mhogsmfan (a, b);
- c = __ev_mhogsmian (a, b);
- c = __ev_mhogumian (a, b);
- c = __ev_mhegsmfan (a, b);
- c = __ev_mhegsmian (a, b);
- c = __ev_mhegumian (a, b);
-
- c = __ev_mhogumfan (a, b);
- c = __ev_mhegumfan (a, b);
-
- c = __ev_mwhssf (a, b);
- c = __ev_mwhsmf (a, b);
- c = __ev_mwhsmi (a, b);
- c = __ev_mwhumi (a, b);
- c = __ev_mwhssfa (a, b);
- c = __ev_mwhsmfa (a, b);
- c = __ev_mwhsmia (a, b);
- c = __ev_mwhumia (a, b);
-
- c = __ev_mwhumf (a, b);
- c = __ev_mwhumfa (a, b);
-
- c = __ev_mwlumi (a, b);
- c = __ev_mwlumia (a, b);
- c = __ev_mwlumiaaw (a, b);
-
- c = __ev_mwlssiaaw (a, b);
- c = __ev_mwlsmiaaw (a, b);
- c = __ev_mwlusiaaw (a, b);
- c = __ev_mwlusiaaw (a, b);
-
- c = __ev_mwlssianw (a, b);
- c = __ev_mwlsmianw (a, b);
- c = __ev_mwlusianw (a, b);
- c = __ev_mwlumianw (a, b);
-
- c = __ev_mwssf (a, b);
- c = __ev_mwsmf (a, b);
- c = __ev_mwsmi (a, b);
- c = __ev_mwumi (a, b);
- c = __ev_mwssfa (a, b);
- c = __ev_mwsmfa (a, b);
- c = __ev_mwsmia (a, b);
- c = __ev_mwumia (a, b);
- c = __ev_mwumf (a, b);
- c = __ev_mwumfa (a, b);
- c = __ev_mwssfaa (a, b);
- c = __ev_mwsmfaa (a, b);
- c = __ev_mwsmiaa (a, b);
- c = __ev_mwumiaa (a, b);
- c = __ev_mwumfaa (a, b);
- c = __ev_mwssfan (a, b);
- c = __ev_mwsmfan (a, b);
- c = __ev_mwsmian (a, b);
- c = __ev_mwumian (a, b);
- c = __ev_mwumfan (a, b);
- c = __ev_addssiaaw (a);
- c = __ev_addsmiaaw (a);
- c = __ev_addusiaaw (a);
- c = __ev_addumiaaw (a);
- c = __ev_addusfaaw (a);
- c = __ev_addumfaaw (a);
- c = __ev_addsmfaaw (a);
- c = __ev_addssfaaw (a);
- c = __ev_subfssiaaw (a);
- c = __ev_subfsmiaaw (a);
- c = __ev_subfusiaaw (a);
- c = __ev_subfumiaaw (a);
- c = __ev_subfusfaaw (a);
- c = __ev_subfumfaaw (a);
- c = __ev_subfsmfaaw (a);
- c = __ev_subfssfaaw (a);
-
- /* Floating point SIMD instructions. */
- c = __ev_fsabs (a);
- c = __ev_fsnabs (a);
- c = __ev_fsneg (a);
- c = __ev_fsadd (a, b);
- c = __ev_fssub (a, b);
- c = __ev_fsmul (a, b);
- c = __ev_fsdiv (a, b);
- c = __ev_fscfui (a);
- c = __ev_fscfsi (a);
- c = __ev_fscfuf (a);
- c = __ev_fscfsf (a);
- c = __ev_fsctui (a);
- c = __ev_fsctsi (a);
- c = __ev_fsctuf (a);
- c = __ev_fsctsf (a);
- c = __ev_fsctuiz (a);
- c = __ev_fsctsiz (a);
-
- /* Non supported sythetic instructions made from two instructions. */
-
- c = __ev_mwhssfaaw (a, b);
- c = __ev_mwhssiaaw (a, b);
- c = __ev_mwhsmfaaw (a, b);
- c = __ev_mwhsmiaaw (a, b);
- c = __ev_mwhusiaaw (a, b);
- c = __ev_mwhumiaaw (a, b);
- c = __ev_mwhusfaaw (a, b);
- c = __ev_mwhumfaaw (a, b);
- c = __ev_mwhssfanw (a, b);
- c = __ev_mwhssianw (a, b);
- c = __ev_mwhsmfanw (a, b);
- c = __ev_mwhsmianw (a, b);
- c = __ev_mwhusianw (a, b);
- c = __ev_mwhumianw (a, b);
- c = __ev_mwhusfanw (a, b);
- c = __ev_mwhumfanw (a, b);
-
- c = __ev_mwhgssfaa (a, b);
- c = __ev_mwhgsmfaa (a, b);
- c = __ev_mwhgsmiaa (a, b);
- c = __ev_mwhgumiaa (a, b);
- c = __ev_mwhgssfan (a, b);
- c = __ev_mwhgsmfan (a, b);
- c = __ev_mwhgsmian (a, b);
- c = __ev_mwhgumian (a, b);
-
- /* Creating, insertion, and extraction. */
-
- a = __ev_create_u64 ((uint64_t) 55);
- a = __ev_create_s64 ((int64_t) 66);
- a = __ev_create_fs (3.14F, 2.18F);
- a = __ev_create_u32 ((uint32_t) 5, (uint32_t) i);
- a = __ev_create_s32 ((int32_t) 5, (int32_t) 6);
- a = __ev_create_u16 ((uint16_t) 6, (uint16_t) 6, (uint16_t) 7, (uint16_t) 1);
- a = __ev_create_s16 ((int16_t) 6, (int16_t) 6, (int16_t) 7, (int16_t) 9);
- a = __ev_create_sfix32_fs (3.0F, 2.0F);
- a = __ev_create_ufix32_fs (3.0F, 2.0F);
- a = __ev_create_ufix32_u32 (3U, 5U);
- a = __ev_create_sfix32_s32 (6, 9);
- ull = __ev_convert_u64 (a);
- sll = __ev_convert_s64 (a);
- i = __ev_get_upper_u32 (a);
- ui = __ev_get_lower_u32 (a);
- i = __ev_get_upper_s32 (a);
- i = __ev_get_lower_s32 (a);
- fl = __ev_get_upper_fs (a);
- fl = __ev_get_lower_fs (a);
- u16 = __ev_get_u16 (a, 5U);
- s16 = __ev_get_s16 (a, 5U);
- ui = __ev_get_upper_ufix32_u32 (a);
- ui = __ev_get_lower_ufix32_u32 (a);
- i = __ev_get_upper_sfix32_s32 (a);
- i = __ev_get_lower_sfix32_s32 (a);
- fl = __ev_get_upper_sfix32_fs (a);
- fl = __ev_get_lower_sfix32_fs (a);
- fl = __ev_get_upper_ufix32_fs (a);
- fl = __ev_get_lower_ufix32_fs (a);
- a = __ev_set_upper_u32 (a, 5U);
- a = __ev_set_lower_u32 (a, 5U);
- a = __ev_set_upper_s32 (a, 5U);
- a = __ev_set_lower_s32 (a, 6U);
- a = __ev_set_upper_fs (a, 6U);
- a = __ev_set_lower_fs (a, fl);
- a = __ev_set_upper_ufix32_u32 (a, 5U);
- a = __ev_set_lower_ufix32_u32 (a, 5U);
- a = __ev_set_upper_sfix32_s32 (a, 5);
- a = __ev_set_lower_sfix32_s32 (a, 5);
- a = __ev_set_upper_sfix32_fs (a, fl);
- a = __ev_set_lower_sfix32_fs (a, fl);
- a = __ev_set_upper_ufix32_fs (a, fl);
- a = __ev_set_lower_ufix32_fs (a, fl);
- a = __ev_set_acc_u64 ((uint64_t) 640);
- a = __ev_set_acc_s64 ((int64_t) 460);
- a = __ev_set_acc_vec64 (b);
- a = __ev_set_u32 (a, 5, 6);
- a = __ev_set_s32 (a, 5, 6);
- a = __ev_set_fs (a, fl, 5);
- a = __ev_set_u16 (a, 5U, 3);
- a = __ev_set_s16 (a, 5, 6);
- a = __ev_set_ufix32_u32 (a, 5U, 6U);
- a = __ev_set_sfix32_s32 (a, 3, 6);
- a = __ev_set_ufix32_fs (a, fl, 5);
- a = __ev_set_sfix32_fs (a, fl, 5);
- ui = __ev_get_u32 (a, 1);
- i = __ev_get_s32 (a, 0);
- fl = __ev_get_fs (a, 1);
- u16 = __ev_get_u16 (a, 2);
- s16 = __ev_get_s16 (a, 2);
- ui = __ev_get_ufix32_u32 (a, 1);
- i = __ev_get_sfix32_s32 (a, 0);
- fl = __ev_get_ufix32_fs (a, 1);
- fl = __ev_get_sfix32_fs (a, 0);
-
- /* Predicates. */
- i = __ev_any_gts (a, b);
- i = __ev_all_gts (a, b);
- i = __ev_upper_gts (a, b);
- i = __ev_lower_gts (a, b);
- a = __ev_select_gts (a, b, c, c);
-
- i = __ev_any_gtu (a, b);
- i = __ev_all_gtu (a, b);
- i = __ev_upper_gtu (a, b);
- i = __ev_lower_gtu (a, b);
- a = __ev_select_gtu (a, b, c, c);
-
- i = __ev_any_lts (a, b);
- i = __ev_all_lts (a, b);
- i = __ev_upper_lts (a, b);
- i = __ev_lower_lts (a, b);
- a = __ev_select_lts (a, b, c, c);
-
- i = __ev_any_ltu (a, b);
- i = __ev_all_ltu (a, b);
- i = __ev_upper_ltu (a, b);
- i = __ev_lower_ltu (a, b);
- a = __ev_select_ltu (a, b, c, c);
-
- i = __ev_any_eq (a, b);
- i = __ev_all_eq (a, b);
- i = __ev_upper_eq (a, b);
- i = __ev_lower_eq (a, b);
- a = __ev_select_eq (a, b, c, c);
-
- i = __ev_any_fs_gt (a, b);
- i = __ev_all_fs_gt (a, b);
- i = __ev_upper_fs_gt (a, b);
- i = __ev_lower_fs_gt (a, b);
- a = __ev_select_fs_gt (a, b, c, c);
-
- i = __ev_any_fs_lt (a, b);
- i = __ev_all_fs_lt (a, b);
- i = __ev_upper_fs_lt (a, b);
- i = __ev_lower_fs_lt (a, b);
- a = __ev_select_fs_lt (a, b, c, b);
-
- i = __ev_any_fs_eq (a, b);
- i = __ev_all_fs_eq (a, b);
- i = __ev_upper_fs_eq (a, b);
- i = __ev_lower_fs_eq (a, b);
- a = __ev_select_fs_eq (a, b, c, c);
-
- i = __ev_any_fs_tst_gt (a, b);
- i = __ev_all_fs_tst_gt (a, b);
- i = __ev_upper_fs_tst_gt (a, b);
- i = __ev_lower_fs_tst_gt (a, b);
- a = __ev_select_fs_tst_gt (a, b, c, c);
-
- i = __ev_any_fs_tst_lt (a, b);
- i = __ev_all_fs_tst_lt (a, b);
- i = __ev_upper_fs_tst_lt (a, b);
- i = __ev_lower_fs_tst_lt (a, b);
- a = __ev_select_fs_tst_lt (a, b, c, c);
-
- i = __ev_any_fs_tst_eq (a, b);
- i = __ev_all_fs_tst_eq (a, b);
- i = __ev_upper_fs_tst_eq (a, b);
- i = __ev_lower_fs_tst_eq (a, b);
- a = __ev_select_fs_tst_eq (a, b, c, c);
-}
-
-int
-main (void)
-{
- /* Generic binary operations. */
- c = __builtin_spe_evaddw (a, b);
- c = __builtin_spe_evand (a, b);
- c = __builtin_spe_evandc (a, b);
- c = __builtin_spe_evdivws (a, b);
- c = __builtin_spe_evdivwu (a, b);
- c = __builtin_spe_eveqv (a, b);
- h = __builtin_spe_evfsadd (f, g);
- h = __builtin_spe_evfsdiv (f, g);
- h = __builtin_spe_evfsmul (f, g);
- h = __builtin_spe_evfssub (f, g);
- c = __builtin_spe_evlddx (ap, j);
- c = __builtin_spe_evldhx (ap, j);
- c = __builtin_spe_evldwx (ap, j);
- c = __builtin_spe_evlhhesplatx (usp, j);
- c = __builtin_spe_evlhhossplatx (usp, j);
- c = __builtin_spe_evlhhousplatx (usp, j);
- c = __builtin_spe_evlwhex (uip, j);
- c = __builtin_spe_evlwhosx (uip, j);
- c = __builtin_spe_evlwhoux (uip, j);
- c = __builtin_spe_evlwhsplatx (uip, j);
- c = __builtin_spe_evlwwsplatx (uip, j);
- c = __builtin_spe_evmergehi (a, b);
- c = __builtin_spe_evmergehilo (a, b);
- c = __builtin_spe_evmergelo (a, b);
- c = __builtin_spe_evmergelohi (a, b);
- c = __builtin_spe_evmhegsmfaa (a, b);
- c = __builtin_spe_evmhegsmfan (a, b);
- c = __builtin_spe_evmhegsmiaa (a, b);
- c = __builtin_spe_evmhegsmian (a, b);
- c = __builtin_spe_evmhegumiaa (a, b);
- c = __builtin_spe_evmhegumian (a, b);
- c = __builtin_spe_evmhesmf (a, b);
- c = __builtin_spe_evmhesmfa (a, b);
- c = __builtin_spe_evmhesmfaaw (a, b);
- c = __builtin_spe_evmhesmfanw (a, b);
- c = __builtin_spe_evmhesmi (a, b);
- c = __builtin_spe_evmhesmia (a, b);
- c = __builtin_spe_evmhesmiaaw (a, b);
- c = __builtin_spe_evmhesmianw (a, b);
- c = __builtin_spe_evmhessf (a, b);
- c = __builtin_spe_evmhessfa (a, b);
- c = __builtin_spe_evmhessfaaw (a, b);
- c = __builtin_spe_evmhessfanw (a, b);
- c = __builtin_spe_evmhessiaaw (a, b);
- c = __builtin_spe_evmhessianw (a, b);
- c = __builtin_spe_evmheumi (a, b);
- c = __builtin_spe_evmheumia (a, b);
- c = __builtin_spe_evmheumiaaw (a, b);
- c = __builtin_spe_evmheumianw (a, b);
- c = __builtin_spe_evmheusiaaw (a, b);
- c = __builtin_spe_evmheusianw (a, b);
- c = __builtin_spe_evmhogsmfaa (a, b);
- c = __builtin_spe_evmhogsmfan (a, b);
- c = __builtin_spe_evmhogsmiaa (a, b);
- c = __builtin_spe_evmhogsmian (a, b);
- c = __builtin_spe_evmhogumiaa (a, b);
- c = __builtin_spe_evmhogumian (a, b);
- c = __builtin_spe_evmhosmf (a, b);
- c = __builtin_spe_evmhosmfa (a, b);
- c = __builtin_spe_evmhosmfaaw (a, b);
- c = __builtin_spe_evmhosmfanw (a, b);
- c = __builtin_spe_evmhosmi (a, b);
- c = __builtin_spe_evmhosmia (a, b);
- c = __builtin_spe_evmhosmiaaw (a, b);
- c = __builtin_spe_evmhosmianw (a, b);
- c = __builtin_spe_evmhossf (a, b);
- c = __builtin_spe_evmhossfa (a, b);
- c = __builtin_spe_evmhossfaaw (a, b);
- c = __builtin_spe_evmhossfanw (a, b);
- c = __builtin_spe_evmhossiaaw (a, b);
- c = __builtin_spe_evmhossianw (a, b);
- c = __builtin_spe_evmhoumi (a, b);
- c = __builtin_spe_evmhoumia (a, b);
- c = __builtin_spe_evmhoumiaaw (a, b);
- c = __builtin_spe_evmhoumianw (a, b);
- c = __builtin_spe_evmhousiaaw (a, b);
- c = __builtin_spe_evmhousianw (a, b);
- c = __builtin_spe_evmwhsmf (a, b);
- c = __builtin_spe_evmwhsmfa (a, b);
- c = __builtin_spe_evmwhsmi (a, b);
- c = __builtin_spe_evmwhsmia (a, b);
- c = __builtin_spe_evmwhssf (a, b);
- c = __builtin_spe_evmwhssfa (a, b);
- c = __builtin_spe_evmwhumi (a, b);
- c = __builtin_spe_evmwhumia (a, b);
- c = __builtin_spe_evmwlsmiaaw (a, b);
- c = __builtin_spe_evmwlsmianw (a, b);
- c = __builtin_spe_evmwlssiaaw (a, b);
- c = __builtin_spe_evmwlssianw (a, b);
- c = __builtin_spe_evmwlumi (a, b);
- c = __builtin_spe_evmwlumia (a, b);
- c = __builtin_spe_evmwlumiaaw (a, b);
- c = __builtin_spe_evmwlumianw (a, b);
- c = __builtin_spe_evmwlusiaaw (a, b);
- c = __builtin_spe_evmwlusianw (a, b);
- c = __builtin_spe_evmwsmf (a, b);
- c = __builtin_spe_evmwsmfa (a, b);
- c = __builtin_spe_evmwsmfaa (a, b);
- c = __builtin_spe_evmwsmfan (a, b);
- c = __builtin_spe_evmwsmi (a, b);
- c = __builtin_spe_evmwsmia (a, b);
- c = __builtin_spe_evmwsmiaa (a, b);
- c = __builtin_spe_evmwsmian (a, b);
- c = __builtin_spe_evmwssf (a, b);
- c = __builtin_spe_evmwssfa (a, b);
- c = __builtin_spe_evmwssfaa (a, b);
- c = __builtin_spe_evmwssfan (a, b);
- c = __builtin_spe_evmwumi (a, b);
- c = __builtin_spe_evmwumia (a, b);
- c = __builtin_spe_evmwumiaa (a, b);
- c = __builtin_spe_evmwumian (a, b);
- c = __builtin_spe_evnand (a, b);
- c = __builtin_spe_evnor (a, b);
- c = __builtin_spe_evor (a, b);
- c = __builtin_spe_evorc (a, b);
- c = __builtin_spe_evrlw (a, b);
- c = __builtin_spe_evslw (a, b);
- c = __builtin_spe_evsrws (a, b);
- c = __builtin_spe_evsrwu (a, b);
- c = __builtin_spe_evsubfw (a, b);
- c = __builtin_spe_evxor (a, b);
-
- c = __builtin_spe_evmwhssfaa (a, b);
- c = __builtin_spe_evmwhssmaa (a, b);
- c = __builtin_spe_evmwhsmfaa (a, b);
- c = __builtin_spe_evmwhsmiaa (a, b);
- c = __builtin_spe_evmwhusiaa (a, b);
- c = __builtin_spe_evmwhumiaa (a, b);
- c = __builtin_spe_evmwhssfan (a, b);
- c = __builtin_spe_evmwhssian (a, b);
- c = __builtin_spe_evmwhsmfan (a, b);
- c = __builtin_spe_evmwhsmian (a, b);
- c = __builtin_spe_evmwhusian (a, b);
- c = __builtin_spe_evmwhumian (a, b);
- c = __builtin_spe_evmwhgssfaa (a, b);
- c = __builtin_spe_evmwhgsmfaa (a, b);
- c = __builtin_spe_evmwhgsmiaa (a, b);
- c = __builtin_spe_evmwhgumiaa (a, b);
- c = __builtin_spe_evmwhgssfan (a, b);
- c = __builtin_spe_evmwhgsmfan (a, b);
- c = __builtin_spe_evmwhgsmian (a, b);
- c = __builtin_spe_evmwhgumian (a, b);
- i = __builtin_spe_brinc (i, j);
-
- /* Generic unary operations. */
- a = __builtin_spe_evabs (b);
- a = __builtin_spe_evaddsmiaaw (b);
- a = __builtin_spe_evaddssiaaw (b);
- a = __builtin_spe_evaddumiaaw (b);
- a = __builtin_spe_evaddusiaaw (b);
- a = __builtin_spe_evcntlsw (b);
- a = __builtin_spe_evcntlzw (b);
- a = __builtin_spe_evextsb (b);
- a = __builtin_spe_evextsh (b);
- f = __builtin_spe_evfsabs (g);
- f = __builtin_spe_evfscfsf (g);
- a = __builtin_spe_evfscfsi (g);
- f = __builtin_spe_evfscfuf (g);
- f = __builtin_spe_evfscfui (a);
- f = __builtin_spe_evfsctsf (g);
- a = __builtin_spe_evfsctsi (g);
- a = __builtin_spe_evfsctsiz (g);
- f = __builtin_spe_evfsctuf (g);
- a = __builtin_spe_evfsctui (g);
- a = __builtin_spe_evfsctuiz (g);
- f = __builtin_spe_evfsnabs (g);
- f = __builtin_spe_evfsneg (g);
- a = __builtin_spe_evmra (b);
- a = __builtin_spe_evneg (b);
- a = __builtin_spe_evrndw (b);
- a = __builtin_spe_evsubfsmiaaw (b);
- a = __builtin_spe_evsubfssiaaw (b);
- a = __builtin_spe_evsubfumiaaw (b);
- a = __builtin_spe_evsubfusiaaw (b);
-
- /* Unary operations of the form: X = foo (5_bit_signed_immediate). */
- a = __builtin_spe_evsplatfi (5);
- a = __builtin_spe_evsplati (5);
-
- /* Binary operations of the form: X = foo(Y, 5_bit_immediate). */
- a = __builtin_spe_evaddiw (b, 13);
- a = __builtin_spe_evldd (ap, 13);
- a = __builtin_spe_evldh (ap, 13);
- a = __builtin_spe_evldw (ap, 13);
- a = __builtin_spe_evlhhesplat (usp, 13);
- a = __builtin_spe_evlhhossplat (usp, 13);
- a = __builtin_spe_evlhhousplat (usp, 13);
- a = __builtin_spe_evlwhe (uip, 13);
- a = __builtin_spe_evlwhos (uip, 13);
- a = __builtin_spe_evlwhou (uip, 13);
- a = __builtin_spe_evlwhsplat (uip, 13);
- a = __builtin_spe_evlwwsplat (uip, 13);
-
- a = __builtin_spe_evrlwi (b, 13);
- a = __builtin_spe_evslwi (b, 13);
- a = __builtin_spe_evsrwis (b, 13);
- a = __builtin_spe_evsrwiu (b, 13);
- a = __builtin_spe_evsubifw (b, 13);
-
- /* Store indexed builtins. */
- __builtin_spe_evstddx (b, ap, j);
- __builtin_spe_evstdhx (b, ap, j);
- __builtin_spe_evstdwx (b, ap, j);
- __builtin_spe_evstwhex (b, uip, j);
- __builtin_spe_evstwhox (b, uip, j);
- __builtin_spe_evstwwex (b, uip, j);
- __builtin_spe_evstwwox (b, uip, j);
-
- /* Store indexed immediate builtins. */
- __builtin_spe_evstdd (b, ap, 5);
- __builtin_spe_evstdh (b, ap, 5);
- __builtin_spe_evstdw (b, ap, 5);
- __builtin_spe_evstwhe (b, uip, 5);
- __builtin_spe_evstwho (b, uip, 5);
- __builtin_spe_evstwwe (b, uip, 5);
- __builtin_spe_evstwwo (b, uip, 5);
-
- /* SPEFSCR builtins. */
- i = __builtin_spe_mfspefscr ();
- __builtin_spe_mtspefscr (j);
-
- test_api ();
-
- return 0;
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-spe64-1.c b/gcc/testsuite/gcc.target/powerpc/ppc-spe64-1.c
deleted file mode 100644
index a9d632bf9f3..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/ppc-spe64-1.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Test that SPE targets do not permit -m64. */
-/* Origin: Joseph Myers <joseph@codesourcery.com> */
-/* { dg-do compile { target powerpc-*-*spe } } */
-/* { dg-options "-m64" } */
-
-/* { dg-error "-m64 not supported in this configuration" "SPE not 64-bit" { target *-*-* } 0 } */
-/* { dg-error "64-bit SPE not supported" "64-bit SPE" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr52457.c b/gcc/testsuite/gcc.target/powerpc/pr52457.c
index ed89daad9df..be8e8f16d3e 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr52457.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr52457.c
@@ -1,6 +1,5 @@
/* { dg-do run { target { powerpc*-*-linux* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target vsx_hw } */
/* { dg-options "-O1 -mdejagnu-cpu=power7" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr60102.c b/gcc/testsuite/gcc.target/powerpc/pr60102.c
deleted file mode 100644
index 0b572a5f9d7..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/pr60102.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=8548 -mspe -mabi=spe -g -mfloat-gprs=double" } */
-/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } } */
-
-double
-pr60102 (double x, int m)
-{
- double y;
- y = m % 2 ? x : 1;
- return y;
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr60158.c b/gcc/testsuite/gcc.target/powerpc/pr60158.c
deleted file mode 100644
index 4395378e17d..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/pr60158.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* { dg-do compile } */
-/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } } */
-/* { dg-options "-mdejagnu-cpu=8548 -mno-spe -mfloat-gprs=double -Os -fdata-sections -fpic -mrelocatable" } */
-
-#define NULL 0
-int func (int val);
-void *func2 (void *ptr);
-
-static const char *ifs;
-static char map[256];
-
-typedef struct {
-/* None of these fields are used, but removing any
- of them makes the problem go away. */
- char *data;
- int length;
- int maxlen;
- int quote;
-} o_string;
-
-#define NULL_O_STRING {NULL,0,0,0}
-
-static int parse_stream (void *dest, void *ctx)
-{
- int ch = func (0), m;
-
- while (ch != -1) {
- m = map[ch];
- if (ch != '\n')
- func2(dest);
-
- ctx = func2 (ctx);
- if (!func (0))
- return 0;
- if (m != ch) {
- func2 ("htns");
- break;
- }
- }
- return -1;
-}
-
-static void mapset (const char *set, int code)
-{
- const char *s;
- for (s=set; *s; s++) map[(int)*s] = code;
-}
-
-static void update_ifs_map(void)
-{
- /* char *ifs and char map[256] are both globals. */
- ifs = func2 ("abc");
- if (ifs == NULL) ifs="def";
-
- func2 (map);
- {
- char subst[2] = {4, 0};
- mapset (subst, 3);
- }
- mapset (";&|#", 1);
-}
-
-int parse_stream_outer (int flag)
-{
- int blah;
- o_string temp=NULL_O_STRING;
- int rcode;
-
- do {
- update_ifs_map ();
- func2 (&blah); /* a memory clobber works as well. */
- rcode = parse_stream (&temp, NULL);
- func2 ("aoeu");
- if (func (0) != 0) {
- func2 (NULL);
- }
- } while (rcode != -1);
- return 0;
-}
-
-/* { dg-final { if ![file exists pr60158.s] { fail "pr60158.c (compile)"; return; } } } */
-
-/* { dg-final { set c_rel [llength [grep pr60158.s \\.data\\.rel\\.ro\\.local]] } } */
-/* { dg-final { set c_fix [llength [grep pr60158.s \\.fixup]] } } */
-/* { dg-final { if [string match $c_rel $c_fix] \{ } } */
-/* { dg-final { pass "pr60158.c (passed)" } } */
-/* { dg-final { \} else \{ } } */
-/* { dg-final { fail "pr60158.c (.fixup table entries not generated for .data.rel.ro.local section)" } } */
-/* { dg-final { \} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr60735.c b/gcc/testsuite/gcc.target/powerpc/pr60735.c
deleted file mode 100644
index 39b9037ac45..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/pr60735.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=8548 -mspe -mabi=spe -O2" } */
-/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } } */
-
-/* In PR60735, the type _Decimal64 generated an insn not found message. */
-
-void
-pr60735 (_Decimal64 *p, _Decimal64 *q)
-{
- *p = *q;
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr71309.c b/gcc/testsuite/gcc.target/powerpc/pr71309.c
new file mode 100644
index 00000000000..e1cbcea7e76
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr71309.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mdejagnu-cpu=power9" } */
+
+#define TYPE void*
+#define TYPE2 void*
+
+struct path {
+ TYPE2 mnt;
+ TYPE dentry;
+};
+
+struct nameidata {
+ struct path path;
+ struct path root;
+};
+
+__attribute__ ((noinline))
+TYPE foo(struct nameidata *nd)
+{
+ TYPE d;
+ TYPE2 d2;
+
+ nd->path = nd->root;
+ d = nd->path.dentry;
+ d2 = nd->path.mnt;
+ return d;
+}
+
+/* { dg-final { scan-assembler-not {\mlxv\M} } } */
+/* { dg-final { scan-assembler-not {\mstxv\M} } } */
+/* { dg-final { scan-assembler-times {\mld\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mstd\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr71763.c b/gcc/testsuite/gcc.target/powerpc/pr71763.c
index b36ddfa26b0..b8888394393 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr71763.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr71763.c
@@ -1,5 +1,6 @@
// PR target/71763
// { dg-do compile }
+// { dg-require-effective-target powerpc_vsx_ok }
// { dg-options "-O1 -mvsx" }
int a, b;
diff --git a/gcc/testsuite/gcc.target/powerpc/pr78458.c b/gcc/testsuite/gcc.target/powerpc/pr78458.c
deleted file mode 100644
index b16f99a49dd..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/pr78458.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=8548 -mspe -mabi=spe" } */
-/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } } */
-
-extern void bar (void);
-long double
-pr78458 (long double p1)
-{
- bar ();
- asm volatile ("# clobbers" :::
- "r14", "r15", "r16", "r17", "r18", "r19",
- "r20", "r21", "r22", "r23", "r24", "r25",
- "r26", "r27", "r28", "r29", "r30", "r31");
- return p1;
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr80343.c b/gcc/testsuite/gcc.target/powerpc/pr80343.c
deleted file mode 100644
index cea2a771abb..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/pr80343.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* { dg-do compile { target powerpc-*-*spe } } */
-/* { dg-options "-O2 -ftracer -fPIC" } */
-long long int vi, ls;
-int wq, oa, to, fv;
-signed char zo;
-
-long long int
-ai (long long int ip, long long int jc, int gt)
-{
- ip /= 3;
- jc += ip;
- if (ip != 0)
- vi = 0;
- vi += ls;
-
- if (wq != oa)
- {
- int tz;
-
- for (tz = 0; tz < 32; ++tz)
- zo -= wq & gt;
-
- if ((gt & 5) > oa)
- {
- zo += gt;
- fv += zo + to;
- }
-
- if (gt != 0)
- oa = 0;
-
- if (fv != 0)
- {
- vi += wq;
- ls += ip;
- jc += (vi != 0) ? ip : ls;
- }
-
- while (tz != 0)
- {
- zo = wq;
- tz = zo;
- }
-
- ++to;
- wq = ip;
- }
-
- return jc;
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr88845.c b/gcc/testsuite/gcc.target/powerpc/pr88845.c
index a939fa950bf..f3d02c5a52d 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr88845.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr88845.c
@@ -1,6 +1,5 @@
/* { dg-do compile { target powerpc*-*-linux* } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
/* { dg-final { scan-assembler {\mmtvsrd\M} { target { lp64 } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr89310.c b/gcc/testsuite/gcc.target/powerpc/pr89310.c
new file mode 100644
index 00000000000..8bb1a140824
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr89310.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power8 " } */
+
+struct s {
+ int i;
+ float f;
+};
+
+float
+foo (struct s arg)
+{
+ return arg.f;
+}
+
+/* { dg-final { scan-assembler-not {\msrdi\M} } } */
+/* { dg-final { scan-assembler-not {\msldi\M} {target le} } } */
+/* { dg-final { scan-assembler-times {\mrldicr\M} 1 {target le} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr90763.c b/gcc/testsuite/gcc.target/powerpc/pr90763.c
index 55f1d461e82..2f4c4f4c0f1 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr90763.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr90763.c
@@ -1,6 +1,7 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
-/* { dg-options "-mcpu=power9 -O2" } */
+/* { dg-require-effective-target int128 } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2" } */
/* PR90763: PowerPC vec_xl_len should take const.
*/
diff --git a/gcc/testsuite/gcc.target/powerpc/pr91275.c b/gcc/testsuite/gcc.target/powerpc/pr91275.c
index bcceec16a0c..39fcd738bc2 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr91275.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr91275.c
@@ -1,7 +1,7 @@
/* Test that we generate vpmsumd correctly without a swap error. */
/* { dg-do run { target { p8vector_hw } } } */
-/* { dg-options "-O2 -std=gnu11 -mcpu=power8" } */
+/* { dg-options "-O2 -std=gnu11 -mdejagnu-cpu=power8" } */
#include <altivec.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/pr92488.c b/gcc/testsuite/gcc.target/powerpc/pr92488.c
new file mode 100644
index 00000000000..3ca575531ca
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr92488.c
@@ -0,0 +1,43 @@
+/* { dg-do run } */
+/* { dg-require-effective-target dfprt } */
+/* { dg-options "-O2" } */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+/* Runnable test case for testing _Decimal128 to _Decimal32 rounding.
+ The value below when rounded to _Decimal64 would result in the value
+ 1.2345675e+00, which if it were rounded to _Decimal32 would result in
+ the value 1.234568e+00. However, the correct value when rounding from
+ _Decimal128 directly to _Decimal32 is 1.234567e+00. */
+
+_Decimal128 td = 1.23456749999999999999e+00dl;
+_Decimal32 sd_expected = 1.234567e+00df;
+
+_Decimal32 __attribute__((noinline))
+td2sd (_Decimal128 td)
+{
+ return td;
+}
+
+int
+main (void)
+{
+ _Decimal32 sd = td2sd (td);
+ if (sd != sd_expected)
+ {
+ union {
+ _Decimal32 sd;
+ unsigned int i;
+ } u;
+
+ printf ("cast to _Decimal32 failed:\n");
+ u.sd = sd;
+ printf (" actual = 0x%x\n", u.i);
+ u.sd = sd_expected;
+ printf (" expected = 0x%x\n", u.i);
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr92796.c b/gcc/testsuite/gcc.target/powerpc/pr92796.c
index da4b6a47a6a..1e671e175de 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr92796.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr92796.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fstack-protector-strong -mcpu=power8" } */
+/* { dg-options "-O2 -fstack-protector-strong -mdejagnu-cpu=power8" } */
/* { dg-require-effective-target ppc_ieee128_ok } */
typedef union
diff --git a/gcc/testsuite/gcc.target/powerpc/pr93122.c b/gcc/testsuite/gcc.target/powerpc/pr93122.c
index a440a05c98a..8ea4eb6a48b 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr93122.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr93122.c
@@ -1,7 +1,7 @@
/* PR target/93122 */
-/* { dg-require-effective-target powerpc_future_ok } */
+/* { dg-require-effective-target power10_ok } */
/* { dg-do compile { target lp64 } } */
-/* { dg-options "-fstack-clash-protection -mprefixed -mfuture" } */
+/* { dg-options "-fstack-clash-protection -mprefixed -mcpu=power10" } */
void bar (char *);
diff --git a/gcc/testsuite/gcc.target/powerpc/pr93658.c b/gcc/testsuite/gcc.target/powerpc/pr93658.c
index 0170d34d259..d1010ee26b0 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr93658.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr93658.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -fstack-protector-strong -mcpu=power8" } */
+/* { dg-options "-O3 -fstack-protector-strong -mdejagnu-cpu=power8" } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* PR93658: Failure compiling this test is an infinite loop in LRA's
diff --git a/gcc/testsuite/gcc.target/powerpc/pr93800.c b/gcc/testsuite/gcc.target/powerpc/pr93800.c
index f8dfbe7c082..6b0dc76e0f2 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr93800.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr93800.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-mcpu=860 -O2" } */
+/* { dg-options "-mdejagnu-cpu=860 -O2" } */
/* { dg-require-effective-target ilp32 } */
/* { dg-final { scan-assembler-not "\\.p2align 4" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr94740.c b/gcc/testsuite/gcc.target/powerpc/pr94740.c
index 78e40fc84da..9c2b4644701 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr94740.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr94740.c
@@ -1,7 +1,7 @@
/* PR rtl-optimization/94740 */
/* { dg-do compile } */
-/* { dg-require-effective-target powerpc_future_ok } */
-/* { dg-options "-O2 -mdejagnu-cpu=future -mpcrel" } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel" } */
int array[8];
int
diff --git a/gcc/testsuite/gcc.target/powerpc/pr95907.c b/gcc/testsuite/gcc.target/powerpc/pr95907.c
new file mode 100644
index 00000000000..f2512b0d606
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr95907.c
@@ -0,0 +1,7 @@
+/* PR target/95907 */
+/* { dg-do compile } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-mpower10" } */
+/* { dg-warning "switch .-mpower10. is no longer supported" "" {target *-*-*} 0 } */
+
+void f(void) { }
diff --git a/gcc/testsuite/gcc.target/powerpc/pr96125.c b/gcc/testsuite/gcc.target/powerpc/pr96125.c
new file mode 100644
index 00000000000..bd9487d73cb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr96125.c
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mdejagnu-cpu=power7 -O2" } */
+
+void
+__attribute__((target("cpu=power10")))
+test0 (__vector_quad *dst)
+{
+ __vector_quad acc;
+ __builtin_mma_xxsetaccz (&acc);
+ *dst = acc;
+}
+
+void
+test1 (__vector_quad *dst)
+{
+ __vector_quad acc;
+ __builtin_mma_xxsetaccz (&acc); /* { dg-error "'__builtin_mma_xxsetaccz' requires the '-mmma' option" } */
+ *dst = acc;
+}
+
+#pragma GCC target("cpu=power10")
+void
+test2 (__vector_quad *dst)
+{
+ __vector_quad acc;
+ __builtin_mma_xxsetaccz (&acc);
+ *dst = acc;
+}
+
+void
+test3 (__vector_quad *dst)
+{
+ __vector_quad acc;
+ __builtin_mma_xxsetaccz (&acc);
+ *dst = acc;
+}
+
+#pragma GCC reset_options
+void
+test4 (__vector_quad *dst)
+{
+ __vector_quad acc;
+ __builtin_mma_xxmfacc (&acc); /* { dg-error "'__builtin_mma_xxmfacc' requires the '-mmma' option" } */
+ *dst = acc;
+}
+
diff --git a/gcc/testsuite/gcc.target/powerpc/pr96446.c b/gcc/testsuite/gcc.target/powerpc/pr96446.c
new file mode 100644
index 00000000000..2083bf4a76a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr96446.c
@@ -0,0 +1,16 @@
+/* PR target/96466 */
+/* { dg-do compile } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */
+
+/* Verify we do not ICE on the following. */
+
+extern void bar0 (void);
+void
+foo0 (__vector_quad *dst)
+{
+ __vector_quad acc;
+ __builtin_mma_xxsetaccz (&acc);
+ bar0 ();
+ *dst = acc;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr96493.c b/gcc/testsuite/gcc.target/powerpc/pr96493.c
new file mode 100644
index 00000000000..1e5d43f199d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr96493.c
@@ -0,0 +1,30 @@
+/* { dg-do run { target { power10_hw } } } */
+/* { dg-do link { target { ! power10_hw } } } */
+/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
+/* { dg-require-effective-target powerpc_elfv2 } */
+/* { dg-require-effective-target power10_ok } */
+
+/* Test local calls between pcrel and non-pcrel code.
+
+ Despite the cpu=power10 option, the code generated here should just
+ be plain powerpc64, even the necessary linker stubs. */
+
+int one = 1;
+
+int __attribute__ ((target("cpu=power8"),noclone,noinline))
+p8_func (int x)
+{
+ return x - one;
+}
+
+int __attribute__ ((target("cpu=power10"),noclone,noinline))
+p10_func (int x)
+{
+ return p8_func (x);
+}
+
+int
+main (void)
+{
+ return p10_func (1);
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr96506.c b/gcc/testsuite/gcc.target/powerpc/pr96506.c
new file mode 100644
index 00000000000..b1b40c5a5c8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr96506.c
@@ -0,0 +1,66 @@
+/* PR target/96506 */
+/* { dg-do compile } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */
+
+extern void bar0();
+extern void bar1();
+extern void bar2();
+extern void bar3();
+
+typedef __vector_pair vpair_t;
+typedef __vector_quad vquad_t;
+
+/* Verify we flag errors on the following. */
+
+void
+foo0 (void)
+{
+ __vector_pair v;
+ bar0 (v); /* { dg-error "invalid use of MMA operand of type .__vector_pair. as a function parameter" } */
+}
+
+void
+foo1 (void)
+{
+ vpair_t v;
+ bar1 (v); /* { dg-error "invalid use of MMA operand of type .__vector_pair. as a function parameter" } */
+}
+
+void
+foo2 (void)
+{
+ __vector_quad v;
+ bar2 (v); /* { dg-error "invalid use of MMA operand of type .__vector_quad. as a function parameter" } */
+}
+
+void
+foo3 (void)
+{
+ vquad_t v;
+ bar3 (v); /* { dg-error "invalid use of MMA operand of type .__vector_quad. as a function parameter" } */
+}
+
+__vector_pair
+foo4 (__vector_pair *src) /* { dg-error "invalid use of MMA type .__vector_pair. as a function return value" } */
+{
+ return *src;
+}
+
+vpair_t
+foo5 (vpair_t *src) /* { dg-error "invalid use of MMA type .__vector_pair. as a function return value" } */
+{
+ return *src;
+}
+
+__vector_quad
+foo6 (__vector_quad *src) /* { dg-error "invalid use of MMA type .__vector_quad. as a function return value" } */
+{
+ return *src;
+}
+
+vquad_t
+foo7 (vquad_t *src) /* { dg-error "invalid use of MMA type .__vector_quad. as a function return value" } */
+{
+ return *src;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr96530.c b/gcc/testsuite/gcc.target/powerpc/pr96530.c
new file mode 100644
index 00000000000..29bb9e3cc53
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr96530.c
@@ -0,0 +1,20 @@
+/* PR target/96530 */
+/* { dg-do compile } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */
+
+/* Verify we do not reject bar() below due to the typedef. */
+
+typedef __vector_quad vquad_t;
+
+void
+foo (__vector_quad *dst)
+{
+ __builtin_mma_xxsetaccz (dst);
+}
+
+void
+bar (vquad_t *dst)
+{
+ __builtin_mma_xxsetaccz (dst);
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-add.c b/gcc/testsuite/gcc.target/powerpc/prefix-add.c
new file mode 100644
index 00000000000..0027406e457
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-add.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Test that PADDI is generated to add a large constant. */
+unsigned long
+add (unsigned long a)
+{
+ return a + 0x12345U;
+}
+
+/* { dg-final { scan-assembler {\mpaddi\M} } } */
+/* { dg-final { scan-assembler-not {\maddi\M} } } */
+/* { dg-final { scan-assembler-not {\maddis\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-di-constant.c b/gcc/testsuite/gcc.target/powerpc/prefix-di-constant.c
new file mode 100644
index 00000000000..aca7897cd92
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-di-constant.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Test that PLI (PADDI) is generated to load a large constant. */
+unsigned long long
+large (void)
+{
+ return 0x12345678ULL;
+}
+
+/* { dg-final { scan-assembler {\mpli\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c b/gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c
new file mode 100644
index 00000000000..554cd0c1bea
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c
@@ -0,0 +1,161 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether we generate a prefixed load/store operation for addresses that
+ don't meet DS/DQ offset constraints. 64-bit is needed for testing the use
+ of the PLWA instruciton. */
+
+struct packed_struct
+{
+ long long pad; /* offset 0 bytes. */
+ unsigned char pad_uc; /* offset 8 bytes. */
+ unsigned char uc; /* offset 9 bytes. */
+
+ unsigned char pad_sc[sizeof (long long) - sizeof (unsigned char)];
+ unsigned char sc; /* offset 17 bytes. */
+
+ unsigned char pad_us[sizeof (long long) - sizeof (signed char)];
+ unsigned short us; /* offset 25 bytes. */
+
+ unsigned char pad_ss[sizeof (long long) - sizeof (unsigned short)];
+ short ss; /* offset 33 bytes. */
+
+ unsigned char pad_ui[sizeof (long long) - sizeof (short)];
+ unsigned int ui; /* offset 41 bytes. */
+
+ unsigned char pad_si[sizeof (long long) - sizeof (unsigned int)];
+ unsigned int si; /* offset 49 bytes. */
+
+ unsigned char pad_f[sizeof (long long) - sizeof (int)];
+ float f; /* offset 57 bytes. */
+
+ unsigned char pad_d[sizeof (long long) - sizeof (float)];
+ double d; /* offset 65 bytes. */
+ __float128 f128; /* offset 73 bytes. */
+} __attribute__((packed));
+
+unsigned char
+load_uc (struct packed_struct *p)
+{
+ return p->uc; /* LBZ 3,9(3). */
+}
+
+signed char
+load_sc (struct packed_struct *p)
+{
+ return p->sc; /* LBZ 3,17(3) + EXTSB 3,3. */
+}
+
+unsigned short
+load_us (struct packed_struct *p)
+{
+ return p->us; /* LHZ 3,25(3). */
+}
+
+short
+load_ss (struct packed_struct *p)
+{
+ return p->ss; /* LHA 3,33(3). */
+}
+
+unsigned int
+load_ui (struct packed_struct *p)
+{
+ return p->ui; /* LWZ 3,41(3). */
+}
+
+int
+load_si (struct packed_struct *p)
+{
+ return p->si; /* PLWA 3,49(3). */
+}
+
+float
+load_float (struct packed_struct *p)
+{
+ return p->f; /* LFS 1,57(3). */
+}
+
+double
+load_double (struct packed_struct *p)
+{
+ return p->d; /* LFD 1,65(3). */
+}
+
+__float128
+load_float128 (struct packed_struct *p)
+{
+ return p->f128; /* PLXV 34,73(3). */
+}
+
+void
+store_uc (struct packed_struct *p, unsigned char uc)
+{
+ p->uc = uc; /* STB 4,9(3). */
+}
+
+void
+store_sc (struct packed_struct *p, signed char sc)
+{
+ p->sc = sc; /* STB 4,17(3). */
+}
+
+void
+store_us (struct packed_struct *p, unsigned short us)
+{
+ p->us = us; /* STH 4,25(3). */
+}
+
+void
+store_ss (struct packed_struct *p, signed short ss)
+{
+ p->ss = ss; /* STH 4,33(3). */
+}
+
+void
+store_ui (struct packed_struct *p, unsigned int ui)
+{
+ p->ui = ui; /* STW 4,41(3). */
+}
+
+void
+store_si (struct packed_struct *p, signed int si)
+{
+ p->si = si; /* STW 4,49(3). */
+}
+
+void
+store_float (struct packed_struct *p, float f)
+{
+ p->f = f; /* STFS 1,57(3). */
+}
+
+void
+store_double (struct packed_struct *p, double d)
+{
+ p->d = d; /* STFD 1,65(3). */
+}
+
+void
+store_float128 (struct packed_struct *p, __float128 f128)
+{
+ p->f128 = f128; /* PSTXV 34,1(3). */
+}
+
+/* { dg-final { scan-assembler-times {\mextsb\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mlbz\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mlfd\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mlfs\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mlha\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mlhz\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mlwz\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mplwa\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mplxv\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mpstxv\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mstb\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mstfd\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mstfs\M} 1 } } */
+/* { dg-final { scan-assembler-times {\msth\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mstw\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-large-dd.c b/gcc/testsuite/gcc.target/powerpc/prefix-large-dd.c
new file mode 100644
index 00000000000..a498b18c919
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-large-dd.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-require-effective-target dfp } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether prefixed instructions with large numeric offsets are generated
+ for the _Decimal64 type. */
+
+#define TYPE _Decimal64
+
+#include "prefix-large.h"
+
+/* { dg-final { scan-assembler-times {\mplfd\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstfd\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-large-df.c b/gcc/testsuite/gcc.target/powerpc/prefix-large-df.c
new file mode 100644
index 00000000000..49a049b777a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-large-df.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether prefixed instructions with large numeric offsets are generated
+ for the double type. */
+
+#define TYPE double
+
+#include "prefix-large.h"
+
+/* { dg-final { scan-assembler-times {\mplfd\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstfd\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-large-di.c b/gcc/testsuite/gcc.target/powerpc/prefix-large-di.c
new file mode 100644
index 00000000000..399f6967ed9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-large-di.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether prefixed instructions with large numeric offsets are generated
+ for the long long type. */
+
+#define TYPE long long
+
+#include "prefix-large.h"
+
+/* { dg-final { scan-assembler-times {\mpld\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstd\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-large-hi.c b/gcc/testsuite/gcc.target/powerpc/prefix-large-hi.c
new file mode 100644
index 00000000000..18380cac49b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-large-hi.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether prefixed instructions with large numeric offsets are generated
+ for the short type. */
+
+#define TYPE short
+
+#include "prefix-large.h"
+
+/* { dg-final { scan-assembler-times {\mplh[az]\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpsth\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-large-kf.c b/gcc/testsuite/gcc.target/powerpc/prefix-large-kf.c
new file mode 100644
index 00000000000..42ec7b7861e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-large-kf.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-require-effective-target float128 } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether prefixed instructions with large numeric offsets are generated
+ for the _Float128 type. */
+
+#define TYPE _Float128
+
+#include "prefix-large.h"
+
+/* { dg-final { scan-assembler-times {\mplxv\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstxv\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-large-qi.c b/gcc/testsuite/gcc.target/powerpc/prefix-large-qi.c
new file mode 100644
index 00000000000..24cdac16e99
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-large-qi.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether prefixed instructions with large numeric offsets are generated
+ for the signed char type. */
+
+#define TYPE signed char
+
+#include "prefix-large.h"
+
+/* { dg-final { scan-assembler-times {\mplbz\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstb\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-large-sd.c b/gcc/testsuite/gcc.target/powerpc/prefix-large-sd.c
new file mode 100644
index 00000000000..bc992ee9f6b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-large-sd.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-require-effective-target dfp } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether prefixed instructions with large numeric offsets are generated
+ for the _Decimal32 type. Note, the _Decimal32 type will not generate any
+ prefixed load or stores, because there is no prefixed load/store instruction
+ to load up a vector register as a zero extended 32-bit integer. So we count
+ the number of load addresses that are generated. */
+
+#define TYPE _Decimal32
+
+#include "prefix-large.h"
+
+/* { dg-final { scan-assembler-times {\mpli\M} 3 } } */
+/* { dg-final { scan-assembler-times {\mlfiwzx\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mstfiwx\M} 2 } } */
+
+
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-large-sf.c b/gcc/testsuite/gcc.target/powerpc/prefix-large-sf.c
new file mode 100644
index 00000000000..9fde1f0a7a6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-large-sf.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether prefixed instructions with large numeric offsets are generated
+ for the float type. */
+
+#define TYPE float
+
+#include "prefix-large.h"
+
+/* { dg-final { scan-assembler-times {\mplfs\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstfs\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-large-si.c b/gcc/testsuite/gcc.target/powerpc/prefix-large-si.c
new file mode 100644
index 00000000000..876a013a2ac
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-large-si.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether prefixed instructions with large numeric offsets are generated
+ for the _Decimal64 type. */
+
+#define TYPE int
+
+#include "prefix-large.h"
+
+/* { dg-final { scan-assembler-times {\mplw[az]\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstw\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-large-udi.c b/gcc/testsuite/gcc.target/powerpc/prefix-large-udi.c
new file mode 100644
index 00000000000..e6365d37d0c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-large-udi.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether prefixed instructions with large numeric offsets are generated
+ for the unsigned long long type. */
+
+#define TYPE unsigned long long
+
+#include "prefix-large.h"
+
+/* { dg-final { scan-assembler-times {\mpld\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstd\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-large-uhi.c b/gcc/testsuite/gcc.target/powerpc/prefix-large-uhi.c
new file mode 100644
index 00000000000..3523767a6f0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-large-uhi.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether prefixed instructions with large numeric offsets are generated
+ for the unsigned short type. */
+
+#define TYPE unsigned short
+
+#include "prefix-large.h"
+
+/* { dg-final { scan-assembler-times {\mplhz\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpsth\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-large-uqi.c b/gcc/testsuite/gcc.target/powerpc/prefix-large-uqi.c
new file mode 100644
index 00000000000..f251c4a12c2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-large-uqi.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether prefixed instructions with large numeric offsets are generated
+ for the unsigned char type. */
+
+#define TYPE unsigned char
+
+#include "prefix-large.h"
+
+/* { dg-final { scan-assembler-times {\mplbz\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstb\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-large-usi.c b/gcc/testsuite/gcc.target/powerpc/prefix-large-usi.c
new file mode 100644
index 00000000000..d60036da026
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-large-usi.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether prefixed instructions with large numeric offsets are generated
+ for the unsigned int type. */
+
+#define TYPE unsigned int
+
+#include "prefix-large.h"
+
+/* { dg-final { scan-assembler-times {\mplwz\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstw\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-large-v2df.c b/gcc/testsuite/gcc.target/powerpc/prefix-large-v2df.c
new file mode 100644
index 00000000000..f6d042f0984
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-large-v2df.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether prefixed instructions with large numeric offsets are generated
+ for the vector double type. */
+
+#define TYPE vector double
+
+#include "prefix-large.h"
+
+/* { dg-final { scan-assembler-times {\mplxv\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstxv\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-large.h b/gcc/testsuite/gcc.target/powerpc/prefix-large.h
new file mode 100644
index 00000000000..07b38ae0875
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-large.h
@@ -0,0 +1,40 @@
+/* Common tests for prefixed instructions testing whether we can generate a
+ 34-bit offset using 1 instruction. */
+
+#ifndef TYPE
+#define TYPE unsigned int
+#endif
+
+#if !defined(DO_ADD) && !defined(DO_VALUE) && !defined(DO_SET)
+#define DO_ADD 1
+#define DO_VALUE 1
+#define DO_SET 1
+#endif
+
+#ifndef CONSTANT
+#define CONSTANT 0x12480UL
+#endif
+
+#if DO_ADD
+void
+add (TYPE *p, TYPE a)
+{
+ p[CONSTANT] += a;
+}
+#endif
+
+#if DO_VALUE
+TYPE
+value (TYPE *p)
+{
+ return p[CONSTANT];
+}
+#endif
+
+#if DO_SET
+void
+set (TYPE *p, TYPE a)
+{
+ p[CONSTANT] = a;
+}
+#endif
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-no-update.c b/gcc/testsuite/gcc.target/powerpc/prefix-no-update.c
new file mode 100644
index 00000000000..837fcd77c0b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-no-update.c
@@ -0,0 +1,51 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Make sure that we don't generate a prefixed form of the load and store with
+ update instructions (i.e. instead of generating LWZU we have to generate
+ PLWZ plus a PADDI). */
+
+#ifndef SIZE
+#define SIZE 50000
+#endif
+
+struct foo {
+ unsigned int field;
+ char pad[SIZE];
+};
+
+struct foo *inc_load (struct foo *p, unsigned int *q)
+{
+ *q = (++p)->field; /* PLWZ, PADDI, STW. */
+ return p;
+}
+
+struct foo *dec_load (struct foo *p, unsigned int *q)
+{
+ *q = (--p)->field; /* PLWZ, PADDI, STW. */
+ return p;
+}
+
+struct foo *inc_store (struct foo *p, unsigned int *q)
+{
+ (++p)->field = *q; /* LWZ, PADDI, PSTW. */
+ return p;
+}
+
+struct foo *dec_store (struct foo *p, unsigned int *q)
+{
+ (--p)->field = *q; /* LWZ, PADDI, PSTW. */
+ return p;
+}
+
+/* { dg-final { scan-assembler-times {\mlwz\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mstw\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpaddi\M} 4 } } */
+/* { dg-final { scan-assembler-times {\mplwz\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstw\M} 2 } } */
+/* { dg-final { scan-assembler-not {\mplwzu\M} } } */
+/* { dg-final { scan-assembler-not {\mpstwu\M} } } */
+/* { dg-final { scan-assembler-not {\maddis\M} } } */
+/* { dg-final { scan-assembler-not {\maddi\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-dd.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-dd.c
new file mode 100644
index 00000000000..053ca32f127
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-dd.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-require-effective-target dfp } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether pc-relative prefixed instructions are generated for the
+ _Decimal64 type. */
+
+#define TYPE _Decimal64
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplfd\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstfd\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-df.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-df.c
new file mode 100644
index 00000000000..b7fd84e7de2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-df.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether pc-relative prefixed instructions are generated for the
+ double type. */
+
+#define TYPE double
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplfd\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstfd\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-di.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-di.c
new file mode 100644
index 00000000000..90081e452a2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-di.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether pc-relative prefixed instructions are generated for the
+ long long type. */
+
+#define TYPE long long
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mpld\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstd\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-hi.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-hi.c
new file mode 100644
index 00000000000..71357b7d149
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-hi.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether pc-relative prefixed instructions are generated for the
+ short type. */
+
+#define TYPE short
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplh[az]\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpsth\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-kf.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-kf.c
new file mode 100644
index 00000000000..497bdd6dadc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-kf.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-require-effective-target float128 } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether pc-relative prefixed instructions are generated for the
+ _Float128 type. */
+
+#define TYPE _Float128
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplxv\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstxv\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-qi.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-qi.c
new file mode 100644
index 00000000000..472360c08f6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-qi.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether pc-relative prefixed instructions are generated for the
+ signed char type. */
+
+#define TYPE signed char
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplbz\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstb\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sd.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sd.c
new file mode 100644
index 00000000000..7ab07baa143
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sd.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-require-effective-target dfp } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether pc-relative prefixed instructions are generated for the
+ _Decimal32 type. Note, the _Decimal32 type will not generate any prefixed
+ load or stores, because there is no prefixed load/store instruction to load
+ up a vector register as a zero extended 32-bit integer. So we count the
+ number of load addresses that are generated. */
+
+#define TYPE _Decimal32
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mpla\M} 3 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sf.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sf.c
new file mode 100644
index 00000000000..0e907e07d00
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sf.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether pc-relative prefixed instructions are generated for the
+ float type. */
+
+#define TYPE float
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplfs\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstfs\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-si.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-si.c
new file mode 100644
index 00000000000..fb90fcd878f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-si.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether pc-relative prefixed instructions are generated for the
+ int type. */
+
+#define TYPE int
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplw[az]\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstw\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-udi.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-udi.c
new file mode 100644
index 00000000000..940040fc5aa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-udi.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether pc-relative prefixed instructions are generated for the
+ unsigned long long type. */
+
+#define TYPE unsigned long long
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mpld\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstd\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uhi.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uhi.c
new file mode 100644
index 00000000000..5c8d082e831
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uhi.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether pc-relative prefixed instructions are generated for the
+ unsigned short type. */
+
+#define TYPE unsigned short
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplhz\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpsth\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uqi.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uqi.c
new file mode 100644
index 00000000000..68999192d54
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uqi.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether pc-relative prefixed instructions are generated for the
+ unsigned char type. */
+
+#define TYPE unsigned char
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplbz\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstb\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-usi.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-usi.c
new file mode 100644
index 00000000000..5948f8254c3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-usi.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether pc-relative prefixed instructions are generated for the
+ unsigned int type. */
+
+#define TYPE unsigned int
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplwz\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstw\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-v2df.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-v2df.c
new file mode 100644
index 00000000000..d626b8a128e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-v2df.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Tests whether pc-relative prefixed instructions are generated for the
+ vector double type. */
+
+#define TYPE vector double
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplxv\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mpstxv\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel.h b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel.h
new file mode 100644
index 00000000000..26175dc7d1e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel.h
@@ -0,0 +1,41 @@
+/* Common tests for prefixed instructions testing whether pc-relative prefixed
+ instructions are generated for each type. */
+
+#ifndef TYPE
+#define TYPE unsigned int
+#endif
+
+static TYPE a;
+
+/* Make sure a is not optimized away. */
+TYPE *p = &a;
+
+#if !defined(DO_ADD) && !defined(DO_VALUE) && !defined(DO_SET)
+#define DO_ADD 1
+#define DO_VALUE 1
+#define DO_SET 1
+#endif
+
+#if DO_ADD
+void
+add (TYPE b)
+{
+ a += b;
+}
+#endif
+
+#if DO_VALUE
+TYPE
+value (void)
+{
+ return a;
+}
+#endif
+
+#if DO_SET
+void
+set (TYPE b)
+{
+ a = b;
+}
+#endif
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-si-constant.c b/gcc/testsuite/gcc.target/powerpc/prefix-si-constant.c
new file mode 100644
index 00000000000..6403aa8024c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-si-constant.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Test that PLI (PADDI) is generated to load a large constant for SImode. */
+void
+large_si (unsigned int *p)
+{
+ *p = 0x12345U;
+}
+
+/* { dg-final { scan-assembler {\mpli\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-stack-protect.c b/gcc/testsuite/gcc.target/powerpc/prefix-stack-protect.c
new file mode 100644
index 00000000000..ca3b3dfd89f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-stack-protect.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -fstack-protector-strong" } */
+
+/* Test that we can handle large stack frames with -fstack-protector-strong and
+ prefixed addressing. This was originally discovered when trying to build
+ glibc with -mcpu=power10, and vfwprintf.c failed because it used
+ -fstack-protector-strong. It needs 64-bit due to the size of the stack. */
+
+extern long foo (char *);
+
+long
+bar (void)
+{
+ char buffer[0x20000];
+ return foo (buffer) + 1;
+}
+
+/* { dg-final { scan-assembler {\mpld\M} } } */
+/* { dg-final { scan-assembler {\mpstd\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/quad-atomic.c b/gcc/testsuite/gcc.target/powerpc/quad-atomic.c
index f48ff5f67b1..0849e5eeaa2 100644
--- a/gcc/testsuite/gcc.target/powerpc/quad-atomic.c
+++ b/gcc/testsuite/gcc.target/powerpc/quad-atomic.c
@@ -1,6 +1,5 @@
/* { dg-do run { target { powerpc*-*-linux* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target p8vector_hw } */
/* { dg-options "-mdejagnu-cpu=power8 -O2 -Wno-shift-overflow" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/recip-6.c b/gcc/testsuite/gcc.target/powerpc/recip-6.c
index 3748dbfdb08..151dd6f88d4 100644
--- a/gcc/testsuite/gcc.target/powerpc/recip-6.c
+++ b/gcc/testsuite/gcc.target/powerpc/recip-6.c
@@ -1,6 +1,5 @@
/* { dg-do run { target { powerpc*-*-linux* powerpc*-ibm-aix* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target vsx_hw } */
/* { dg-options "-mdejagnu-cpu=power7 -O3 -ftree-vectorize -ffast-math -mrecip=all -mrecip-precision" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/recip-7.c b/gcc/testsuite/gcc.target/powerpc/recip-7.c
index 8841e9e11e8..12b1e9cd6f9 100644
--- a/gcc/testsuite/gcc.target/powerpc/recip-7.c
+++ b/gcc/testsuite/gcc.target/powerpc/recip-7.c
@@ -1,6 +1,5 @@
/* { dg-do run { target { powerpc*-*-linux* powerpc*-ibm-aix* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target ppc_recip_hw } */
/* { dg-options "-O3 -ftree-vectorize -ffast-math -mrecip -mpowerpc-gfxopt -mpowerpc-gpopt -mpopcntb" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/setbc.h b/gcc/testsuite/gcc.target/powerpc/setbc.h
new file mode 100644
index 00000000000..51334246eca
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/setbc.h
@@ -0,0 +1,27 @@
+#define XSTR(a,b) a ## b
+#define T(a,b) XSTR(a,b)
+
+int T(NAME,ii)(int a, int b) { return a CODE b; }
+int T(NAME,il)(long a, long b) { return a CODE b; }
+long T(NAME,li)(int a, int b) { return a CODE b; }
+long T(NAME,ll)(long a, long b) { return a CODE b; }
+
+int T(NAME,iin0)(int a) { return a CODE 0; }
+int T(NAME,iln0)(long a) { return a CODE 0; }
+long T(NAME,lin0)(int a) { return a CODE 0; }
+long T(NAME,lln0)(long a) { return a CODE 0; }
+
+int T(NAME,iin1)(int a) { return a CODE 1; }
+int T(NAME,iln1)(long a) { return a CODE 1; }
+long T(NAME,lin1)(int a) { return a CODE 1; }
+long T(NAME,lln1)(long a) { return a CODE 1; }
+
+int T(NAME,iinm1)(int a) { return a CODE -1; }
+int T(NAME,ilnm1)(long a) { return a CODE -1; }
+long T(NAME,linm1)(int a) { return a CODE -1; }
+long T(NAME,llnm1)(long a) { return a CODE -1; }
+
+int T(NAME,iin42)(int a) { return a CODE 42; }
+int T(NAME,iln42)(long a) { return a CODE 42; }
+long T(NAME,lin42)(int a) { return a CODE 42; }
+long T(NAME,lln42)(long a) { return a CODE 42; }
diff --git a/gcc/testsuite/gcc.target/powerpc/setbceq.c b/gcc/testsuite/gcc.target/powerpc/setbceq.c
new file mode 100644
index 00000000000..63ea8ad5ee0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/setbceq.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#define NAME eq
+#define CODE ==
+
+#include "setbc.h"
+
+/* { dg-final { scan-assembler-times {\msetbc\M} 20 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/setbcge.c b/gcc/testsuite/gcc.target/powerpc/setbcge.c
new file mode 100644
index 00000000000..1b66301b0e2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/setbcge.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#define NAME ge
+#define CODE >=
+
+#include "setbc.h"
+
+/* "x >= 0" is done without setbc.
+ The generic code sometimes transforms "x >= A" to "x > A-1"; we allow
+ either here. */
+/* { dg-final { scan-assembler-times {\msetbcr?\M} 16 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/setbcgt.c b/gcc/testsuite/gcc.target/powerpc/setbcgt.c
new file mode 100644
index 00000000000..f8862a41b4a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/setbcgt.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#define NAME gt
+#define CODE >
+
+#include "setbc.h"
+
+/* "x > -1" is done without setbc. */
+/* { dg-final { scan-assembler-times {\msetbc\M} 16 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/setbcle.c b/gcc/testsuite/gcc.target/powerpc/setbcle.c
new file mode 100644
index 00000000000..29cf4743758
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/setbcle.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#define NAME le
+#define CODE <=
+
+#include "setbc.h"
+
+/* "x <= -1" is done without setbc. */
+/* { dg-final { scan-assembler-times {\msetbcr\M} 16 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/setbclt.c b/gcc/testsuite/gcc.target/powerpc/setbclt.c
new file mode 100644
index 00000000000..7b56ba726a0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/setbclt.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#define NAME lt
+#define CODE <
+
+#include "setbc.h"
+
+/* "x < 0" is done without setbc.
+ The generic code sometimes transforms "x < A" to "x <= A-1"; we allow
+ either here. */
+/* { dg-final { scan-assembler-times {\msetbcr?\M} 16 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/setbcne.c b/gcc/testsuite/gcc.target/powerpc/setbcne.c
new file mode 100644
index 00000000000..787a0cd92c9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/setbcne.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#define NAME ne
+#define CODE !=
+
+#include "setbc.h"
+
+/* { dg-final { scan-assembler-times {\msetbcr\M} 20 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/setnbc.h b/gcc/testsuite/gcc.target/powerpc/setnbc.h
new file mode 100644
index 00000000000..d278d4a687f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/setnbc.h
@@ -0,0 +1,27 @@
+#define XSTR(a,b) a ## b
+#define T(a,b) XSTR(a,b)
+
+int T(NAME,ii)(int a, int b) { return -(a CODE b); }
+int T(NAME,il)(long a, long b) { return -(a CODE b); }
+long T(NAME,li)(int a, int b) { return -(a CODE b); }
+long T(NAME,ll)(long a, long b) { return -(a CODE b); }
+
+int T(NAME,iin0)(int a) { return -(a CODE 0); }
+int T(NAME,iln0)(long a) { return -(a CODE 0); }
+long T(NAME,lin0)(int a) { return -(a CODE 0); }
+long T(NAME,lln0)(long a) { return -(a CODE 0); }
+
+int T(NAME,iin1)(int a) { return -(a CODE 1); }
+int T(NAME,iln1)(long a) { return -(a CODE 1); }
+long T(NAME,lin1)(int a) { return -(a CODE 1); }
+long T(NAME,lln1)(long a) { return -(a CODE 1); }
+
+int T(NAME,iinm1)(int a) { return -(a CODE -1); }
+int T(NAME,ilnm1)(long a) { return -(a CODE -1); }
+long T(NAME,linm1)(int a) { return -(a CODE -1); }
+long T(NAME,llnm1)(long a) { return -(a CODE -1); }
+
+int T(NAME,iin42)(int a) { return -(a CODE 42); }
+int T(NAME,iln42)(long a) { return -(a CODE 42); }
+long T(NAME,lin42)(int a) { return -(a CODE 42); }
+long T(NAME,lln42)(long a) { return -(a CODE 42); }
diff --git a/gcc/testsuite/gcc.target/powerpc/setnbceq.c b/gcc/testsuite/gcc.target/powerpc/setnbceq.c
new file mode 100644
index 00000000000..a5233794395
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/setnbceq.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#define NAME eq
+#define CODE ==
+
+#include "setnbc.h"
+
+/* { dg-final { scan-assembler-times {\msetnbc\M} 20 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/setnbcge.c b/gcc/testsuite/gcc.target/powerpc/setnbcge.c
new file mode 100644
index 00000000000..2615e7297be
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/setnbcge.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#define NAME ge
+#define CODE >=
+
+#include "setnbc.h"
+
+/* "x >= 0" is done without setnbc.
+ The generic code sometimes transforms "x >= A" to "x > A-1"; we allow
+ either here. */
+/* { dg-final { scan-assembler-times {\msetnbcr?\M} 16 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/setnbcgt.c b/gcc/testsuite/gcc.target/powerpc/setnbcgt.c
new file mode 100644
index 00000000000..ba878404f20
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/setnbcgt.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#define NAME gt
+#define CODE >
+
+#include "setnbc.h"
+
+/* "x > -1" is done without setnbc. */
+/* { dg-final { scan-assembler-times {\msetnbc\M} 16 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/setnbcle.c b/gcc/testsuite/gcc.target/powerpc/setnbcle.c
new file mode 100644
index 00000000000..8b55e44b455
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/setnbcle.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#define NAME le
+#define CODE <=
+
+#include "setnbc.h"
+
+/* "x <= -1" is done without setnbc. */
+/* { dg-final { scan-assembler-times {\msetnbcr\M} 16 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/setnbclt.c b/gcc/testsuite/gcc.target/powerpc/setnbclt.c
new file mode 100644
index 00000000000..4755aa82f07
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/setnbclt.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#define NAME lt
+#define CODE <
+
+#include "setnbc.h"
+
+/* "x < 0" is done without setnbc.
+ The generic code sometimes transforms "x < A" to "x <= A-1"; we allow
+ either here. */
+/* { dg-final { scan-assembler-times {\msetnbcr?\M} 16 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/setnbcne.c b/gcc/testsuite/gcc.target/powerpc/setnbcne.c
new file mode 100644
index 00000000000..c4c1b6f30c9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/setnbcne.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#define NAME ne
+#define CODE !=
+
+#include "setnbc.h"
+
+/* { dg-final { scan-assembler-times {\msetnbcr\M} 20 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/spe-evmerge.c b/gcc/testsuite/gcc.target/powerpc/spe-evmerge.c
deleted file mode 100644
index df0a33e4009..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/spe-evmerge.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Verify SPE vector permute builtins. */
-/* { dg-do run { target { powerpc*-*-* && powerpc_spe } } } */
-/* Remove `-ansi' from options so that <spe.h> compiles. */
-/* { dg-options "" } */
-
-#include <spe.h>
-#include <stdlib.h>
-
-#define vector __attribute__ ((vector_size (8)))
-
-#define WORDS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
-
-int
-main (void)
-{
- vector int a = { 0x11111111, 0x22222222 };
- vector int b = { 0x33333333, 0x44444444 };
- vector int c;
-
- /* c[hi] = a[hi], c[lo] = b[hi] */
- c = __ev_mergehi (a, b);
- if (c[0] != (WORDS_BIG_ENDIAN ? 0x11111111 : 0x44444444))
- abort ();
- if (c[1] != (WORDS_BIG_ENDIAN ? 0x33333333 : 0x22222222))
- abort ();
- /* c[hi] = a[lo], c[lo] = b[lo] */
- c = __ev_mergelo (a, b);
- if (c[0] != (WORDS_BIG_ENDIAN ? 0x22222222 : 0x33333333))
- abort ();
- if (c[1] != (WORDS_BIG_ENDIAN ? 0x44444444 : 0x11111111))
- abort ();
- /* c[hi] = a[lo], c[lo] = b[hi] */
- c = __ev_mergelohi (a, b);
- if (c[0] != (WORDS_BIG_ENDIAN ? 0x22222222 : 0x44444444))
- abort ();
- if (c[1] != (WORDS_BIG_ENDIAN ? 0x33333333 : 0x11111111))
- abort ();
- /* c[hi] = a[hi], c[lo] = b[lo] */
- c = __ev_mergehilo (a, b);
- if (c[0] != (WORDS_BIG_ENDIAN ? 0x11111111 : 0x33333333))
- abort ();
- if (c[1] != (WORDS_BIG_ENDIAN ? 0x44444444 : 0x22222222))
- abort ();
-
- /* c[hi] = a[hi], c[lo] = b[hi] */
- c = __builtin_spe_evmergehi (a, b);
- if (c[0] != (WORDS_BIG_ENDIAN ? 0x11111111 : 0x44444444))
- abort ();
- if (c[1] != (WORDS_BIG_ENDIAN ? 0x33333333 : 0x22222222))
- abort ();
- /* c[hi] = a[lo], c[lo] = b[lo] */
- c = __builtin_spe_evmergelo (a, b);
- if (c[0] != (WORDS_BIG_ENDIAN ? 0x22222222 : 0x33333333))
- abort ();
- if (c[1] != (WORDS_BIG_ENDIAN ? 0x44444444 : 0x11111111))
- abort ();
- /* c[hi] = a[lo], c[lo] = b[hi] */
- c = __builtin_spe_evmergelohi (a, b);
- if (c[0] != (WORDS_BIG_ENDIAN ? 0x22222222 : 0x44444444))
- abort ();
- if (c[1] != (WORDS_BIG_ENDIAN ? 0x33333333 : 0x11111111))
- abort ();
- /* c[hi] = a[hi], c[lo] = b[lo] */
- c = __builtin_spe_evmergehilo (a, b);
- if (c[0] != (WORDS_BIG_ENDIAN ? 0x11111111 : 0x33333333))
- abort ();
- if (c[1] != (WORDS_BIG_ENDIAN ? 0x44444444 : 0x22222222))
- abort ();
-
- return 0;
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/spe-small-data-1.c b/gcc/testsuite/gcc.target/powerpc/spe-small-data-1.c
deleted file mode 100644
index 8bdb154e1af..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/spe-small-data-1.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Verify that we don't ICE trying to put SPE data in .sdata2. */
-/* { dg-do run { target { powerpc*-*-linux* && powerpc_spe } } } */
-/* { dg-options "-msdata=eabi -mcall-eabi -G 8" } */
-
-#include <spe.h>
-
-__ev64_fs__ x;
-
-int main(void)
-{
- x = __ev_fsabs (x);
- return(0);
-}
-
diff --git a/gcc/testsuite/gcc.target/powerpc/spe-small-data-2.c b/gcc/testsuite/gcc.target/powerpc/spe-small-data-2.c
deleted file mode 100644
index 5354e49f470..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/spe-small-data-2.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Verify that we don't ICE trying to put float data in .sdata2. */
-/* { dg-do compile } */
-/* { dg-require-effective-target powerpc_eabi_ok } */
-/* { dg-options "-msdata=eabi -mcall-eabi -G 8" } */
-
-double x;
-
-int main(void)
-{
- x = x * 2;
- return(0);
-}
-
diff --git a/gcc/testsuite/gcc.target/powerpc/spe-unwind-1.c b/gcc/testsuite/gcc.target/powerpc/spe-unwind-1.c
deleted file mode 100644
index 84d4bf28803..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/spe-unwind-1.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/* Verify that unwinding can find SPE registers in signal frames. */
-/* Origin: Joseph Myers <joseph@codesourcery.com> */
-/* { dg-do run { target { powerpc*-*-linux* && powerpc_spe } } } */
-/* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */
-
-#include <unwind.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <string.h>
-
-int count;
-char *null;
-int found_reg;
-
-typedef int v2si __attribute__((__vector_size__(8)));
-
-v2si v1 = { 123, 234 };
-v2si v2 = { 345, 456 };
-
-static _Unwind_Reason_Code
-force_unwind_stop (int version, _Unwind_Action actions,
- _Unwind_Exception_Class exc_class,
- struct _Unwind_Exception *exc_obj,
- struct _Unwind_Context *context,
- void *stop_parameter)
-{
- unsigned int reg;
- if (actions & _UA_END_OF_STACK)
- abort ();
- if (_Unwind_GetGR (context, 1215) == 123)
- found_reg = 1;
- return _URC_NO_REASON;
-}
-
-static void force_unwind ()
-{
- struct _Unwind_Exception *exc = malloc (sizeof (*exc));
- memset (&exc->exception_class, 0, sizeof (exc->exception_class));
- exc->exception_cleanup = 0;
-
-#ifndef __USING_SJLJ_EXCEPTIONS__
- _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
-#else
- _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);
-#endif
-
- abort ();
-}
-
-static void counter (void *p __attribute__((unused)))
-{
- ++count;
-}
-
-static void handler (void *p __attribute__((unused)))
-{
- if (count != 2)
- abort ();
- if (!found_reg)
- abort ();
- exit (0);
-}
-
-static int __attribute__((noinline)) fn5 ()
-{
- char dummy __attribute__((cleanup (counter)));
- force_unwind ();
- return 0;
-}
-
-static void fn4 (int sig)
-{
- char dummy __attribute__((cleanup (counter)));
- /* Clobber high part without compiler's knowledge so the only saved
- copy is from the signal frame. */
- asm volatile ("evmergelo 15,15,15");
- fn5 ();
- null = NULL;
-}
-
-static void fn3 ()
-{
- abort ();
-}
-
-static int __attribute__((noinline)) fn2 ()
-{
- register v2si r15 asm("r15");
- r15 = v1;
- asm volatile ("" : "+r" (r15));
- *null = 0;
- fn3 ();
- return 0;
-}
-
-static int __attribute__((noinline)) fn1 ()
-{
- signal (SIGSEGV, fn4);
- signal (SIGBUS, fn4);
- fn2 ();
- return 0;
-}
-
-static int __attribute__((noinline)) fn0 ()
-{
- char dummy __attribute__((cleanup (handler)));
- fn1 ();
- null = 0;
- return 0;
-}
-
-int main()
-{
- fn0 ();
- abort ();
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/spe-vector-memcpy.c b/gcc/testsuite/gcc.target/powerpc/spe-vector-memcpy.c
deleted file mode 100644
index c33874b7fcf..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/spe-vector-memcpy.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O -mdejagnu-cpu=8540 -mspe -mabi=spe -mfloat-gprs=single" } */
-/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } } */
-/* { dg-final { scan-assembler "evstdd" } } */
-
-void foo(void)
-{
- int x[8] __attribute__((aligned(64))) = { 1, 1, 1, 1, 1, 1, 1, 1 };
- bar (x);
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/spe-vector-memset.c b/gcc/testsuite/gcc.target/powerpc/spe-vector-memset.c
deleted file mode 100644
index 7ecaf103706..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/spe-vector-memset.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* { dg-do compile { target powerpc*-*-* } } */
-/* { dg-require-effective-target powerpc_spe } */
-/* { dg-options "-O -mspe=yes" } */
-/* { dg-final { scan-assembler "evstdd" } } */
-
-#include <string.h>
-
-void foo(void)
-{
- int x[8] __attribute__((aligned(64)));
- memset (x, 0, sizeof (x));
- bar (x);
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/spe1.c b/gcc/testsuite/gcc.target/powerpc/spe1.c
deleted file mode 100644
index be80c6ca718..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/spe1.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=8540 -mspe -mabi=spe -mfloat-gprs=single -O0" } */
-/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } } */
-
-/* (Test with -O0 so we don't optimize any of them away). */
-
-
-typedef float __attribute__((vector_size(8))) __ev64_fs__;
-
-__ev64_opaque__ Foo (void);
-
-void Bar ()
-{
- __ev64_fs__ fs = Foo ();
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-blend-runnable.c b/gcc/testsuite/gcc.target/powerpc/vec-blend-runnable.c
new file mode 100644
index 00000000000..0c3d47234ed
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-blend-runnable.c
@@ -0,0 +1,276 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+#include <altivec.h>
+
+#define DEBUG 0
+
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ int i;
+ vector signed char vsrc_a_char, vsrc_b_char;
+ vector signed char vresult_char;
+ vector signed char expected_vresult_char;
+
+ vector unsigned char vsrc_a_uchar, vsrc_b_uchar, vsrc_c_uchar;
+ vector unsigned char vresult_uchar;
+ vector unsigned char expected_vresult_uchar;
+
+ vector signed short vsrc_a_short, vsrc_b_short, vsrc_c_short;
+ vector signed short vresult_short;
+ vector signed short expected_vresult_short;
+
+ vector unsigned short vsrc_a_ushort, vsrc_b_ushort, vsrc_c_ushort;
+ vector unsigned short vresult_ushort;
+ vector unsigned short expected_vresult_ushort;
+
+ vector int vsrc_a_int, vsrc_b_int, vsrc_c_int;
+ vector int vresult_int;
+ vector int expected_vresult_int;
+
+ vector unsigned int vsrc_a_uint, vsrc_b_uint, vsrc_c_uint;
+ vector unsigned int vresult_uint;
+ vector unsigned int expected_vresult_uint;
+
+ vector long long int vsrc_a_ll, vsrc_b_ll, vsrc_c_ll;
+ vector long long int vresult_ll;
+ vector long long int expected_vresult_ll;
+
+ vector unsigned long long int vsrc_a_ull, vsrc_b_ull, vsrc_c_ull;
+ vector unsigned long long int vresult_ull;
+ vector unsigned long long int expected_vresult_ull;
+
+ vector float vresult_f;
+ vector float expected_vresult_f;
+ vector float vsrc_a_f, vsrc_b_f;
+
+ vector double vsrc_a_d, vsrc_b_d;
+ vector double vresult_d;
+ vector double expected_vresult_d;
+
+ /* Vector blend */
+ vsrc_c_uchar = (vector unsigned char) { 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80,
+ 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80 };
+
+ vsrc_a_char = (vector signed char) { -1, 3, 5, 7, 9, 11, 13, 15,
+ 17, 19, 21, 23, 25, 27, 29 };
+ vsrc_b_char = (vector signed char) { 2, -4, 6, 8, 10, 12, 14, 16,
+ 18, 20, 22, 24, 26, 28, 30, 32 };
+ vsrc_c_uchar = (vector unsigned char) { 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80,
+ 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80 };
+ vresult_char = (vector signed char) { 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_char = (vector signed char) { -1, -4, 5, 8,
+ 9, 12, 13, 16,
+ 17, 20, 21, 24,
+ 25, 28, 29, 32 };
+
+ vresult_char = vec_blendv (vsrc_a_char, vsrc_b_char, vsrc_c_uchar);
+
+ if (!vec_all_eq (vresult_char, expected_vresult_char)) {
+#if DEBUG
+ printf("ERROR, vec_blendv (vsrc_a_char, vsrc_b_char, vsrc_c_uchar)\n");
+ for(i = 0; i < 16; i++)
+ printf(" vresult_char[%d] = %d, expected_vresult_char[%d] = %d\n",
+ i, vresult_char[i], i, expected_vresult_char[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_uchar = (vector unsigned char) { 1, 3, 5, 7, 9, 11, 13, 15,
+ 17, 19, 21, 23, 25, 27, 29 };
+ vsrc_b_uchar = (vector unsigned char) { 2, 4, 6, 8, 10, 12, 14, 16,
+ 18, 20, 22, 24, 26, 28, 30, 32 };
+ vsrc_c_uchar = (vector unsigned char) { 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80,
+ 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80 };
+ vresult_uchar = (vector unsigned char) { 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_uchar = (vector unsigned char) { 1, 4, 5, 8,
+ 9, 12, 13, 16,
+ 17, 20, 21, 24,
+ 25, 28, 29, 32 };
+
+ vresult_uchar = vec_blendv (vsrc_a_uchar, vsrc_b_uchar, vsrc_c_uchar);
+
+ if (!vec_all_eq (vresult_uchar, expected_vresult_uchar)) {
+#if DEBUG
+ printf("ERROR, vec_blendv (vsrc_a_uchar, vsrc_b_uchar, vsrc_c_uchar)\n");
+ for(i = 0; i < 16; i++)
+ printf(" vresult_uchar[%d] = %d, expected_vresult_uchar[%d] = %d\n",
+ i, vresult_uchar[i], i, expected_vresult_uchar[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_short = (vector signed short) { -1, 3, 5, 7, 9, 11, 13, 15 };
+ vsrc_b_short = (vector signed short) { 2, -4, 6, 8, 10, 12, 14, 16 };
+ vsrc_c_ushort = (vector unsigned short) { 0, 0x8000, 0, 0x8000,
+ 0, 0x8000, 0, 0x8000 };
+ vresult_short = (vector signed short) { 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_short = (vector signed short) { -1, -4, 5, 8,
+ 9, 12, 13, 16 };
+
+ vresult_short = vec_blendv (vsrc_a_short, vsrc_b_short, vsrc_c_ushort);
+
+ if (!vec_all_eq (vresult_short, expected_vresult_short)) {
+#if DEBUG
+ printf("ERROR, vec_blendv (vsrc_a_short, vsrc_b_short, vsrc_c_ushort)\n");
+ for(i = 0; i < 8; i++)
+ printf(" vresult_short[%d] = %d, expected_vresult_short[%d] = %d\n",
+ i, vresult_short[i], i, expected_vresult_short[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_ushort = (vector unsigned short) { 1, 3, 5, 7, 9, 11, 13, 15 };
+ vsrc_b_ushort = (vector unsigned short) { 2, 4, 6, 8, 10, 12, 14, 16 };
+ vsrc_c_ushort = (vector unsigned short) { 0, 0x8000, 0, 0x8000,
+ 0, 0x8000, 0, 0x8000 };
+ vresult_ushort = (vector unsigned short) { 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_ushort = (vector unsigned short) { 1, 4, 5, 8,
+ 9, 12, 13, 16 };
+
+ vresult_ushort = vec_blendv (vsrc_a_ushort, vsrc_b_ushort, vsrc_c_ushort);
+
+ if (!vec_all_eq (vresult_ushort, expected_vresult_ushort)) {
+#if DEBUG
+ printf("ERROR, vec_blendv (vsrc_a_ushort, vsrc_b_ushort, vsrc_c_ushort)\n");
+ for(i = 0; i < 8; i++)
+ printf(" vresult_ushort[%d] = %d, expected_vresult_ushort[%d] = %d\n",
+ i, vresult_ushort[i], i, expected_vresult_ushort[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_int = (vector signed int) { -1, -3, -5, -7 };
+ vsrc_b_int = (vector signed int) { 2, 4, 6, 8 };
+ vsrc_c_uint = (vector unsigned int) { 0, 0x80000000, 0, 0x80000000};
+ vresult_int = (vector signed int) { 0, 0, 0, 0 };
+ expected_vresult_int = (vector signed int) { -1, 4, -5, 8 };
+
+ vresult_int = vec_blendv (vsrc_a_int, vsrc_b_int, vsrc_c_uint);
+
+ if (!vec_all_eq (vresult_int, expected_vresult_int)) {
+#if DEBUG
+ printf("ERROR, vec_blendv (vsrc_a_int, vsrc_b_int, vsrc_c_uint)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_int[%d] = %d, expected_vresult_int[%d] = %d\n",
+ i, vresult_int[i], i, expected_vresult_int[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_uint = (vector unsigned int) { 1, 3, 5, 7 };
+ vsrc_b_uint = (vector unsigned int) { 2, 4, 6, 8 };
+ vsrc_c_uint = (vector unsigned int) { 0, 0x80000000, 0, 0x80000000 };
+ vresult_uint = (vector unsigned int) { 0, 0, 0, 0 };
+ expected_vresult_uint = (vector unsigned int) { 1, 4, 5, 8 };
+
+ vresult_uint = vec_blendv (vsrc_a_uint, vsrc_b_uint, vsrc_c_uint);
+
+ if (!vec_all_eq (vresult_uint, expected_vresult_uint)) {
+#if DEBUG
+ printf("ERROR, vec_blendv (vsrc_a_uint, vsrc_b_uint, vsrc_c_uint)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_uint[%d] = %d, expected_vresult_uint[%d] = %d\n",
+ i, vresult_uint[i], i, expected_vresult_uint[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_ll = (vector signed long long int) { -1, -3 };
+ vsrc_b_ll = (vector signed long long int) { 2, 4, };
+ vsrc_c_ull = (vector unsigned long long int) { 0, 0x8000000000000000ULL };
+ vresult_ll = (vector signed long long int) { 0, 0 };
+ expected_vresult_ll = (vector signed long long int) { -1, 4 };
+
+ vresult_ll = vec_blendv (vsrc_a_ll, vsrc_b_ll, vsrc_c_ull);
+
+ if (!vec_all_eq (vresult_ll, expected_vresult_ll)) {
+#if DEBUG
+ printf("ERROR, vec_blendv (vsrc_a_ll, vsrc_b_ll, vsrc_c_ull)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_ll[%d] = %d, expected_vresult_ll[%d] = %d\n",
+ i, vresult_ll[i], i, expected_vresult_ll[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_ull = (vector unsigned long long) { 1, 3 };
+ vsrc_b_ull = (vector unsigned long long) { 2, 4 };
+ vsrc_c_ull = (vector unsigned long long int) { 0, 0x8000000000000000ULL };
+ vresult_ull = (vector unsigned long long) { 0, 0 };
+ expected_vresult_ull = (vector unsigned long long) { 1, 4 };
+
+ vresult_ull = vec_blendv (vsrc_a_ull, vsrc_b_ull, vsrc_c_ull);
+
+ if (!vec_all_eq (vresult_ull, expected_vresult_ull)) {
+#if DEBUG
+ printf("ERROR, vec_blendv (vsrc_a_ull, vsrc_b_ull, vsrc_c_ull)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_ull[%d] = %d, expected_vresult_ull[%d] = %d\n",
+ i, vresult_ull[i], i, expected_vresult_ull[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_f = (vector float) { -1.0, -3.0, -5.0, -7.0 };
+ vsrc_b_f = (vector float) { 2.0, 4.0, 6.0, 8.0 };
+ vsrc_c_uint = (vector unsigned int) { 0, 0x80000000, 0, 0x80000000};
+ vresult_f = (vector float) { 0, 0, 0, 0 };
+ expected_vresult_f = (vector float) { -1, 4, -5, 8 };
+
+ vresult_f = vec_blendv (vsrc_a_f, vsrc_b_f, vsrc_c_uint);
+
+ if (!vec_all_eq (vresult_f, expected_vresult_f)) {
+#if DEBUG
+ printf("ERROR, vec_blendv (vsrc_a_f, vsrc_b_f, vsrc_c_uint)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_f[%d] = %d, expected_vresult_f[%d] = %d\n",
+ i, vresult_f[i], i, expected_vresult_f[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_d = (vector double) { -1.0, -3.0 };
+ vsrc_b_d = (vector double) { 2.0, 4.0 };
+ vsrc_c_ull = (vector unsigned long long int) { 0, 0x8000000000000000ULL };
+ vresult_d = (vector double) { 0, 0 };
+ expected_vresult_d = (vector double) { -1, 4 };
+
+ vresult_d = vec_blendv (vsrc_a_d, vsrc_b_d, vsrc_c_ull);
+
+ if (!vec_all_eq (vresult_d, expected_vresult_d)) {
+#if DEBUG
+ printf("ERROR, vec_blendv (vsrc_a_d, vsrc_b_d, vsrc_c_ull)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_d[%d] = %d, expected_vresult_d[%d] = %d\n",
+ i, vresult_d[i], i, expected_vresult_d[i]);
+#else
+ abort();
+#endif
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {\mxxblendvb\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mxxblendvh\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mxxblendvw\M} 3 } } */
+/* { dg-final { scan-assembler-times {\mxxblendvd\M} 3 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-cfuged-0.c b/gcc/testsuite/gcc.target/powerpc/vec-cfuged-0.c
new file mode 100644
index 00000000000..26084a6bc14
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-cfuged-0.c
@@ -0,0 +1,61 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned long long int
+do_vec_cfuge (vector unsigned long long int source,
+ vector unsigned long long int mask)
+{
+ return vec_cfuge (source, mask);
+}
+
+int
+vectors_equal (vector unsigned long long int a,
+ vector unsigned long long int b)
+{
+ return (a[0] == b[0]) && (a[1] == b[1]);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull };
+ vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull };
+
+ vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull };
+ vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull };
+
+ /* See cfuged-0.c for derivation of expected results.
+
+ result_aa [0] is compute (source [0], mask [0];
+ result_aa [1] is compute (source [1], mask [1].
+
+ result_ab [0] is compute (source [0], mask [2];
+ result_ab [1] is compute (source [1], mask [3].
+
+ result_ba [0] is compute (source [2], mask [0];
+ result_ba [1] is compute (source [3], mask [1].
+
+ result_bb [0] is compute (source [2], mask [2];
+ result_bb [1] is compute (source [3], mask [3]. */
+
+ vector unsigned long long int result_aa = { 0x7e3ca5f0ull, 0x7e3ca5f0ull };
+ vector unsigned long long int result_ab = { 0xaf7350ecull, 0xec5073afull };
+ vector unsigned long long int result_ba = { 0xf07e3ca5ull, 0x5a0fe7c3ull };
+ vector unsigned long long int result_bb = { 0x3af7c50eull, 0xaf7350ecull };
+
+ if (!vectors_equal (do_vec_cfuge (source_a, mask_a), result_aa))
+ abort ();
+ if (!vectors_equal (do_vec_cfuge (source_a, mask_b), result_ab))
+ abort ();
+ if (!vectors_equal (do_vec_cfuge (source_b, mask_a), result_ba))
+ abort ();
+ if (!vectors_equal (do_vec_cfuge (source_b, mask_b), result_bb))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvcfuged\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-cfuged-1.c b/gcc/testsuite/gcc.target/powerpc/vec-cfuged-1.c
new file mode 100644
index 00000000000..2a6f5ed8c8e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-cfuged-1.c
@@ -0,0 +1,60 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned long long int
+do_vec_cfuge (vector unsigned long long int source,
+ vector unsigned long long int mask)
+{
+ return vec_cfuge (source, mask);
+}
+
+int
+vectors_equal (vector unsigned long long int a,
+ vector unsigned long long int b)
+{
+ return (a[0] == b[0]) && (a[1] == b[1]);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull };
+ vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull };
+
+ vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull };
+ vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull };
+
+ /* See cfuged-0.c for derivation of expected results.
+
+ result_aa [0] is compute (source [0], mask [0];
+ result_aa [1] is compute (source [1], mask [1].
+
+ result_ab [0] is compute (source [0], mask [2];
+ result_ab [1] is compute (source [1], mask [3].
+
+ result_ba [0] is compute (source [2], mask [0];
+ result_ba [1] is compute (source [3], mask [1].
+
+ result_bb [0] is compute (source [2], mask [2];
+ result_bb [1] is compute (source [3], mask [3]. */
+
+ vector unsigned long long int result_aa = { 0x7e3ca5f0ull, 0x7e3ca5f0ull };
+ vector unsigned long long int result_ab = { 0xaf7350ecull, 0xec5073afull };
+ vector unsigned long long int result_ba = { 0xf07e3ca5ull, 0x5a0fe7c3ull };
+ vector unsigned long long int result_bb = { 0x3af7c50eull, 0xaf7350ecull };
+
+ if (!vectors_equal (do_vec_cfuge (source_a, mask_a), result_aa))
+ abort ();
+ if (!vectors_equal (do_vec_cfuge (source_a, mask_b), result_ab))
+ abort ();
+ if (!vectors_equal (do_vec_cfuge (source_b, mask_a), result_ba))
+ abort ();
+ if (!vectors_equal (do_vec_cfuge (source_b, mask_b), result_bb))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-clrl-0.c b/gcc/testsuite/gcc.target/powerpc/vec-clrl-0.c
new file mode 100644
index 00000000000..d0b183ebfaf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-clrl-0.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string clear left-most bytes of unsigned char. */
+vector unsigned char
+clrl (vector unsigned char arg, int n)
+{
+ return vec_clrl (arg, n);
+}
+
+/* { dg-final { scan-assembler {\mvclrlb\M} { target be } } } */
+/* { dg-final { scan-assembler {\mvclrrb\M} { target le } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-clrl-1.c b/gcc/testsuite/gcc.target/powerpc/vec-clrl-1.c
new file mode 100644
index 00000000000..7f7d28b04d5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-clrl-1.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string clear left-most bytes of unsigned char. */
+vector unsigned char
+clrl (vector unsigned char arg, int n)
+{
+ return vec_clrl (arg, n);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned char input0 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char expected0 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char expected1 =
+ { 0x0, 0x0, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char expected2 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+
+ if (!vec_all_eq (clrl (input0, 5), expected0))
+ abort ();
+ if (!vec_all_eq (clrl (input0, 13), expected1))
+ abort ();
+ if (!vec_all_eq (clrl (input0, 19), expected2))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-clrl-2.c b/gcc/testsuite/gcc.target/powerpc/vec-clrl-2.c
new file mode 100644
index 00000000000..b9676b8b04c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-clrl-2.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string clear left-most bytes of unsigned char. */
+vector signed char
+clrl (vector signed char arg, int n)
+{
+ return vec_clrl (arg, n);
+}
+
+/* { dg-final { scan-assembler {\mvclrlb\M} { target be } } } */
+/* { dg-final { scan-assembler {\mvclrrb\M} { target le } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-clrl-3.c b/gcc/testsuite/gcc.target/powerpc/vec-clrl-3.c
new file mode 100644
index 00000000000..26eae792f27
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-clrl-3.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string clear left-most bytes of unsigned char. */
+vector signed char
+clrl (vector signed char arg, int n)
+{
+ return vec_clrl (arg, n);
+}
+
+int main (int argc, char *argv [])
+{
+ vector signed char input0 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector signed char expected0 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector signed char expected1 =
+ { 0x0, 0x0, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector signed char expected2 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+
+ if (!vec_all_eq (clrl (input0, 5), expected0))
+ abort ();
+ if (!vec_all_eq (clrl (input0, 13), expected1))
+ abort ();
+ if (!vec_all_eq (clrl (input0, 19), expected2))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-clrr-0.c b/gcc/testsuite/gcc.target/powerpc/vec-clrr-0.c
new file mode 100644
index 00000000000..2aa1454d140
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-clrr-0.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string clear right-most bytes of unsigned char. */
+vector unsigned char
+clrr (vector unsigned char arg, int n)
+{
+ return vec_clrr (arg, n);
+}
+
+/* { dg-final { scan-assembler {\mvclrrb\M} { target be } } } */
+/* { dg-final { scan-assembler {\mvclrlb\M} { target le } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-clrr-1.c b/gcc/testsuite/gcc.target/powerpc/vec-clrr-1.c
new file mode 100644
index 00000000000..307617ece64
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-clrr-1.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string clear right-most bytes of unsigned char. */
+vector unsigned char
+clrr (vector unsigned char arg, int n)
+{
+ return vec_clrr (arg, n);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned char input0 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char expected0 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector unsigned char expected1 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0x0, 0x0 };
+ vector unsigned char expected2 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+
+ if (!vec_all_eq (clrr(input0, 5), expected0))
+ abort ();
+ if (!vec_all_eq (clrr(input0, 13), expected1))
+ abort ();
+ if (!vec_all_eq (clrr(input0, 19), expected2))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-clrr-2.c b/gcc/testsuite/gcc.target/powerpc/vec-clrr-2.c
new file mode 100644
index 00000000000..f09be49e0ab
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-clrr-2.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string clear right-most bytes of unsigned char. */
+vector signed char
+clrr (vector signed char arg, int n)
+{
+ return vec_clrr (arg, n);
+}
+
+/* { dg-final { scan-assembler {\mvclrrb\M} { target be } } } */
+/* { dg-final { scan-assembler {\mvclrlb\M} { target le } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-clrr-3.c b/gcc/testsuite/gcc.target/powerpc/vec-clrr-3.c
new file mode 100644
index 00000000000..b46995d4ffe
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-clrr-3.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string clear right-most bytes of unsigned char. */
+vector signed char
+clrr (vector signed char arg, int n)
+{
+ return vec_clrr (arg, n);
+}
+
+int main (int argc, char *argv [])
+{
+ vector signed char input0 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector signed char expected0 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector signed char expected1 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0x0, 0x0 };
+ vector signed char expected2 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+
+ if (!vec_all_eq (clrr (input0, 5), expected0))
+ abort ();
+ if (!vec_all_eq (clrr (input0, 13), expected1))
+ abort ();
+ if (!vec_all_eq (clrr (input0, 19), expected2))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-cntlzm-0.c b/gcc/testsuite/gcc.target/powerpc/vec-cntlzm-0.c
new file mode 100644
index 00000000000..1fd578f05bf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-cntlzm-0.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned long long int
+do_vec_cntlzm (vector unsigned long long int source,
+ vector unsigned long long int mask)
+{
+ return vec_cntlzm (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull };
+ vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull };
+
+ vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull };
+ vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull };
+
+ /* See cntlzdm-0.c for derivation of expected results.
+
+ result_aa [0] is compute (source [0], mask [0];
+ result_aa [1] is compute (source [1], mask [1].
+
+ result_ab [0] is compute (source [0], mask [2];
+ result_ab [1] is compute (source [1], mask [3].
+
+ result_ba [0] is compute (source [2], mask [0];
+ result_ba [1] is compute (source [3], mask [1].
+
+ result_bb [0] is compute (source [2], mask [2];
+ result_bb [1] is compute (source [3], mask [3]. */
+
+ vector unsigned long long int result_aa = { 0, 0 };
+ vector unsigned long long int result_ab = { 1, 1 };
+ vector unsigned long long int result_ba = { 2, 0 };
+ vector unsigned long long int result_bb = { 0, 1 };
+
+ if (!vec_all_eq (do_vec_cntlzm (source_a, mask_a), result_aa))
+ abort ();
+ if (!vec_all_eq (do_vec_cntlzm (source_a, mask_b), result_ab))
+ abort ();
+ if (!vec_all_eq (do_vec_cntlzm (source_b, mask_a), result_ba))
+ abort ();
+ if (!vec_all_eq (do_vec_cntlzm (source_b, mask_b), result_bb))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvclzdm\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-cntlzm-1.c b/gcc/testsuite/gcc.target/powerpc/vec-cntlzm-1.c
new file mode 100644
index 00000000000..b92bccf1d2a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-cntlzm-1.c
@@ -0,0 +1,54 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned long long int
+do_vec_cntlzm (vector unsigned long long int source,
+ vector unsigned long long int mask)
+{
+ return vec_cntlzm (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull };
+ vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull };
+
+ vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull };
+ vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull };
+
+ /* See cntlzdm-0.c for derivation of expected results.
+
+ result_aa [0] is compute (source [0], mask [0];
+ result_aa [1] is compute (source [1], mask [1].
+
+ result_ab [0] is compute (source [0], mask [2];
+ result_ab [1] is compute (source [1], mask [3].
+
+ result_ba [0] is compute (source [2], mask [0];
+ result_ba [1] is compute (source [3], mask [1].
+
+ result_bb [0] is compute (source [2], mask [2];
+ result_bb [1] is compute (source [3], mask [3]. */
+
+ vector unsigned long long int result_aa = { 0, 0 };
+ vector unsigned long long int result_ab = { 1, 1 };
+ vector unsigned long long int result_ba = { 2, 0 };
+ vector unsigned long long int result_bb = { 0, 1 };
+
+ if (!vec_all_eq (do_vec_cntlzm (source_a, mask_a), result_aa))
+ abort ();
+ if (!vec_all_eq (do_vec_cntlzm (source_a, mask_b), result_ab))
+ abort ();
+ if (!vec_all_eq (do_vec_cntlzm (source_b, mask_a), result_ba))
+ abort ();
+ if (!vec_all_eq (do_vec_cntlzm (source_b, mask_b), result_bb))
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-cnttzm-0.c b/gcc/testsuite/gcc.target/powerpc/vec-cnttzm-0.c
new file mode 100644
index 00000000000..aac9a6f8113
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-cnttzm-0.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned long long int
+do_vec_cnttzm (vector unsigned long long int source,
+ vector unsigned long long int mask)
+{
+ return vec_cnttzm (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull };
+ vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull };
+
+ vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull };
+ vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull };
+
+ /* See cnttzdm-0.c for derivation of expected results.
+
+ result_aa [0] is compute (source [0], mask [0];
+ result_aa [1] is compute (source [1], mask [1].
+
+ result_ab [0] is compute (source [0], mask [2];
+ result_ab [1] is compute (source [1], mask [3].
+
+ result_ba [0] is compute (source [2], mask [0];
+ result_ba [1] is compute (source [3], mask [1].
+
+ result_bb [0] is compute (source [2], mask [2];
+ result_bb [1] is compute (source [3], mask [3]. */
+
+ vector unsigned long long int result_aa = { 4, 4 };
+ vector unsigned long long int result_ab = { 2, 0 };
+ vector unsigned long long int result_ba = { 0, 0 };
+ vector unsigned long long int result_bb = { 1, 2 };
+
+ if (!vec_all_eq (do_vec_cnttzm (source_a, mask_a), result_aa))
+ abort ();
+ if (!vec_all_eq (do_vec_cnttzm (source_a, mask_b), result_ab))
+ abort ();
+ if (!vec_all_eq (do_vec_cnttzm (source_b, mask_a),result_ba))
+ abort ();
+ if (!vec_all_eq (do_vec_cnttzm (source_b, mask_b), result_bb))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvctzdm\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-cnttzm-1.c b/gcc/testsuite/gcc.target/powerpc/vec-cnttzm-1.c
new file mode 100644
index 00000000000..83bdd954e54
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-cnttzm-1.c
@@ -0,0 +1,53 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned long long int
+do_vec_cnttzm (vector unsigned long long int source,
+ vector unsigned long long int mask)
+{
+ return vec_cnttzm (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull };
+ vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull };
+
+ vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull };
+ vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull };
+
+ /* See cnttzdm-0.c for derivation of expected results.
+
+ result_aa [0] is compute (source [0], mask [0];
+ result_aa [1] is compute (source [1], mask [1].
+
+ result_ab [0] is compute (source [0], mask [2];
+ result_ab [1] is compute (source [1], mask [3].
+
+ result_ba [0] is compute (source [2], mask [0];
+ result_ba [1] is compute (source [3], mask [1].
+
+ result_bb [0] is compute (source [2], mask [2];
+ result_bb [1] is compute (source [3], mask [3]. */
+
+ vector unsigned long long int result_aa = { 4, 4 };
+ vector unsigned long long int result_ab = { 2, 0 };
+ vector unsigned long long int result_ba = { 0, 0 };
+ vector unsigned long long int result_bb = { 1, 2 };
+
+ if (!vec_all_eq (do_vec_cnttzm (source_a, mask_a), result_aa))
+ abort ();
+ if (!vec_all_eq (do_vec_cnttzm (source_a, mask_b), result_ab))
+ abort ();
+ if (!vec_all_eq (do_vec_cnttzm (source_b, mask_a),result_ba))
+ abort ();
+ if (!vec_all_eq (do_vec_cnttzm (source_b, mask_b), result_bb))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extracth-0.c b/gcc/testsuite/gcc.target/powerpc/vec-extracth-0.c
new file mode 100644
index 00000000000..0c911f7d1bb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extracth-0.c
@@ -0,0 +1,33 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned char source_a = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+ vector unsigned char source_b = {
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
+
+ vector unsigned long long int result_1 = { 0, 16 };
+ vector unsigned long long int result_2 = { 0, 15 };
+ vector unsigned long long int result_3 = { 0, 11 };
+ vector unsigned long long int result_4 = { 0, 23 };
+
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 15), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 4), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 24), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextdubvlx\M} { target le } } } */
+/* { dg-final { scan-assembler {\mvextdubvrx\M} { target be } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extracth-1.c b/gcc/testsuite/gcc.target/powerpc/vec-extracth-1.c
new file mode 100644
index 00000000000..13618cef26c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extracth-1.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned char source_a = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+ vector unsigned char source_b = {
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
+
+ vector unsigned long long int result_1 = { 0, 16 };
+ vector unsigned long long int result_2 = { 0, 15 };
+ vector unsigned long long int result_3 = { 0, 11 };
+ vector unsigned long long int result_4 = { 0, 23 };
+
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 15), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 4), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 24), result_4))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extracth-2.c b/gcc/testsuite/gcc.target/powerpc/vec-extracth-2.c
new file mode 100644
index 00000000000..e369c3c316c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extracth-2.c
@@ -0,0 +1,31 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned short source_a = { 0, 2, 4, 6, 8, 10, 12, 14 };
+ vector unsigned short source_b = { 16, 18, 20, 22, 24, 26, 28, 30 };
+
+ vector unsigned long long int result_1 = { 0, 16 };
+ vector unsigned long long int result_2 = { 0, 14 };
+ vector unsigned long long int result_3 = { 0, 6 };
+ vector unsigned long long int result_4 = { 0, 18 };
+
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 14), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 28), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextduhvlx\M} { target le } } } */
+/* { dg-final { scan-assembler {\mvextduhvrx\M} { target be } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extracth-3.c b/gcc/testsuite/gcc.target/powerpc/vec-extracth-3.c
new file mode 100644
index 00000000000..1d8a690979c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extracth-3.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned short source_a = { 0, 2, 4, 6, 8, 10, 12, 14 };
+ vector unsigned short source_b = { 16, 18, 20, 22, 24, 26, 28, 30 };
+
+ vector unsigned long long int result_1 = { 0, 16 };
+ vector unsigned long long int result_2 = { 0, 14 };
+ vector unsigned long long int result_3 = { 0, 6 };
+ vector unsigned long long int result_4 = { 0, 18 };
+
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 14), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 28), result_4))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extracth-4.c b/gcc/testsuite/gcc.target/powerpc/vec-extracth-4.c
new file mode 100644
index 00000000000..f8c8182d4ba
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extracth-4.c
@@ -0,0 +1,31 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned int source_a = { 0, 4, 8, 12 };
+ vector unsigned int source_b = { 16, 20, 24, 28 };
+
+ vector unsigned long long int result_1 = { 0, 16 };
+ vector unsigned long long int result_2 = { 0, 12 };
+ vector unsigned long long int result_3 = { 0, 4 };
+ vector unsigned long long int result_4 = { 0, 16 };
+
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 12), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 28), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextduwvlx\M} { target le } } } */
+/* { dg-final { scan-assembler {\mvextduwvrx\M} { target be } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extracth-5.c b/gcc/testsuite/gcc.target/powerpc/vec-extracth-5.c
new file mode 100644
index 00000000000..17229f40389
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extracth-5.c
@@ -0,0 +1,29 @@
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned int source_a = { 0, 4, 8, 12 };
+ vector unsigned int source_b = { 16, 20, 24, 28 };
+
+ vector unsigned long long int result_1 = { 0, 16 };
+ vector unsigned long long int result_2 = { 0, 12 };
+ vector unsigned long long int result_3 = { 0, 4 };
+ vector unsigned long long int result_4 = { 0, 16 };
+
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 12), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 28), result_4))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extracth-6.c b/gcc/testsuite/gcc.target/powerpc/vec-extracth-6.c
new file mode 100644
index 00000000000..4cbc3f03962
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extracth-6.c
@@ -0,0 +1,31 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned long long source_a = { 0, 14 };
+ vector unsigned long long source_b = { 16, 30 };
+
+ vector unsigned long long int result_1 = { 0, 16 };
+ vector unsigned long long int result_2 = { 0, 14 };
+ vector unsigned long long int result_3 = { 0, 0 };
+ vector unsigned long long int result_4 = { 0, 30 };
+
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 8), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 16), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextddvlx\M} { target le } } } */
+/* { dg-final { scan-assembler {\mvextddvrx\M} { target be } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extracth-7.c b/gcc/testsuite/gcc.target/powerpc/vec-extracth-7.c
new file mode 100644
index 00000000000..64ca22e85e6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extracth-7.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned long long source_a = { 0, 14 };
+ vector unsigned long long source_b = { 16, 30 };
+
+ vector unsigned long long int result_1 = { 0, 16 };
+ vector unsigned long long int result_2 = { 0, 14 };
+ vector unsigned long long int result_3 = { 0, 0 };
+ vector unsigned long long int result_4 = { 0, 30 };
+
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 8), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 16), result_4))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extracth-be-0.c b/gcc/testsuite/gcc.target/powerpc/vec-extracth-be-0.c
new file mode 100644
index 00000000000..0535a741b73
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extracth-be-0.c
@@ -0,0 +1,33 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+/* { dg-additional-options "-mbig" { target powerpc64le-*-* } } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned char source_a = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+ vector unsigned char source_b = {
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
+
+ vector unsigned long long int result_1 = { 0, 16 };
+ vector unsigned long long int result_2 = { 0, 15 };
+ vector unsigned long long int result_3 = { 0, 11 };
+ vector unsigned long long int result_4 = { 0, 23 };
+
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 15), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 4), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 24), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextdubvrx\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extracth-be-1.c b/gcc/testsuite/gcc.target/powerpc/vec-extracth-be-1.c
new file mode 100644
index 00000000000..a97ffdb16b8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extracth-be-1.c
@@ -0,0 +1,31 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+/* { dg-additional-options "-mbig" { target powerpc64le-*-* } } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned short source_a = { 0, 2, 4, 6, 8, 10, 12, 14 };
+ vector unsigned short source_b = { 16, 18, 20, 22, 24, 26, 28, 30 };
+
+ vector unsigned long long int result_1 = { 0, 16 };
+ vector unsigned long long int result_2 = { 0, 14 };
+ vector unsigned long long int result_3 = { 0, 6 };
+ vector unsigned long long int result_4 = { 0, 18 };
+
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 14), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 28), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextduhvrx\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extracth-be-2.c b/gcc/testsuite/gcc.target/powerpc/vec-extracth-be-2.c
new file mode 100644
index 00000000000..26c77fe4b7e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extracth-be-2.c
@@ -0,0 +1,31 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+/* { dg-additional-options "-mbig" { target powerpc64le-*-* } } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned int source_a = { 0, 4, 8, 12 };
+ vector unsigned int source_b = { 16, 20, 24, 28 };
+
+ vector unsigned long long int result_1 = { 0, 16 };
+ vector unsigned long long int result_2 = { 0, 12 };
+ vector unsigned long long int result_3 = { 0, 4 };
+ vector unsigned long long int result_4 = { 0, 16 };
+
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 12), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 28), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextduwvrx\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extracth-be-3.c b/gcc/testsuite/gcc.target/powerpc/vec-extracth-be-3.c
new file mode 100644
index 00000000000..0e94bf04c95
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extracth-be-3.c
@@ -0,0 +1,31 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+/* { dg-additional-options "-mbig" { target powerpc64le-*-* } } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned long long source_a = { 0, 14 };
+ vector unsigned long long source_b = { 16, 30 };
+
+ vector unsigned long long int result_1 = { 0, 16 };
+ vector unsigned long long int result_2 = { 0, 14 };
+ vector unsigned long long int result_3 = { 0, 0 };
+ vector unsigned long long int result_4 = { 0, 30 };
+
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 8), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extracth (source_b, source_a, 16), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextddvrx\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extractl-0.c b/gcc/testsuite/gcc.target/powerpc/vec-extractl-0.c
new file mode 100644
index 00000000000..95567bcb007
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extractl-0.c
@@ -0,0 +1,33 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned char source_a = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+ vector unsigned char source_b = {
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
+
+ vector unsigned long long int result_1 = { 0, 15 };
+ vector unsigned long long int result_2 = { 0, 16 };
+ vector unsigned long long int result_3 = { 0, 20 };
+ vector unsigned long long int result_4 = { 0, 8 };
+
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 15), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 4), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 24), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextdubvrx\M} { target le } } } */
+/* { dg-final { scan-assembler {\mvextdubvlx\M} { target be } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extractl-1.c b/gcc/testsuite/gcc.target/powerpc/vec-extractl-1.c
new file mode 100644
index 00000000000..879c253d416
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extractl-1.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned char source_a = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+ vector unsigned char source_b = {
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
+
+ vector unsigned long long int result_1 = { 0, 15 };
+ vector unsigned long long int result_2 = { 0, 16 };
+ vector unsigned long long int result_3 = { 0, 20 };
+ vector unsigned long long int result_4 = { 0, 8 };
+
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 15), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 4), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 24), result_4))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extractl-2.c b/gcc/testsuite/gcc.target/powerpc/vec-extractl-2.c
new file mode 100644
index 00000000000..e024f522fe1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extractl-2.c
@@ -0,0 +1,31 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned short source_a = { 0, 2, 4, 6, 8, 10, 12, 14 };
+ vector unsigned short source_b = { 16, 18, 20, 22, 24, 26, 28, 30 };
+
+ vector unsigned long long int result_1 = { 0, 14 };
+ vector unsigned long long int result_2 = { 0, 16 };
+ vector unsigned long long int result_3 = { 0, 24 };
+ vector unsigned long long int result_4 = { 0, 12 };
+
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 14), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 28), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextduhvrx\M} { target le } } } */
+/* { dg-final { scan-assembler {\mvextduhvlx\M} { target be } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extractl-3.c b/gcc/testsuite/gcc.target/powerpc/vec-extractl-3.c
new file mode 100644
index 00000000000..b3ab43326b3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extractl-3.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned short source_a = { 0, 2, 4, 6, 8, 10, 12, 14 };
+ vector unsigned short source_b = { 16, 18, 20, 22, 24, 26, 28, 30 };
+
+ vector unsigned long long int result_1 = { 0, 14 };
+ vector unsigned long long int result_2 = { 0, 16 };
+ vector unsigned long long int result_3 = { 0, 24 };
+ vector unsigned long long int result_4 = { 0, 12 };
+
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 14), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 28), result_4))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extractl-4.c b/gcc/testsuite/gcc.target/powerpc/vec-extractl-4.c
new file mode 100644
index 00000000000..6cbeab32166
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extractl-4.c
@@ -0,0 +1,31 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned int source_a = { 0, 4, 8, 12 };
+ vector unsigned int source_b = { 16, 20, 24, 28 };
+
+ vector unsigned long long int result_1 = { 0, 12 };
+ vector unsigned long long int result_2 = { 0, 16 };
+ vector unsigned long long int result_3 = { 0, 24 };
+ vector unsigned long long int result_4 = { 0, 4 };
+
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 12), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 20), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextduwvrx\M} { target le } } } */
+/* { dg-final { scan-assembler {\mvextduwvlx\M} { target be } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extractl-5.c b/gcc/testsuite/gcc.target/powerpc/vec-extractl-5.c
new file mode 100644
index 00000000000..df239e83e1c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extractl-5.c
@@ -0,0 +1,29 @@
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned int source_a = { 0, 4, 8, 12 };
+ vector unsigned int source_b = { 16, 20, 24, 28 };
+
+ vector unsigned long long int result_1 = { 0, 12 };
+ vector unsigned long long int result_2 = { 0, 16 };
+ vector unsigned long long int result_3 = { 0, 24 };
+ vector unsigned long long int result_4 = { 0, 4 };
+
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 12), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 20), result_4))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extractl-6.c b/gcc/testsuite/gcc.target/powerpc/vec-extractl-6.c
new file mode 100644
index 00000000000..f4b8b627a5f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extractl-6.c
@@ -0,0 +1,31 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned long long source_a = { 0, 14 };
+ vector unsigned long long source_b = { 16, 30 };
+
+ vector unsigned long long int result_1 = { 0, 14 };
+ vector unsigned long long int result_2 = { 0, 16 };
+ vector unsigned long long int result_3 = { 0, 30 };
+ vector unsigned long long int result_4 = { 0, 0 };
+
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 8), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 16), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextddvrx\M} { target le } } } */
+/* { dg-final { scan-assembler {\mvextddvlx\M} { target be } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extractl-7.c b/gcc/testsuite/gcc.target/powerpc/vec-extractl-7.c
new file mode 100644
index 00000000000..fd1ab604f45
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extractl-7.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned long long source_a = { 0, 14 };
+ vector unsigned long long source_b = { 16, 30 };
+
+ vector unsigned long long int result_1 = { 0, 14 };
+ vector unsigned long long int result_2 = { 0, 16 };
+ vector unsigned long long int result_3 = { 0, 30 };
+ vector unsigned long long int result_4 = { 0, 0 };
+
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 8), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 16), result_4))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extractl-be-0.c b/gcc/testsuite/gcc.target/powerpc/vec-extractl-be-0.c
new file mode 100644
index 00000000000..1ee1d0ef9d7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extractl-be-0.c
@@ -0,0 +1,33 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+/* { dg-additional-options "-mbig" { target powerpc64le-*-* } } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned char source_a = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+ vector unsigned char source_b = {
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
+
+ vector unsigned long long int result_1 = { 0, 15 };
+ vector unsigned long long int result_2 = { 0, 16 };
+ vector unsigned long long int result_3 = { 0, 20 };
+ vector unsigned long long int result_4 = { 0, 8 };
+
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 15), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 4), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 24), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextdubvlx\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extractl-be-1.c b/gcc/testsuite/gcc.target/powerpc/vec-extractl-be-1.c
new file mode 100644
index 00000000000..e0cf29e5757
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extractl-be-1.c
@@ -0,0 +1,31 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+/* { dg-additional-options "-mbig" { target powerpc64le-*-* } } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned short source_a = { 0, 2, 4, 6, 8, 10, 12, 14 };
+ vector unsigned short source_b = { 16, 18, 20, 22, 24, 26, 28, 30 };
+
+ vector unsigned long long int result_1 = { 0, 14 };
+ vector unsigned long long int result_2 = { 0, 16 };
+ vector unsigned long long int result_3 = { 0, 24 };
+ vector unsigned long long int result_4 = { 0, 12 };
+
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 14), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 28), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextduhvlx\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extractl-be-2.c b/gcc/testsuite/gcc.target/powerpc/vec-extractl-be-2.c
new file mode 100644
index 00000000000..e1f0e7d8c92
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extractl-be-2.c
@@ -0,0 +1,31 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+/* { dg-additional-options "-mbig" { target powerpc64le-*-* } } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned int source_a = { 0, 4, 8, 12 };
+ vector unsigned int source_b = { 16, 20, 24, 28 };
+
+ vector unsigned long long int result_1 = { 0, 12 };
+ vector unsigned long long int result_2 = { 0, 16 };
+ vector unsigned long long int result_3 = { 0, 24 };
+ vector unsigned long long int result_4 = { 0, 4 };
+
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 12), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 20), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextduwvlx\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-extractl-be-3.c b/gcc/testsuite/gcc.target/powerpc/vec-extractl-be-3.c
new file mode 100644
index 00000000000..842ea5c4207
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-extractl-be-3.c
@@ -0,0 +1,31 @@
+/* { dg-options "-mdejagnu-cpu=power10" } */
+/* { dg-additional-options "-mbig" { target powerpc64le-*-* } } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned long long source_a = { 0, 14 };
+ vector unsigned long long source_b = { 16, 30 };
+
+ vector unsigned long long int result_1 = { 0, 14 };
+ vector unsigned long long int result_2 = { 0, 16 };
+ vector unsigned long long int result_3 = { 0, 30 };
+ vector unsigned long long int result_4 = { 0, 0 };
+
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 8), result_1))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_a, source_b, 16), result_2))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 8), result_3))
+ abort ();
+ if (!vec_all_eq (vec_extractl (source_b, source_a, 16), result_4))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvextddvlx\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-gnb-0.c b/gcc/testsuite/gcc.target/powerpc/vec-gnb-0.c
new file mode 100644
index 00000000000..324dd77fb20
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-gnb-0.c
@@ -0,0 +1,74 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int128 } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+unsigned long long int
+do_vec_gnb (vector unsigned __int128 source, int stride)
+{
+ switch (stride)
+ {
+ case 2:
+ return vec_gnb (source, 2);
+ case 3:
+ return vec_gnb (source, 3);
+ case 4:
+ return vec_gnb (source, 4);
+ case 5:
+ return vec_gnb (source, 5);
+ case 6:
+ return vec_gnb (source, 6);
+ case 7:
+ return vec_gnb (source, 7);
+
+ default:
+ /* Illegal value of stride */
+ abort ();
+ return 0;
+ }
+}
+
+int
+main (int argc, char *argv [])
+{
+ /* For result = 0xaaaa_0000_0000_0000, use:
+ stride = 2: binary 1x0x_1x0x_1x0x_... = 0x8888_8888_0000_0000, 0
+ stride = 4: binary 1xxx_0xxx_1xxx_0xxxx = 0x8080_8080_8080_8080, 0
+
+ For result = 0xaaaa_aaaa_0000_0000, use:
+ stride = 2: source = 0x8888_8888_8888_8888, 0x0 }
+ stride = 4: source = { 0x8080_8080_8080_8080, 0x8080_8080_8080_8080 }
+ */
+
+ /* The last array element appears in the left-most (first) bit
+ positions of the vector register. */
+ vector unsigned __int128 source_a =
+ { ((unsigned __int128) 0x8888888800000000ull) << 64 };
+ vector unsigned __int128 source_b =
+ { ((unsigned __int128) 0x8080808080808080ull) << 64 };
+ vector unsigned __int128 source_c =
+ { ((unsigned __int128) 0x8888888888888888ull) << 64 };
+ vector unsigned __int128 source_d =
+ { 0x8080808080808080ull |
+ ((unsigned __int128) 0x8080808080808080ull) << 64 };
+
+ unsigned long long int results [] =
+ { 0xaaaa000000000000ull, 0xaaaa000000000000ull,
+ 0xaaaaaaaa00000000ull, 0xaaaaaaaa00000000ull };
+
+ if (do_vec_gnb (source_a, 2) != results [0])
+ abort ();
+ if (do_vec_gnb (source_b, 4) != results [1])
+ abort ();
+ if (do_vec_gnb (source_c, 2) != results [2])
+ abort ();
+ if (do_vec_gnb (source_d, 4) != results [3])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvgnb\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-gnb-1.c b/gcc/testsuite/gcc.target/powerpc/vec-gnb-1.c
new file mode 100644
index 00000000000..527cc3fb06c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-gnb-1.c
@@ -0,0 +1,73 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-require-effective-target int128 } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+unsigned long long int
+do_vec_gnb (vector unsigned __int128 source, int stride)
+{
+ switch (stride)
+ {
+ case 2:
+ return vec_gnb (source, 2);
+ case 3:
+ return vec_gnb (source, 3);
+ case 4:
+ return vec_gnb (source, 4);
+ case 5:
+ return vec_gnb (source, 5);
+ case 6:
+ return vec_gnb (source, 6);
+ case 7:
+ return vec_gnb (source, 7);
+
+ default:
+ /* Illegal value of stride */
+ abort ();
+ return 0;
+ }
+}
+
+int
+main (int argc, char *argv [])
+{
+ /* For result = 0xaaaa_0000_0000_0000, use:
+ stride = 2: binary 1x0x_1x0x_1x0x_... = 0x8888_8888_0000_0000, 0
+ stride = 4: binary 1xxx_0xxx_1xxx_0xxxx = 0x8080_8080_8080_8080, 0
+
+ For result = 0xaaaa_aaaa_0000_0000, use:
+ stride = 2: source = 0x8888_8888_8888_8888, 0x0 }
+ stride = 4: source = { 0x8080_8080_8080_8080, 0x8080_8080_8080_8080 }
+ */
+
+ /* The last array element appears in the left-most (first) bit
+ positions of the vector register. */
+ vector unsigned __int128 source_a =
+ { ((unsigned __int128) 0x8888888800000000ull) << 64 };
+ vector unsigned __int128 source_b =
+ { ((unsigned __int128) 0x8080808080808080ull) << 64 };
+ vector unsigned __int128 source_c =
+ { ((unsigned __int128) 0x8888888888888888ull) << 64 };
+ vector unsigned __int128 source_d =
+ { 0x8080808080808080ull |
+ ((unsigned __int128) 0x8080808080808080ull) << 64 };
+
+ unsigned long long int results [] =
+ { 0xaaaa000000000000ull, 0xaaaa000000000000ull,
+ 0xaaaaaaaa00000000ull, 0xaaaaaaaa00000000ull };
+
+ if (do_vec_gnb (source_a, 2) != results [0])
+ abort ();
+ if (do_vec_gnb (source_b, 4) != results [1])
+ abort ();
+ if (do_vec_gnb (source_c, 2) != results [2])
+ abort ();
+ if (do_vec_gnb (source_d, 4) != results [3])
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-gnb-2.c b/gcc/testsuite/gcc.target/powerpc/vec-gnb-2.c
new file mode 100644
index 00000000000..895bb953b37
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-gnb-2.c
@@ -0,0 +1,73 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int128 } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+unsigned long long int
+do_vec_gnb (vector unsigned __int128 source, int stride)
+{
+ switch (stride)
+ {
+ case 2:
+ return vec_gnb (source, 0); /* { dg-error "between 2 and 7" } */
+ case 3:
+ return vec_gnb (source, -1); /* { dg-error "between 2 and 7" } */
+ case 4:
+ return vec_gnb (source, 8); /* { dg-error "between 2 and 7" } */
+ case 5:
+ return vec_gnb (source, 1); /* { dg-error "between 2 and 7" } */
+ case 6:
+ return vec_gnb (source, stride); /* { dg-error "unsigned literal" } */
+ case 7:
+ return vec_gnb (source, 7);
+
+ default:
+ /* Illegal value of stride */
+ abort ();
+ return 0;
+ }
+}
+
+int
+main (int argc, char *argv [])
+{
+ /* For result = 0xaaaa_0000_0000_0000, use:
+ stride = 2: binary 1x0x_1x0x_1x0x_... = 0x8888_8888_0000_0000, 0
+ stride = 4: binary 1xxx_0xxx_1xxx_0xxxx = 0x8080_8080_8080_8080, 0
+
+ For result = 0xaaaa_aaaa_0000_0000, use:
+ stride = 2: source = 0x8888_8888_8888_8888, 0x0 }
+ stride = 4: source = { 0x8080_8080_8080_8080, 0x8080_8080_8080_8080 }
+ */
+
+ /* The last array element appears in the left-most (first) bit
+ positions of the vector register. */
+ vector unsigned __int128 source_a =
+ { ((unsigned __int128) 0x8888888800000000ull) << 64 };
+ vector unsigned __int128 source_b =
+ { ((unsigned __int128) 0x8080808080808080ull) << 64 };
+ vector unsigned __int128 source_c =
+ { ((unsigned __int128) 0x8888888888888888ull) << 64 };
+ vector unsigned __int128 source_d =
+ { 0x8080808080808080ull |
+ ((unsigned __int128) 0x8080808080808080ull) << 64 };
+
+ unsigned long long int results [] =
+ { 0xaaaa000000000000ull, 0xaaaa000000000000ull,
+ 0xaaaaaaaa00000000ull, 0xaaaaaaaa00000000ull };
+
+ if (do_vec_gnb (source_a, 2) != results [0])
+ abort ();
+ if (do_vec_gnb (source_b, 4) != results [1])
+ abort ();
+ if (do_vec_gnb (source_c, 2) != results [2])
+ abort ();
+ if (do_vec_gnb (source_d, 4) != results [3])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-insert-word-runnable.c b/gcc/testsuite/gcc.target/powerpc/vec-insert-word-runnable.c
new file mode 100644
index 00000000000..8c2721aedfc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-insert-word-runnable.c
@@ -0,0 +1,345 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+#include <altivec.h>
+
+#define DEBUG 0
+
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ int i;
+ unsigned int index;
+ vector unsigned char vresult_ch;
+ vector unsigned char expected_vresult_ch;
+ vector unsigned char src_va_ch;
+ vector unsigned char src_vb_ch;
+ unsigned char src_a_ch;
+
+ vector unsigned short vresult_sh;
+ vector unsigned short expected_vresult_sh;
+ vector unsigned short src_va_sh;
+ vector unsigned short src_vb_sh;
+ unsigned short int src_a_sh;
+
+ vector unsigned int vresult_int;
+ vector unsigned int expected_vresult_int;
+ vector unsigned int src_va_int;
+ vector unsigned int src_vb_int;
+ unsigned int src_a_int;
+
+ vector unsigned long long vresult_ll;
+ vector unsigned long long expected_vresult_ll;
+ vector unsigned long long src_va_ll;
+ unsigned long long int src_a_ll;
+
+ /* Vector insert, low index, from GPR */
+ src_a_ch = 79;
+ index = 2;
+ src_va_ch = (vector unsigned char) { 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15 };
+ vresult_ch = (vector unsigned char) { 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_ch = (vector unsigned char) { 0, 1, 79, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15 };
+
+ vresult_ch = vec_insertl (src_a_ch, src_va_ch, index);
+
+ if (!vec_all_eq (vresult_ch, expected_vresult_ch)) {
+#if DEBUG
+ printf("ERROR, vec_insertl (src_a_ch, src_va_ch, index)\n");
+ for(i = 0; i < 16; i++)
+ printf(" vresult_ch[%d] = %d, expected_vresult_ch[%d] = %d\n",
+ i, vresult_ch[i], i, expected_vresult_ch[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_a_sh = 79;
+ index = 10;
+ src_va_sh = (vector unsigned short int) { 0, 1, 2, 3, 4, 5, 6, 7 };
+ vresult_sh = (vector unsigned short int) { 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_sh = (vector unsigned short int) { 0, 1, 2, 3,
+ 4, 79, 6, 7 };
+
+ vresult_sh = vec_insertl (src_a_sh, src_va_sh, index);
+
+ if (!vec_all_eq (vresult_sh, expected_vresult_sh)) {
+#if DEBUG
+ printf("ERROR, vec_insertl (src_a_sh, src_va_sh, index)\n");
+ for(i = 0; i < 8; i++)
+ printf(" vresult_sh[%d] = %d, expected_vresult_sh[%d] = %d\n",
+ i, vresult_sh[i], i, expected_vresult_sh[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_a_int = 79;
+ index = 8;
+ src_va_int = (vector unsigned int) { 0, 1, 2, 3 };
+ vresult_int = (vector unsigned int) { 0, 0, 0, 0 };
+ expected_vresult_int = (vector unsigned int) { 0, 1, 79, 3 };
+
+ vresult_int = vec_insertl (src_a_int, src_va_int, index);
+
+ if (!vec_all_eq (vresult_int, expected_vresult_int)) {
+#if DEBUG
+ printf("ERROR, vec_insertl (src_a_int, src_va_int, index)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_int[%d] = %d, expected_vresult_int[%d] = %d\n",
+ i, vresult_int[i], i, expected_vresult_int[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_a_ll = 79;
+ index = 8;
+ src_va_ll = (vector unsigned long long) { 0, 1 };
+ vresult_ll = (vector unsigned long long) { 0, 0 };
+ expected_vresult_ll = (vector unsigned long long) { 0, 79 };
+
+ vresult_ll = vec_insertl (src_a_ll, src_va_ll, index);
+
+ if (!vec_all_eq (vresult_ll, expected_vresult_ll)) {
+#if DEBUG
+ printf("ERROR, vec_insertl (src_a_ll, src_va_ll, index)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_ll[%d] = %d, expected_vresult_ll[%d] = %d\n",
+ i, vresult_ll[i], i, expected_vresult_ll[i]);
+#else
+ abort();
+#endif
+ }
+
+ /* Vector insert, low index, from vector */
+ index = 2;
+ src_va_ch = (vector unsigned char) { 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15 };
+ src_vb_ch = (vector unsigned char) { 10, 11, 12, 13, 14, 15, 16, 17,
+ 18, 19, 20, 21, 22, 23, 24, 25 };
+ vresult_ch = (vector unsigned char) { 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_ch = (vector unsigned char) { 0, 1, 18, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15 };
+
+ vresult_ch = vec_insertl (src_vb_ch, src_va_ch, index);
+
+ if (!vec_all_eq (vresult_ch, expected_vresult_ch)) {
+#if DEBUG
+ printf("ERROR, vec_insertl (src_vb_ch, src_va_ch, index)\n");
+ for(i = 0; i < 16; i++)
+ printf(" vresult_ch[%d] = %d, expected_vresult_ch[%d] = %d\n",
+ i, vresult_ch[i], i, expected_vresult_ch[i]);
+#else
+ abort();
+#endif
+ }
+
+ index = 4;
+ src_va_sh = (vector unsigned short) { 0, 1, 2, 3, 4, 5, 6, 7 };
+ src_vb_sh = (vector unsigned short) { 10, 11, 12, 13, 14, 15, 16, 17 };
+ vresult_sh = (vector unsigned short) { 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_sh = (vector unsigned short) { 0, 1, 14, 3, 4, 5, 6, 7 };
+
+ vresult_sh = vec_insertl (src_vb_sh, src_va_sh, index);
+
+ if (!vec_all_eq (vresult_sh, expected_vresult_sh)) {
+#if DEBUG
+ printf("ERROR, vec_insertl (src_vb_sh, src_va_sh, index)\n");
+ for(i = 0; i < 8; i++)
+ printf(" vresult_sh[%d] = %d, expected_vresult_sh[%d] = %d\n",
+ i, vresult_sh[i], i, expected_vresult_sh[i]);
+#else
+ abort();
+#endif
+ }
+
+ index = 8;
+ src_va_int = (vector unsigned int) { 0, 1, 2, 3 };
+ src_vb_int = (vector unsigned int) { 10, 11, 12, 13 };
+ vresult_int = (vector unsigned int) { 0, 0, 0, 0 };
+ expected_vresult_int = (vector unsigned int) { 0, 1, 12, 3 };
+
+ vresult_int = vec_insertl (src_vb_int, src_va_int, index);
+
+ if (!vec_all_eq (vresult_int, expected_vresult_int)) {
+#if DEBUG
+ printf("ERROR, vec_insertl (src_vb_int, src_va_int, index)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_int[%d] = %d, expected_vresult_int[%d] = %d\n",
+ i, vresult_int[i], i, expected_vresult_int[i]);
+#else
+ abort();
+#endif
+ }
+
+ /* Vector insert, high index, from GPR */
+ src_a_ch = 79;
+ index = 2;
+ src_va_ch = (vector unsigned char) { 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15 };
+ vresult_ch = (vector unsigned char) { 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_ch = (vector unsigned char) { 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 79, 14, 15 };
+
+ vresult_ch = vec_inserth (src_a_ch, src_va_ch, index);
+
+ if (!vec_all_eq (vresult_ch, expected_vresult_ch)) {
+#if DEBUG
+ printf("ERROR, vec_inserth (src_a_ch, src_va_ch, index)\n");
+ for(i = 0; i < 16; i++)
+ printf(" vresult_ch[%d] = %d, expected_vresult_ch[%d] = %d\n",
+ i, vresult_ch[i], i, expected_vresult_ch[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_a_sh = 79;
+ index = 10;
+ src_va_sh = (vector unsigned short int) { 0, 1, 2, 3, 4, 5, 6, 7 };
+ vresult_sh = (vector unsigned short int) { 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_sh = (vector unsigned short int) { 0, 1, 79, 3,
+ 4, 5, 6, 7 };
+
+ vresult_sh = vec_inserth (src_a_sh, src_va_sh, index);
+
+ if (!vec_all_eq (vresult_sh, expected_vresult_sh)) {
+#if DEBUG
+ printf("ERROR, vec_inserth (src_a_sh, src_va_sh, index)\n");
+ for(i = 0; i < 8; i++)
+ printf(" vresult_sh[%d] = %d, expected_vresult_sh[%d] = %d\n",
+ i, vresult_sh[i], i, expected_vresult_sh[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_a_int = 79;
+ index = 8;
+ src_va_int = (vector unsigned int) { 0, 1, 2, 3 };
+ vresult_int = (vector unsigned int) { 0, 0, 0, 0 };
+ expected_vresult_int = (vector unsigned int) { 0, 79, 2, 3 };
+
+ vresult_int = vec_inserth (src_a_int, src_va_int, index);
+
+ if (!vec_all_eq (vresult_int, expected_vresult_int)) {
+#if DEBUG
+ printf("ERROR, vec_inserth (src_a_int, src_va_int, index)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_int[%d] = %d, expected_vresult_int[%d] = %d\n",
+ i, vresult_int[i], i, expected_vresult_int[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_a_ll = 79;
+ index = 8;
+ src_va_ll = (vector unsigned long long) { 0, 1 };
+ vresult_ll = (vector unsigned long long) { 0, 0 };
+ expected_vresult_ll = (vector unsigned long long) { 79, 1 };
+
+ vresult_ll = vec_inserth (src_a_ll, src_va_ll, index);
+
+ if (!vec_all_eq (vresult_ll, expected_vresult_ll)) {
+#if DEBUG
+ printf("ERROR, vec_inserth (src_a_ll, src_va_ll, index)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_ll[%d] = %d, expected_vresult_ll[%d] = %d\n",
+ i, vresult_ll[i], i, expected_vresult_ll[i]);
+#else
+ abort();
+#endif
+ }
+
+ /* Vector insert, left index, from vector */
+ index = 2;
+ src_va_ch = (vector unsigned char) { 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15 };
+ src_vb_ch = (vector unsigned char) { 10, 11, 12, 13, 14, 15, 16, 17,
+ 18, 19, 20, 21, 22, 23, 24, 25 };
+ vresult_ch = (vector unsigned char) { 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_ch = (vector unsigned char) { 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 18, 14, 15 };
+
+ vresult_ch = vec_inserth (src_vb_ch, src_va_ch, index);
+
+ if (!vec_all_eq (vresult_ch, expected_vresult_ch)) {
+#if DEBUG
+ printf("ERROR, vec_inserth (src_vb_ch, src_va_ch, index)\n");
+ for(i = 0; i < 16; i++)
+ printf(" vresult_ch[%d] = %d, expected_vresult_ch[%d] = %d\n",
+ i, vresult_ch[i], i, expected_vresult_ch[i]);
+#else
+ abort();
+#endif
+ }
+
+ index = 4;
+ src_va_sh = (vector unsigned short) { 0, 1, 2, 3, 4, 5, 6, 7 };
+ src_vb_sh = (vector unsigned short) { 10, 11, 12, 13, 14, 15, 16, 17 };
+ vresult_sh = (vector unsigned short) { 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_sh = (vector unsigned short) { 0, 1, 2, 3, 4, 14, 6, 7 };
+
+ vresult_sh = vec_inserth (src_vb_sh, src_va_sh, index);
+
+ if (!vec_all_eq (vresult_sh, expected_vresult_sh)) {
+#if DEBUG
+ printf("ERROR, vec_inserth (src_vb_sh, src_va_sh, index)\n");
+ for(i = 0; i < 8; i++)
+ printf(" vresult_sh[%d] = %d, expected_vresult_sh[%d] = %d\n",
+ i, vresult_sh[i], i, expected_vresult_sh[i]);
+#else
+ abort();
+#endif
+ }
+
+ index = 8;
+ src_va_int = (vector unsigned int) { 0, 1, 2, 3 };
+ src_vb_int = (vector unsigned int) { 10, 11, 12, 13 };
+ vresult_int = (vector unsigned int) { 0, 0, 0, 0 };
+ expected_vresult_int = (vector unsigned int) { 0, 12, 2, 3 };
+
+ vresult_int = vec_inserth (src_vb_int, src_va_int, index);
+
+ if (!vec_all_eq (vresult_int, expected_vresult_int)) {
+#if DEBUG
+ printf("ERROR, vec_inserth (src_vb_int, src_va_int, index)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_int[%d] = %d, expected_vresult_int[%d] = %d\n",
+ i, vresult_int[i], i, expected_vresult_int[i]);
+#else
+ abort();
+#endif
+ }
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvinsblx\M} } } */
+/* { dg-final { scan-assembler {\mvinshlx\M} } } */
+/* { dg-final { scan-assembler {\mvinswlx\M} } } */
+/* { dg-final { scan-assembler {\mvinsdlx\M} } } */
+/* { dg-final { scan-assembler {\mvinsbvlx\M} } } */
+/* { dg-final { scan-assembler {\mvinshvlx\M} } } */
+/* { dg-final { scan-assembler {\mvinswvlx\M} } } */
+
+/* { dg-final { scan-assembler {\mvinsbrx\M} } } */
+/* { dg-final { scan-assembler {\mvinshrx\M} } } */
+/* { dg-final { scan-assembler {\mvinswrx\M} } } */
+/* { dg-final { scan-assembler {\mvinsdrx\M} } } */
+/* { dg-final { scan-assembler {\mvinsbvrx\M} } } */
+/* { dg-final { scan-assembler {\mvinshvrx\M} } } */
+/* { dg-final { scan-assembler {\mvinswvrx\M} } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-mult-char-2.c b/gcc/testsuite/gcc.target/powerpc/vec-mult-char-2.c
index 04c67109bef..dcfa270a1ee 100644
--- a/gcc/testsuite/gcc.target/powerpc/vec-mult-char-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/vec-mult-char-2.c
@@ -18,4 +18,4 @@ vector signed char vmulsi(vector signed char v,
/* { dg-final { scan-assembler-times "vmulesb" 2 } } */
/* { dg-final { scan-assembler-times "vmulosb" 2 } } */
-/* { dg-final { scan-assembler-times "vperm" 2 } } */
+/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-pdep-0.c b/gcc/testsuite/gcc.target/powerpc/vec-pdep-0.c
new file mode 100644
index 00000000000..b7c1c25d53c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-pdep-0.c
@@ -0,0 +1,61 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned long long int
+do_vec_pdep (vector unsigned long long int source,
+ vector unsigned long long int mask) {
+ return vec_pdep (source, mask);
+}
+
+int
+vectors_equal (vector unsigned long long int a,
+ vector unsigned long long int b)
+{
+ return (a[0] == b[0]) && (a[1] == b[1]);
+}
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull };
+ vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull };
+
+ vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull };
+ vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull };
+
+ /* See pdepd-0.c for derivation of expected results.
+
+ result_aa [0] is compute (source [0], mask [0];
+ result_aa [1] is compute (source [1], mask [1].
+
+ result_ab [0] is compute (source [0], mask [2];
+ result_ab [1] is compute (source [1], mask [3].
+
+ result_ba [0] is compute (source [2], mask [0];
+ result_ba [1] is compute (source [3], mask [1].
+
+ result_bb [0] is compute (source [2], mask [2];
+ result_bb [1] is compute (source [3], mask [3]. */
+
+ vector unsigned long long int result_aa = { 0x7e3c0000ull, 0x0000a5f0ull };
+ vector unsigned long long int result_ab = { 0x070e030cull, 0xa050f000ull };
+ vector unsigned long long int result_ba = { 0xf07e0000ull, 0x0000e7c3ull };
+ vector unsigned long long int result_bb = { 0x0f00070eull, 0xe070c030ull };
+
+ if (!vec_all_eq (do_vec_pdep (source_a, mask_a), result_aa))
+ abort ();
+ if (!vec_all_eq (do_vec_pdep (source_a, mask_b), result_ab))
+ abort ();
+ if (!vec_all_eq (do_vec_pdep (source_b, mask_a), result_ba))
+ abort ();
+ if (!vec_all_eq (do_vec_pdep (source_b, mask_b), result_bb))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvpdepd\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-pdep-1.c b/gcc/testsuite/gcc.target/powerpc/vec-pdep-1.c
new file mode 100644
index 00000000000..02404a6d316
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-pdep-1.c
@@ -0,0 +1,53 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned long long int
+do_vec_pdep (vector unsigned long long int source,
+ vector unsigned long long int mask) {
+ return vec_pdep (source, mask);
+}
+
+int
+main (int argc, char *argv [])
+{
+ vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull };
+ vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull };
+
+ vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull };
+ vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull };
+
+ /* See pdepd-0.c for derivation of expected results.
+
+ result_aa [0] is compute (source [0], mask [0];
+ result_aa [1] is compute (source [1], mask [1].
+
+ result_ab [0] is compute (source [0], mask [2];
+ result_ab [1] is compute (source [1], mask [3].
+
+ result_ba [0] is compute (source [2], mask [0];
+ result_ba [1] is compute (source [3], mask [1].
+
+ result_bb [0] is compute (source [2], mask [2];
+ result_bb [1] is compute (source [3], mask [3]. */
+
+ vector unsigned long long int result_aa = { 0x7e3c0000ull, 0x0000a5f0ull };
+ vector unsigned long long int result_ab = { 0x070e030cull, 0xa050f000ull };
+ vector unsigned long long int result_ba = { 0xf07e0000ull, 0x0000e7c3ull };
+ vector unsigned long long int result_bb = { 0x0f00070eull, 0xe070c030ull };
+
+ if (!vec_all_eq (do_vec_pdep (source_a, mask_a), result_aa))
+ abort ();
+ if (!vec_all_eq (do_vec_pdep (source_a, mask_b), result_ab))
+ abort ();
+ if (!vec_all_eq (do_vec_pdep (source_b, mask_a), result_ba))
+ abort ();
+ if (!vec_all_eq (do_vec_pdep (source_b, mask_b), result_bb))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-permute-ext-runnable.c b/gcc/testsuite/gcc.target/powerpc/vec-permute-ext-runnable.c
new file mode 100644
index 00000000000..c2dcd48b4c5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-permute-ext-runnable.c
@@ -0,0 +1,294 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+#include <altivec.h>
+
+#define DEBUG 0
+
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ int i;
+ vector signed char vsrc_a_char, vsrc_b_char;
+ vector signed char vresult_char;
+ vector signed char expected_vresult_char;
+
+ vector unsigned char vsrc_a_uchar, vsrc_b_uchar, vsrc_c_uchar;
+ vector unsigned char vresult_uchar;
+ vector unsigned char expected_vresult_uchar;
+
+ vector signed short vsrc_a_short, vsrc_b_short, vsrc_c_short;
+ vector signed short vresult_short;
+ vector signed short expected_vresult_short;
+
+ vector unsigned short vsrc_a_ushort, vsrc_b_ushort, vsrc_c_ushort;
+ vector unsigned short vresult_ushort;
+ vector unsigned short expected_vresult_ushort;
+
+ vector int vsrc_a_int, vsrc_b_int, vsrc_c_int;
+ vector int vresult_int;
+ vector int expected_vresult_int;
+
+ vector unsigned int vsrc_a_uint, vsrc_b_uint, vsrc_c_uint;
+ vector unsigned int vresult_uint;
+ vector unsigned int expected_vresult_uint;
+
+ vector long long int vsrc_a_ll, vsrc_b_ll, vsrc_c_ll;
+ vector long long int vresult_ll;
+ vector long long int expected_vresult_ll;
+
+ vector unsigned long long int vsrc_a_ull, vsrc_b_ull, vsrc_c_ull;
+ vector unsigned long long int vresult_ull;
+ vector unsigned long long int expected_vresult_ull;
+
+ vector float vresult_f;
+ vector float expected_vresult_f;
+ vector float vsrc_a_f, vsrc_b_f;
+
+ vector double vsrc_a_d, vsrc_b_d;
+ vector double vresult_d;
+ vector double expected_vresult_d;
+
+ /* Vector permx */
+ vsrc_a_char = (vector signed char) { -1, 3, 5, 7, 9, 11, 13, 15,
+ 17, 19, 21, 23, 25, 27, 29 };
+ vsrc_b_char = (vector signed char) { 2, -4, 6, 8, 10, 12, 14, 16,
+ 18, 20, 22, 24, 26, 28, 30, 32 };
+ vsrc_c_uchar = (vector unsigned char) { 0x0, 0x7, 0, 0x5, 0, 0x3, 0, 0x1,
+ 0, 0x2, 0, 0x4, 0, 0x6, 0, 0x0 };
+ vresult_char = (vector signed char) { 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_char = (vector signed char) { -1, 15, -1, 11,
+ -1, 7, -1, 3,
+ -1, 5, -1, 9,
+ -1, 13, -1, -1 };
+
+ vresult_char = vec_permx (vsrc_a_char, vsrc_b_char, vsrc_c_uchar, 0);
+
+ if (!vec_all_eq (vresult_char, expected_vresult_char)) {
+#if DEBUG
+ printf("ERROR, vec_permx (vsrc_a_char, vsrc_b_char, vsrc_c_uchar)\n");
+ for(i = 0; i < 16; i++)
+ printf(" vresult_char[%d] = %d, expected_vresult_char[%d] = %d\n",
+ i, vresult_char[i], i, expected_vresult_char[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_uchar = (vector unsigned char) { 1, 3, 5, 7, 9, 11, 13, 15,
+ 17, 19, 21, 23, 25, 27, 29 };
+ vsrc_b_uchar = (vector unsigned char) { 2, 4, 6, 8, 10, 12, 14, 16,
+ 18, 20, 22, 24, 26, 28, 30, 32 };
+ vsrc_c_uchar = (vector unsigned char) { 0x0, 0x7, 0, 0x5, 0, 0x3, 0, 0x1,
+ 0, 0x2, 0, 0x4, 0, 0x6, 0, 0x0 };
+ vresult_uchar = (vector unsigned char) { 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_uchar = (vector unsigned char) { 1, 15, 1, 11,
+ 1, 7, 1, 3,
+ 1, 5, 1, 9,
+ 1, 13, 1, 1 };
+
+ vresult_uchar = vec_permx (vsrc_a_uchar, vsrc_b_uchar, vsrc_c_uchar, 0);
+
+ if (!vec_all_eq (vresult_uchar, expected_vresult_uchar)) {
+#if DEBUG
+ printf("ERROR, vec_permx (vsrc_a_uchar, vsrc_b_uchar, vsrc_c_uchar)\n");
+ for(i = 0; i < 16; i++)
+ printf(" vresult_uchar[%d] = %d, expected_vresult_uchar[%d] = %d\n",
+ i, vresult_uchar[i], i, expected_vresult_uchar[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_short = (vector signed short int) { 1, -3, 5, 7, 9, 11, 13, 15 };
+ vsrc_b_short = (vector signed short int) { 2, 4, -6, 8, 10, 12, 14, 16 };
+ vsrc_c_uchar = (vector unsigned char) { 0x0, 0x1, 0x2, 0x3,
+ 0x4, 0x5, 0x2, 0x3,
+ 0x8, 0x9, 0x2, 0x3,
+ 0x1E, 0x1F, 0x2, 0x3 };
+ vresult_short = (vector signed short int) { 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_short = (vector signed short int) { 1, -3, 5, -3,
+ 9, -3, 16, -3 };
+
+ vresult_short = vec_permx (vsrc_a_short, vsrc_b_short, vsrc_c_uchar, 0);
+
+ if (!vec_all_eq (vresult_short, expected_vresult_short)) {
+#if DEBUG
+ printf("ERROR, vec_permx (vsrc_a_short, vsrc_b_short, vsrc_c_uchar)\n");
+ for(i = 0; i < 8; i++)
+ printf(" vresult_short[%d] = %d, expected_vresult_short[%d] = %d\n",
+ i, vresult_short[i], i, expected_vresult_short[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_ushort = (vector unsigned short int) { 1, 3, 5, 7, 9, 11, 13, 15 };
+ vsrc_b_ushort = (vector unsigned short int) { 2, 4, 6, 8, 10, 12, 14, 16 };
+ vsrc_c_uchar = (vector unsigned char) { 0x0, 0x1, 0x2, 0x3,
+ 0x4, 0x5, 0x2, 0x3,
+ 0x8, 0x9, 0x2, 0x3,
+ 0x1E, 0x1F, 0x2, 0x3 };
+ vresult_ushort = (vector unsigned short int) { 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_ushort = (vector unsigned short int) { 1, 3, 5, 3,
+ 9, 3, 16, 3 };
+
+ vresult_ushort = vec_permx (vsrc_a_ushort, vsrc_b_ushort, vsrc_c_uchar, 0);
+
+ if (!vec_all_eq (vresult_ushort, expected_vresult_ushort)) {
+#if DEBUG
+ printf("ERROR, vec_permx (vsrc_a_ushort, vsrc_b_ushort, vsrc_c_uchar)\n");
+ for(i = 0; i < 8; i++)
+ printf(" vresult_ushort[%d] = %d, expected_vresult_ushort[%d] = %d\n",
+ i, vresult_ushort[i], i, expected_vresult_ushort[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_int = (vector signed int) { 1, -3, 5, 7 };
+ vsrc_b_int = (vector signed int) { 2, 4, -6, 8 };
+ vsrc_c_uchar = (vector unsigned char) { 0x0, 0x1, 0x2, 0x3,
+ 0x4, 0x5, 0x6, 0x7,
+ 0x18, 0x19, 0x1A, 0x1B,
+ 0x1C, 0x1D, 0x1E, 0x1F };
+ vresult_int = (vector signed int) { 0, 0, 0, 0 };
+ expected_vresult_int = (vector signed int) { 1, -3, -6, 8 };
+
+ vresult_int = vec_permx (vsrc_a_int, vsrc_b_int, vsrc_c_uchar, 0);
+
+ if (!vec_all_eq (vresult_int, expected_vresult_int)) {
+#if DEBUG
+ printf("ERROR, vec_permx (vsrc_a_int, vsrc_b_int, vsrc_c_uchar)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_int[%d] = %d, expected_vresult_int[%d] = %d\n",
+ i, vresult_int[i], i, expected_vresult_int[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_uint = (vector unsigned int) { 1, 3, 5, 7 };
+ vsrc_b_uint = (vector unsigned int) { 10, 12, 14, 16 };
+ vsrc_c_uchar = (vector unsigned char) { 0x0, 0x1, 0x2, 0x3,
+ 0x4, 0x5, 0x6, 0x7,
+ 0x18, 0x19, 0x1A, 0x1B,
+ 0x1C, 0x1D, 0x1E, 0x1F };
+ vresult_uint = (vector unsigned int) { 0, 0, 0, 0 };
+ expected_vresult_uint = (vector unsigned int) { 1, 3, 14, 16 };
+
+ vresult_uint = vec_permx (vsrc_a_uint, vsrc_b_uint, vsrc_c_uchar, 0);
+
+ if (!vec_all_eq (vresult_uint, expected_vresult_uint)) {
+#if DEBUG
+ printf("ERROR, vec_permx (vsrc_a_uint, vsrc_b_uint, vsrc_c_uchar)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_uint[%d] = %d, expected_vresult_uint[%d] = %d\n",
+ i, vresult_uint[i], i, expected_vresult_uint[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_ll = (vector signed long long int) { 1, -3 };
+ vsrc_b_ll = (vector signed long long int) { 2, -4 };
+ vsrc_c_uchar = (vector unsigned char) { 0x0, 0x1, 0x2, 0x3,
+ 0x4, 0x5, 0x6, 0x7,
+ 0x18, 0x19, 0x1A, 0x1B,
+ 0x1C, 0x1D, 0x1E, 0x1F };
+ vresult_ll = (vector signed long long int) { 0, 0};
+ expected_vresult_ll = (vector signed long long int) { 1, -4 };
+
+ vresult_ll = vec_permx (vsrc_a_ll, vsrc_b_ll, vsrc_c_uchar, 0);
+
+ if (!vec_all_eq (vresult_ll, expected_vresult_ll)) {
+#if DEBUG
+ printf("ERROR, vec_permx (vsrc_a_ll, vsrc_b_ll, vsrc_c_uchar)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_ll[%d] = %lld, expected_vresult_ll[%d] = %lld\n",
+ i, vresult_ll[i], i, expected_vresult_ll[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_ull = (vector unsigned long long int) { 1, 3 };
+ vsrc_b_ull = (vector unsigned long long int) { 10, 12 };
+ vsrc_c_uchar = (vector unsigned char) { 0x0, 0x1, 0x2, 0x3,
+ 0x4, 0x5, 0x6, 0x7,
+ 0x18, 0x19, 0x1A, 0x1B,
+ 0x1C, 0x1D, 0x1E, 0x1F };
+ vresult_ull = (vector unsigned long long int) { 0, 0 };
+ expected_vresult_ull = (vector unsigned long long int) { 1, 12 };
+
+ vresult_ull = vec_permx (vsrc_a_ull, vsrc_b_ull, vsrc_c_uchar, 0);
+
+ if (!vec_all_eq (vresult_ull, expected_vresult_ull)) {
+#if DEBUG
+ printf("ERROR, vec_permx (vsrc_a_ull, vsrc_b_ull, vsrc_c_uchar)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_ull[%d] = %d, expected_vresult_ull[%d] = %d\n",
+ i, vresult_ull[i], i, expected_vresult_ull[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_f = (vector float) { -3.0, 5.0, 7.0, 9.0 };
+ vsrc_b_f = (vector float) { 2.0, 4.0, 6.0, 8.0 };
+ vsrc_c_uchar = (vector unsigned char) { 0x0, 0x1, 0x2, 0x3,
+ 0x4, 0x5, 0x6, 0x7,
+ 0x18, 0x19, 0x1A, 0x1B,
+ 0x1C, 0x1D, 0x1E, 0x1F };
+ vresult_f = (vector float) { 0.0, 0.0, 0.0, 0.0 };
+ expected_vresult_f = (vector float) { -3.0, 5.0, 6.0, 8.0 };
+
+ vresult_f = vec_permx (vsrc_a_f, vsrc_b_f, vsrc_c_uchar, 0);
+
+ if (!vec_all_eq (vresult_f, expected_vresult_f)) {
+#if DEBUG
+ printf("ERROR, vec_permx (vsrc_a_f, vsrc_b_f, vsrc_c_uchar)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_f[%d] = %f, expected_vresult_f[%d] = %f\n",
+ i, vresult_f[i], i, expected_vresult_f[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_d = (vector double) { 1.0, -3.0 };
+ vsrc_b_d = (vector double) { 2.0, -4.0 };
+ vsrc_c_uchar = (vector unsigned char) { 0x0, 0x1, 0x2, 0x3,
+ 0x4, 0x5, 0x6, 0x7,
+ 0x1A, 0x1B, 0x1C, 0x1B,
+ 0x1C, 0x1D, 0x1E, 0x1F };
+ vresult_d = (vector double) { 0.0, 0.0 };
+ expected_vresult_d = (vector double) { 1.0, -4.0 };
+
+ vresult_d = vec_permx (vsrc_a_d, vsrc_b_d, vsrc_c_uchar, 0);
+
+ if (!vec_all_eq (vresult_d, expected_vresult_d)) {
+#if DEBUG
+ printf("ERROR, vec_permx (vsrc_a_d, vsrc_b_d, vsrc_c_uchar)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_d[%d] = %f, expected_vresult_d[%d] = %f\n",
+ i, vresult_d[i], i, expected_vresult_d[i]);
+#else
+ abort();
+#endif
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {\mxxpermx\M} 10 } } */
+
+
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-pext-0.c b/gcc/testsuite/gcc.target/powerpc/vec-pext-0.c
new file mode 100644
index 00000000000..54073ca267f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-pext-0.c
@@ -0,0 +1,53 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned long long int
+do_vec_pext (vector unsigned long long int source,
+ vector unsigned long long int mask) {
+ return vec_pext (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull };
+ vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull };
+
+ vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull };
+ vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull };
+
+ /* See pextd-0.c for derivation of expected results.
+
+ result_aa [0] is compute (source [0], mask [0];
+ result_aa [1] is compute (source [1], mask [1].
+
+ result_ab [0] is compute (source [0], mask [2];
+ result_ab [1] is compute (source [1], mask [3].
+
+ result_ba [0] is compute (source [2], mask [0];
+ result_ba [1] is compute (source [3], mask [1].
+
+ result_bb [0] is compute (source [2], mask [2];
+ result_bb [1] is compute (source [3], mask [3]. */
+
+ vector unsigned long long int result_aa = { 0x0000a5f0ull, 0x0000a5f0ull };
+ vector unsigned long long int result_ab = { 0x000050ecull, 0x000073afull };
+ vector unsigned long long int result_ba = { 0x00003ca5ull, 0x0000e7c3ull };
+ vector unsigned long long int result_bb = { 0x0000c50eull, 0x000050ecull };
+
+ if (!vec_all_eq (do_vec_pext (source_a, mask_a), result_aa))
+ abort ();
+ if (!vec_all_eq (do_vec_pext (source_a, mask_b),result_ab))
+ abort ();
+ if (!vec_all_eq (do_vec_pext (source_b, mask_a), result_ba))
+ abort ();
+ if (!vec_all_eq (do_vec_pext (source_b, mask_b), result_bb))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mvpextd\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-pext-1.c b/gcc/testsuite/gcc.target/powerpc/vec-pext-1.c
new file mode 100644
index 00000000000..ed289bfbe13
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-pext-1.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned long long int
+do_vec_pext (vector unsigned long long int source,
+ vector unsigned long long int mask) {
+ return vec_pext (source, mask);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull };
+ vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull };
+
+ vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull };
+ vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull };
+
+ /* See pextd-0.c for derivation of expected results.
+
+ result_aa [0] is compute (source [0], mask [0];
+ result_aa [1] is compute (source [1], mask [1].
+
+ result_ab [0] is compute (source [0], mask [2];
+ result_ab [1] is compute (source [1], mask [3].
+
+ result_ba [0] is compute (source [2], mask [0];
+ result_ba [1] is compute (source [3], mask [1].
+
+ result_bb [0] is compute (source [2], mask [2];
+ result_bb [1] is compute (source [3], mask [3]. */
+
+ vector unsigned long long int result_aa = { 0x0000a5f0ull, 0x0000a5f0ull };
+ vector unsigned long long int result_ab = { 0x000050ecull, 0x000073afull };
+ vector unsigned long long int result_ba = { 0x00003ca5ull, 0x0000e7c3ull };
+ vector unsigned long long int result_bb = { 0x0000c50eull, 0x000050ecull };
+
+ if (!vec_all_eq (do_vec_pext (source_a, mask_a), result_aa))
+ abort ();
+ if (!vec_all_eq (do_vec_pext (source_a, mask_b),result_ab))
+ abort ();
+ if (!vec_all_eq (do_vec_pext (source_b, mask_a), result_ba))
+ abort ();
+ if (!vec_all_eq (do_vec_pext (source_b, mask_b), result_bb))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-replace-word-runnable.c b/gcc/testsuite/gcc.target/powerpc/vec-replace-word-runnable.c
new file mode 100644
index 00000000000..94af2106482
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-replace-word-runnable.c
@@ -0,0 +1,289 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+#define DEBUG 0
+
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ int i;
+ unsigned char ch;
+ unsigned int index;
+
+ vector unsigned int vresult_uint;
+ vector unsigned int expected_vresult_uint;
+ vector unsigned int src_va_uint;
+ vector unsigned int src_vb_uint;
+ unsigned int src_a_uint;
+
+ vector int vresult_int;
+ vector int expected_vresult_int;
+ vector int src_va_int;
+ vector int src_vb_int;
+ int src_a_int;
+
+ vector unsigned long long int vresult_ullint;
+ vector unsigned long long int expected_vresult_ullint;
+ vector unsigned long long int src_va_ullint;
+ vector unsigned long long int src_vb_ullint;
+ unsigned int long long src_a_ullint;
+
+ vector long long int vresult_llint;
+ vector long long int expected_vresult_llint;
+ vector long long int src_va_llint;
+ vector long long int src_vb_llint;
+ long long int src_a_llint;
+
+ vector float vresult_float;
+ vector float expected_vresult_float;
+ vector float src_va_float;
+ float src_a_float;
+
+ vector double vresult_double;
+ vector double expected_vresult_double;
+ vector double src_va_double;
+ double src_a_double;
+
+ /* Vector replace 32-bit element */
+ src_a_uint = 345;
+ src_va_uint = (vector unsigned int) { 0, 1, 2, 3 };
+ vresult_uint = (vector unsigned int) { 0, 0, 0, 0 };
+ expected_vresult_uint = (vector unsigned int) { 0, 1, 345, 3 };
+
+ vresult_uint = vec_replace_elt (src_va_uint, src_a_uint, 2);
+
+ if (!vec_all_eq (vresult_uint, expected_vresult_uint)) {
+#if DEBUG
+ printf("ERROR, vec_replace_elt (src_vb_uint, src_va_uint, index)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_uint[%d] = %d, expected_vresult_uint[%d] = %d\n",
+ i, vresult_uint[i], i, expected_vresult_uint[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_a_int = 234;
+ src_va_int = (vector int) { 0, 1, 2, 3 };
+ vresult_int = (vector int) { 0, 0, 0, 0 };
+ expected_vresult_int = (vector int) { 0, 234, 2, 3 };
+
+ vresult_int = vec_replace_elt (src_va_int, src_a_int, 1);
+
+ if (!vec_all_eq (vresult_int, expected_vresult_int)) {
+#if DEBUG
+ printf("ERROR, vec_replace_elt (src_vb_int, src_va_int, index)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_int[%d] = %d, expected_vresult_int[%d] = %d\n",
+ i, vresult_int[i], i, expected_vresult_int[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_a_float = 34.0;
+ src_va_float = (vector float) { 0.0, 10.0, 20.0, 30.0 };
+ vresult_float = (vector float) { 0.0, 0.0, 0.0, 0.0 };
+ expected_vresult_float = (vector float) { 0.0, 34.0, 20.0, 30.0 };
+
+ vresult_float = vec_replace_elt (src_va_float, src_a_float, 1);
+
+ if (!vec_all_eq (vresult_float, expected_vresult_float)) {
+#if DEBUG
+ printf("ERROR, vec_replace_elt (src_vb_float, src_va_float, index)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_float[%d] = %f, expected_vresult_float[%d] = %f\n",
+ i, vresult_float[i], i, expected_vresult_float[i]);
+#else
+ abort();
+#endif
+ }
+
+ /* Vector replace 64-bit element */
+ src_a_ullint = 456;
+ src_va_ullint = (vector unsigned long long int) { 0, 1 };
+ vresult_ullint = (vector unsigned long long int) { 0, 0 };
+ expected_vresult_ullint = (vector unsigned long long int) { 0, 456 };
+
+ vresult_ullint = vec_replace_elt (src_va_ullint, src_a_ullint, 1);
+
+ if (!vec_all_eq (vresult_ullint, expected_vresult_ullint)) {
+#if DEBUG
+ printf("ERROR, vec_replace_elt (src_vb_ullint, src_va_ullint, index)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_ullint[%d] = %d, expected_vresult_ullint[%d] = %d\n",
+ i, vresult_ullint[i], i, expected_vresult_ullint[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_a_llint = 678;
+ src_va_llint = (vector long long int) { 0, 1 };
+ vresult_llint = (vector long long int) { 0, 0 };
+ expected_vresult_llint = (vector long long int) { 0, 678 };
+
+ vresult_llint = vec_replace_elt (src_va_llint, src_a_llint, 1);
+
+ if (!vec_all_eq (vresult_llint, expected_vresult_llint)) {
+#if DEBUG
+ printf("ERROR, vec_replace_elt (src_vb_llint, src_va_llint, index)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_llint[%d] = %d, expected_vresult_llint[%d] = %d\n",
+ i, vresult_llint[i], i, expected_vresult_llint[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_a_double = 678.0;
+ src_va_double = (vector double) { 0.0, 50.0 };
+ vresult_double = (vector double) { 0.0, 0.0 };
+ expected_vresult_double = (vector double) { 0.0, 678.0 };
+
+ vresult_double = vec_replace_elt (src_va_double, src_a_double, 1);
+
+ if (!vec_all_eq (vresult_double, expected_vresult_double)) {
+#if DEBUG
+ printf("ERROR, vec_replace_elt (src_vb_double, src_va_double, index)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_double[%d] = %f, expected_vresult_double[%d] = %f\n",
+ i, vresult_double[i], i, expected_vresult_double[i]);
+#else
+ abort();
+#endif
+ }
+
+
+ /* Vector replace 32-bit element, unaligned */
+ src_a_uint = 345;
+ src_va_uint = (vector unsigned int) { 1, 2, 0, 0 };
+ vresult_uint = (vector unsigned int) { 0, 0, 0, 0 };
+ /* Byte index 7 will overwrite part of elements 2 and 3 */
+ expected_vresult_uint = (vector unsigned int) { 1, 2, 345*256, 0 };
+
+ vresult_uint = vec_replace_unaligned (src_va_uint, src_a_uint, 3);
+
+ if (!vec_all_eq (vresult_uint, expected_vresult_uint)) {
+#if DEBUG
+ printf("ERROR, vec_replace_unaligned (src_vb_uint, src_va_uint, index)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_uint[%d] = %d, expected_vresult_uint[%d] = %d\n",
+ i, vresult_uint[i], i, expected_vresult_uint[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_a_int = 234;
+ src_va_int = (vector int) { 1, 0, 3, 4 };
+ vresult_int = (vector int) { 0, 0, 0, 0 };
+ /* Byte index 7 will over write part of elements 1 and 2 */
+ expected_vresult_int = (vector int) { 1, 234*256, 0, 4 };
+
+ vresult_int = vec_replace_unaligned (src_va_int, src_a_int, 7);
+
+ if (!vec_all_eq (vresult_int, expected_vresult_int)) {
+#if DEBUG
+ printf("ERROR, vec_replace_unaligned (src_vb_int, src_va_int, index)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_int[%d] = %d, expected_vresult_int[%d] = %d\n",
+ i, vresult_int[i], i, expected_vresult_int[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_a_float = 34.0;
+ src_va_float = (vector float) { 0.0, 10.0, 20.0, 30.0 };
+ vresult_float = (vector float) { 0.0, 0.0, 0.0, 0.0 };
+ expected_vresult_float = (vector float) { 0.0, 34.0, 20.0, 30.0 };
+
+ vresult_float = vec_replace_unaligned (src_va_float, src_a_float, 8);
+
+ if (!vec_all_eq (vresult_float, expected_vresult_float)) {
+#if DEBUG
+ printf("ERROR, vec_replace_unaligned (src_vb_float, src_va_float, index)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_float[%d] = %f, expected_vresult_float[%d] = %f\n",
+ i, vresult_float[i], i, expected_vresult_float[i]);
+#else
+ abort();
+#endif
+ }
+
+ /* Vector replace 64-bit element, unaligned */
+ src_a_ullint = 456;
+ src_va_ullint = (vector unsigned long long int) { 0, 0x222 };
+ vresult_ullint = (vector unsigned long long int) { 0, 0 };
+ expected_vresult_ullint = (vector unsigned long long int) { 456*256,
+ 0x200 };
+
+ /* Byte index 7 will over write least significant byte of element 0 */
+ vresult_ullint = vec_replace_unaligned (src_va_ullint, src_a_ullint, 7);
+
+ if (!vec_all_eq (vresult_ullint, expected_vresult_ullint)) {
+#if DEBUG
+ printf("ERROR, vec_replace_unaligned (src_vb_ullint, src_va_ullint, index)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_ullint[%d] = %d, expected_vresult_ullint[%d] = %d\n",
+ i, vresult_ullint[i], i, expected_vresult_ullint[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_a_llint = 678;
+ src_va_llint = (vector long long int) { 0, 0x101 };
+ vresult_llint = (vector long long int) { 0, 0 };
+ /* Byte index 7 will over write least significant byte of element 0 */
+ expected_vresult_llint = (vector long long int) { 678*256, 0x100 };
+
+ vresult_llint = vec_replace_unaligned (src_va_llint, src_a_llint, 7);
+
+ if (!vec_all_eq (vresult_llint, expected_vresult_llint)) {
+#if DEBUG
+ printf("ERROR, vec_replace_unaligned (src_vb_llint, src_va_llint, index)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_llint[%d] = %d, expected_vresult_llint[%d] = %d\n",
+ i, vresult_llint[i], i, expected_vresult_llint[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_a_double = 678.0;
+ src_va_double = (vector double) { 0.0, 50.0 };
+ vresult_double = (vector double) { 0.0, 0.0 };
+ expected_vresult_double = (vector double) { 0.0, 678.0 };
+
+ vresult_double = vec_replace_unaligned (src_va_double, src_a_double, 0);
+
+ if (!vec_all_eq (vresult_double, expected_vresult_double)) {
+#if DEBUG
+ printf("ERROR, vec_replace_unaligned (src_vb_double, src_va_double, index)\
+n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_double[%d] = %f, expected_vresult_double[%d] = %f\n",
+ i, vresult_double[i], i, expected_vresult_double[i]);
+#else
+ abort();
+#endif
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {\mvinsw\M} 6 } } */
+/* { dg-final { scan-assembler-times {\mvinsd\M} 6 } } */
+
+
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-shift-double-runnable.c b/gcc/testsuite/gcc.target/powerpc/vec-shift-double-runnable.c
new file mode 100644
index 00000000000..13213bd22ee
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-shift-double-runnable.c
@@ -0,0 +1,384 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+#include <altivec.h>
+
+#define DEBUG 0
+
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ int i;
+
+ vector signed char vresult_char;
+ vector signed char expected_vresult_char;
+ vector signed char src_va_char;
+ vector signed char src_vb_char;
+
+ vector unsigned char vresult_uchar;
+ vector unsigned char expected_vresult_uchar;
+ vector unsigned char src_va_uchar;
+ vector unsigned char src_vb_uchar;
+
+ vector short int vresult_sh;
+ vector short int expected_vresult_sh;
+ vector short int src_va_sh;
+ vector short int src_vb_sh;
+
+ vector short unsigned int vresult_ush;
+ vector short unsigned int expected_vresult_ush;
+ vector short unsigned int src_va_ush;
+ vector short unsigned int src_vb_ush;
+
+ vector int vresult_int;
+ vector int expected_vresult_int;
+ vector int src_va_int;
+ vector int src_vb_int;
+ int src_a_int;
+
+ vector unsigned int vresult_uint;
+ vector unsigned int expected_vresult_uint;
+ vector unsigned int src_va_uint;
+ vector unsigned int src_vb_uint;
+ unsigned int src_a_uint;
+
+ vector long long int vresult_llint;
+ vector long long int expected_vresult_llint;
+ vector long long int src_va_llint;
+ vector long long int src_vb_llint;
+ long long int src_a_llint;
+
+ vector unsigned long long int vresult_ullint;
+ vector unsigned long long int expected_vresult_ullint;
+ vector unsigned long long int src_va_ullint;
+ vector unsigned long long int src_vb_ullint;
+ unsigned int long long src_a_ullint;
+
+ /* Vector shift double left */
+ src_va_char = (vector signed char) { 0, 2, 4, 6, 8, 10, 12, 14,
+ 16, 18, 20, 22, 24, 26, 28, 30 };
+ src_vb_char = (vector signed char) { 10, 20, 30, 40, 50, 60, 70, 80, 90,
+ 100, 110, 120, 130, 140, 150, 160 };
+ vresult_char = (vector signed char) { 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_char = (vector signed char) { 80, 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14 };
+
+ vresult_char = vec_sldb (src_va_char, src_vb_char, 7);
+
+ if (!vec_all_eq (vresult_char, expected_vresult_char)) {
+#if DEBUG
+ printf("ERROR, vec_sldb (src_va_char_, src_vb_char, 7)\n");
+ for(i = 0; i < 16; i++)
+ printf(" vresult_char[%d] = %d, expected_vresult_char[%d] = %d\n",
+ i, vresult_char[i], i, expected_vresult_char[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_va_uchar = (vector unsigned char) { 0, 2, 4, 6, 8, 10, 12, 14,
+ 16, 18, 20, 22, 24, 26, 28, 30 };
+ src_vb_uchar = (vector unsigned char) { 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+ vresult_uchar = (vector unsigned char) { 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_uchar = (vector unsigned char) { 0, 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14 };
+
+ vresult_uchar = vec_sldb (src_va_uchar, src_vb_uchar, 7);
+
+ if (!vec_all_eq (vresult_uchar, expected_vresult_uchar)) {
+#if DEBUG
+ printf("ERROR, vec_sldb (src_va_uchar_, src_vb_uchar, 7)\n");
+ for(i = 0; i < 16; i++)
+ printf(" vresult_uchar[%d] = %d, expected_vresult_uchar[%d] = %d\n",
+ i, vresult_uchar[i], i, expected_vresult_uchar[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_va_sh = (vector short int) { 0, 2, 4, 6, 8, 10, 12, 14 };
+ src_vb_sh = (vector short int) { 0, 0, 0, 0, 0, 0, 0, 0 };
+ vresult_sh = (vector short int) { 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_sh = (vector short int) { 0, 2*128, 4*128, 6*128,
+ 8*128, 10*128, 12*128, 14*128 };
+
+ vresult_sh = vec_sldb (src_va_sh, src_vb_sh, 7);
+
+ if (!vec_all_eq (vresult_sh, expected_vresult_sh)) {
+#if DEBUG
+ printf("ERROR, vec_sldb (src_va_sh_, src_vb_sh, 7)\n");
+ for(i = 0; i < 8; i++)
+ printf(" vresult_sh[%d] = %d, expected_vresult_sh[%d] = %d\n",
+ i, vresult_sh[i], i, expected_vresult_sh[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_va_ush = (vector short unsigned int) { 0, 2, 4, 6, 8, 10, 12, 14 };
+ src_vb_ush = (vector short unsigned int) { 10, 20, 30, 40, 50, 60, 70, 80 };
+ vresult_ush = (vector short unsigned int) { 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_ush = (vector short unsigned int) { 0, 2*128, 4*128, 6*128,
+ 8*128, 10*128, 12*128,
+ 14*128 };
+
+ vresult_ush = vec_sldb (src_va_ush, src_vb_ush, 7);
+
+ if (!vec_all_eq (vresult_ush, expected_vresult_ush)) {
+#if DEBUG
+ printf("ERROR, vec_sldb (src_va_ush_, src_vb_ush, 7)\n");
+ for(i = 0; i < 8; i++)
+ printf(" vresult_ush[%d] = %d, expected_vresult_ush[%d] = %d\n",
+ i, vresult_ush[i], i, expected_vresult_ush[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_va_int = (vector signed int) { 0, 2, 3, 1 };
+ src_vb_int = (vector signed int) { 0, 0, 0, 0 };
+ vresult_int = (vector signed int) { 0, 0, 0, 0 };
+ expected_vresult_int = (vector signed int) { 0, 2*128, 3*128, 1*128 };
+
+ vresult_int = vec_sldb (src_va_int, src_vb_int, 7);
+
+ if (!vec_all_eq (vresult_int, expected_vresult_int)) {
+#if DEBUG
+ printf("ERROR, vec_sldb (src_va_int_, src_vb_int, 7)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_int[%d] = %d, expected_vresult_int[%d] = %d\n",
+ i, vresult_int[i], i, expected_vresult_int[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_va_uint = (vector unsigned int) { 0, 2, 4, 6 };
+ src_vb_uint = (vector unsigned int) { 10, 20, 30, 40 };
+ vresult_uint = (vector unsigned int) { 0, 0, 0, 0 };
+ expected_vresult_uint = (vector unsigned int) { 0, 2*128, 4*128, 6*128 };
+
+ vresult_uint = vec_sldb (src_va_uint, src_vb_uint, 7);
+
+ if (!vec_all_eq (vresult_uint, expected_vresult_uint)) {
+#if DEBUG
+ printf("ERROR, vec_sldb (src_va_uint_, src_vb_uint, 7)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_uint[%d] = %d, expected_vresult_uint[%d] = %d\n",
+ i, vresult_uint[i], i, expected_vresult_uint[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_va_llint = (vector signed long long int) { 5, 6 };
+ src_vb_llint = (vector signed long long int) { 0, 0 };
+ vresult_llint = (vector signed long long int) { 0, 0 };
+ expected_vresult_llint = (vector signed long long int) { 5*128, 6*128 };
+
+ vresult_llint = vec_sldb (src_va_llint, src_vb_llint, 7);
+
+ if (!vec_all_eq (vresult_llint, expected_vresult_llint)) {
+#if DEBUG
+ printf("ERROR, vec_sldb (src_va_llint_, src_vb_llint, 7)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_llint[%d] = %d, expected_vresult_llint[%d] = %d\n",
+ i, vresult_llint[i], i, expected_vresult_llint[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_va_ullint = (vector unsigned long long int) { 54, 26 };
+ src_vb_ullint = (vector unsigned long long int) { 10, 20 };
+ vresult_ullint = (vector unsigned long long int) { 0, 0 };
+ expected_vresult_ullint = (vector unsigned long long int) { 54*128,
+ 26*128 };
+
+ vresult_ullint = vec_sldb (src_va_ullint, src_vb_ullint, 7);
+
+ if (!vec_all_eq (vresult_ullint, expected_vresult_ullint)) {
+#if DEBUG
+ printf("ERROR, vec_sldb (src_va_ullint_, src_vb_ullint, 7)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_ullint[%d] = %d, expected_vresult_ullint[%d] = %d\n",
+ i, vresult_ullint[i], i, expected_vresult_ullint[i]);
+#else
+ abort();
+#endif
+ }
+
+ /* Vector shift double right */
+ src_va_char = (vector signed char) { 0, 2, 4, 6, 8, 10, 12, 14,
+ 16, 18, 20, 22, 24, 26, 28, 30 };
+ src_vb_char = (vector signed char) { 10, 12, 14, 16, 18, 20, 22, 24, 26,
+ 28, 30, 32, 34, 36, 38, 40 };
+ vresult_char = (vector signed char) { 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_char = (vector signed char) { 24, 28, 32, 36, 40, 44, 48,
+ 52, 56, 60, 64, 68, 72, 76,
+ 80, 0 };
+
+ vresult_char = vec_srdb (src_va_char, src_vb_char, 7);
+
+ if (!vec_all_eq (vresult_char, expected_vresult_char)) {
+#if DEBUG
+ printf("ERROR, vec_srdb (src_va_char_, src_vb_char, 7)\n");
+ for(i = 0; i < 16; i++)
+ printf(" vresult_char[%d] = %d, expected_vresult_char[%d] = %d\n",
+ i, vresult_char[i], i, expected_vresult_char[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_va_uchar = (vector unsigned char) { 100, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+ src_vb_uchar = (vector unsigned char) { 0, 2, 4, 6, 8, 10, 12, 14,
+ 16, 18, 20, 22, 24, 26, 28, 30 };
+ vresult_uchar = (vector unsigned char) { 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_uchar = (vector unsigned char) { 4, 8, 12, 16, 20, 24, 28,
+ 32, 36, 40, 44, 48, 52,
+ 56, 60, 200 };
+
+ vresult_uchar = vec_srdb (src_va_uchar, src_vb_uchar, 7);
+
+ if (!vec_all_eq (vresult_uchar, expected_vresult_uchar)) {
+#if DEBUG
+ printf("ERROR, vec_srdb (src_va_uchar_, src_vb_uchar, 7)\n");
+ for(i = 0; i < 16; i++)
+ printf(" vresult_uchar[%d] = %d, expected_vresult_uchar[%d] = %d\n",
+ i, vresult_uchar[i], i, expected_vresult_uchar[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_va_sh = (vector short int) { 0, 0, 0, 0, 0, 0, 0, 0 };
+ src_vb_sh = (vector short int) { 0, 2*128, 4*128, 6*128,
+ 8*128, 10*128, 12*128, 14*128 };
+ vresult_sh = (vector short int) { 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_sh = (vector short int) { 0, 2, 4, 6, 8, 10, 12, 14 };
+
+ vresult_sh = vec_srdb (src_va_sh, src_vb_sh, 7);
+
+ if (!vec_all_eq (vresult_sh, expected_vresult_sh)) {
+#if DEBUG
+ printf("ERROR, vec_srdb (src_va_sh_, src_vb_sh, 7)\n");
+ for(i = 0; i < 8; i++)
+ printf(" vresult_sh[%d] = %d, expected_vresult_sh[%d] = %d\n",
+ i, vresult_sh[i], i, expected_vresult_sh[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_va_ush = (vector short unsigned int) { 0, 20, 30, 40, 50, 60, 70, 80 };
+ src_vb_ush = (vector short unsigned int) { 0, 2*128, 4*128, 6*128,
+ 8*128, 10*128, 12*128, 14*128 };
+ vresult_ush = (vector short unsigned int) { 0, 0, 0, 0, 0, 0, 0, 0 };
+ expected_vresult_ush = (vector short unsigned int) { 0, 2, 4, 6, 8, 10,
+ 12, 14 };
+
+ vresult_ush = vec_srdb (src_va_ush, src_vb_ush, 7);
+
+ if (!vec_all_eq (vresult_ush, expected_vresult_ush)) {
+#if DEBUG
+ printf("ERROR, vec_srdb (src_va_ush_, src_vb_ush, 7)\n");
+ for(i = 0; i < 8; i++)
+ printf(" vresult_ush[%d] = %d, expected_vresult_ush[%d] = %d\n",
+ i, vresult_ush[i], i, expected_vresult_ush[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_va_int = (vector signed int) { 0, 0, 0, 0 };
+ src_vb_int = (vector signed int) { 0, 2*128, 3*128, 1*128 };
+ vresult_int = (vector signed int) { 0, 0, 0, 0 };
+ expected_vresult_int = (vector signed int) { 0, 2, 3, 1 };
+
+ vresult_int = vec_srdb (src_va_int, src_vb_int, 7);
+
+ if (!vec_all_eq (vresult_int, expected_vresult_int)) {
+#if DEBUG
+ printf("ERROR, vec_srdb (src_va_int_, src_vb_int, 7)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_int[%d] = %d, expected_vresult_int[%d] = %d\n",
+ i, vresult_int[i], i, expected_vresult_int[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_va_uint = (vector unsigned int) { 0, 20, 30, 40 };
+ src_vb_uint = (vector unsigned int) { 128, 2*128, 4*128, 6*128 };
+ vresult_uint = (vector unsigned int) { 0, 0, 0, 0 };
+ expected_vresult_uint = (vector unsigned int) { 1, 2, 4, 6 };
+
+ vresult_uint = vec_srdb (src_va_uint, src_vb_uint, 7);
+
+ if (!vec_all_eq (vresult_uint, expected_vresult_uint)) {
+#if DEBUG
+ printf("ERROR, vec_srdb (src_va_uint_, src_vb_uint, 7)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_uint[%d] = %d, expected_vresult_uint[%d] = %d\n",
+ i, vresult_uint[i], i, expected_vresult_uint[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_va_llint = (vector signed long long int) { 0, 0 };
+ src_vb_llint = (vector signed long long int) { 5*128, 6*128 };
+ vresult_llint = (vector signed long long int) { 0, 0 };
+ expected_vresult_llint = (vector signed long long int) { 5, 6 };
+
+ vresult_llint = vec_srdb (src_va_llint, src_vb_llint, 7);
+
+ if (!vec_all_eq (vresult_llint, expected_vresult_llint)) {
+#if DEBUG
+ printf("ERROR, vec_srdb (src_va_llint_, src_vb_llint, 7)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_llint[%d] = %d, expected_vresult_llint[%d] = %d\n",
+ i, vresult_llint[i], i, expected_vresult_llint[i]);
+#else
+ abort();
+#endif
+ }
+
+ src_va_ullint = (vector unsigned long long int) { 0, 0 };
+ src_vb_ullint = (vector unsigned long long int) { 54*128, 26*128 };
+ vresult_ullint = (vector unsigned long long int) { 0, 0 };
+ expected_vresult_ullint = (vector unsigned long long int) { 54, 26 };
+
+ vresult_ullint = vec_srdb (src_va_ullint, src_vb_ullint, 7);
+
+ if (!vec_all_eq (vresult_ullint, expected_vresult_ullint)) {
+#if DEBUG
+ printf("ERROR, vec_srdb (src_va_ullint_, src_vb_ullint, 7)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_ullint[%d] = %d, expected_vresult_ullint[%d] = %d\n",
+ i, vresult_ullint[i], i, expected_vresult_ullint[i]);
+#else
+ abort();
+#endif
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {\msldbi\M} 6 } } */
+/* { dg-final { scan-assembler-times {\msrdbi\M} 6 } } */
+
+
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c b/gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c
new file mode 100644
index 00000000000..afb0bfdef3a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c
@@ -0,0 +1,166 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+#include <altivec.h>
+
+#define DEBUG 0
+
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+extern void abort (void);
+
+int
+main (int argc, char *argv [])
+{
+ int i;
+ vector int vsrc_a_int;
+ vector int vresult_int;
+ vector int expected_vresult_int;
+ int src_a_int = 13;
+
+ vector unsigned int vsrc_a_uint;
+ vector unsigned int vresult_uint;
+ vector unsigned int expected_vresult_uint;
+ unsigned int src_a_uint = 7;
+
+ vector float vresult_f;
+ vector float expected_vresult_f;
+ vector float vsrc_a_f;
+ float src_a_f = 23.0;
+
+ vector double vsrc_a_d;
+ vector double vresult_d;
+ vector double expected_vresult_d;
+
+ /* Vector splati word */
+ vresult_int = (vector signed int) { 1, 2, 3, 4 };
+ expected_vresult_int = (vector signed int) { -13, -13, -13, -13 };
+
+ vresult_int = vec_splati ( -13 );
+
+ if (!vec_all_eq (vresult_int, expected_vresult_int)) {
+#if DEBUG
+ printf("ERROR, vec_splati (src_a_int)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_int[%d] = %d, expected_vresult_int[%d] = %d\n",
+ i, vresult_int[i], i, expected_vresult_int[i]);
+#else
+ abort();
+#endif
+ }
+
+ vresult_f = (vector float) { 1.0, 2.0, 3.0, 4.0 };
+ expected_vresult_f = (vector float) { 23.0, 23.0, 23.0, 23.0 };
+
+ vresult_f = vec_splati (23.0f);
+
+ if (!vec_all_eq (vresult_f, expected_vresult_f)) {
+#if DEBUG
+ printf("ERROR, vec_splati (src_a_f)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_f[%d] = %f, expected_vresult_f[%d] = %f\n",
+ i, vresult_f[i], i, expected_vresult_f[i]);
+#else
+ abort();
+#endif
+ }
+
+ /* Vector splati double */
+ vresult_d = (vector double) { 2.0, 3.0 };
+ expected_vresult_d = (vector double) { -31.0, -31.0 };
+
+ vresult_d = vec_splatid (-31.0f);
+
+ if (!vec_all_eq (vresult_d, expected_vresult_d)) {
+#if DEBUG
+ printf("ERROR, vec_splati (-31.0f)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_d[%i] = %f, expected_vresult_d[%i] = %f\n",
+ i, vresult_d[i], i, expected_vresult_d[i]);
+#else
+ abort();
+#endif
+ }
+
+ /* This test will generate a "note" to the user that the argument
+ is subnormal. It is not an error, but results are not defined. */
+ vresult_d = (vector double) { 2.0, 3.0 };
+ expected_vresult_d = (vector double) { 6.6E-42f, 6.6E-42f };
+
+ vresult_d = vec_splatid (6.6E-42f);
+
+ /* Although the instruction says the results are not defined, it does seem
+ to work, at least on Mambo. But no guarentees! */
+ if (!vec_all_eq (vresult_d, expected_vresult_d)) {
+#if DEBUG
+ printf("ERROR, vec_splati (6.6E-42f)\n");
+ for(i = 0; i < 2; i++)
+ printf(" vresult_d[%i] = %e, expected_vresult_d[%i] = %e\n",
+ i, vresult_d[i], i, expected_vresult_d[i]);
+#else
+ abort();
+#endif
+ }
+
+ /* Vector splat immediate */
+ vsrc_a_int = (vector int) { 2, 3, 4, 5 };
+ vresult_int = (vector int) { 1, 1, 1, 1 };
+ expected_vresult_int = (vector int) { 2, 20, 4, 20 };
+
+ vresult_int = vec_splati_ins (vsrc_a_int, 1, 20);
+
+ if (!vec_all_eq (vresult_int, expected_vresult_int)) {
+#if DEBUG
+ printf("ERROR, vec_splati_ins (vsrc_a_int, 1, 20)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_int[%i] = %d, expected_vresult_int[%i] = %d\n",
+ i, vresult_int[i], i, expected_vresult_int[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_uint = (vector unsigned int) { 4, 5, 6, 7 };
+ vresult_uint = (vector unsigned int) { 1, 1, 1, 1 };
+ expected_vresult_uint = (vector unsigned int) { 4, 40, 6, 40 };
+
+ vresult_uint = vec_splati_ins (vsrc_a_uint, 1, 40);
+
+ if (!vec_all_eq (vresult_uint, expected_vresult_uint)) {
+#if DEBUG
+ printf("ERROR, vec_splati_ins (vsrc_a_uint, 1, 40)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_uint[%i] = %d, expected_vresult_uint[%i] = %d\n",
+ i, vresult_uint[i], i, expected_vresult_uint[i]);
+#else
+ abort();
+#endif
+ }
+
+ vsrc_a_f = (vector float) { 2.0, 3.0, 4.0, 5.0 };
+ vresult_f = (vector float) { 1.0, 1.0, 1.0, 1.0 };
+ expected_vresult_f = (vector float) { 2.0, 20.1, 4.0, 20.1 };
+
+ vresult_f = vec_splati_ins (vsrc_a_f, 1, 20.1f);
+
+ if (!vec_all_eq (vresult_f, expected_vresult_f)) {
+#if DEBUG
+ printf("ERROR, vec_splati_ins (vsrc_a_f, 1, 20.1)\n");
+ for(i = 0; i < 4; i++)
+ printf(" vresult_f[%i] = %f, expected_vresult_f[%i] = %f\n",
+ i, vresult_f[i], i, expected_vresult_f[i]);
+#else
+ abort();
+#endif
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {\mxxspltiw\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mxxspltidp\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mxxsplti32dx\M} 3 } } */
+
+
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-0.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-0.c
new file mode 100644
index 00000000000..5c59cb2076a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-0.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate left-justified on array of unsigned char. */
+vector unsigned char
+silj (vector unsigned char arg)
+{
+ return vec_stril (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribl\M} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-1.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-1.c
new file mode 100644
index 00000000000..98ee29f7c5e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-1.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate left-justified on array of unsigned char. */
+vector unsigned char
+silj (vector unsigned char arg)
+{
+ return vec_stril (arg);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned char input1 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char expected1 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char input2 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector unsigned char expected2 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 00, 0x0 };
+ vector unsigned char input3 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector unsigned char expected3 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0x0, 0x0 };
+ vector unsigned char input4 =
+ { 0x1, 0x2, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector unsigned char expected4 =
+ { 0x1, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+
+ if (!vec_all_eq (silj (input1), expected1))
+ abort ();
+ if (!vec_all_eq (silj (input2), expected2))
+ abort ();
+ if (!vec_all_eq (silj (input3), expected3))
+ abort ();
+ if (!vec_all_eq (silj (input4), expected4))
+ abort ();
+
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-10.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-10.c
new file mode 100644
index 00000000000..10b5d610a9e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-10.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10" } */
+/* See vec-stril-11.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+vector signed char
+doString(vector signed char *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector signed char result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribl\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { be } }} } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { le } }} } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-11.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-11.c
new file mode 100644
index 00000000000..00184ffec4c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-11.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+vector signed char
+doString(vector signed char *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both and should
+ convert tail recursion to iteration with two copies of the "loop
+ body" when compiled with -O2 or -O3. */
+ vector signed char result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that exactly two dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribl\.} 2 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\.} 2 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { le } } } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-12.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-12.c
new file mode 100644
index 00000000000..e235425ebbc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-12.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10" } */
+/* See vec-stril-13.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+vector unsigned short
+doString(vector unsigned short *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector unsigned short result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-13.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-13.c
new file mode 100644
index 00000000000..1537ed09739
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-13.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+vector unsigned short
+doString(vector unsigned short *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both and should
+ convert tail recursion to iteration with two copies of the "loop
+ body" when compiled with -O2 or -O3. */
+ vector unsigned short result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that exactly two dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 2 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 2 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-14.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-14.c
new file mode 100644
index 00000000000..6ba44ae3121
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-14.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10" } */
+/* See vec-stril-15.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+vector signed short
+doString(vector signed short *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector signed short result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-15.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-15.c
new file mode 100644
index 00000000000..11ac940bda3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-15.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+vector signed short
+doString(vector signed short *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both and should
+ convert tail recursion to iteration with two copies of the "loop
+ body" when compiled with -O2 or -O3. */
+ vector signed short result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that exactly two dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 2 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 2 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-16.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-16.c
new file mode 100644
index 00000000000..6aaad999f4c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-16.c
@@ -0,0 +1,56 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10" } */
+/* See vec-stril-17.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned char
+doString(vector unsigned char *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector unsigned char result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned char composed_string [4] = {
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 },
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 },
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 },
+ { 0x1, 0x2, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 }
+ };
+
+ vector unsigned char expected0 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char expected1 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 00, 0x0 };
+ vector unsigned char expected2 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0x0, 0x0 };
+ vector unsigned char expected3 =
+ { 0x1, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-17.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-17.c
new file mode 100644
index 00000000000..2015aad07ff
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-17.c
@@ -0,0 +1,54 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned char
+doString(vector unsigned char *vp)
+{
+ /* Tail recursion replaced with iteration with -O2. */
+ vector unsigned char result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned char composed_string [4] = {
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 },
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 },
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 },
+ { 0x1, 0x2, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 }
+ };
+
+ vector unsigned char expected0 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char expected1 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 00, 0x0 };
+ vector unsigned char expected2 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0x0, 0x0 };
+ vector unsigned char expected3 =
+ { 0x1, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-18.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-18.c
new file mode 100644
index 00000000000..fce56937537
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-18.c
@@ -0,0 +1,56 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10" } */
+/* See vec-stril-19.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector signed char
+doString(vector signed char *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector signed char result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, char *argv [])
+{
+ vector signed char composed_string [4] = {
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 },
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 },
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 },
+ { 0x1, 0x2, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 }
+ };
+
+ vector signed char expected0 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector signed char expected1 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 00, 0x0 };
+ vector signed char expected2 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0x0, 0x0 };
+ vector signed char expected3 =
+ { 0x1, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-19.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-19.c
new file mode 100644
index 00000000000..6226dde0ba7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-19.c
@@ -0,0 +1,54 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector signed char
+doString(vector signed char *vp)
+{
+ /* Tail recursion replaced with iteration with -O2. */
+ vector signed char result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, char *argv [])
+{
+ vector signed char composed_string [4] = {
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 },
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 },
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 },
+ { 0x1, 0x2, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 }
+ };
+
+ vector signed char expected0 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector signed char expected1 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 00, 0x0 };
+ vector signed char expected2 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0x0, 0x0 };
+ vector signed char expected3 =
+ { 0x1, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-2.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-2.c
new file mode 100644
index 00000000000..0face99d4a7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate left-justified on array of signed char. */
+vector signed char
+silj (vector signed char arg)
+{
+ return vec_stril (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribl\M} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-20.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-20.c
new file mode 100644
index 00000000000..9da116c050b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-20.c
@@ -0,0 +1,46 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10" } */
+/* See vec-stril-21.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned short
+doString(vector unsigned short *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector unsigned short result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, short *argv [])
+{
+ vector unsigned short composed_string [4] = {
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 },
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 }
+ };
+
+ vector unsigned short expected0 = { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short expected1 = { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector unsigned short expected2 = { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector unsigned short expected3 = { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
+
+
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-21.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-21.c
new file mode 100644
index 00000000000..b281c45c56d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-21.c
@@ -0,0 +1,44 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned short
+doString(vector unsigned short *vp)
+{
+ /* Iteration replaces tail recursion with -O2. */
+ vector unsigned short result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, short *argv [])
+{
+ vector unsigned short composed_string [4] = {
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 },
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 }
+ };
+
+ vector unsigned short expected0 = { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short expected1 = { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector unsigned short expected2 = { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector unsigned short expected3 = { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
+
+
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-22.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-22.c
new file mode 100644
index 00000000000..a63dab727fa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-22.c
@@ -0,0 +1,44 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10" } */
+/* See vec-stril-23.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector signed short
+doString(vector signed short *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector signed short result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, short *argv [])
+{
+ vector signed short composed_string [4] = {
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 },
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 }
+ };
+
+ vector signed short expected0 = { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short expected1 = { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector signed short expected2 = { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector signed short expected3 = { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-23.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-23.c
new file mode 100644
index 00000000000..ec0e4836457
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-23.c
@@ -0,0 +1,42 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector signed short
+doString(vector signed short *vp)
+{
+ /* Iteration replaces tail recursion with -O2. */
+ vector signed short result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, short *argv [])
+{
+ vector signed short composed_string [4] = {
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 },
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 }
+ };
+
+ vector signed short expected0 = { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short expected1 = { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector signed short expected2 = { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector signed short expected3 = { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-3.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-3.c
new file mode 100644
index 00000000000..970c1a13c82
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-3.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of signed char. */
+vector signed char
+silj (vector signed char arg)
+{
+ return vec_stril (arg);
+}
+
+int main (int argc, char *argv [])
+{
+ vector signed char input1 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0xf, 0x11 };
+ vector signed char expected1 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0xf, 0x11 };
+ vector signed char input2 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector signed char expected2 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0x0, 0x0 };
+ vector signed char input3 =
+ { 0x1, 0x2, 0xf3, 0x0, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 };
+ vector signed char expected3 =
+ { 0x1, 0x2, 0xf3, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector signed char input4 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 };
+ vector signed char expected4 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x0 };
+
+ if (!vec_all_eq (silj (input1), expected1))
+ abort ();
+ if (!vec_all_eq (silj (input2), expected2))
+ abort ();
+ if (!vec_all_eq (silj (input3), expected3))
+ abort ();
+ if (!vec_all_eq (silj (input4), expected4))
+ abort ();
+
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-4.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-4.c
new file mode 100644
index 00000000000..186208bb46a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-4.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate left-justified on array of unsigned short. */
+vector unsigned short
+silj (vector unsigned short arg)
+{
+ return vec_stril (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihl\M} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-5.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-5.c
new file mode 100644
index 00000000000..c74cad63db4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-5.c
@@ -0,0 +1,45 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate left-justified on array of unsigned short. */
+vector unsigned short
+silj (vector unsigned short arg)
+{
+ return vec_stril (arg);
+}
+
+int main (int argc, short *argv [])
+{
+ vector unsigned short input1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short expected1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short input2 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short expected2 =
+ { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector unsigned short input3 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector unsigned short expected3 =
+ { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector unsigned short input4 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector unsigned short expected4 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+
+
+ if (!vec_all_eq (silj (input1), expected1))
+ abort ();
+ if (!vec_all_eq (silj (input2), expected2))
+ abort ();
+ if (!vec_all_eq (silj (input3), expected3))
+ abort ();
+ if (!vec_all_eq (silj (input4), expected4))
+ abort ();
+
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-6.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-6.c
new file mode 100644
index 00000000000..c07ff0351c6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-6.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate left-justified on array of signed short. */
+vector signed short
+silj (vector signed short arg)
+{
+ return vec_stril (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihl\M} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-7.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-7.c
new file mode 100644
index 00000000000..9c5d45421c5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-7.c
@@ -0,0 +1,43 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate left-justified on array of signed short. */
+vector signed short
+silj (vector signed short arg)
+{
+ return vec_stril (arg);
+}
+
+int main (int argc, short *argv [])
+{
+ vector signed short input1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short expected1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short input2 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short expected2 =
+ { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector signed short input3 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector signed short expected3 =
+ { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector signed short input4 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector signed short expected4 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+
+ if (!vec_all_eq (silj (input1), expected1))
+ abort ();
+ if (!vec_all_eq (silj (input2), expected2))
+ abort ();
+ if (!vec_all_eq (silj (input3), expected3))
+ abort ();
+ if (!vec_all_eq (silj (input4), expected4))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-8.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-8.c
new file mode 100644
index 00000000000..3efa404a52e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-8.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10 -O1" } */
+/* See vec-stril-9.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+vector unsigned char
+doString(vector unsigned char *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector unsigned char result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribl\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril-9.c b/gcc/testsuite/gcc.target/powerpc/vec-stril-9.c
new file mode 100644
index 00000000000..b4dd551b6b9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril-9.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+vector unsigned char
+doString(vector unsigned char *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both and should
+ convert tail recursion to iteration with two copies of the "loop
+ body" when compiled with -O2 or -O3. */
+ vector unsigned char result = vec_stril (*vp);
+ if (vec_stril_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that exactly two dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribl\.} 2 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\.} 2 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril_p-0.c b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-0.c
new file mode 100644
index 00000000000..4c55342bd54
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-0.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate left-justified predicate on array of
+ unsigned char. */
+int
+silj_p (vector unsigned char arg)
+{
+ return vec_stril_p (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribl\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril_p-1.c b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-1.c
new file mode 100644
index 00000000000..cd9c468c280
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-1.c
@@ -0,0 +1,41 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate left-justified predicate on array of
+ unsigned char. */
+int
+silj_p (vector unsigned char arg)
+{
+ return vec_stril_p (arg);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned char input1 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char input2 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector unsigned char input3 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector unsigned char input4 =
+ { 0x1, 0x2, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+
+ if (silj_p (input1))
+ abort ();
+ if (!silj_p (input2))
+ abort ();
+ if (!silj_p (input3))
+ abort ();
+ if (!silj_p (input4))
+ abort ();
+
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril_p-10.c b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-10.c
new file mode 100644
index 00000000000..af7abf841c7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-10.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int main (int argc, short *argv [])
+{
+ vector unsigned short input1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short input2 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short input3 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector unsigned short input4 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+
+ if (vec_stril_p (input1))
+ abort ();
+ if (!vec_stril_p (input2))
+ abort ();
+ if (!vec_stril_p (input3))
+ abort ();
+ if (!vec_stril_p (input4))
+ abort ();
+}
+
+/* Enforce that exactly four dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 4 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 4 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril_p-11.c b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-11.c
new file mode 100644
index 00000000000..0f3f545d6b1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-11.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int main (int argc, short *argv [])
+{
+ vector signed short input1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short input2 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short input3 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector signed short input4 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+
+ if (vec_stril_p (input1))
+ abort ();
+ if (!vec_stril_p (input2))
+ abort ();
+ if (!vec_stril_p (input3))
+ abort ();
+ if (!vec_stril_p (input4))
+ abort ();
+}
+
+/* Enforce that exactly four dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 4 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 4 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril_p-2.c b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-2.c
new file mode 100644
index 00000000000..96beb86061d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-2.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate left-justified on array of signed char. */
+int
+silj_p (vector signed char arg)
+{
+ return vec_stril_p (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribl\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril_p-3.c b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-3.c
new file mode 100644
index 00000000000..24b0a86372e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-3.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of signed char. */
+int
+silj_p (vector signed char arg)
+{
+ return vec_stril_p (arg);
+}
+
+int main (int argc, char *argv [])
+{
+ vector signed char input1 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0xf, 0x11 };
+ vector signed char input2 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector signed char input3 =
+ { 0x1, 0x2, 0xf3, 0x0, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 };
+ vector signed char input4 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 };
+
+ if (silj_p (input1))
+ abort ();
+ if (!silj_p (input2))
+ abort ();
+ if (!silj_p (input3))
+ abort ();
+ if (!silj_p (input4))
+ abort ();
+
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril_p-4.c b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-4.c
new file mode 100644
index 00000000000..be381d64253
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-4.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate left-justified on array of unsigned short. */
+int
+silj_p (vector unsigned short arg)
+{
+ return vec_stril_p (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril_p-5.c b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-5.c
new file mode 100644
index 00000000000..2c2ff34fd0e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-5.c
@@ -0,0 +1,35 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate left-justified on array of unsigned short. */
+int
+silj_p (vector unsigned short arg)
+{
+ return vec_stril_p (arg);
+}
+
+int main (int argc, short *argv [])
+{
+ vector unsigned short input1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short input2 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short input3 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector unsigned short input4 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+
+ if (silj_p (input1))
+ abort ();
+ if (!silj_p (input2))
+ abort ();
+ if (!silj_p (input3))
+ abort ();
+ if (!silj_p (input4))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril_p-6.c b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-6.c
new file mode 100644
index 00000000000..de98a9d4e36
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-6.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate left-justified on array of signed short. */
+int
+silj_p (vector signed short arg)
+{
+ return vec_stril_p (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril_p-7.c b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-7.c
new file mode 100644
index 00000000000..900aaf17f46
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-7.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate left-justified on array of signed short. */
+int
+silj_p (vector signed short arg)
+{
+ return vec_stril_p (arg);
+}
+
+int main (int argc, short *argv [])
+{
+ vector signed short input1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short input2 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short input3 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector signed short input4 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+
+ if (silj_p (input1))
+ abort ();
+ if (!silj_p (input2))
+ abort ();
+ if (!silj_p (input3))
+ abort ();
+ if (!silj_p (input4))
+ abort ();
+
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril_p-8.c b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-8.c
new file mode 100644
index 00000000000..35be29a35d0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-8.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int main (int argc, char *argv [])
+{
+ vector unsigned char input1 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char input2 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector unsigned char input3 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector unsigned char input4 =
+ { 0x1, 0x2, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+
+ if (vec_stril_p (input1))
+ abort ();
+ if (!vec_stril_p (input2))
+ abort ();
+ if (!vec_stril_p (input3))
+ abort ();
+ if (!vec_stril_p (input4))
+ abort ();
+
+}
+
+/* Enforce that exactly four dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribl\.} 4 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\.} 4 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-stril_p-9.c b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-9.c
new file mode 100644
index 00000000000..e108a56a159
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-stril_p-9.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int main (int argc, char *argv [])
+{
+ vector signed char input1 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0xf, 0x11 };
+ vector signed char input2 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector signed char input3 =
+ { 0x1, 0x2, 0xf3, 0x0, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 };
+ vector signed char input4 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 };
+
+ if (vec_stril_p (input1))
+ abort ();
+ if (!vec_stril_p (input2))
+ abort ();
+ if (!vec_stril_p (input3))
+ abort ();
+ if (!vec_stril_p (input4))
+ abort ();
+
+}
+
+/* Enforce that exactly four dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribl\.} 4 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\.} 4 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-0.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-0.c
new file mode 100644
index 00000000000..65e0fd8b775
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-0.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of unsigned char. */
+vector unsigned char
+sirj (vector unsigned char arg)
+{
+ return vec_strir (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribr\M} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-1.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-1.c
new file mode 100644
index 00000000000..ff09cd3dd92
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-1.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of unsigned char. */
+vector unsigned char
+sirj (vector unsigned char arg)
+{
+ return vec_strir (arg);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned char input1 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char expected1 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char input2 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector unsigned char expected2 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0x11 };
+ vector unsigned char input3 =
+ { 0x1, 0x2, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector unsigned char expected3 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0x11 };
+ vector unsigned char input4 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector unsigned char expected4 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0x11 };
+
+ if (!vec_all_eq (sirj (input1), expected1))
+ abort ();
+ if (!vec_all_eq (sirj (input2), expected2))
+ abort ();
+ if (!vec_all_eq (sirj (input3), expected3))
+ abort ();
+ if (!vec_all_eq (sirj (input4), expected4))
+ abort ();
+
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-10.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-10.c
new file mode 100644
index 00000000000..4cccdb870ea
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-10.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10" } */
+/* See vec-strir-11.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+vector signed char
+doString(vector signed char *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector signed char result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribr\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-11.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-11.c
new file mode 100644
index 00000000000..337450e8674
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-11.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+vector signed char
+doString(vector signed char *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both and should
+ convert tail recursion to iteration with two copies of the "loop
+ body" when compiled with -O2 or -O3. */
+ vector signed char result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that exactly two dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribr\.} 2 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\.} 2 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-12.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-12.c
new file mode 100644
index 00000000000..1634a0e213e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-12.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10" } */
+/* See vec-strir-13.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+vector unsigned short
+doString(vector unsigned short *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector unsigned short result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { le } } } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-13.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-13.c
new file mode 100644
index 00000000000..641940cf651
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-13.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+vector unsigned short
+doString(vector unsigned short *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both and should
+ convert tail recursion to iteration with two copies of the "loop
+ body" when compiled with -O2 or -O3. */
+ vector unsigned short result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that exactly two dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 2 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 2 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { le } } } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-14.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-14.c
new file mode 100644
index 00000000000..b5b360ab282
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-14.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10" } */
+/* See vec-strir-15.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+vector signed short
+doString(vector signed short *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector signed short result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-15.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-15.c
new file mode 100644
index 00000000000..e7e766353e1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-15.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+vector signed short
+doString(vector signed short *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both and should
+ convert tail recursion to iteration with two copies of the "loop
+ body" when compiled with -O2 or -O3. */
+ vector signed short result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that exactly two dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 2 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 2 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-16.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-16.c
new file mode 100644
index 00000000000..19e051e06ae
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-16.c
@@ -0,0 +1,56 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10" } */
+/* See vec-strir-17.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned char
+doString(vector unsigned char *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector unsigned char result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned char composed_string [4] = {
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 },
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 },
+ { 0x1, 0x2, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 },
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 }
+ };
+
+ vector unsigned char expected0 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char expected1 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char expected2 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0x11 };
+ vector unsigned char expected3 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0x11 };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-17.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-17.c
new file mode 100644
index 00000000000..00f27cc49e6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-17.c
@@ -0,0 +1,54 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned char
+doString(vector unsigned char *vp)
+{
+ /* Tail recursion replaced with iteration with -O2. */
+ vector unsigned char result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned char composed_string [4] = {
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 },
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 },
+ { 0x1, 0x2, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 },
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 }
+ };
+
+ vector unsigned char expected0 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char expected1 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char expected2 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0x11 };
+ vector unsigned char expected3 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0x11 };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-18.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-18.c
new file mode 100644
index 00000000000..d69b474626a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-18.c
@@ -0,0 +1,56 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10" } */
+/* See vec-strir-19.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector signed char
+doString(vector signed char *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector signed char result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, char *argv [])
+{
+ vector signed char composed_string [4] = {
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0xf, 0x11 },
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 },
+ { 0x1, 0x2, 0xf3, 0x0, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 },
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 }
+ };
+
+ vector signed char expected0 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0xf, 0x11 };
+ vector signed char expected1 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0x11 };
+ vector signed char expected2 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11 };
+ vector signed char expected3 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11 };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-19.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-19.c
new file mode 100644
index 00000000000..3728d49421a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-19.c
@@ -0,0 +1,54 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector signed char
+doString(vector signed char *vp)
+{
+ /* Tail recursion replaced with iteration with -O2. */
+ vector signed char result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, char *argv [])
+{
+ vector signed char composed_string [4] = {
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0xf, 0x11 },
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 },
+ { 0x1, 0x2, 0xf3, 0x0, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 },
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 }
+ };
+
+ vector signed char expected0 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0xf, 0x11 };
+ vector signed char expected1 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0x11 };
+ vector signed char expected2 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11 };
+ vector signed char expected3 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11 };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-2.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-2.c
new file mode 100644
index 00000000000..9459011709c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of signed char. */
+vector signed char
+sirj (vector signed char arg)
+{
+ return vec_strir (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribr\M} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-20.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-20.c
new file mode 100644
index 00000000000..a635a041edd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-20.c
@@ -0,0 +1,48 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10" } */
+/* See vec-strir-21.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned short
+doString(vector unsigned short *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector unsigned short result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, short *argv [])
+{
+ vector unsigned short composed_string [4] = {
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 },
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0x0, 0xd, 0xe }
+ };
+
+ vector unsigned short expected0 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short expected1 =
+ { 0x0, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short expected2 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector unsigned short expected3 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xd, 0xe };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-21.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-21.c
new file mode 100644
index 00000000000..5557d5de229
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-21.c
@@ -0,0 +1,46 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector unsigned short
+doString(vector unsigned short *vp)
+{
+ /* Iteration replaces tail recursion with -O2. */
+ vector unsigned short result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, short *argv [])
+{
+ vector unsigned short composed_string [4] = {
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 },
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0x0, 0xd, 0xe }
+ };
+
+ vector unsigned short expected0 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short expected1 =
+ { 0x0, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short expected2 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector unsigned short expected3 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xd, 0xe };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-22.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-22.c
new file mode 100644
index 00000000000..328a56b619e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-22.c
@@ -0,0 +1,48 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10" } */
+/* See vec-strir-23.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector signed short
+doString(vector signed short *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector signed short result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, short *argv [])
+{
+ vector signed short composed_string [4] = {
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 },
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0x0, 0xd, 0xe }
+ };
+
+ vector signed short expected0 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short expected1 =
+ { 0x0, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short expected2 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector signed short expected3 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xd, 0xe };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-23.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-23.c
new file mode 100644
index 00000000000..5f05ab28f75
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-23.c
@@ -0,0 +1,46 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+vector signed short
+doString(vector signed short *vp)
+{
+ /* Iteration replaces tail recursion with -O2. */
+ vector signed short result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+int main (int argc, short *argv [])
+{
+ vector signed short composed_string [4] = {
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 },
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0x0, 0xd, 0xe }
+ };
+
+ vector signed short expected0 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short expected1 =
+ { 0x0, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short expected2 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector signed short expected3 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xd, 0xe };
+
+ if (!vec_all_eq (doString (&composed_string[0]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[1]), expected1))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[2]), expected2))
+ abort ();
+ if (!vec_all_eq (doString (&composed_string[3]), expected3))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-3.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-3.c
new file mode 100644
index 00000000000..5fb2306b471
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-3.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of signed char. */
+vector signed char
+sirj (vector signed char arg)
+{
+ return vec_strir (arg);
+}
+
+int main (int argc, char *argv [])
+{
+ vector signed char input1 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0xf, 0x11 };
+ vector signed char expected1 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0xf, 0x11 };
+ vector signed char input2 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector signed char expected2 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0x11 };
+ vector signed char input3 =
+ { 0x1, 0x2, 0xf3, 0x0, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 };
+ vector signed char expected3 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11 };
+ vector signed char input4 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 };
+ vector signed char expected4 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11 };
+
+ if (!vec_all_eq (sirj (input1), expected1))
+ abort ();
+ if (!vec_all_eq (sirj (input2), expected2))
+ abort ();
+ if (!vec_all_eq (sirj (input3), expected3))
+ abort ();
+ if (!vec_all_eq (sirj (input4), expected4))
+ abort ();
+
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-4.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-4.c
new file mode 100644
index 00000000000..5959285a1be
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-4.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of unsigned short. */
+vector unsigned short
+sirj (vector unsigned short arg)
+{
+ return vec_strir (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihr\M} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-5.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-5.c
new file mode 100644
index 00000000000..eabecafa43a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-5.c
@@ -0,0 +1,44 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of unsigned short. */
+vector unsigned short
+sirj (vector unsigned short arg)
+{
+ return vec_strir (arg);
+}
+
+int main (int argc, short *argv [])
+{
+ vector unsigned short input1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short expected1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short input2 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short expected2 =
+ { 0x0, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short input3 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector unsigned short expected3 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector unsigned short input4 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector unsigned short expected4 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+
+ if (!vec_all_eq (sirj (input1), expected1))
+ abort ();
+ if (!vec_all_eq (sirj (input2), expected2))
+ abort ();
+ if (!vec_all_eq (sirj (input3), expected3))
+ abort ();
+ if (!vec_all_eq (sirj (input4), expected4))
+ abort ();
+
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-6.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-6.c
new file mode 100644
index 00000000000..a31dc613767
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-6.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of signed short. */
+vector signed short
+sirj (vector signed short arg)
+{
+ return vec_strir (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihr\M} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-7.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-7.c
new file mode 100644
index 00000000000..a73efea68ee
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-7.c
@@ -0,0 +1,44 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of signed short. */
+vector signed short
+sirj (vector signed short arg)
+{
+ return vec_strir (arg);
+}
+
+int main (int argc, short *argv [])
+{
+ vector signed short input1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short expected1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short input2 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short expected2 =
+ { 0x0, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short input3 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector signed short expected3 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+ vector signed short input4 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector signed short expected4 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+
+ if (!vec_all_eq (sirj (input1), expected1))
+ abort ();
+ if (!vec_all_eq (sirj (input2), expected2))
+ abort ();
+ if (!vec_all_eq (sirj (input3), expected3))
+ abort ();
+ if (!vec_all_eq (sirj (input4), expected4))
+ abort ();
+
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-8.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-8.c
new file mode 100644
index 00000000000..c9db0f9e039
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-8.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -mdejagnu-cpu=power10" } */
+/* See vec-strir-9.c for the same test with -O2 optimization. */
+
+#include <altivec.h>
+
+vector unsigned char
+doString(vector unsigned char *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both with -O1. */
+ vector unsigned char result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribr\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir-9.c b/gcc/testsuite/gcc.target/powerpc/vec-strir-9.c
new file mode 100644
index 00000000000..6af8924e1ed
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir-9.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+vector unsigned char
+doString(vector unsigned char *vp)
+{
+ /* Though two built-in functions are called, the implementation
+ should use a single instruction to implement both and should
+ convert tail recursion to iteration with two copies of the "loop
+ body" when compiled with -O2 or -O3. */
+ vector unsigned char result = vec_strir (*vp);
+ if (vec_strir_p (*vp))
+ return result;
+ else
+ return doString (vp + 1);
+}
+
+/* Enforce that exactly two dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribr\.} 2 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\.} 2 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir_p-0.c b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-0.c
new file mode 100644
index 00000000000..e294f869689
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-0.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of unsigned char. */
+int
+sirj_p (vector unsigned char arg)
+{
+ return vec_strir_p (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribr\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir_p-1.c b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-1.c
new file mode 100644
index 00000000000..569b8b466e3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-1.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of unsigned char. */
+int
+sirj_p (vector unsigned char arg)
+{
+ return vec_strir_p (arg);
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned char input1 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char input2 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector unsigned char input3 =
+ { 0x1, 0x2, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector unsigned char input4 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+
+ if (sirj_p (input1))
+ abort ();
+ if (!sirj_p (input2))
+ abort ();
+ if (!sirj_p (input3))
+ abort ();
+ if (!sirj_p (input4))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir_p-10.c b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-10.c
new file mode 100644
index 00000000000..86e33645463
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-10.c
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int main (int argc, short *argv [])
+{
+ vector unsigned short input1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short expected1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short input2 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short expected2 =
+ { 0x0, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short input3 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector unsigned short expected3 =
+ { 0x0, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector unsigned short input4 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector unsigned short expected4 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+
+ if (vec_strir_p (input1))
+ abort ();
+ if (!vec_strir_p (input2))
+ abort ();
+ if (!vec_strir_p (input3))
+ abort ();
+ if (!vec_strir_p (input4))
+ abort ();
+
+}
+
+/* Enforce that exactly four dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 4 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 4 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir_p-11.c b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-11.c
new file mode 100644
index 00000000000..118310c4af6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-11.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int main (int argc, short *argv [])
+{
+ vector signed short input1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short input2 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short input3 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector signed short input4 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+
+ if (vec_strir_p (input1))
+ abort ();
+ if (!vec_strir_p (input2))
+ abort ();
+ if (!vec_strir_p (input3))
+ abort ();
+ if (!vec_strir_p (input4))
+ abort ();
+
+}
+
+/* Enforce that exactly four dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 4 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 4 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir_p-2.c b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-2.c
new file mode 100644
index 00000000000..5c8cfab4a7d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-2.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of signed char. */
+int
+sirj_p (vector signed char arg)
+{
+ return vec_strir_p (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribr\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir_p-3.c b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-3.c
new file mode 100644
index 00000000000..3a411feb409
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-3.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of signed char. */
+int
+sirj_p (vector signed char arg)
+{
+ return vec_strir_p (arg);
+}
+
+int main (int argc, char *argv [])
+{
+ vector signed char input1 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0xf, 0x11 };
+ vector signed char input2 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector signed char input3 =
+ { 0x1, 0x2, 0xf3, 0x0, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 };
+ vector signed char input4 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 };
+
+ if (sirj_p (input1))
+ abort ();
+ if (!sirj_p (input2))
+ abort ();
+ if (!sirj_p (input3))
+ abort ();
+ if (!sirj_p (input4))
+ abort ();
+
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir_p-4.c b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-4.c
new file mode 100644
index 00000000000..16ebab1b3a0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-4.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of unsigned short. */
+int
+sirj_p (vector unsigned short arg)
+{
+ return vec_strir_p (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir_p-5.c b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-5.c
new file mode 100644
index 00000000000..0edff34737b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-5.c
@@ -0,0 +1,44 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of unsigned short. */
+int
+sirj_p (vector unsigned short arg)
+{
+ return vec_strir_p (arg);
+}
+
+int main (int argc, short *argv [])
+{
+ vector unsigned short input1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short expected1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short input2 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short expected2 =
+ { 0x0, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector unsigned short input3 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector unsigned short expected3 =
+ { 0x0, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector unsigned short input4 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector unsigned short expected4 =
+ { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+
+ if (sirj_p (input1))
+ abort ();
+ if (!sirj_p (input2))
+ abort ();
+ if (!sirj_p (input3))
+ abort ();
+ if (!sirj_p (input4))
+ abort ();
+
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir_p-6.c b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-6.c
new file mode 100644
index 00000000000..0c635d03a38
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-6.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of signed short. */
+int
+sirj_p (vector signed short arg)
+{
+ return vec_strir_p (arg);
+}
+
+/* Enforce that a single dot-form instruction which is properly biased
+ for the target's endianness implements this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstrihr\.} 1 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\.} 1 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstrihr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir_p-7.c b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-7.c
new file mode 100644
index 00000000000..18926b0d738
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-7.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+/* Vector string isolate right-justified on array of signed short. */
+int
+sirj_p (vector signed short arg)
+{
+ return vec_strir_p (arg);
+}
+
+int main (int argc, short *argv [])
+{
+ vector signed short input1 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short input2 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
+ vector signed short input3 =
+ { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+ vector signed short input4 =
+ { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
+
+ if (sirj_p (input1))
+ abort ();
+ if (!sirj_p (input2))
+ abort ();
+ if (!sirj_p (input3))
+ abort ();
+ if (!sirj_p (input4))
+ abort ();
+
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir_p-8.c b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-8.c
new file mode 100644
index 00000000000..0338ad8df3f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-8.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int main (int argc, char *argv [])
+{
+ vector unsigned char input1 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
+ vector unsigned char input2 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector unsigned char input3 =
+ { 0x1, 0x2, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector unsigned char input4 =
+ { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+
+ if (!vec_strir_p (input1))
+ abort ();
+ if (!vec_strir_p (input2))
+ abort ();
+ if (!vec_strir_p (input3))
+ abort ();
+ if (!vec_strir_p (input4))
+ abort ();
+}
+
+/* Enforce that exactly four dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribr\.} 4 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\.} 4 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { le } } } } */
+
+
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-strir_p-9.c b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-9.c
new file mode 100644
index 00000000000..818b76cc8ab
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-strir_p-9.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+int main (int argc, char *argv [])
+{
+ vector signed char input1 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0xf, 0x11 };
+ vector signed char input2 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
+ vector signed char input3 =
+ { 0x1, 0x2, 0xf3, 0x0, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 };
+ vector signed char input4 =
+ { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
+ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 };
+
+ if (vec_strir_p (input1))
+ abort ();
+ if (!vec_strir_p (input2))
+ abort ();
+ if (!vec_strir_p (input3))
+ abort ();
+ if (!vec_strir_p (input4))
+ abort ();
+
+}
+
+/* Enforce that exactly four dot-form instructions which are properly biased
+ for the target's endianness implement this built-in. */
+
+/* { dg-final { scan-assembler-times {\mvstribr\.} 4 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr\M[^.]} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl} 0 { target { be } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\.} 4 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribl\M[^.]} 0 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mvstribr} 0 { target { le } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-0.c b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-0.c
new file mode 100644
index 00000000000..bf97dd0034c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-0.c
@@ -0,0 +1,120 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+#define NumSamples 4
+
+void
+doTests00000001 (vector unsigned char a_sources [],
+ vector unsigned char b_sources [],
+ vector unsigned char c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned char a = a_sources [i];
+ vector unsigned char b = b_sources [j];
+ vector unsigned char c = c_sources [k];
+ vector unsigned char result = vec_ternarylogic (a, b, c, 0x01);
+ vector unsigned char intended = (a & b & c);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void
+doTests11100101 (vector unsigned char a_sources [],
+ vector unsigned char b_sources [],
+ vector unsigned char c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned char a = a_sources [i];
+ vector unsigned char b = b_sources [j];
+ vector unsigned char c = c_sources [k];
+ vector unsigned char result = vec_ternarylogic (a, b, c, 0xe5);
+ vector unsigned char intended =
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ // Supposed to be a ? c: nand (b,c)
+ for (int l = 0; l < 16; l++)
+ {
+ for (int m = 0; m < 8; m++)
+ {
+ unsigned char bit_selector = (0x01 << m);
+ if (a[l] & bit_selector)
+ intended [l] |= c [l] & bit_selector;
+ else if ((b [l] & c [l] & bit_selector) == 0)
+ intended [l] |= bit_selector;
+ }
+ }
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void
+doTests11110011 (vector unsigned char a_sources [],
+ vector unsigned char b_sources [],
+ vector unsigned char c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned char a = a_sources [i];
+ vector unsigned char b = b_sources [j];
+ vector unsigned char c = c_sources [k];
+ vector unsigned char result = vec_ternarylogic (a, b, c, 0xfb);
+ vector unsigned char intended = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ for (int i = 0; i < 16; i++)
+ intended [i] = b [i] | ~(a [i] & c [i]);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned char a_sources [NumSamples] = {
+ { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+ 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 },
+ { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
+ { 0xcc, 0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55, 0x55,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7,
+ 0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x69 },
+ };
+ vector unsigned char b_sources [NumSamples] = {
+ { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+ 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 },
+ { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
+ { 0xcc, 0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55, 0x55,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7,
+ 0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x69 },
+ };
+ vector unsigned char c_sources [NumSamples] = {
+ { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+ 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 },
+ { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
+ { 0xcc, 0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55, 0x55,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7,
+ 0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x69 },
+ };
+
+ doTests00000001 (a_sources, b_sources, c_sources);
+ doTests11100101 (a_sources, b_sources, c_sources);
+ doTests11110011 (a_sources, b_sources, c_sources);
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mxxeval\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-1.c b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-1.c
new file mode 100644
index 00000000000..052d99de834
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-1.c
@@ -0,0 +1,119 @@
+/* { dg-do run} */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+#define NumSamples 4
+
+void
+doTests00000001 (vector unsigned char a_sources [],
+ vector unsigned char b_sources [],
+ vector unsigned char c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned char a = a_sources [i];
+ vector unsigned char b = b_sources [j];
+ vector unsigned char c = c_sources [k];
+ vector unsigned char result = vec_ternarylogic (a, b, c, 0x01);
+ vector unsigned char intended = (a & b & c);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void
+doTests11100101 (vector unsigned char a_sources [],
+ vector unsigned char b_sources [],
+ vector unsigned char c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned char a = a_sources [i];
+ vector unsigned char b = b_sources [j];
+ vector unsigned char c = c_sources [k];
+ vector unsigned char result = vec_ternarylogic (a, b, c, 0xe5);
+ vector unsigned char intended =
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ // Supposed to be a ? c: nand (b,c)
+ for (int l = 0; l < 16; l++)
+ {
+ for (int m = 0; m < 8; m++)
+ {
+ unsigned char bit_selector = (0x01 << m);
+ if (a[l] & bit_selector)
+ intended [l] |= c [l] & bit_selector;
+ else if ((b [l] & c [l] & bit_selector) == 0)
+ intended [l] |= bit_selector;
+ }
+ }
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void
+doTests11110011 (vector unsigned char a_sources [],
+ vector unsigned char b_sources [],
+ vector unsigned char c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned char a = a_sources [i];
+ vector unsigned char b = b_sources [j];
+ vector unsigned char c = c_sources [k];
+ vector unsigned char result = vec_ternarylogic (a, b, c, 0xfb);
+ vector unsigned char intended = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ for (int i = 0; i < 16; i++)
+ intended [i] = b [i] | ~(a [i] & c [i]);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned char a_sources [NumSamples] = {
+ { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+ 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 },
+ { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
+ { 0xcc, 0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55, 0x55,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7,
+ 0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x69 },
+ };
+ vector unsigned char b_sources [NumSamples] = {
+ { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+ 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 },
+ { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
+ { 0xcc, 0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55, 0x55,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7,
+ 0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x69 },
+ };
+ vector unsigned char c_sources [NumSamples] = {
+ { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+ 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 },
+ { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
+ { 0xcc, 0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55, 0x55,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7,
+ 0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x69 },
+ };
+
+ doTests00000001 (a_sources, b_sources, c_sources);
+ doTests11100101 (a_sources, b_sources, c_sources);
+ doTests11110011 (a_sources, b_sources, c_sources);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-10.c b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-10.c
new file mode 100644
index 00000000000..35700fcb364
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-10.c
@@ -0,0 +1,130 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int128 } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+#define NumSamples 4
+
+/* vec_all_eq not yet supported for arguments of type
+ vector unsigned __int128. */
+int
+vector_equal (vector unsigned __int128 a, vector unsigned __int128 b)
+{
+ return a[0] == b[0];
+}
+
+void
+doTests00000001 (vector unsigned __int128 a_sources [],
+ vector unsigned __int128 b_sources [],
+ vector unsigned __int128 c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned __int128 a = a_sources [i];
+ vector unsigned __int128 b = b_sources [j];
+ vector unsigned __int128 c = c_sources [k];
+ vector unsigned __int128 result;
+ result = vec_ternarylogic (a, b, c, 0xfff); /* { dg-error "8-bit unsigned literal" } */
+ vector unsigned __int128 intended = (a & b & c);
+ if (!vector_equal (result, intended))
+ abort ();
+ }
+}
+
+void
+doTests11100101 (vector unsigned __int128 a_sources [],
+ vector unsigned __int128 b_sources [],
+ vector unsigned __int128 c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned __int128 a = a_sources [i];
+ vector unsigned __int128 b = b_sources [j];
+ vector unsigned __int128 c = c_sources [k];
+ vector unsigned __int128 result;
+ result = vec_ternarylogic (a, b, c, -1); /* { dg-error "8-bit unsigned literal" } */
+ vector unsigned __int128 intended = { 0 };
+ // Supposed to be a ? c: nand (b,c)
+ for (int l = 0; l < 1; l++)
+ {
+ for (int m = 0; m < 128; m++)
+ {
+ unsigned __int128 bit_selector = 0x01;
+ bit_selector = bit_selector << m;
+
+ if (a[l] & bit_selector)
+ intended [l] |= c [l] & bit_selector;
+ else if ((b [l] & c [l] & bit_selector) == 0)
+ intended [l] |= bit_selector;
+ }
+ }
+ if (!vector_equal (result, intended))
+ abort ();
+ }
+}
+
+void
+doTests11110011 (vector unsigned __int128 a_sources [],
+ vector unsigned __int128 b_sources [],
+ vector unsigned __int128 c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned __int128 a = a_sources [i];
+ vector unsigned __int128 b = b_sources [j];
+ vector unsigned __int128 c = c_sources [k];
+ vector unsigned __int128 result;
+ result = vec_ternarylogic (a, b, c, i); /* { dg-error "8-bit unsigned literal" } */
+ vector unsigned __int128 intended = { 0 };
+ for (int i = 0; i < 1; i++)
+ intended [i] = b [i] | ~(a [i] & c [i]);
+ if (!vector_equal (result, intended))
+ abort ();
+ }
+}
+
+int main (int argc, int *argv [])
+{
+ vector unsigned __int128 a_sources [NumSamples];
+ vector unsigned __int128 b_sources [NumSamples];
+ vector unsigned __int128 c_sources [NumSamples];
+
+ a_sources [0][0] = 0x0123456789abcdefull;
+ a_sources [0][0] = a_sources [0][0] << 64 | 0x123456789abcdef0ull;
+ a_sources [1][0] = 0x5555555555555555ull;
+ a_sources [1][0] = a_sources [1][0] << 64 | 0xffffffffffffffffull;
+ a_sources [2][0] = 0xcccccccc55555555ull;
+ a_sources [2][0] = a_sources [2][0] << 64 | 0x0000000000000000ull;
+ a_sources [3][0] = 0xe7e7e7e7e7e7e7e7ull;
+ a_sources [3][0] = a_sources [3][0] << 64 | 0x6969696969696969ull;
+
+ b_sources [0][0] = 0x0123456789abcdefull;
+ b_sources [0][0] = b_sources [0][0] << 64 | 0x123456789abcdef0ull;
+ b_sources [1][0] = 0x5555555555555555ull;
+ b_sources [1][0] = b_sources [1][0] << 64 | 0xffffffffffffffffull;
+ b_sources [2][0] = 0xcccccccc55555555ull;
+ b_sources [2][0] = b_sources [2][0] << 64 | 0x0000000000000000ull;
+ b_sources [3][0] = 0xe7e7e7e7e7e7e7e7ull;
+ b_sources [3][0] = b_sources [3][0] << 64 | 0x6969696969696969ull;
+
+ c_sources [0][0] = 0x0123456789abcdefull;
+ c_sources [0][0] = c_sources [0][0] << 64 | 0x123456789abcdef0ull;
+ c_sources [1][0] = 0x5555555555555555ull;
+ c_sources [1][0] = c_sources [1][0] << 64 | 0xffffffffffffffffull;
+ c_sources [2][0] = 0xcccccccc55555555ull;
+ c_sources [2][0] = c_sources [2][0] << 64 | 0x0000000000000000ull;
+ c_sources [3][0] = 0xe7e7e7e7e7e7e7e7ull;
+ c_sources [3][0] = c_sources [3][0] << 64 | 0x6969696969696969ull;
+
+ doTests00000001 (a_sources, b_sources, c_sources);
+ doTests11100101 (a_sources, b_sources, c_sources);
+ doTests11110011 (a_sources, b_sources, c_sources);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-2.c b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-2.c
new file mode 100644
index 00000000000..ec53ff29102
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-2.c
@@ -0,0 +1,105 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+#define NumSamples 4
+
+void
+doTests00000001 (vector unsigned short int a_sources [],
+ vector unsigned short int b_sources [],
+ vector unsigned short int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned short a = a_sources [i];
+ vector unsigned short b = b_sources [j];
+ vector unsigned short c = c_sources [k];
+ vector unsigned short result = vec_ternarylogic (a, b, c, 0x01);
+ vector unsigned short intended = (a & b & c);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void doTests11100101 (vector unsigned short int a_sources [],
+ vector unsigned short int b_sources [],
+ vector unsigned short int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned short a = a_sources [i];
+ vector unsigned short b = b_sources [j];
+ vector unsigned short c = c_sources [k];
+ vector unsigned short result = vec_ternarylogic (a, b, c, 0xe5);
+ vector unsigned short intended =
+ { 0, 0, 0, 0, 0, 0, 0, 0 };
+ // Supposed to be a ? c: nand (b,c)
+ for (int l = 0; l < 8; l++)
+ {
+ for (int m = 0; m < 16; m++)
+ {
+ unsigned short int bit_selector = (0x01 << m);
+ if (a[l] & bit_selector)
+ intended [l] |= c [l] & bit_selector;
+ else if ((b [l] & c [l] & bit_selector) == 0)
+ intended [l] |= bit_selector;
+ }
+ }
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void doTests11110011 (vector unsigned short int a_sources [],
+ vector unsigned short int b_sources [],
+ vector unsigned short int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned short a = a_sources [i];
+ vector unsigned short b = b_sources [j];
+ vector unsigned short c = c_sources [k];
+ vector unsigned short result = vec_ternarylogic (a, b, c, 0xfb);
+ vector unsigned short intended = { 0, 0, 0, 0, 0, 0, 0, 0 };
+ for (int i = 0; i < 8; i++)
+ intended [i] = b [i] | ~(a [i] & c [i]);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+int main (int argc, short *argv [])
+{
+ vector unsigned short int a_sources [NumSamples] = {
+ { 0x0123, 0x4567, 0x89ab, 0xcdef, 0x1234, 0x5678, 0x9abc, 0xdef0 },
+ { 0x5555, 0x5555, 0x5555, 0x5555, 0xffff, 0xffff, 0xffff, 0xffff },
+ { 0xcccc, 0xcccc, 0x5555, 0x5555, 0x0000, 0x0000, 0x0000, 0x0000 },
+ { 0xe7e7, 0xe7e7, 0xe7e7, 0xe7e7, 0x6969, 0x6969, 0x6969, 0x6969 },
+ };
+ vector unsigned short int b_sources [NumSamples] = {
+ { 0x0123, 0x4567, 0x89ab, 0xcdef, 0x1234, 0x5678, 0x9abc, 0xdef0 },
+ { 0x5555, 0x5555, 0x5555, 0x5555, 0xffff, 0xffff, 0xffff, 0xffff },
+ { 0xcccc, 0xcccc, 0x5555, 0x5555, 0x0000, 0x0000, 0x0000, 0x0000 },
+ { 0xe7e7, 0xe7e7, 0xe7e7, 0xe7e7, 0x6969, 0x6969, 0x6969, 0x6969 },
+ };
+ vector unsigned short int c_sources [NumSamples] = {
+ { 0x0123, 0x4567, 0x89ab, 0xcdef, 0x1234, 0x5678, 0x9abc, 0xdef0 },
+ { 0x5555, 0x5555, 0x5555, 0x5555, 0xffff, 0xffff, 0xffff, 0xffff },
+ { 0xcccc, 0xcccc, 0x5555, 0x5555, 0x0000, 0x0000, 0x0000, 0x0000 },
+ { 0xe7e7, 0xe7e7, 0xe7e7, 0xe7e7, 0x6969, 0x6969, 0x6969, 0x6969 },
+ };
+
+ doTests00000001 (a_sources, b_sources, c_sources);
+ doTests11100101 (a_sources, b_sources, c_sources);
+ doTests11110011 (a_sources, b_sources, c_sources);
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mxxeval\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-3.c b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-3.c
new file mode 100644
index 00000000000..411bafe7e16
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-3.c
@@ -0,0 +1,106 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+#define NumSamples 4
+
+void
+doTests00000001 (vector unsigned short int a_sources [],
+ vector unsigned short int b_sources [],
+ vector unsigned short int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned short a = a_sources [i];
+ vector unsigned short b = b_sources [j];
+ vector unsigned short c = c_sources [k];
+ vector unsigned short result = vec_ternarylogic (a, b, c, 0x01);
+ vector unsigned short intended = (a & b & c);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void doTests11100101 (vector unsigned short int a_sources [],
+ vector unsigned short int b_sources [],
+ vector unsigned short int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned short a = a_sources [i];
+ vector unsigned short b = b_sources [j];
+ vector unsigned short c = c_sources [k];
+ vector unsigned short result = vec_ternarylogic (a, b, c, 0xe5);
+ vector unsigned short intended =
+ { 0, 0, 0, 0, 0, 0, 0, 0 };
+ // Supposed to be a ? c: nand (b,c)
+ for (int l = 0; l < 8; l++)
+ {
+ for (int m = 0; m < 16; m++)
+ {
+ unsigned short int bit_selector = (0x01 << m);
+ if (a[l] & bit_selector)
+ intended [l] |= c [l] & bit_selector;
+ else if ((b [l] & c [l] & bit_selector) == 0)
+ intended [l] |= bit_selector;
+ }
+ }
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void doTests11110011 (vector unsigned short int a_sources [],
+ vector unsigned short int b_sources [],
+ vector unsigned short int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned short a = a_sources [i];
+ vector unsigned short b = b_sources [j];
+ vector unsigned short c = c_sources [k];
+ vector unsigned short result = vec_ternarylogic (a, b, c, 0xfb);
+ vector unsigned short intended = { 0, 0, 0, 0, 0, 0, 0, 0 };
+ for (int i = 0; i < 8; i++)
+ intended [i] = b [i] | ~(a [i] & c [i]);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+int main (int argc, short *argv [])
+{
+ vector unsigned short int a_sources [NumSamples] = {
+ { 0x0123, 0x4567, 0x89ab, 0xcdef, 0x1234, 0x5678, 0x9abc, 0xdef0 },
+ { 0x5555, 0x5555, 0x5555, 0x5555, 0xffff, 0xffff, 0xffff, 0xffff },
+ { 0xcccc, 0xcccc, 0x5555, 0x5555, 0x0000, 0x0000, 0x0000, 0x0000 },
+ { 0xe7e7, 0xe7e7, 0xe7e7, 0xe7e7, 0x6969, 0x6969, 0x6969, 0x6969 },
+ };
+ vector unsigned short int b_sources [NumSamples] = {
+ { 0x0123, 0x4567, 0x89ab, 0xcdef, 0x1234, 0x5678, 0x9abc, 0xdef0 },
+ { 0x5555, 0x5555, 0x5555, 0x5555, 0xffff, 0xffff, 0xffff, 0xffff },
+ { 0xcccc, 0xcccc, 0x5555, 0x5555, 0x0000, 0x0000, 0x0000, 0x0000 },
+ { 0xe7e7, 0xe7e7, 0xe7e7, 0xe7e7, 0x6969, 0x6969, 0x6969, 0x6969 },
+ };
+ vector unsigned short int c_sources [NumSamples] = {
+ { 0x0123, 0x4567, 0x89ab, 0xcdef, 0x1234, 0x5678, 0x9abc, 0xdef0 },
+ { 0x5555, 0x5555, 0x5555, 0x5555, 0xffff, 0xffff, 0xffff, 0xffff },
+ { 0xcccc, 0xcccc, 0x5555, 0x5555, 0x0000, 0x0000, 0x0000, 0x0000 },
+ { 0xe7e7, 0xe7e7, 0xe7e7, 0xe7e7, 0x6969, 0x6969, 0x6969, 0x6969 },
+ };
+
+ doTests00000001 (a_sources, b_sources, c_sources);
+ doTests11100101 (a_sources, b_sources, c_sources);
+ doTests11110011 (a_sources, b_sources, c_sources);
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mxxeval\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-4.c b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-4.c
new file mode 100644
index 00000000000..49767e9d90e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-4.c
@@ -0,0 +1,104 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+#define NumSamples 4
+
+void
+doTests00000001 (vector unsigned int a_sources [],
+ vector unsigned int b_sources [],
+ vector unsigned int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned int a = a_sources [i];
+ vector unsigned int b = b_sources [j];
+ vector unsigned int c = c_sources [k];
+ vector unsigned int result = vec_ternarylogic (a, b, c, 0x01);
+ vector unsigned int intended = (a & b & c);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void doTests11100101 (vector unsigned int a_sources [],
+ vector unsigned int b_sources [],
+ vector unsigned int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned int a = a_sources [i];
+ vector unsigned int b = b_sources [j];
+ vector unsigned int c = c_sources [k];
+ vector unsigned int result = vec_ternarylogic (a, b, c, 0xe5);
+ vector unsigned int intended = { 0, 0, 0, 0 };
+ // Supposed to be a ? c: nand (b,c)
+ for (int l = 0; l < 4; l++)
+ {
+ for (int m = 0; m < 32; m++)
+ {
+ unsigned int bit_selector = (0x01 << m);
+ if (a[l] & bit_selector)
+ intended [l] |= c [l] & bit_selector;
+ else if ((b [l] & c [l] & bit_selector) == 0)
+ intended [l] |= bit_selector;
+ }
+ }
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void doTests11110011 (vector unsigned int a_sources [],
+ vector unsigned int b_sources [],
+ vector unsigned int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned int a = a_sources [i];
+ vector unsigned int b = b_sources [j];
+ vector unsigned int c = c_sources [k];
+ vector unsigned int result = vec_ternarylogic (a, b, c, 0xfb);
+ vector unsigned int intended = { 0, 0, 0, 0 };
+ for (int i = 0; i < 4; i++)
+ intended [i] = b [i] | ~(a [i] & c [i]);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+int main (int argc, int *argv [])
+{
+ vector unsigned int a_sources [NumSamples] = {
+ { 0x01234567, 0x89abcdef, 0x12345678, 0x9abcdef0 },
+ { 0x55555555, 0x55555555, 0xffffffff, 0xffffffff },
+ { 0xcccccccc, 0x55555555, 0x00000000, 0x00000000 },
+ { 0xe7e7e7e7, 0xe7e7e7e7, 0x69696969, 0x69696969 },
+ };
+ vector unsigned int b_sources [NumSamples] = {
+ { 0x01234567, 0x89abcdef, 0x12345678, 0x9abcdef0 },
+ { 0x55555555, 0x55555555, 0xffffffff, 0xffffffff },
+ { 0xcccccccc, 0x55555555, 0x00000000, 0x00000000 },
+ { 0xe7e7e7e7, 0xe7e7e7e7, 0x69696969, 0x69696969 },
+ };
+ vector unsigned int c_sources [NumSamples] = {
+ { 0x01234567, 0x89abcdef, 0x12345678, 0x9abcdef0 },
+ { 0x55555555, 0x55555555, 0xffffffff, 0xffffffff },
+ { 0xcccccccc, 0x55555555, 0x00000000, 0x00000000 },
+ { 0xe7e7e7e7, 0xe7e7e7e7, 0x69696969, 0x69696969 },
+ };
+
+ doTests00000001 (a_sources, b_sources, c_sources);
+ doTests11100101 (a_sources, b_sources, c_sources);
+ doTests11110011 (a_sources, b_sources, c_sources);
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mxxeval\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-5.c b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-5.c
new file mode 100644
index 00000000000..527e8f2f8bc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-5.c
@@ -0,0 +1,103 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+#define NumSamples 4
+
+void
+doTests00000001 (vector unsigned int a_sources [],
+ vector unsigned int b_sources [],
+ vector unsigned int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned int a = a_sources [i];
+ vector unsigned int b = b_sources [j];
+ vector unsigned int c = c_sources [k];
+ vector unsigned int result = vec_ternarylogic (a, b, c, 0x01);
+ vector unsigned int intended = (a & b & c);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void doTests11100101 (vector unsigned int a_sources [],
+ vector unsigned int b_sources [],
+ vector unsigned int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned int a = a_sources [i];
+ vector unsigned int b = b_sources [j];
+ vector unsigned int c = c_sources [k];
+ vector unsigned int result = vec_ternarylogic (a, b, c, 0xe5);
+ vector unsigned int intended = { 0, 0, 0, 0 };
+ // Supposed to be a ? c: nand (b,c)
+ for (int l = 0; l < 4; l++)
+ {
+ for (int m = 0; m < 32; m++)
+ {
+ unsigned int bit_selector = (0x01 << m);
+ if (a[l] & bit_selector)
+ intended [l] |= c [l] & bit_selector;
+ else if ((b [l] & c [l] & bit_selector) == 0)
+ intended [l] |= bit_selector;
+ }
+ }
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void doTests11110011 (vector unsigned int a_sources [],
+ vector unsigned int b_sources [],
+ vector unsigned int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned int a = a_sources [i];
+ vector unsigned int b = b_sources [j];
+ vector unsigned int c = c_sources [k];
+ vector unsigned int result = vec_ternarylogic (a, b, c, 0xfb);
+ vector unsigned int intended = { 0, 0, 0, 0 };
+ for (int i = 0; i < 4; i++)
+ intended [i] = b [i] | ~(a [i] & c [i]);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+int main (int argc, int *argv [])
+{
+ vector unsigned int a_sources [NumSamples] = {
+ { 0x01234567, 0x89abcdef, 0x12345678, 0x9abcdef0 },
+ { 0x55555555, 0x55555555, 0xffffffff, 0xffffffff },
+ { 0xcccccccc, 0x55555555, 0x00000000, 0x00000000 },
+ { 0xe7e7e7e7, 0xe7e7e7e7, 0x69696969, 0x69696969 },
+ };
+ vector unsigned int b_sources [NumSamples] = {
+ { 0x01234567, 0x89abcdef, 0x12345678, 0x9abcdef0 },
+ { 0x55555555, 0x55555555, 0xffffffff, 0xffffffff },
+ { 0xcccccccc, 0x55555555, 0x00000000, 0x00000000 },
+ { 0xe7e7e7e7, 0xe7e7e7e7, 0x69696969, 0x69696969 },
+ };
+ vector unsigned int c_sources [NumSamples] = {
+ { 0x01234567, 0x89abcdef, 0x12345678, 0x9abcdef0 },
+ { 0x55555555, 0x55555555, 0xffffffff, 0xffffffff },
+ { 0xcccccccc, 0x55555555, 0x00000000, 0x00000000 },
+ { 0xe7e7e7e7, 0xe7e7e7e7, 0x69696969, 0x69696969 },
+ };
+
+ doTests00000001 (a_sources, b_sources, c_sources);
+ doTests11100101 (a_sources, b_sources, c_sources);
+ doTests11110011 (a_sources, b_sources, c_sources);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-6.c b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-6.c
new file mode 100644
index 00000000000..ffafb499614
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-6.c
@@ -0,0 +1,104 @@
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+#define NumSamples 4
+
+void
+doTests00000001 (vector unsigned long long int a_sources [],
+ vector unsigned long long int b_sources [],
+ vector unsigned long long int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned long long a = a_sources [i];
+ vector unsigned long long b = b_sources [j];
+ vector unsigned long long c = c_sources [k];
+ vector unsigned long long result = vec_ternarylogic (a, b, c, 0x01);
+ vector unsigned long long intended = (a & b & c);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void doTests11100101 (vector unsigned long long int a_sources [],
+ vector unsigned long long int b_sources [],
+ vector unsigned long long int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned long long a = a_sources [i];
+ vector unsigned long long b = b_sources [j];
+ vector unsigned long long c = c_sources [k];
+ vector unsigned long long result = vec_ternarylogic (a, b, c, 0xe5);
+ vector unsigned long long intended = { 0, 0 };
+ // Supposed to be a ? c: nand (b,c)
+ for (int l = 0; l < 2; l++)
+ {
+ for (int m = 0; m < 64; m++)
+ {
+ unsigned long long int bit_selector = (0x01ll << m);
+ if (a[l] & bit_selector)
+ intended [l] |= c [l] & bit_selector;
+ else if ((b [l] & c [l] & bit_selector) == 0)
+ intended [l] |= (0x01ll << m);
+ }
+ }
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void doTests11110011 (vector unsigned long long int a_sources [],
+ vector unsigned long long int b_sources [],
+ vector unsigned long long int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned long long a = a_sources [i];
+ vector unsigned long long b = b_sources [j];
+ vector unsigned long long c = c_sources [k];
+ vector unsigned long long result = vec_ternarylogic (a, b, c, 0xfb);
+ vector unsigned long long intended = { 0, 0 };
+ intended [0] = b [0] | ~(a [0] & c [0]);
+ intended [1] = b [1] | ~(a [1] & c [1]);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned long long int a_sources [NumSamples] = {
+ { 0x0123456789abcdef, 0x123456789abcdef0 },
+ { 0x5555555555555555, 0xffffffffffffffff },
+ { 0xcccccccc55555555, 0x0000000000000000 },
+ { 0xe7e7e7e7e7e7e7e7, 0x6969696969696969 },
+ };
+ vector unsigned long long int b_sources [NumSamples] = {
+ { 0x0123456789abcdef, 0x123456789abcdef0 },
+ { 0x5555555555555555, 0xffffffffffffffff },
+ { 0xcccccccc55555555, 0x0000000000000000 },
+ { 0xe7e7e7e7e7e7e7e7, 0x6969696969696969 },
+ };
+ vector unsigned long long int c_sources [NumSamples] = {
+ { 0x0123456789abcdef, 0x123456789abcdef0 },
+ { 0x5555555555555555, 0xffffffffffffffff },
+ { 0xcccccccc55555555, 0x0000000000000000 },
+ { 0xe7e7e7e7e7e7e7e7, 0x6969696969696969 },
+ };
+
+ doTests00000001 (a_sources, b_sources, c_sources);
+ doTests11100101 (a_sources, b_sources, c_sources);
+ doTests11110011 (a_sources, b_sources, c_sources);
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mxxeval\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-7.c b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-7.c
new file mode 100644
index 00000000000..b754195c2dc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-7.c
@@ -0,0 +1,103 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+#define NumSamples 4
+
+void
+doTests00000001 (vector unsigned long long int a_sources [],
+ vector unsigned long long int b_sources [],
+ vector unsigned long long int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned long long a = a_sources [i];
+ vector unsigned long long b = b_sources [j];
+ vector unsigned long long c = c_sources [k];
+ vector unsigned long long result = vec_ternarylogic (a, b, c, 0x01);
+ vector unsigned long long intended = (a & b & c);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void doTests11100101 (vector unsigned long long int a_sources [],
+ vector unsigned long long int b_sources [],
+ vector unsigned long long int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned long long a = a_sources [i];
+ vector unsigned long long b = b_sources [j];
+ vector unsigned long long c = c_sources [k];
+ vector unsigned long long result = vec_ternarylogic (a, b, c, 0xe5);
+ vector unsigned long long intended = { 0, 0 };
+ // Supposed to be a ? c: nand (b,c)
+ for (int l = 0; l < 2; l++)
+ {
+ for (int m = 0; m < 64; m++)
+ {
+ unsigned long long int bit_selector = (0x01ll << m);
+ if (a[l] & bit_selector)
+ intended [l] |= c [l] & bit_selector;
+ else if ((b [l] & c [l] & bit_selector) == 0)
+ intended [l] |= (0x01ll << m);
+ }
+ }
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+void doTests11110011 (vector unsigned long long int a_sources [],
+ vector unsigned long long int b_sources [],
+ vector unsigned long long int c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned long long a = a_sources [i];
+ vector unsigned long long b = b_sources [j];
+ vector unsigned long long c = c_sources [k];
+ vector unsigned long long result = vec_ternarylogic (a, b, c, 0xfb);
+ vector unsigned long long intended = { 0, 0 };
+ intended [0] = b [0] | ~(a [0] & c [0]);
+ intended [1] = b [1] | ~(a [1] & c [1]);
+ if (!vec_all_eq (result, intended))
+ abort ();
+ }
+}
+
+int main (int argc, char *argv [])
+{
+ vector unsigned long long int a_sources [NumSamples] = {
+ { 0x0123456789abcdef, 0x123456789abcdef0 },
+ { 0x5555555555555555, 0xffffffffffffffff },
+ { 0xcccccccc55555555, 0x0000000000000000 },
+ { 0xe7e7e7e7e7e7e7e7, 0x6969696969696969 },
+ };
+ vector unsigned long long int b_sources [NumSamples] = {
+ { 0x0123456789abcdef, 0x123456789abcdef0 },
+ { 0x5555555555555555, 0xffffffffffffffff },
+ { 0xcccccccc55555555, 0x0000000000000000 },
+ { 0xe7e7e7e7e7e7e7e7, 0x6969696969696969 },
+ };
+ vector unsigned long long int c_sources [NumSamples] = {
+ { 0x0123456789abcdef, 0x123456789abcdef0 },
+ { 0x5555555555555555, 0xffffffffffffffff },
+ { 0xcccccccc55555555, 0x0000000000000000 },
+ { 0xe7e7e7e7e7e7e7e7, 0x6969696969696969 },
+ };
+
+ doTests00000001 (a_sources, b_sources, c_sources);
+ doTests11100101 (a_sources, b_sources, c_sources);
+ doTests11110011 (a_sources, b_sources, c_sources);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-8.c b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-8.c
new file mode 100644
index 00000000000..6c760ff4e08
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-8.c
@@ -0,0 +1,129 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int128 } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+#define NumSamples 4
+
+/* vec_all_eq not yet supported for arguments of type
+ vector unsigned __int128. */
+int
+vector_equal (vector unsigned __int128 a, vector unsigned __int128 b)
+{
+ return a[0] == b[0];
+}
+
+void
+doTests00000001 (vector unsigned __int128 a_sources [],
+ vector unsigned __int128 b_sources [],
+ vector unsigned __int128 c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned __int128 a = a_sources [i];
+ vector unsigned __int128 b = b_sources [j];
+ vector unsigned __int128 c = c_sources [k];
+ vector unsigned __int128 result = vec_ternarylogic (a, b, c, 0x01);
+ vector unsigned __int128 intended = (a & b & c);
+ if (!vector_equal (result, intended))
+ abort ();
+ }
+}
+
+void
+doTests11100101 (vector unsigned __int128 a_sources [],
+ vector unsigned __int128 b_sources [],
+ vector unsigned __int128 c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned __int128 a = a_sources [i];
+ vector unsigned __int128 b = b_sources [j];
+ vector unsigned __int128 c = c_sources [k];
+ vector unsigned __int128 result = vec_ternarylogic (a, b, c, 0xe5);
+ vector unsigned __int128 intended = { 0 };
+ // Supposed to be a ? c: nand (b,c)
+ for (int l = 0; l < 1; l++)
+ {
+ for (int m = 0; m < 128; m++)
+ {
+ unsigned __int128 bit_selector = 0x01;
+ bit_selector = bit_selector << m;
+
+ if (a[l] & bit_selector)
+ intended [l] |= c [l] & bit_selector;
+ else if ((b [l] & c [l] & bit_selector) == 0)
+ intended [l] |= bit_selector;
+ }
+ }
+ if (!vector_equal (result, intended))
+ abort ();
+ }
+}
+
+void
+doTests11110011 (vector unsigned __int128 a_sources [],
+ vector unsigned __int128 b_sources [],
+ vector unsigned __int128 c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned __int128 a = a_sources [i];
+ vector unsigned __int128 b = b_sources [j];
+ vector unsigned __int128 c = c_sources [k];
+ vector unsigned __int128 result = vec_ternarylogic (a, b, c, 0xfb);
+ vector unsigned __int128 intended = { 0 };
+ for (int i = 0; i < 1; i++)
+ intended [i] = b [i] | ~(a [i] & c [i]);
+ if (!vector_equal (result, intended))
+ abort ();
+ }
+}
+
+int main (int argc, int *argv [])
+{
+ vector unsigned __int128 a_sources [NumSamples];
+ vector unsigned __int128 b_sources [NumSamples];
+ vector unsigned __int128 c_sources [NumSamples];
+
+ a_sources [0][0] = 0x0123456789abcdefull;
+ a_sources [0][0] = a_sources [0][0] << 64 | 0x123456789abcdef0ull;
+ a_sources [1][0] = 0x5555555555555555ull;
+ a_sources [1][0] = a_sources [1][0] << 64 | 0xffffffffffffffffull;
+ a_sources [2][0] = 0xcccccccc55555555ull;
+ a_sources [2][0] = a_sources [2][0] << 64 | 0x0000000000000000ull;
+ a_sources [3][0] = 0xe7e7e7e7e7e7e7e7ull;
+ a_sources [3][0] = a_sources [3][0] << 64 | 0x6969696969696969ull;
+
+ b_sources [0][0] = 0x0123456789abcdefull;
+ b_sources [0][0] = b_sources [0][0] << 64 | 0x123456789abcdef0ull;
+ b_sources [1][0] = 0x5555555555555555ull;
+ b_sources [1][0] = b_sources [1][0] << 64 | 0xffffffffffffffffull;
+ b_sources [2][0] = 0xcccccccc55555555ull;
+ b_sources [2][0] = b_sources [2][0] << 64 | 0x0000000000000000ull;
+ b_sources [3][0] = 0xe7e7e7e7e7e7e7e7ull;
+ b_sources [3][0] = b_sources [3][0] << 64 | 0x6969696969696969ull;
+
+ c_sources [0][0] = 0x0123456789abcdefull;
+ c_sources [0][0] = c_sources [0][0] << 64 | 0x123456789abcdef0ull;
+ c_sources [1][0] = 0x5555555555555555ull;
+ c_sources [1][0] = c_sources [1][0] << 64 | 0xffffffffffffffffull;
+ c_sources [2][0] = 0xcccccccc55555555ull;
+ c_sources [2][0] = c_sources [2][0] << 64 | 0x0000000000000000ull;
+ c_sources [3][0] = 0xe7e7e7e7e7e7e7e7ull;
+ c_sources [3][0] = c_sources [3][0] << 64 | 0x6969696969696969ull;
+
+ doTests00000001 (a_sources, b_sources, c_sources);
+ doTests11100101 (a_sources, b_sources, c_sources);
+ doTests11110011 (a_sources, b_sources, c_sources);
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mxxeval\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-9.c b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-9.c
new file mode 100644
index 00000000000..0d9998e6341
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-9.c
@@ -0,0 +1,130 @@
+/* { dg-do run } */
+/* { dg-require-effective-target power10_hw } */
+/* { dg-require-effective-target int128 } */
+/* { dg-options "-mdejagnu-cpu=power10" } */
+
+#include <altivec.h>
+
+extern void abort (void);
+
+#define NumSamples 4
+
+/* vec_all_eq not yet supported for arguments of type
+ vector unsigned __int128. */
+int
+vector_equal (vector unsigned __int128 a, vector unsigned __int128 b)
+{
+ return a[0] == b[0];
+}
+
+void
+doTests00000001 (vector unsigned __int128 a_sources [],
+ vector unsigned __int128 b_sources [],
+ vector unsigned __int128 c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned __int128 a = a_sources [i];
+ vector unsigned __int128 b = b_sources [j];
+ vector unsigned __int128 c = c_sources [k];
+ vector unsigned __int128 result = vec_ternarylogic (a, b, c, 0x01);
+ vector unsigned __int128 intended = (a & b & c);
+ if (!vector_equal (result, intended))
+ abort ();
+ }
+}
+
+void
+doTests11100101 (vector unsigned __int128 a_sources [],
+ vector unsigned __int128 b_sources [],
+ vector unsigned __int128 c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned __int128 a = a_sources [i];
+ vector unsigned __int128 b = b_sources [j];
+ vector unsigned __int128 c = c_sources [k];
+ vector unsigned __int128 result = vec_ternarylogic (a, b, c, 0xe5);
+ vector unsigned __int128 intended = { 0 };
+ // Supposed to be a ? c: nand (b,c)
+ for (int l = 0; l < 1; l++)
+ {
+ for (int m = 0; m < 128; m++)
+ {
+ unsigned __int128 bit_selector = 0x01;
+ bit_selector = bit_selector << m;
+
+ if (a[l] & bit_selector)
+ intended [l] |= c [l] & bit_selector;
+ else if ((b [l] & c [l] & bit_selector) == 0)
+ intended [l] |= bit_selector;
+ }
+ }
+ if (!vector_equal (result, intended))
+ abort ();
+ }
+}
+
+void
+doTests11110011 (vector unsigned __int128 a_sources [],
+ vector unsigned __int128 b_sources [],
+ vector unsigned __int128 c_sources []) {
+ for (int i = 0; i < NumSamples; i++)
+ for (int j = 0; j < NumSamples; j++)
+ for (int k = 0; k < NumSamples; k++)
+ {
+ vector unsigned __int128 a = a_sources [i];
+ vector unsigned __int128 b = b_sources [j];
+ vector unsigned __int128 c = c_sources [k];
+ vector unsigned __int128 result = vec_ternarylogic (a, b, c, 0xfb);
+ vector unsigned __int128 intended = { 0 };
+ for (int i = 0; i < 1; i++)
+ intended [i] = b [i] | ~(a [i] & c [i]);
+ if (!vector_equal (result, intended))
+ abort ();
+ }
+}
+
+int main (int argc, int *argv [])
+{
+ vector unsigned __int128 a_sources [NumSamples];
+ vector unsigned __int128 b_sources [NumSamples];
+ vector unsigned __int128 c_sources [NumSamples];
+
+ a_sources [0][0] = 0x0123456789abcdefull;
+ a_sources [0][0] = a_sources [0][0] << 64 | 0x123456789abcdef0ull;
+ a_sources [1][0] = 0x5555555555555555ull;
+ a_sources [1][0] = a_sources [1][0] << 64 | 0xffffffffffffffffull;
+ a_sources [2][0] = 0xcccccccc55555555ull;
+ a_sources [2][0] = a_sources [2][0] << 64 | 0x0000000000000000ull;
+ a_sources [3][0] = 0xe7e7e7e7e7e7e7e7ull;
+ a_sources [3][0] = a_sources [3][0] << 64 | 0x6969696969696969ull;
+
+ b_sources [0][0] = 0x0123456789abcdefull;
+ b_sources [0][0] = b_sources [0][0] << 64 | 0x123456789abcdef0ull;
+ b_sources [1][0] = 0x5555555555555555ull;
+ b_sources [1][0] = b_sources [1][0] << 64 | 0xffffffffffffffffull;
+ b_sources [2][0] = 0xcccccccc55555555ull;
+ b_sources [2][0] = b_sources [2][0] << 64 | 0x0000000000000000ull;
+ b_sources [3][0] = 0xe7e7e7e7e7e7e7e7ull;
+ b_sources [3][0] = b_sources [3][0] << 64 | 0x6969696969696969ull;
+
+ c_sources [0][0] = 0x0123456789abcdefull;
+ c_sources [0][0] = c_sources [0][0] << 64 | 0x123456789abcdef0ull;
+ c_sources [1][0] = 0x5555555555555555ull;
+ c_sources [1][0] = c_sources [1][0] << 64 | 0xffffffffffffffffull;
+ c_sources [2][0] = 0xcccccccc55555555ull;
+ c_sources [2][0] = c_sources [2][0] << 64 | 0x0000000000000000ull;
+ c_sources [3][0] = 0xe7e7e7e7e7e7e7e7ull;
+ c_sources [3][0] = c_sources [3][0] << 64 | 0x6969696969696969ull;
+
+ doTests00000001 (a_sources, b_sources, c_sources);
+ doTests11100101 (a_sources, b_sources, c_sources);
+ doTests11110011 (a_sources, b_sources, c_sources);
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\mxxeval\M} } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vector_float.c b/gcc/testsuite/gcc.target/powerpc/vector_float.c
new file mode 100644
index 00000000000..4ac2d9fa2ac
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vector_float.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mdejagnu-cpu=power9" } */
+
+vector float
+test (float *a, float *b, float *c, float *d)
+{
+ return (vector float){*a, *b, *c, *d};
+}
+
+/* { dg-final { scan-assembler-not {\mlxssp} } } */
+/* { dg-final { scan-assembler-not {\mlfs} } } */
+/* { dg-final { scan-assembler-times {\mlwz\M} 4 } } */
+/* { dg-final { scan-assembler-times {\mrldimi\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mmtvsrdd\M} 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-builtin-msum.c b/gcc/testsuite/gcc.target/powerpc/vsx-builtin-msum.c
new file mode 100644
index 00000000000..058ca0b0fe4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-builtin-msum.c
@@ -0,0 +1,26 @@
+/* Verify that overloaded built-ins for vec_msum with __int128
+ inputs generate the proper code. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target int128 } */
+/* { dg-options "-mdejagnu-cpu=power9 -O3" } */
+
+#include <altivec.h>
+
+vector signed __int128
+test_msum_si (vector signed long long vsll_1, vector signed long long vsll_2,
+ vector signed __int128 vsi128)
+{
+ return vec_msum (vsll_1, vsll_2, vsi128);
+}
+
+vector unsigned __int128
+test_msum_ui (vector unsigned long long vull_1, vector unsigned long long vull_2,
+ vector unsigned __int128 vui128)
+{
+ return vec_msum (vull_1, vull_2, vui128);
+}
+
+/* { dg_final { scan_assembler_times "vmsumudm" 2 } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vector-1.c b/gcc/testsuite/gcc.target/powerpc/vsx-vector-1.c
index 493be61e08e..364406ae725 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vector-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vector-1.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O2 -ftree-vectorize -mdejagnu-cpu=power7 -ffast-math" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vector-2.c b/gcc/testsuite/gcc.target/powerpc/vsx-vector-2.c
index 0338a8f67a4..4db63e00c31 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vector-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vector-2.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O2 -ftree-vectorize -mdejagnu-cpu=power7 -ffast-math" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vector-3.c b/gcc/testsuite/gcc.target/powerpc/vsx-vector-3.c
index b9f7d101ef2..9313e77e997 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vector-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vector-3.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O2 -ftree-vectorize -mdejagnu-cpu=power7" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vector-4.c b/gcc/testsuite/gcc.target/powerpc/vsx-vector-4.c
index 8a6fa44e7a0..016366d703d 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vector-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vector-4.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O2 -ftree-vectorize -mdejagnu-cpu=power7" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vector-5.c b/gcc/testsuite/gcc.target/powerpc/vsx-vector-5.c
index 4570dc3e09b..dcc88b1f3a4 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vector-5.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vector-5.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do run { target lp64 } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mvsx -O2" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p8.c b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p8.c
index a99da650492..49f5bf52af5 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p8.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p8.c
@@ -1,6 +1,6 @@
/* { dg-do compile { target lp64 } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-O2 -mdejagnu-cpu=power8" } */
/* Source code for the test in vsx-vector-6.h */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p9.c b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p9.c
index eabdf71a7be..3fdd9f62a4c 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p9.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p9.c
@@ -1,6 +1,6 @@
/* { dg-do compile { target lp64 } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
/* { dg-options "-O2 -mdejagnu-cpu=power9" } */
/* Source code for the test in vsx-vector-6.h */
@@ -9,7 +9,7 @@
/* { dg-final { scan-assembler-times {\mvmaxub\M} 1 } } */
/* { dg-final { scan-assembler-times {\mvmsumshs\M} 1 } } */
/* { dg-final { scan-assembler-times {\mvmsumuhs\M} 1 } } */
-/* { dg-final { scan-assembler-times {\mvpermr?\M} 1 } } */
+/* { dg-final { scan-assembler-times {\m(?:v|xx)permr?\M} 1 } } */
/* { dg-final { scan-assembler-times {\mxvabsdp\M} 1 } } */
/* { dg-final { scan-assembler-times {\mxvadddp\M} 1 } } */
/* { dg-final { scan-assembler-times {\mxvcmpeqdp\M} 9 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vector-abss.c b/gcc/testsuite/gcc.target/powerpc/vsx-vector-abss.c
index d8927b37fbf..eacb52dda36 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vector-abss.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vector-abss.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do run } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target vsx_hw } */
/* { dg-options "-mvsx -O2" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-1.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-1.c
index 686638f005b..31ef5b6c51a 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-1.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mdejagnu-cpu=power7 -O2 -ftree-vectorize -fno-tree-loop-distribute-patterns -fno-vect-cost-model -fdump-tree-vect-details" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c
index dfbbb564d2e..b32484e83bc 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mdejagnu-cpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c
index 24d7330c0e3..003e5f831d3 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mdejagnu-cpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c
index f8944faf4fa..6f078e75a78 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mdejagnu-cpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
@@ -54,6 +54,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" { xfail { powerpc*-*-aix* } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c
index 5d390bed1f8..82a31e15801 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mdejagnu-cpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c
index 4138d2cac66..0fe1f5806af 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mdejagnu-cpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
@@ -58,6 +58,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" {xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" { xfail { powerpc*-*-aix* } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c
index 380d9b0e57d..df55222aed6 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mdejagnu-cpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-8.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-8.c
index cf52b0a963f..d2febfbb5e6 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-8.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-8.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-do compile } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mdejagnu-cpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx_mask-count-runnable.c b/gcc/testsuite/gcc.target/powerpc/vsx_mask-count-runnable.c
new file mode 100644
index 00000000000..f1e3860ee43
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vsx_mask-count-runnable.c
@@ -0,0 +1,149 @@
+/* { dg-do run } */
+/* { dg-options "-mcpu=power10 -O2" } */
+/* { dg-require-effective-target power10_hw } */
+
+/* Check that the expected 128-bit instructions are generated if the processor
+ supports the 128-bit integer instructions. */
+/* { dg-final { scan-assembler-times {\mvcntmbb\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mvcntmbh\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mvcntmbw\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mvcntmbd\M} 1 } } */
+
+#define DEBUG 0
+
+#if DEBUG
+#include <stdio.h>
+#include <stdlib.h>
+#endif
+#include <altivec.h>
+
+void abort (void);
+
+int main ()
+{
+ int i, num_elements;
+ unsigned long long arg1;
+
+ vector unsigned char vbc_result_bi, vbc_expected_result_bi;
+ vector unsigned short vbc_result_hi, vbc_expected_result_hi;
+ vector unsigned int vbc_result_wi, vbc_expected_result_wi;
+ vector unsigned long long vbc_result_di, vbc_expected_result_di;
+ vector __uint128_t vbc_result_qi, vbc_expected_result_qi;
+
+ unsigned int result_wi, expected_result_wi;
+ unsigned long long result, expected_result;
+ const unsigned char mp=1;
+ vector unsigned char vbc_bi_src;
+ vector unsigned short vbc_hi_src;
+ vector unsigned int vbc_wi_src;
+ vector unsigned long long vbc_di_src;
+ vector __uint128_t vbc_qi_src;
+
+ /* vcntmbb */
+ num_elements = 16;
+ vbc_bi_src[0] = 0xFF;
+ vbc_bi_src[1] = 0xFF;
+ vbc_bi_src[2] = 0x0;
+ vbc_bi_src[3] = 0x0;
+ vbc_bi_src[4] = 0x0;
+ vbc_bi_src[5] = 0x0;
+ vbc_bi_src[6] = 0xFF;
+ vbc_bi_src[7] = 0xFF;
+ vbc_bi_src[8] = 0x0;
+ vbc_bi_src[9] = 0x0;
+ vbc_bi_src[10] = 0x0;
+ vbc_bi_src[11] = 0x0;
+ vbc_bi_src[12] = 0x0;
+ vbc_bi_src[13] = 0xFF;
+ vbc_bi_src[14] = 0xFF;
+ vbc_bi_src[15] = 0xFF;
+
+ expected_result = 7;
+
+ result = vec_cntm (vbc_bi_src, 1);
+ /* Note count is put in bits[0:7], IBM numbering, of the 64-bit result */
+ result = result >> (64-8);
+
+ if (result != expected_result) {
+#if DEBUG
+ printf("ERROR: char vec_cntm(arg) ");
+ printf("count %llu does not match expected count = %llu\n",
+ result, expected_result);
+#else
+ abort();
+#endif
+ }
+
+ /* vcntmhb */
+ num_elements = 8;
+ vbc_hi_src[0] = 0xFFFF;
+ vbc_hi_src[1] = 0xFFFF;
+ vbc_hi_src[2] = 0x0;
+ vbc_hi_src[3] = 0x0;
+ vbc_hi_src[4] = 0x0;
+ vbc_hi_src[5] = 0x0;
+ vbc_hi_src[6] = 0xFFFF;
+ vbc_hi_src[7] = 0xFFFF;
+
+ expected_result = 4;
+
+ result = vec_cntm (vbc_hi_src, 1);
+ /* Note count is put in bits[0:6], IBM numbering, of the 64-bit result */
+ result = result >> (64-7);
+
+ if (result != expected_result) {
+#if DEBUG
+ printf("ERROR: short vec_cntm(arg) ");
+ printf("count %llu does not match expected count = %llu\n",
+ result, expected_result);
+#else
+ abort();
+#endif
+ }
+
+ /* vcntmwb */
+ num_elements = 4;
+ vbc_wi_src[0] = 0xFFFFFFFF;
+ vbc_wi_src[1] = 0xFFFFFFFF;
+ vbc_wi_src[2] = 0x0;
+ vbc_wi_src[3] = 0x0;
+
+ expected_result = 2;
+
+ result = vec_cntm (vbc_wi_src, 1);
+ /* Note count is put in bits[0:5], IBM numbering, of the 64-bit result */
+ result = result >> (64-6);
+
+ if (result != expected_result) {
+#if DEBUG
+ printf("ERROR: word vec_cntm(arg) ");
+ printf("count %llu does not match expected count = %llu\n",
+ result, expected_result);
+#else
+ abort();
+#endif
+ }
+
+ /* vcntmdb */
+ num_elements = 2;
+ vbc_di_src[0] = 0xFFFFFFFFFFFFFFFFULL;
+ vbc_di_src[1] = 0xFFFFFFFFFFFFFFFFULL;
+
+ expected_result = 2;
+
+ result = vec_cntm (vbc_di_src, 1);
+ /* Note count is put in bits[0:4], IBM numbering, of the 64-bit result */
+ result = result >> (64-5);
+
+ if (result != expected_result) {
+#if DEBUG
+ printf("ERROR: double vec_cntm(arg) ");
+ printf("count %llu does not match expected count = %llu\n",
+ result, expected_result);
+#else
+ abort();
+#endif
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx_mask-expand-runnable.c b/gcc/testsuite/gcc.target/powerpc/vsx_mask-expand-runnable.c
new file mode 100644
index 00000000000..0c5695e4807
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vsx_mask-expand-runnable.c
@@ -0,0 +1,194 @@
+/* { dg-do run } */
+/* { dg-options "-mcpu=power10 -O2" } */
+/* { dg-require-effective-target power10_hw } */
+
+/* Check that the expected 128-bit instructions are generated if the processor
+ supports the 128-bit integer instructions. */
+/* { dg-final { scan-assembler-times {\mvexpandbm\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mvexpandhm\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mvexpandwm\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mvexpanddm\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mvexpandqm\M} 1 } } */
+
+#define DEBUG 0
+
+#if DEBUG
+#include <stdio.h>
+#include <stdlib.h>
+#endif
+#include <altivec.h>
+
+void abort (void);
+
+int main ()
+{
+ int i, num_elements;
+ unsigned long long arg1;
+
+ vector unsigned char vbc_result_bi, vbc_expected_result_bi;
+ vector unsigned short vbc_result_hi, vbc_expected_result_hi;
+ vector unsigned int vbc_result_wi, vbc_expected_result_wi;
+ vector unsigned long long vbc_result_di, vbc_expected_result_di;
+ vector __uint128_t vbc_result_qi, vbc_expected_result_qi;
+
+ unsigned int result_wi, expected_result_wi;
+ unsigned long long result, expected_result;
+ const unsigned char mp=1;
+ vector unsigned char vbc_bi_src;
+ vector unsigned short vbc_hi_src;
+ vector unsigned int vbc_wi_src;
+ vector unsigned long long vbc_di_src;
+ vector __uint128_t vbc_qi_src;
+
+ /* vexpandbm */
+ num_elements = 16;
+ vbc_bi_src[0] = 0xFF;
+ vbc_bi_src[1] = 0xFF;
+ vbc_bi_src[2] = 0x0;
+ vbc_bi_src[3] = 0x0;
+ vbc_bi_src[4] = 0x0;
+ vbc_bi_src[5] = 0x0;
+ vbc_bi_src[6] = 0xFF;
+ vbc_bi_src[7] = 0xFF;
+ vbc_bi_src[8] = 0x0;
+ vbc_bi_src[9] = 0x0;
+ vbc_bi_src[10] = 0x0;
+ vbc_bi_src[11] = 0x0;
+ vbc_bi_src[12] = 0x0;
+ vbc_bi_src[13] = 0xFF;
+ vbc_bi_src[14] = 0xFF;
+ vbc_bi_src[15] = 0xFF;
+
+ vbc_expected_result_bi[0] = 0xFF;
+ vbc_expected_result_bi[1] = 0xFF;
+ vbc_expected_result_bi[2] = 0x0;
+ vbc_expected_result_bi[3] = 0x0;
+ vbc_expected_result_bi[4] = 0x0;
+ vbc_expected_result_bi[5] = 0x0;
+ vbc_expected_result_bi[6] = 0xFF;
+ vbc_expected_result_bi[7] = 0xFF;
+ vbc_expected_result_bi[8] = 0x0;
+ vbc_expected_result_bi[9] = 0x0;
+ vbc_expected_result_bi[10] = 0x0;
+ vbc_expected_result_bi[11] = 0x0;
+ vbc_expected_result_bi[12] = 0x0;
+ vbc_expected_result_bi[13] = 0xFF;
+ vbc_expected_result_bi[14] = 0xFF;
+ vbc_expected_result_bi[15] = 0xFF;
+
+ vbc_result_bi = vec_expandm (vbc_bi_src);
+
+ for (i = 0; i<num_elements; i++) {
+ if (vbc_result_bi[i] != vbc_expected_result_bi[i]) {
+#if DEBUG
+ printf("ERROR: char vec_expandm(arg) ");
+ printf("element %d, 0x%x does not match expected value = 0x%x\n",
+ i, vbc_result_bi[i], vbc_expected_result_bi[i]);
+#else
+ abort();
+#endif
+ }
+ }
+
+ /* vexpandhm */
+ num_elements = 8;
+ vbc_hi_src[0] = 0x0;
+ vbc_hi_src[1] = 0xFFFF;
+ vbc_hi_src[2] = 0x0;
+ vbc_hi_src[3] = 0xFFFF;
+ vbc_hi_src[4] = 0x0;
+ vbc_hi_src[5] = 0x0;
+ vbc_hi_src[6] = 0xFFFF;
+ vbc_hi_src[7] = 0xFFFF;
+
+ vbc_expected_result_hi[0] = 0x0;
+ vbc_expected_result_hi[1] = 0xFFFF;
+ vbc_expected_result_hi[2] = 0x0;
+ vbc_expected_result_hi[3] = 0xFFFF;
+ vbc_expected_result_hi[4] = 0x0;
+ vbc_expected_result_hi[5] = 0x0;
+ vbc_expected_result_hi[6] = 0xFFFF;
+ vbc_expected_result_hi[7] = 0xFFFF;
+
+ vbc_result_hi = vec_expandm (vbc_hi_src);
+
+ for (i = 0; i<num_elements; i++) {
+ if (vbc_result_hi[i] != vbc_expected_result_hi[i]) {
+#if DEBUG
+ printf("ERROR: short vec_expandm(arg) ");
+ printf("element %d, 0x%x does not match expected value = 0x%x\n",
+ i, vbc_result_hi[i], vbc_expected_result_hi[i]);
+#else
+ abort();
+#endif
+ }
+ }
+
+ /* vexpandwm */
+ num_elements = 4;
+ vbc_wi_src[0] = 0x0;
+ vbc_wi_src[1] = 0xFFFFFFFF;
+ vbc_wi_src[2] = 0x0;
+ vbc_wi_src[3] = 0xFFFFFFFF;
+
+ vbc_expected_result_wi[0] = 0x0;
+ vbc_expected_result_wi[1] = 0xFFFFFFFF;
+ vbc_expected_result_wi[2] = 0x0;
+ vbc_expected_result_wi[3] = 0xFFFFFFFF;
+
+ vbc_result_wi = vec_expandm (vbc_wi_src);
+
+ for (i = 0; i<num_elements; i++) {
+ if (vbc_result_wi[i] != vbc_expected_result_wi[i]) {
+#if DEBUG
+ printf("ERROR: int vec_expandm(arg) ");
+ printf("element %d, 0x%x does not match expected value = 0x%x\n",
+ i, vbc_result_wi[i], vbc_expected_result_wi[i]);
+#else
+ abort();
+#endif
+ }
+ }
+
+ /* vexpanddm */
+ num_elements = 2;
+ vbc_di_src[0] = 0x0;
+ vbc_di_src[1] = 0xFFFFFFFFFFFFFFFFULL;
+
+ vbc_expected_result_di[0] = 0x0;
+ vbc_expected_result_di[1] = 0xFFFFFFFFFFFFFFFFULL;
+
+ vbc_result_di = vec_expandm (vbc_di_src);
+
+ for (i = 0; i<num_elements; i++) {
+ if (vbc_result_di[i] != vbc_expected_result_di[i]) {
+#if DEBUG
+ printf("ERROR: double vec_expandm(arg) ");
+ printf("element %d, 0x%llx does not match expected value = 0x%llx\n",
+ i, vbc_result_di[i], vbc_expected_result_di[i]);
+#else
+ abort();
+#endif
+ }
+ }
+
+ /* vexpandqm */
+ num_elements = 1;
+ vbc_qi_src[0] = 0x0;
+
+ vbc_expected_result_qi[0] = 0x0;
+
+ vbc_result_qi = vec_expandm (vbc_qi_src);
+
+ if (vbc_result_qi[0] != vbc_expected_result_qi[0]) {
+#if DEBUG
+ printf("ERROR: quad vec_expandm(arg) ");
+ printf("element %d, 0x%x does not match expected value = 0x%x\n",
+ 0, vbc_result_qi[i], vbc_expected_result_qi[i]);
+#else
+ abort();
+#endif
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx_mask-extract-runnable.c b/gcc/testsuite/gcc.target/powerpc/vsx_mask-extract-runnable.c
new file mode 100644
index 00000000000..93c3c720246
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vsx_mask-extract-runnable.c
@@ -0,0 +1,162 @@
+/* { dg-do run } */
+/* { dg-options "-mcpu=power10 -O2" } */
+/* { dg-require-effective-target power10_hw } */
+
+/* Check that the expected 128-bit instructions are generated if the processor
+ supports the 128-bit integer instructions. */
+/* { dg-final { scan-assembler-times {\mvextractbm\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mvextracthm\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mvextractwm\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mvextractdm\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mvextractqm\M} 1 } } */
+
+
+#define DEBUG 0
+
+#if DEBUG
+#include <stdio.h>
+#include <stdlib.h>
+#endif
+#include <altivec.h>
+
+void abort (void);
+
+int main ()
+{
+ int i, num_elements;
+ unsigned long long arg1;
+
+ vector unsigned char vbc_result_bi, vbc_expected_result_bi;
+ vector unsigned short vbc_result_hi, vbc_expected_result_hi;
+ vector unsigned int vbc_result_wi, vbc_expected_result_wi;
+ vector unsigned long long vbc_result_di, vbc_expected_result_di;
+ vector __uint128_t vbc_result_qi, vbc_expected_result_qi;
+
+ unsigned int result_wi, expected_result_wi;
+ unsigned long long result, expected_result;
+ const unsigned char mp=1;
+ vector unsigned char vbc_bi_src;
+ vector unsigned short vbc_hi_src;
+ vector unsigned int vbc_wi_src;
+ vector unsigned long long vbc_di_src;
+ vector __uint128_t vbc_qi_src;
+
+/* vextractbm */
+ num_elements = 8;
+ vbc_bi_src[0] = 0xFF;
+ vbc_bi_src[1] = 0xFF;
+ vbc_bi_src[2] = 0x0;
+ vbc_bi_src[3] = 0x0;
+ vbc_bi_src[4] = 0x0;
+ vbc_bi_src[5] = 0x0;
+ vbc_bi_src[6] = 0xFF;
+ vbc_bi_src[7] = 0xFF;
+ vbc_bi_src[8] = 0xFF;
+ vbc_bi_src[9] = 0xFF;
+ vbc_bi_src[10] = 0xFF;
+ vbc_bi_src[11] = 0xFF;
+ vbc_bi_src[12] = 0xFF;
+ vbc_bi_src[13] = 0x0;
+ vbc_bi_src[14] = 0xFF;
+ vbc_bi_src[15] = 0xFF;
+
+ expected_result_wi = 0b1101111111000011;
+
+ result_wi = vec_extractm (vbc_bi_src);
+
+ if (result_wi != expected_result_wi) {
+#if DEBUG
+ printf("ERROR: short vec_extractm(%d) ", vbc_bi_src);
+ printf("result %llu does not match expected result = %llu\n",
+ result, expected_result);
+#else
+ abort();
+#endif
+ }
+
+ /* vextracthm */
+ num_elements = 8;
+ vbc_hi_src[0] = 0xFFFF;
+ vbc_hi_src[1] = 0xFFFF;
+ vbc_hi_src[2] = 0x0;
+ vbc_hi_src[3] = 0x0;
+ vbc_hi_src[4] = 0x0;
+ vbc_hi_src[5] = 0x0;
+ vbc_hi_src[6] = 0xFFFF;
+ vbc_hi_src[7] = 0xFFFF;
+
+ expected_result_wi = 0b11000011;
+
+ result_wi = vec_extractm (vbc_hi_src);
+
+ if (result_wi != expected_result_wi) {
+#if DEBUG
+ printf("ERROR: short vec_extractm(%d) ", vbc_hi_src);
+ printf("result %llu does not match expected result = %llu\n",
+ result, expected_result);
+#else
+ abort();
+#endif
+ }
+
+ /* vextractwm */
+ num_elements = 4;
+ vbc_wi_src[0] = 0xFFFFFFFF;
+ vbc_wi_src[1] = 0xFFFFFFFF;
+ vbc_wi_src[2] = 0x0;
+ vbc_wi_src[3] = 0x0;
+
+ expected_result_wi = 0b0011;
+
+ result_wi = vec_extractm (vbc_wi_src);
+
+ if (result_wi != expected_result_wi) {
+#if DEBUG
+ printf("ERROR: word vec_extractm(%d) ", vbc_wi_src);
+ printf("result %llu does not match expected result = %llu\n",
+ result, expected_result);
+#else
+ abort();
+#endif
+ }
+
+ /* vextractdm */
+ num_elements = 2;
+ vbc_di_src[0] = 0xFFFFFFFFFFFFFFFF;
+ vbc_di_src[1] = 0xFFFFFFFFFFFFFFFF;
+
+ expected_result_wi = 0b11;
+
+ result_wi = vec_extractm (vbc_di_src);
+
+ if (result_wi != expected_result_wi) {
+#if DEBUG
+ printf("ERROR: double vec_extractm(%lld) ", vbc_di_src);
+ printf("result %llu does not match expected result = %llu\n",
+ result, expected_result);
+#else
+ abort();
+#endif
+ }
+
+ /* vextractqm */
+ num_elements = 1;
+ vbc_qi_src[0] = 0x1;
+ vbc_qi_src[0] = vbc_qi_src[0] << 127;
+
+ expected_result_wi = 1;
+
+ result_wi = vec_extractm (vbc_qi_src);
+
+ if (result_wi != expected_result_wi) {
+#if DEBUG
+ printf("ERROR: quad vec_extractm(arg) ");
+ printf("result 0x%x does not match expected result = 0x%x\n",
+ result, expected_result);
+#else
+ abort();
+#endif
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx_mask-move-runnable.c b/gcc/testsuite/gcc.target/powerpc/vsx_mask-move-runnable.c
new file mode 100644
index 00000000000..41dee583e59
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vsx_mask-move-runnable.c
@@ -0,0 +1,225 @@
+/* { dg-do run } */
+/* { dg-options "-mcpu=power10 -O2" } */
+/* { dg-require-effective-target power10_hw } */
+
+/* Check that the expected 128-bit instructions are generated if the processor
+ supports the 128-bit integer instructions. */
+/* { dg-final { scan-assembler-times {\mmtvsrbm\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mmtvsrhm\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mmtvsrwm\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mmtvsrdm\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mmtvsrqm\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mmtvsrbmi\M} 2 } } */
+
+#define DEBUG 0
+
+#if DEBUG
+#include <stdio.h>
+#include <stdlib.h>
+#endif
+#include <altivec.h>
+
+void abort (void);
+
+int main ()
+{
+ int i, num_elements;
+ unsigned long long arg1;
+
+ vector unsigned char vbc_result_bi, vbc_expected_result_bi;
+ vector unsigned short vbc_result_hi, vbc_expected_result_hi;
+ vector unsigned int vbc_result_wi, vbc_expected_result_wi;
+ vector unsigned long long vbc_result_di, vbc_expected_result_di;
+ vector __uint128_t vbc_result_qi, vbc_expected_result_qi;
+
+ unsigned int result_wi, expected_result_wi;
+ unsigned long long result, expected_result;
+ const unsigned char mp=1;
+ vector unsigned char vbc_bi_src;
+ vector unsigned short vbc_hi_src;
+ vector unsigned int vbc_wi_src;
+ vector unsigned long long vbc_di_src;
+ vector __uint128_t vbc_qi_src;
+
+ /* mtvsrbmi */
+ num_elements = 16;
+
+ for (i = 0; i<num_elements; i++)
+ vbc_expected_result_bi[i] = 0x0;
+
+ vbc_expected_result_bi[0] = 0xFF;
+ vbc_expected_result_bi[2] = 0xFF;
+
+ vbc_result_bi = vec_genbm(5);
+
+ for (i = 0; i<num_elements; i++) {
+ if (vbc_result_bi[i] != vbc_expected_result_bi[i]) {
+#if DEBUG
+ printf("ERROR: vec_genbm(const 5) ");
+ printf("element %d equals 0x%x does not match expected_result = 0x%x",
+ i, vbc_result_bi[i], vbc_expected_result_bi[i]);
+ printf("\n\n");
+#else
+ abort();
+#endif
+ }
+ }
+
+ /* mtvsrbm */
+ num_elements = 16;
+ /* -O2 should generate mtvsrbmi as argument will fit in 6-bit field. */
+ arg1 = 3;
+
+ for (i = 0; i<num_elements; i++)
+ vbc_expected_result_bi[i] = 0x0;
+
+ vbc_expected_result_bi[1] = 0xFF;
+ vbc_expected_result_bi[0] = 0xFF;
+
+ vbc_result_bi = vec_genbm(arg1);
+
+ for (i = 0; i<num_elements; i++) {
+ if (vbc_result_bi[i] != vbc_expected_result_bi[i]) {
+#if DEBUG
+ printf("ERROR: vec_genbm(%d) ", arg1);
+ printf("element %d equals 0x%x does not match expected_result = 0x%x",
+ i, vbc_result_bi[i], vbc_expected_result_bi[i]);
+ printf("\n\n");
+#else
+ abort();
+#endif
+ }
+ }
+
+ num_elements = 16;
+ /* Should generate mtvsrbm as argument will not fit in 6-bit field. */
+ arg1 = 0xEA; // 234 decimal
+
+ for (i = 0; i<num_elements; i++)
+ vbc_expected_result_bi[i] = 0x0;
+
+ vbc_expected_result_bi[7] = 0xFF;
+ vbc_expected_result_bi[6] = 0xFF;
+ vbc_expected_result_bi[5] = 0xFF;
+ vbc_expected_result_bi[3] = 0xFF;
+ vbc_expected_result_bi[1] = 0xFF;
+
+ vbc_result_bi = vec_genbm(arg1);
+
+ for (i = 0; i<num_elements; i++) {
+ if (vbc_result_bi[i] != vbc_expected_result_bi[i]) {
+#if DEBUG
+ printf("ERROR: vec_genbm(%d) ", arg1);
+ printf("element %d equals 0x%x does not match expected_result = 0x%x",
+ i, vbc_result_bi[i], vbc_expected_result_bi[i]);
+ printf("\n\n");
+#else
+ abort();
+#endif
+ }
+ }
+
+ /* mtvsrhm */
+ num_elements = 8;
+ arg1 = 5;
+
+ for (i = 0; i<num_elements; i++)
+ vbc_expected_result_hi[i] = 0x0;
+
+ vbc_expected_result_hi[2] = 0xFFFF;
+ vbc_expected_result_hi[0] = 0xFFFF;
+
+ vbc_result_hi = vec_genhm(arg1);
+
+ for (i = 0; i<num_elements; i++) {
+ if (vbc_result_hi[i] != vbc_expected_result_hi[i]) {
+#if DEBUG
+ printf("ERROR: vec_genhm(%d) ", arg1);
+ printf("element %d equals 0x%x does not match expected_result = 0x%x",
+ i, vbc_result_hi[i], vbc_expected_result_hi[i]);
+ printf("\n\n");
+#else
+ abort();
+#endif
+ }
+ }
+
+ /* mtvsrwm */
+ num_elements = 4;
+ arg1 = 7;
+
+ for (i = 0; i<num_elements; i++)
+ vbc_expected_result_wi[i] = 0x0;
+
+ vbc_expected_result_wi[2] = 0xFFFFFFFF;
+ vbc_expected_result_wi[1] = 0xFFFFFFFF;
+ vbc_expected_result_wi[0] = 0xFFFFFFFF;
+
+ vbc_result_wi = vec_genwm(arg1);
+
+ for (i = 0; i<num_elements; i++) {
+ if (vbc_result_wi[i] != vbc_expected_result_wi[i]) {
+#if DEBUG
+ printf("ERROR: vec_genwm(%d) ", arg1);
+ printf("element %d equals 0x%x does not match expected_result = 0x%x",
+ i, vbc_result_wi[i], vbc_expected_result_wi[i]);
+ printf("\n\n");
+#else
+ abort();
+#endif
+ }
+ }
+
+ /* mtvsrdm */
+ num_elements = 2;
+ arg1 = 1;
+
+ for (i = 0; i<num_elements; i++)
+ vbc_expected_result_di[i] = 0x0;
+
+ vbc_expected_result_di[1] = 0x0;
+ vbc_expected_result_di[0] = 0xFFFFFFFFFFFFFFFF;
+
+ vbc_result_di = vec_gendm(arg1);
+
+ for (i = 0; i<num_elements; i++) {
+ if (vbc_result_di[i] != vbc_expected_result_di[i]) {
+#if DEBUG
+ printf("ERROR: vec_gendm(%d) ", arg1);
+ printf("element %d equals 0x%llx does not match expected_result = ",
+ i, vbc_result_di[i]);
+ printf("0x%llx\n\n", vbc_expected_result_di[i]);
+#else
+ abort();
+#endif
+ }
+ }
+
+ /* mtvsrqm */
+ num_elements = 1;
+ arg1 = 1;
+
+ for (i = 0; i<num_elements; i++)
+ vbc_expected_result_qi[i] = 0x0;
+
+ vbc_expected_result_qi[0] = 0xFFFFFFFFFFFFFFFFULL;
+ vbc_expected_result_qi[0] = (vbc_expected_result_qi[0] << 64)
+ | 0xFFFFFFFFFFFFFFFFULL;
+
+ vbc_result_qi = vec_genqm(arg1);
+
+ for (i = 0; i<num_elements; i++) {
+ if (vbc_result_qi[i] != vbc_expected_result_qi[i]) {
+#if DEBUG
+ printf("ERROR: vec_genqm(%d) ", arg1);
+ printf("element %d equals 0x%llx does not match expected_result = ",
+ i, vbc_result_qi[i]);
+ printf("0x%llx\n\n", vbc_expected_result_qi[i]);
+#else
+ abort();
+#endif
+ }
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/xxgenpc-runnable.c b/gcc/testsuite/gcc.target/powerpc/xxgenpc-runnable.c
new file mode 100644
index 00000000000..244c57365d4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/xxgenpc-runnable.c
@@ -0,0 +1,231 @@
+/* { dg-do run } */
+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */
+/* { dg-require-effective-target power10_hw } */
+
+#include <altivec.h>
+
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+#define IMM0 0
+#define IMM1 1
+#define IMM2 2
+#define IMM3 3
+
+void abort (void);
+
+int main ()
+{
+ int i;
+ vector unsigned char vec_byte_arg;
+ vector unsigned char vec_byte_result, vec_byte_expected0, vec_byte_expected1;
+ vector unsigned char vec_byte_expected2, vec_byte_expected3;
+
+ vector unsigned short vec_hword_arg;
+ vector unsigned short vec_hword_result, vec_hword_expected0;
+ vector unsigned short vec_hword_expected1, vec_hword_expected2;
+ vector unsigned short vec_hword_expected3;
+
+ vector unsigned int vec_word_arg;
+ vector unsigned int vec_word_result, vec_word_expected0, vec_word_expected1;
+ vector unsigned int vec_word_expected2, vec_word_expected3;
+
+ vec_byte_arg = (vector unsigned char ){ 0xFF, 0xF0, 0x7F, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x00, 0x00, 0x01, 0x23,
+ 0x45, 0x67, 0x00, 0x00 };
+
+ vec_byte_result = (vector unsigned char ){ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF };
+
+ vec_byte_expected0 = (vector unsigned char){ 0x1F, 0x1E, 0x1D, 0x1C,
+ 0x1B, 0x1A, 0x19, 0x18,
+ 0x06, 0x05, 0x15, 0x04,
+ 0x03, 0x02, 0x01, 0x00 };
+
+ vec_byte_expected1 = (vector unsigned char){ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x06, 0x04,
+ 0x03, 0x02, 0x01, 0x00 };
+
+ vec_byte_expected2 = (vector unsigned char){ 0x10, 0x11, 0x12, 0x13,
+ 0x14, 0x15, 0x16, 0x17,
+ 0x00, 0x01, 0x1a, 0x02,
+ 0x03, 0x04, 0x05, 0x06 };
+
+ vec_byte_expected3 = (vector unsigned char){ 0x08, 0x09, 0x0B, 0x0C,
+ 0x0D, 0x0E, 0x0F, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00 };
+
+ vec_hword_arg = (vector unsigned short) { 0x0004, 0xF003, 0x0002, 0x0001,
+ 0xF004, 0x1003, 0xF002, 0x0001 };
+ vec_hword_expected0 = (vector unsigned short int){ 0x405, 0x1c1d, 0x203,
+ 0x1819, 0x1617, 0x1,
+ 0x1213, 0x1011 };
+ vec_hword_expected1 = (vector unsigned short int){ 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0xe0f, 0xa0b, 0x405 };
+ vec_hword_expected2 = (vector unsigned short int){ 0x100, 0x1312, 0x302,
+ 0x1716, 0x1918, 0x504,
+ 0x1d1c, 0x1f1e };
+ vec_hword_expected3 = (vector unsigned short int){ 0x100, 0x504, 0xb0a, 0x0,
+ 0x0, 0x0, 0x0, 0x0 };
+
+ vec_word_arg = (vector unsigned int){ 0xFEDCBA90, 0xF101, 0xF0000202, 0xF303 };
+ vec_word_expected0 = (vector unsigned int){ 0x4050607, 0x18191a1b,
+ 0x10203, 0x10111213 };
+ vec_word_expected1 = (vector unsigned int){ 0x0, 0x0, 0xc0d0e0f, 0x4050607 };
+ vec_word_expected2 = (vector unsigned int){ 0x3020100, 0x17161514,
+ 0x7060504, 0x1f1e1d1c };
+ vec_word_expected3 = (vector unsigned int){ 0x3020100, 0xb0a0908, 0x0, 0x0 };
+
+ vec_byte_result = vec_genpcvm (vec_byte_arg, IMM0);
+
+ for (i = 0; i < 16; i++) {
+ if (vec_byte_expected0[i] != vec_byte_result[i])
+#if DEBUG
+ printf("ERROR: vec_genpcvm(IMM = 0), vec_byte_expected[%d] = 0x%x does not match vec_byte_result[%d] = 0x%x\n",
+ i, vec_byte_expected0[i], i, vec_byte_result[i]);
+#else
+ abort();
+#endif
+ }
+
+ vec_byte_result = vec_genpcvm (vec_byte_arg, IMM1);
+
+ for (i = 0; i < 16; i++) {
+ if (vec_byte_expected1[i] != vec_byte_result[i])
+#if DEBUG
+ printf("ERROR: vec_genpcvm(IMM = 1), vec_byte_expected[%d] = 0x%x does not match vec_byte_result[%d] = 0x%x\n",
+ i, vec_byte_expected1[i], i, vec_byte_result[i]);
+#else
+ abort();
+#endif
+ }
+
+ vec_byte_result = vec_genpcvm (vec_byte_arg, IMM2);
+
+ for (i = 0; i < 16; i++) {
+ if (vec_byte_expected2[i] != vec_byte_result[i])
+#if DEBUG
+ printf("ERROR: vec_genpcvmbm(IMM = 2), vec_byte_expected[%d] = 0x%x does not match vec_byte_result[%d] = 0x%x\n",
+ i, vec_byte_expected2[i], i, vec_byte_result[i]);
+#else
+ abort();
+#endif
+ }
+
+ vec_byte_result = vec_genpcvm (vec_byte_arg, IMM3);
+
+ for (i = 0; i < 16; i++) {
+ if (vec_byte_expected3[i] != vec_byte_result[i])
+#if DEBUG
+ printf("ERROR: vec_genpcvm(IMM = 3), vec_byte_expected[%d] = 0x%x does not match vec_byte_result[%d] = 0x%x\n",
+ i, vec_byte_expected3[i], i, vec_byte_result[i]);
+#else
+ abort();
+#endif
+ }
+
+ vec_hword_result = vec_genpcvm (vec_hword_arg, IMM0);
+
+ for (i = 0; i < 8; i++) {
+ if (vec_hword_expected0[i] != vec_hword_result[i])
+#if DEBUG
+ printf("ERROR: vec_genpcvmhm(IMM = 0), vec_hword_expected[%d] = 0x%x does not match vec_hword_result[%d] = 0x%x\n",
+ i, vec_hword_expected0[i], i, vec_hword_result[i]);
+#else
+ abort();
+#endif
+ }
+
+ vec_hword_result = vec_genpcvm (vec_hword_arg, IMM1);
+
+ for (i = 0; i < 8; i++) {
+ if (vec_hword_expected1[i] != vec_hword_result[i])
+#if DEBUG
+ printf("ERROR: vec_genpcvm(IMM = 1), vec_hword_expected[%d] = 0x%x does not match vec_hword_result[%d] = 0x%x\n",
+ i, vec_hword_expected1[i], i, vec_hword_result[i]);
+#else
+ abort();
+#endif
+ }
+
+ vec_hword_result = vec_genpcvm (vec_hword_arg, IMM2);
+
+ for (i = 0; i < 8; i++) {
+ if (vec_hword_expected2[i] != vec_hword_result[i])
+#if DEBUG
+ printf("ERROR: vec_genpcvm(IMM = 2), vec_hword_expected[%d] = 0x%x does not match vec_hword_result[%d] = 0x%x\n",
+ i, vec_hword_expected2[i], i, vec_hword_result[i]);
+#else
+ abort();
+#endif
+ }
+
+ vec_hword_result = vec_genpcvm (vec_hword_arg, IMM3);
+
+ for (i = 0; i < 8; i++) {
+ if (vec_hword_expected3[i] != vec_hword_result[i])
+#if DEBUG
+ printf("ERROR: vec_genpcvm(IMM = 3), vec_hword_expected[%d] = 0x%x does not match vec_hword_result[%d] = 0x%x\n",
+ i, vec_hword_expected3[i], i, vec_hword_result[i]);
+#else
+ abort();
+#endif
+ }
+
+
+ vec_word_result = vec_genpcvm (vec_word_arg, IMM0);
+
+ for (i = 0; i < 4; i++) {
+ if (vec_word_expected0[i] != vec_word_result[i])
+#if DEBUG
+ printf("ERROR: vec_genpcvm(IMM = 0), vec_word_expected[%d] = 0x%x does not match vec_word_result[%d] = 0x%x\n",
+ i, vec_word_expected0[i], i, vec_word_result[i]);
+#else
+ abort();
+#endif
+ }
+
+ vec_word_result = vec_genpcvm (vec_word_arg, IMM1);
+
+ for (i = 0; i < 4; i++) {
+ if (vec_word_expected1[i] != vec_word_result[i])
+#if DEBUG
+ printf("ERROR: vec_genpcvm(IMM = 1), vec_word_expected[%d] = 0%x does not match vec_word_result[%d] = 0x%x\n",
+ i, vec_word_expected1[i], i, vec_word_result[i]);
+#else
+ abort();
+#endif
+ }
+
+ vec_word_result = vec_genpcvm (vec_word_arg, IMM2);
+
+ for (i = 0; i < 4; i++) {
+ if (vec_word_expected2[i] != vec_word_result[i])
+#if DEBUG
+ printf("ERROR: vec_genpcvm(IMM = 2), vec_word_expected[%d] = 0x%x does not match vec_word_result[%d] = 0x%x\n",
+ i, vec_word_expected2[i], i, vec_word_result[i]);
+#else
+ abort();
+#endif
+ }
+
+ vec_word_result = vec_genpcvm (vec_word_arg, IMM3);
+
+ for (i = 0; i < 4; i++) {
+ if (vec_word_expected3[i] != vec_word_result[i])
+#if DEBUG
+ printf("ERROR: vec_genpcvm(IMM = 3), vec_word_expected[%d] = 0x%x does not match vec_word_result[%d] = 0x%x\n",
+ i, vec_word_expected3[i], i, vec_word_result[i]);
+#else
+ abort();
+#endif
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/pru/clobber-sp.c b/gcc/testsuite/gcc.target/pru/clobber-sp.c
new file mode 100644
index 00000000000..3cc0a60bfc9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/pru/clobber-sp.c
@@ -0,0 +1,24 @@
+/* Test inline ASM clobber for SP register */
+
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+/* -O1 in the options is significant. */
+
+extern void abort (void);
+
+int
+test1 (void)
+{
+ int res;
+
+ /* { dg-warning "listing the stack pointer register 'sp' in a clobber list is deprecated" "" { target pru-*-* } .+2 } */
+ /* { dg-message "note: the value of the stack pointer after an 'asm' statement must be the same as it was before the statement" "" { target pru-*-* } .+1 } */
+ asm volatile(
+ "ldi %[res], 101 \n\t"
+ : [res] "=r" (res)
+ :
+ : "sp");
+
+ return res;
+}
diff --git a/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-1.c b/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-1.c
index ee1288fc2ae..b2a49e3a9e1 100644
--- a/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-1.c
+++ b/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-1.c
@@ -12,6 +12,7 @@ uint64_t __attribute__((noinline)) test(uint64_t a, uint64_t b,
uint64_t l1 = 0x12345678, l2 = 0x87654321, l3 = 1001, l4 = 1002;
uint64_t l5 = 1004;
uint32_t l6 = 2005;
+ uint16_t s1 = 4321;
uint8_t c1 = 101, c2 = 102;
/* The numerous dummy asm input operands create just
@@ -24,10 +25,10 @@ uint64_t __attribute__((noinline)) test(uint64_t a, uint64_t b,
: "0" (l1), "r" (a), "r"(b),
"r"(c), "r"(d), "r"(e), "r"(f),
"r"(g), "r"(h), "r"(l2),
- "r"(c1), "r"(c2),
+ "r"(c1), "r"(c2), "r"(s1),
"r"(l3), "r"(l4), "r"(l5), "r"(l6));
- global = a+b+c+d+e+f+g+h + c1+c2 + l2;
+ global = a+b+c+d+e+f+g+h + s1 + c1+c2 + l2;
return l1;
}
diff --git a/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-2.c b/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-2.c
index 6c98e9bf13b..2f910295f2a 100644
--- a/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-2.c
+++ b/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-2.c
@@ -14,6 +14,7 @@ uint64_t __attribute__((noinline)) test(uint64_t a, uint64_t b,
uint64_t l1 = 0x12345678, l2 = 0x87654321, l3 = 1001, l4 = 1002;
uint64_t l5 = 1004;
uint32_t l6 = 2005;
+ uint16_t s1 = 4321;
uint8_t c1 = 101, c2 = 102;
/* The numerous dummy asm input operands create just
@@ -36,13 +37,14 @@ uint64_t __attribute__((noinline)) test(uint64_t a, uint64_t b,
"add %0, %0, %14\n\t"
"add %0, %0, %15\n\t"
"add %0, %0, %16\n\t"
+ "add %0, %0, %17\n\t"
: "=r" (l1)
: "0" (l1), "r" (a), "r"(b),
"r"(c), "r"(d), "r"(e), "r"(f),
- "r"(g), "r"(h), "r"(c1), "r"(c2),
+ "r"(g), "r"(h), "r"(c1), "r"(c2), "r"(s1),
"r"(l2), "r"(l3), "r"(l4), "r"(l5), "r"(l6));
- global = a+b+c+d+e+f+g+h + c1+c2 + l2+l3+l4+l5+l6;
+ global = a+b+c+d+e+f+g+h + s1 + c1+c2 + l2+l3+l4+l5+l6;
return l1;
}
@@ -51,10 +53,10 @@ int main()
{
uint64_t a = test(1, 2, 3, 4, 5, 6, 7, 8);
- if (a != 0x98878ae8) {
+ if (a != 0x98879bc9) {
abort();
}
- if (global != 0x876557a4) {
+ if (global != 0x87656885) {
abort();
}
return 0;
diff --git a/gcc/testsuite/gcc.target/riscv/arch-3.c b/gcc/testsuite/gcc.target/riscv/arch-3.c
index 6aaa0a650fa..124699405c5 100644
--- a/gcc/testsuite/gcc.target/riscv/arch-3.c
+++ b/gcc/testsuite/gcc.target/riscv/arch-3.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O -march=rv32ixbar_sabc_sxfoo -mabi=ilp32" } */
+/* { dg-options "-O -march=rv32isabc_xbar -mabi=ilp32" } */
int foo()
{
}
diff --git a/gcc/testsuite/gcc.target/riscv/arch-5.c b/gcc/testsuite/gcc.target/riscv/arch-5.c
new file mode 100644
index 00000000000..b0a1bd445fe
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/arch-5.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-O -march=rv32isabc_hghi_zfoo_xbar -mabi=ilp32" } */
+int foo()
+{
+}
diff --git a/gcc/testsuite/gcc.target/riscv/arch-6.c b/gcc/testsuite/gcc.target/riscv/arch-6.c
new file mode 100644
index 00000000000..b36dccbf46b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/arch-6.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-O -march=rv32id -mabi=ilp32" } */
+int foo()
+{
+}
diff --git a/gcc/testsuite/gcc.target/riscv/attribute-11.c b/gcc/testsuite/gcc.target/riscv/attribute-11.c
new file mode 100644
index 00000000000..a8649508b2f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/attribute-11.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-O -mriscv-attribute -march=rv32id -mabi=ilp32" } */
+int foo()
+{
+}
+/* { dg-final { scan-assembler ".attribute arch, \"rv32i2p0_f2p0_d2p0\"" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/attribute-12.c b/gcc/testsuite/gcc.target/riscv/attribute-12.c
new file mode 100644
index 00000000000..df27fc3234d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/attribute-12.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-O -mriscv-attribute -march=rv32ifd -mabi=ilp32" } */
+int foo()
+{
+}
+/* { dg-final { scan-assembler ".attribute arch, \"rv32i2p0_f2p0_d2p0\"" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/attribute-13.c b/gcc/testsuite/gcc.target/riscv/attribute-13.c
new file mode 100644
index 00000000000..1e860013293
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/attribute-13.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-O -mriscv-attribute -march=rv32if3d -mabi=ilp32" } */
+int foo()
+{
+}
+/* { dg-final { scan-assembler ".attribute arch, \"rv32i2p0_f3p0_d2p0\"" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/attribute-9.c b/gcc/testsuite/gcc.target/riscv/attribute-9.c
index 670944a1cbe..bc4db0eb647 100644
--- a/gcc/testsuite/gcc.target/riscv/attribute-9.c
+++ b/gcc/testsuite/gcc.target/riscv/attribute-9.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-O -mriscv-attribute -march=rv32i2p0xbar_sabc_sxfoo -mabi=ilp32e" } */
+/* { dg-options "-O -mriscv-attribute -march=rv32i2p0sabc_xbar -mabi=ilp32e" } */
int foo()
{
}
-/* { dg-final { scan-assembler ".attribute arch, \"rv32i2p0_xbar2p0_sabc2p0_sxfoo2p0\"" } } */
+/* { dg-final { scan-assembler ".attribute arch, \"rv32i2p0_sabc2p0_xbar2p0\"" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/pr91441.c b/gcc/testsuite/gcc.target/riscv/pr91441.c
index 593a2972a0f..b55df5e7f00 100644
--- a/gcc/testsuite/gcc.target/riscv/pr91441.c
+++ b/gcc/testsuite/gcc.target/riscv/pr91441.c
@@ -7,4 +7,4 @@ int *f( int a)
{
return bar(&a);
}
-/* { dg-warning ".'-fsanitize=address' and '-fsanitize=kernel-address' are not supported for this target" "" { target *-*-* } 0 } */
+/* { dg-warning ".'-fsanitize=kernel-address' with stack protection is not supported without '-fasan-shadow-offset=' for this target" "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.target/riscv/pr95252.c b/gcc/testsuite/gcc.target/riscv/pr95252.c
new file mode 100644
index 00000000000..0366c089f83
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/pr95252.c
@@ -0,0 +1,47 @@
+/* PR target/95252 */
+/* { dg-options "-O3 -funroll-loops -msave-restore" } */
+/* { dg-do run } */
+
+int a[6], b = 1, d, e;
+long long c;
+static int f = 1;
+
+void
+fn1 (int p1)
+{
+ b = (b >> 1) & (1 ^ a[(1 ^ p1) & 5]);
+}
+
+void
+fn2 ()
+{
+ b = (b >> 1) & (1 ^ a[(b ^ 1) & 1]);
+ fn1 (c >> 1 & 5);
+ fn1 (c >> 2 & 5);
+ fn1 (c >> 4 & 5);
+ fn1 (c >> 8 & 5);
+}
+
+int
+main ()
+{
+ int i, j;
+ for (; d;)
+ {
+ for (; e;)
+ fn2 ();
+ f = 0;
+ }
+ for (i = 0; i < 8; i++)
+ {
+ if (f)
+ i = 9;
+ for (j = 0; j < 7; j++)
+ fn2 ();
+ }
+
+ if (b != 0)
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/riscv/pr95683.c b/gcc/testsuite/gcc.target/riscv/pr95683.c
new file mode 100644
index 00000000000..00cfbdcf282
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/pr95683.c
@@ -0,0 +1,10 @@
+/* PR target/95683 */
+/* { dg-options "-Os" } */
+/* { dg-do compile } */
+void a() {
+ asm(""
+ :
+ :
+ : "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "t0", "t1", "t2", "t3",
+ "t4", "t5", "t6", "ra");
+}
diff --git a/gcc/testsuite/gcc.target/riscv/pr96260.c b/gcc/testsuite/gcc.target/riscv/pr96260.c
new file mode 100644
index 00000000000..229997f877b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/pr96260.c
@@ -0,0 +1,9 @@
+/* PR target/96260 */
+/* { dg-do compile } */
+/* { dg-options "--param asan-stack=1 -fsanitize=kernel-address -fasan-shadow-offset=0x100000" } */
+
+int *bar(int *);
+int *f( int a)
+{
+ return bar(&a);
+}
diff --git a/gcc/testsuite/gcc.target/riscv/read-thread-pointer.c b/gcc/testsuite/gcc.target/riscv/read-thread-pointer.c
new file mode 100644
index 00000000000..401fb421129
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/read-thread-pointer.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+void *get_tp()
+{
+ return __builtin_thread_pointer ();
+}
+/* { dg-final { scan-assembler "mv\[ \t\]*\[at\]\[0-9\]+,tp" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/save-restore-9.c b/gcc/testsuite/gcc.target/riscv/save-restore-9.c
new file mode 100644
index 00000000000..2567daeb376
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/save-restore-9.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -msave-restore" } */
+
+int
+__attribute__((noinline,noclone))
+foo (int u)
+{
+ return u + 1;
+}
+
+int
+__attribute__((noinline,noclone))
+bar (int a, int b, int c, int d, int e, int f, int g, int h, int u)
+{
+ return foo (u);
+}
+
+int main()
+{
+ if (bar (1, 2, 3, 4, 5, 6, 7, 8, 9) != 10)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/riscv/shorten-memrefs-1.c b/gcc/testsuite/gcc.target/riscv/shorten-memrefs-1.c
new file mode 100644
index 00000000000..958942a6f7f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/shorten-memrefs-1.c
@@ -0,0 +1,26 @@
+/* { dg-options "-Os -march=rv32imc -mabi=ilp32" } */
+
+/* These stores cannot be compressed because x0 is not a compressed reg.
+ Therefore the shorten_memrefs pass should not attempt to rewrite them into a
+ compressible format. */
+
+void
+store1z (int *array)
+{
+ array[200] = 0;
+ array[201] = 0;
+ array[202] = 0;
+ array[203] = 0;
+}
+
+void
+store2z (long long *array)
+{
+ array[200] = 0;
+ array[201] = 0;
+ array[202] = 0;
+ array[203] = 0;
+}
+
+/* { dg-final { scan-assembler-not "store1z:\n\taddi" } } */
+/* { dg-final { scan-assembler-not "store2z:\n\taddi" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/shorten-memrefs-2.c b/gcc/testsuite/gcc.target/riscv/shorten-memrefs-2.c
new file mode 100644
index 00000000000..2c2f41548c6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/shorten-memrefs-2.c
@@ -0,0 +1,51 @@
+/* { dg-options "-Os -march=rv32imc -mabi=ilp32" } */
+
+/* shorten_memrefs should rewrite these load/stores into a compressible
+ format. */
+
+void
+store1a (int *array, int a)
+{
+ array[200] = a;
+ array[201] = a;
+ array[202] = a;
+ array[203] = a;
+}
+
+void
+store2a (long long *array, long long a)
+{
+ array[200] = a;
+ array[201] = a;
+ array[202] = a;
+ array[203] = a;
+}
+
+int
+load1r (int *array)
+{
+ int a = 0;
+ a += array[200];
+ a += array[201];
+ a += array[202];
+ a += array[203];
+ return a;
+}
+
+long long
+load2r (long long *array)
+{
+ int a = 0;
+ a += array[200];
+ a += array[201];
+ a += array[202];
+ a += array[203];
+ return a;
+}
+
+/* { dg-final { scan-assembler "store1a:\n\taddi" } } */
+/* The sd insns in store2a are not rewritten because shorten_memrefs currently
+ only optimizes lw and sw.
+/* { dg-final { scan-assembler "store2a:\n\taddi" { xfail riscv*-*-* } } } */
+/* { dg-final { scan-assembler "load1r:\n\taddi" } } */
+/* { dg-final { scan-assembler "load2r:\n\taddi" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/shorten-memrefs-3.c b/gcc/testsuite/gcc.target/riscv/shorten-memrefs-3.c
new file mode 100644
index 00000000000..2001fe871ee
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/shorten-memrefs-3.c
@@ -0,0 +1,39 @@
+/* { dg-options "-Os -march=rv32imc -mabi=ilp32" } */
+
+/* These loads cannot be compressed because only one compressed reg is
+ available (since args are passed in a0-a4, that leaves a5-a7 available, of
+ which only a5 is a compressed reg). Therefore the shorten_memrefs pass should
+ not attempt to rewrite these loads into a compressible format. It may not
+ be possible to avoid this because shorten_memrefs happens before reg alloc.
+*/
+
+extern int sub1 (int, int, int, int, int, int, int);
+
+int
+load1a (int a0, int a1, int a2, int a3, int a4, int *array)
+{
+ int a = 0;
+ a += array[200];
+ a += array[201];
+ a += array[202];
+ a += array[203];
+ return sub1 (a0, a1, a2, a3, a4, 0, a);
+}
+
+extern long long sub2 (long long, long long, long long, long long, long long,
+ long long, long long);
+
+long long
+load2a (long long a0, long long a1, long long a2, long long a3, long long a4,
+ long long *array)
+{
+ int a = 0;
+ a += array[200];
+ a += array[201];
+ a += array[202];
+ a += array[203];
+ return sub2 (a0, a1, a2, a3, a4, 0, a);
+}
+
+/* { dg-final { scan-assembler-not "load1a:\n\taddi" { xfail riscv*-*-* } } } */
+/* { dg-final { scan-assembler-not "load2a:\n.*addi\[ \t\]*\[at\]\[0-9\],\[at\]\[0-9\],\[0-9\]*" { xfail riscv*-*-* } } } */
diff --git a/gcc/testsuite/gcc.target/riscv/shorten-memrefs-4.c b/gcc/testsuite/gcc.target/riscv/shorten-memrefs-4.c
new file mode 100644
index 00000000000..cd4784913e4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/shorten-memrefs-4.c
@@ -0,0 +1,26 @@
+/* { dg-options "-Os -march=rv64imc -mabi=lp64" } */
+
+/* These stores cannot be compressed because x0 is not a compressed reg.
+ Therefore the shorten_memrefs pass should not attempt to rewrite them into a
+ compressible format. */
+
+void
+store1z (int *array)
+{
+ array[200] = 0;
+ array[201] = 0;
+ array[202] = 0;
+ array[203] = 0;
+}
+
+void
+store2z (long long *array)
+{
+ array[200] = 0;
+ array[201] = 0;
+ array[202] = 0;
+ array[203] = 0;
+}
+
+/* { dg-final { scan-assembler-not "store1z:\n\taddi" } } */
+/* { dg-final { scan-assembler-not "store2z:\n\taddi" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/shorten-memrefs-5.c b/gcc/testsuite/gcc.target/riscv/shorten-memrefs-5.c
new file mode 100644
index 00000000000..80b3897e4da
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/shorten-memrefs-5.c
@@ -0,0 +1,53 @@
+/* { dg-options "-Os -march=rv64imc -mabi=lp64" } */
+
+/* shorten_memrefs should rewrite these load/stores into a compressible
+ format. */
+
+void
+store1a (int *array, int a)
+{
+ array[200] = a;
+ array[201] = a;
+ array[202] = a;
+ array[203] = a;
+}
+
+void
+store2a (long long *array, long long a)
+{
+ array[200] = a;
+ array[201] = a;
+ array[202] = a;
+ array[203] = a;
+}
+
+int
+load1r (int *array)
+{
+ int a = 0;
+ a += array[200];
+ a += array[201];
+ a += array[202];
+ a += array[203];
+ return a;
+}
+
+long long
+load2r (long long *array)
+{
+ int a = 0;
+ a += array[200];
+ a += array[201];
+ a += array[202];
+ a += array[203];
+ return a;
+}
+
+/* { dg-final { scan-assembler "store1a:\n\taddi" } } */
+/* The sd insns in store2a are not rewritten because shorten_memrefs currently
+ only optimizes lw and sw.
+/* { dg-final { scan-assembler "store2a:\n\taddi" { xfail riscv*-*-* } } } */
+/* { dg-final { scan-assembler "load1r:\n\taddi" } } */
+/* The ld insns in load2r are not rewritten because shorten_memrefs currently
+ only optimizes lw and sw.
+/* { dg-final { scan-assembler "load2r:\n\taddi" { xfail riscv*-*-* } } } */
diff --git a/gcc/testsuite/gcc.target/riscv/shorten-memrefs-6.c b/gcc/testsuite/gcc.target/riscv/shorten-memrefs-6.c
new file mode 100644
index 00000000000..3403c7044df
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/shorten-memrefs-6.c
@@ -0,0 +1,39 @@
+/* { dg-options "-Os -march=rv64imc -mabi=lp64" } */
+
+/* These loads cannot be compressed because only one compressed reg is
+ available (since args are passed in a0-a4, that leaves a5-a7 available, of
+ which only a5 is a compressed reg). Therefore the shorten_memrefs pass should
+ not attempt to rewrite these loads into a compressible format. It may not
+ be possible to avoid this because shorten_memrefs happens before reg alloc.
+*/
+
+extern int sub1 (int, int, int, int, int, int, int);
+
+int
+load1a (int a0, int a1, int a2, int a3, int a4, int *array)
+{
+ int a = 0;
+ a += array[200];
+ a += array[201];
+ a += array[202];
+ a += array[203];
+ return sub1 (a0, a1, a2, a3, a4, 0, a);
+}
+
+extern long long sub2 (long long, long long, long long, long long, long long,
+ long long, long long);
+
+long long
+load2a (long long a0, long long a1, long long a2, long long a3, long long a4,
+ long long *array)
+{
+ int a = 0;
+ a += array[200];
+ a += array[201];
+ a += array[202];
+ a += array[203];
+ return sub2 (a0, a1, a2, a3, a4, 0, a);
+}
+
+/* { dg-final { scan-assembler-not "load1a:\n\taddi" { xfail riscv*-*-* } } } */
+/* { dg-final { scan-assembler-not "load2a:\n.*addi\[ \t\]*\[at\]\[0-9\],\[at\]\[0-9\],\[0-9\]*" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/shorten-memrefs-7.c b/gcc/testsuite/gcc.target/riscv/shorten-memrefs-7.c
new file mode 100644
index 00000000000..a5833fd356d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/shorten-memrefs-7.c
@@ -0,0 +1,46 @@
+/* { dg-options "-Os -march=rv32imc -mabi=ilp32 -mno-shorten-memrefs" } */
+
+/* Check that these load/stores do not get rewritten into a compressible format
+ when shorten_memrefs is disabled. */
+
+void
+store1a (int *array, int a)
+{
+ array[200] = a;
+ array[201] = a;
+ array[202] = a;
+ array[203] = a;
+}
+
+void
+store2a (long long *array, long long a)
+{
+ array[200] = a;
+ array[201] = a;
+ array[202] = a;
+ array[203] = a;
+}
+
+int
+load1r (int *array)
+{
+ int a = 0;
+ a += array[200];
+ a += array[201];
+ a += array[202];
+ a += array[203];
+ return a;
+}
+
+long long
+load2r (long long *array)
+{
+ int a = 0;
+ a += array[200];
+ a += array[201];
+ a += array[202];
+ a += array[203];
+ return a;
+}
+
+/* { dg-final { scan-assembler-not "addi" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/zero-extend-5.c b/gcc/testsuite/gcc.target/riscv/zero-extend-5.c
new file mode 100644
index 00000000000..1a135b8c097
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/zero-extend-5.c
@@ -0,0 +1,8 @@
+/* { dg-do compile { target { riscv64*-*-* } } } */
+/* { dg-options "-march=rv64gc -mabi=lp64 -O2" } */
+int
+sub (unsigned int i, unsigned int j, unsigned int k, int *array)
+{
+ return array[i] + array[j] + array[k];
+}
+/* { dg-final { scan-assembler-times "slli" 3 } } */
diff --git a/gcc/testsuite/gcc.target/s390/20200617.c b/gcc/testsuite/gcc.target/s390/20200617.c
new file mode 100644
index 00000000000..067d2e1d90b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/20200617.c
@@ -0,0 +1,23 @@
+/* This ICE'd before f9e1ea10e657af9fb02fafecf1a600740fd34409 because
+ a doloop pattern with a dead set of the iteration variable was
+ generated and s390_fix_long_loop_prediction then failed to
+ recognize it as branch on count pattern. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z10" } */
+
+int a, d, e, f;
+long b;
+long *volatile c;
+void
+fn1() {
+ for (; e; ++e)
+ if (d)
+ ;
+ else {
+ a = 0;
+ for (; a != 14; ++a)
+ *c = b && f;
+ d = 8;
+ }
+}
diff --git a/gcc/testsuite/gcc.target/s390/pr96127.c b/gcc/testsuite/gcc.target/s390/pr96127.c
new file mode 100644
index 00000000000..213ed147175
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/pr96127.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fno-tree-loop-im --param=sccvn-max-alias-queries-per-access=0 -w" } */
+
+int a8;
+
+void
+c1 (int oz, int dk, int ub)
+{
+ int *hd = 0;
+ long int *th = &dk;
+
+ while (ub < 1)
+ {
+ oz || dk;
+ ++ub;
+ }
+
+ while (oz < 2)
+ {
+ long int *lq = &oz;
+
+ (*hd < (*lq = *th)) < oz;
+
+ if (oz == 0)
+ *th = a8 = oz;
+
+ *lq = 0;
+ }
+}
diff --git a/gcc/testsuite/gcc.target/s390/pr96456.c b/gcc/testsuite/gcc.target/s390/pr96456.c
new file mode 100644
index 00000000000..ea9e9cd7a37
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/pr96456.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -std=gnu99 -ffast-math -fno-finite-math-only -march=z13" } */
+
+int b, c, d;
+double *e;
+int f() {
+ double *a = a;
+ int g = d, f = c, h = b;
+ if (__builtin_expect(f, 0))
+ for (; g < h; g++)
+ e[g] = (int)(a[g] >= 0.0 ? g + 0.99999999 : a[g]);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/s390/stack-clash-1.c b/gcc/testsuite/gcc.target/s390/stack-clash-1.c
new file mode 100644
index 00000000000..3d29cab9446
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/stack-clash-1.c
@@ -0,0 +1,17 @@
+/* Make sure a stack probe is emitted also for the remaining bytes
+ after the loop probing the large chunk. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=z9-ec -fstack-clash-protection" } */
+
+void large_stack() {
+ volatile int stack[8000];
+ int i;
+ for (i = 0; i < sizeof(stack) / sizeof(int); ++i)
+ stack[i] = i;
+}
+
+/* We use a compare for the stack probe. There needs to be one inside
+ a loop and another for the remaining bytes. */
+/* { dg-final { scan-assembler-times "cg\t" 2 { target lp64 } } } */
+/* { dg-final { scan-assembler-times "c\t" 2 { target { ! lp64 } } } } */
diff --git a/gcc/testsuite/gcc.target/s390/stack-clash-2.c b/gcc/testsuite/gcc.target/s390/stack-clash-2.c
new file mode 100644
index 00000000000..e554ad5ed0d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/stack-clash-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=z900 -fstack-clash-protection" } */
+
+extern void bar (char *);
+
+void
+foo ()
+{
+ char * mem = __builtin_alloca (20000);
+ bar (mem);
+}
+
+/* For alloca a common code routine emits the probes. Make sure the
+ "probe_stack" expander is used in that case. We want to use mem
+ compares instead of stores. */
+/* { dg-final { scan-assembler-times "cg\t" 5 { target lp64 } } } */
+/* { dg-final { scan-assembler-times "c\t" 5 { target { ! lp64 } } } } */
diff --git a/gcc/testsuite/gcc.target/s390/stack-clash-3.c b/gcc/testsuite/gcc.target/s390/stack-clash-3.c
new file mode 100644
index 00000000000..929d3fbb365
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/stack-clash-3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=z900 -fstack-clash-protection -mbackchain" } */
+
+extern void bar (char *);
+
+void
+foo ()
+{
+ char * mem = __builtin_alloca (20000);
+ bar (mem);
+}
+
+/* For alloca a common code routine emits the probes. Make sure the
+ "probe_stack" expander is used in that case. We want to use mem
+ compares instead of stores. */
+/* { dg-final { scan-assembler-times "cg\t" 5 { target lp64 } } } */
+/* { dg-final { scan-assembler-times "c\t" 5 { target { ! lp64 } } } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/align-1.c b/gcc/testsuite/gcc.target/s390/vector/align-1.c
index cc7777ad22a..6997af2ddcd 100644
--- a/gcc/testsuite/gcc.target/s390/vector/align-1.c
+++ b/gcc/testsuite/gcc.target/s390/vector/align-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -mzarch -march=z14" } */
+/* { dg-options "-O3 -mzarch -march=z13" } */
/* The user alignment ends up in DECL_ALIGN of the VAR_DECL and is
currently ignored if it is smaller than the alignment of the type.
diff --git a/gcc/testsuite/gcc.target/s390/vector/align-2.c b/gcc/testsuite/gcc.target/s390/vector/align-2.c
index e4e2fba6a58..00e09d3eadb 100644
--- a/gcc/testsuite/gcc.target/s390/vector/align-2.c
+++ b/gcc/testsuite/gcc.target/s390/vector/align-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -mzarch -march=z14" } */
+/* { dg-options "-O3 -mzarch -march=z13" } */
/* The user alignment ends up in TYPE_ALIGN of the type of the
VAR_DECL. */
diff --git a/gcc/testsuite/gcc.target/s390/vector/pr96128.c b/gcc/testsuite/gcc.target/s390/vector/pr96128.c
new file mode 100644
index 00000000000..20abe5e515c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/pr96128.c
@@ -0,0 +1,35 @@
+/* PR tree-optimization/96128 */
+/* { dg-options "-march=z13" } */
+
+#define B_TEST(TYPE) { TYPE v __attribute__((vector_size(16))); (void)((v < v) < v); }
+#ifdef __cplusplus
+#define T_TEST(TYPE) { TYPE s; TYPE v __attribute__((vector_size(16))); __typeof((v<v)[0]) iv __attribute__((vector_size(16))); (void)((iv ? s : s) < v); }
+#else
+#define T_TEST(TYPE)
+#endif
+#define T(TYPE) B_TEST(TYPE) T_TEST(TYPE)
+#ifdef __SIZEOF_INT128__
+#define SIZEOF_MAXINT __SIZEOF_INT128__
+#else
+#define SIZEOF_MAXINT __SIZEOF_LONG_LONG__
+#endif
+
+void f ()
+{
+ T(short)
+ T(int)
+ T(long)
+ T(long long)
+
+ T_TEST(float)
+ T_TEST(double)
+ /* Avoid trouble with non-power-of-two sizes.
+ Also avoid trouble with long double larger than integral types. */
+#if !defined(__i386__) && !defined(__x86_64__) && !defined(__m68k__) \
+ && !defined(__ia64__) && !defined(__hppa__) \
+ && (__SIZEOF_LONG_DOUBLE__ & (__SIZEOF_LONG_DOUBLE__ - 1)) == 0 \
+ && __SIZEOF_LONG_DOUBLE__ <= 16 \
+ && __SIZEOF_LONG_DOUBLE__ <= SIZEOF_MAXINT
+ T_TEST(long double)
+#endif
+}
diff --git a/gcc/testsuite/gcc.target/xtensa/mabi-call0.c b/gcc/testsuite/gcc.target/xtensa/mabi-call0.c
new file mode 100644
index 00000000000..65d72952810
--- /dev/null
+++ b/gcc/testsuite/gcc.target/xtensa/mabi-call0.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-mabi=call0" } */
+
+#ifndef __XTENSA_CALL0_ABI__
+#error
+#endif
+
+void foo(void)
+{
+}
+
+/* { dg-final { scan-assembler-not "entry" } } */
+/* { dg-final { scan-assembler-not "retw" } } */
diff --git a/gcc/testsuite/gcc.target/xtensa/mabi-windowed.c b/gcc/testsuite/gcc.target/xtensa/mabi-windowed.c
new file mode 100644
index 00000000000..aaddf41d78d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/xtensa/mabi-windowed.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-mabi=windowed" } */
+
+#ifndef __XTENSA_WINDOWED_ABI__
+#error
+#endif
+
+void foo(void)
+{
+}
+
+/* { dg-final { scan-assembler "entry" } } */
+/* { dg-final { scan-assembler "retw" } } */
diff --git a/gcc/testsuite/gdc.dg/array1.d b/gcc/testsuite/gdc.dg/array1.d
new file mode 100644
index 00000000000..af81813e736
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/array1.d
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// { dg-final { scan-assembler-not "_d_arraycopy" } }
+
+void test1()
+{
+ int[10] a1 = void;
+ int[10] a2 = void;
+ a1[] = a2[];
+}
+
+void test2(int[] a1, int[] a2)
+{
+ a1[] = a2[];
+}
diff --git a/gcc/testsuite/gdc.dg/asm1.d b/gcc/testsuite/gdc.dg/asm1.d
index 3fcfd6a58c1..dce36769370 100644
--- a/gcc/testsuite/gdc.dg/asm1.d
+++ b/gcc/testsuite/gdc.dg/asm1.d
@@ -13,8 +13,8 @@ void parse2()
{
asm
{
- "" : : "g" 1 ? 2 : 3;
- "" : : "g" 1 ? 2 : : 3;
+ "" : : "g" (1 ? 2 : 3);
+ "" : : "g" (1 ? 2 : :) 3;
// { dg-error "expression expected, not ':'" "" { target *-*-* } .-1 }
// { dg-error "expected constant string constraint for operand" "" { target *-*-* } .-2 }
}
@@ -58,7 +58,7 @@ void semantic1()
void semantic2a(X...)(X expr)
{
alias X[0] var1;
- asm { "%0" : "=m" var1; } // { dg-error "double 'double' is a type, not an lvalue" }
+ asm { "%0" : "=m" (var1); } // { dg-error "double 'double' is a type, not an lvalue" }
}
void semantic2()
@@ -86,6 +86,6 @@ void semantic4()
{
asm
{
- "%0" : : "m" S4.foo; // { dg-error "template instance opDispatch!\"foo\" has no value" }
+ "%0" : : "m" (S4.foo); // { dg-error "template instance opDispatch!\"foo\" has no value" }
}
}
diff --git a/gcc/testsuite/gdc.dg/compilable.d b/gcc/testsuite/gdc.dg/compilable.d
deleted file mode 100644
index 92a18756a0e..00000000000
--- a/gcc/testsuite/gdc.dg/compilable.d
+++ /dev/null
@@ -1,444 +0,0 @@
-// { dg-options "-I $srcdir/gdc.dg -I $srcdir/gdc.dg/imports -Wno-psabi" }
-// { dg-additional-sources "imports/gdc27.d imports/gdc231.d" }
-// { dg-do compile }
-
-import core.simd;
-import gcc.attribute;
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=27
-
-import imports.gdc27;
-
-interface I_B : I_A
-{
- void b();
-}
-
-abstract class C_B : C_A, I_B
-{
- abstract void b();
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=108
-
-@attribute("forceinline")
-void forceinline108()
-{
-}
-
-@attribute("noinline")
-void noinline108()
-{
-}
-
-@attribute("flatten")
-void flatten108()
-{
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=170
-
-import imports.gdc170;
-
-void test170()
-{
- foo!void.foo1!void();
- foo!void.foo2!void();
- foo!void.foo3();
- foo!void.foo3!void();
- foo!void.foo4();
- foo!void.foo4!void();
- foo!void.foo5!void(null);
- foo!void.foo6!void(null);
- foo!void.foo7(null);
- foo!void.foo7!void(null);
- foo!void.foo8(null);
- foo!void.foo8!void(null);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=212
-
-template hasElaborateAssign212(S)
-{
- enum hasElaborateAssign212 = is(typeof(S.init.opAssign(rvalueOf212!S))) ||
- is(typeof(lvalueOf212!S)) ;
-}
-
-T rvalueOf212(T)();
-
-T lvalueOf212(T)();
-
-
-template TypeTuple212(TList...)
-{
- alias TypeTuple212 = TList;
-}
-
-template Tuple212()
-{
- struct Tuple212
- {
- void opAssign(R)(R)
- {
- if (hasElaborateAssign212!R)
- {
- }
- }
- }
-}
-
-ref emplaceRef212()
-{
- static if (!hasElaborateAssign212!(Tuple212!()))
- chunk;
-}
-
-class TaskPool212
-{
- void reduce()
- {
- Tuple212!() seed = void;
- Tuple212!()[] results;
- foreach(i; TypeTuple212!(0, 1))
- results[i] = seed;
- }
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=213
-
-struct S213
-{
- int4 vec;
-}
-
-void test213()
-{
- S213 s, b;
-
- assert(s == b);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=218
-
-struct S218a
-{
- this(int* pdata_)
- {
- pdata = pdata_;
- }
-
- void opIndexAssign(int, size_t) { }
- int* pdata;
-};
-
-struct S218
-{
- S218a getS218a()
- {
- return S218a(data.ptr);
- }
-
- int[] data;
- int[] tab2;
-};
-
-S218 f()
-{
- S218 r;
-
- for(int i = 0; i < 1; ++i)
- r.getS218a()[0] = 0;
-
- return r;
-}
-
-S218 var;
-
-static this()
-{
- var = f();
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=223
-
-struct S223
-{
- long[8] field;
-}
-
-class C223
-{
- long[8] field;
-}
-
-S223 test223_1();
-real test223_2();
-string[long[8]] test223_3();
-C223 test223_4();
-long test223_5();
-long[] test223_6();
-long[8] test223_7();
-C223[8] test223_8();
-void delegate() test223_9();
-
-bool test223()
-{
- return test223_1() == test223_1() &&
- test223_1() is test223_1() &&
- test223_2() == test223_2() &&
- test223_2() is test223_2() &&
- test223_3() == test223_3() &&
- test223_3() is test223_3() &&
- test223_4() == test223_4() &&
- test223_4() is test223_4() &&
- test223_5() == test223_5() &&
- test223_5() is test223_5() &&
- test223_6() == test223_6() &&
- test223_6() is test223_6() &&
- test223_7() == test223_7() &&
- test223_7() is test223_7() &&
- test223_8() == test223_8() &&
- test223_8() is test223_8() &&
- test223_9() == test223_9() &&
- test223_9() is test223_9();
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=231
-
-import imports.gdc231;
-
-class Range231 : Widget231
-{
- override void* getStruct()
- {
- return null;
- }
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=239
-
-import imports.gdc239;
-
-class C239
-{
- C239a *foo;
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=240
-
-interface I204
-{
- void f();
-}
-
-class C204 : I204
-{
- void f();
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=241
-
-import imports.gdc241a;
-import imports.gdc241b : S241, C241, E241, N241;
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=242
-
-struct S242a
-{
- enum M = S242a();
- void iter() { }
-}
-
-void test242a()
-{
- return S242a.M.iter;
-}
-
-struct S242b
-{
- enum M = S242b();
- void iter() { }
-}
-
-void test242b()
-{
- S242b.M.iter;
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=251
-
-import imports.gdc251a;
-import imports.gdc251b : C251;
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=253
-
-import imports.gdc253;
-
-class C253 : C253a
-{
- void test253() { }
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=255
-
-class C255
-{
- void f2()
- {
- class C1
- {
- void f1()
- {
- void f0()
- {
- class C0
- {
- void test255()
- {
- f2();
- }
- }
- }
- }
- }
- }
-}
-
-class C255a
-{
- void f3()
- {
- class C1
- {
- void f2()
- {
- void f1()
- {
- void f0()
- {
- class C0
- {
- void test255a()
- {
- f3();
- }
- }
- }
- }
- }
- }
- }
-}
-
-class C255b
-{
- void f4()
- {
- class C2
- {
- void f3()
- {
- void f2()
- {
- class C1
- {
- void f1()
- {
- void f0()
- {
- class C0
- {
- void test255b()
- {
- f4();
- }
- }
- }
- }
- }
- }
- }
- }
- }
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=256
-
-import imports.gdcpkg256 : gdc256;
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=261
-
-void test261()
-{
- class C1
- {
- void f1()
- {
- class C2
- {
- void f2()
- {
- auto v = &f1;
- }
- }
- }
- }
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=280
-
-struct RBNode280
-{
- RBNode280* _parent;
-
- @property left(RBNode280*)
- {
- _parent = &this;
- }
-}
-
-class RedBlackTree280
-{
- RBNode280* _end;
- RBNode280* _begin;
-
- this(int[] elems...)
- {
- _end = new RBNode280;
-
- foreach (e; elems)
- {
- _end.left = _begin;
- }
- }
-}
-
-__gshared s = new RedBlackTree280('h');
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=284
-
-alias v284 = __vector(int[2]);
-
-v284 test284(v284 a, ...)
-{
- return a + a;
-}
diff --git a/gcc/testsuite/gdc.dg/gdc108.d b/gcc/testsuite/gdc.dg/gdc108.d
new file mode 100644
index 00000000000..dc214e4b57e
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc108.d
@@ -0,0 +1,19 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=108
+// { dg-do compile }
+
+import gcc.attribute;
+
+@attribute("forceinline")
+void forceinline108()
+{
+}
+
+@attribute("noinline")
+void noinline108()
+{
+}
+
+@attribute("flatten")
+void flatten108()
+{
+}
diff --git a/gcc/testsuite/gdc.dg/gdc115.d b/gcc/testsuite/gdc.dg/gdc115.d
new file mode 100644
index 00000000000..8eca2eb19c2
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc115.d
@@ -0,0 +1,16 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=115
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+void main()
+{
+ union U
+ {
+ float f;
+ uint i;
+ }
+ float a = 123.0;
+ const l = U(a);
+
+ assert(l.i == U(a).i);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc121.d b/gcc/testsuite/gdc.dg/gdc121.d
new file mode 100644
index 00000000000..a04a2646dc5
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc121.d
@@ -0,0 +1,4 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=121
+// { dg-do compile }
+
+immutable char C121 = void; // ICE
diff --git a/gcc/testsuite/gdc.dg/gdc122.d b/gcc/testsuite/gdc.dg/gdc122.d
new file mode 100644
index 00000000000..0f2feef30c9
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc122.d
@@ -0,0 +1,36 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=122
+// { dg-do compile }
+
+struct map(alias fun)
+{
+ @property run()
+ {
+ }
+}
+
+struct Task(Args)
+{
+ Args _args;
+}
+
+class TaskPool
+{
+ template reduce(functions...)
+ {
+ auto reduce(Args)(Args args)
+ {
+ alias RTask = Task!(typeof(args));
+ auto task = RTask();
+ }
+ }
+}
+
+TaskPool taskPool() {
+ return new TaskPool;
+}
+
+void test122()
+{
+ enum delta = 1;
+ taskPool.reduce!"a + b"(map!({ immutable x = delta; })());
+}
diff --git a/gcc/testsuite/gdc.dg/gdc127.d b/gcc/testsuite/gdc.dg/gdc127.d
new file mode 100644
index 00000000000..9de85aa5a0a
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc127.d
@@ -0,0 +1,6 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=127
+// { dg-do compile }
+
+int[0] test127a; // OK
+int[1][0] test127b; // OK
+int[0][1] test127c; // ICE
diff --git a/gcc/testsuite/gdc.dg/gdc131.d b/gcc/testsuite/gdc.dg/gdc131.d
new file mode 100644
index 00000000000..394a90998e2
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc131.d
@@ -0,0 +1,15 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=131
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+struct S131
+{
+ this(string ) { }
+ string opAssign(string v) { return v; }
+}
+
+void main()
+{
+ S131[string] s;
+ s["foo"] = "bar";
+}
diff --git a/gcc/testsuite/gdc.dg/gdc133.d b/gcc/testsuite/gdc.dg/gdc133.d
new file mode 100644
index 00000000000..c694db6a835
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc133.d
@@ -0,0 +1,16 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=133
+// { dg-do compile }
+
+void delegate()[] D133;
+
+void test133a(void delegate() dg)
+{
+ D133 ~= dg;
+}
+
+void test133()
+{
+ void nested()
+ {}
+ test133a(&nested);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc141.d b/gcc/testsuite/gdc.dg/gdc141.d
new file mode 100644
index 00000000000..9a3d5c56c3e
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc141.d
@@ -0,0 +1,14 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=141
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+bool test141(int a)
+{
+ return a > (a + 1);
+}
+
+void main()
+{
+ assert(test141(int.min) == false);
+ assert(test141(int.max) == true);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc142.d b/gcc/testsuite/gdc.dg/gdc142.d
new file mode 100644
index 00000000000..92cf5051b21
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc142.d
@@ -0,0 +1,15 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=142
+// { dg-do compile }
+
+import gcc.attribute;
+
+@attribute("noinline")
+int test142a()()
+{
+ return 142;
+}
+
+void test142()
+{
+ enum E142 = test142a();
+}
diff --git a/gcc/testsuite/gdc.dg/gdc15.d b/gcc/testsuite/gdc.dg/gdc15.d
new file mode 100644
index 00000000000..935a42871f9
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc15.d
@@ -0,0 +1,35 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=15
+// { dg-do compile }
+
+template map(fun...)
+{
+ auto map(Range)(Range r)
+ {
+ return MapResult!(fun, Range)(r);
+ }
+}
+
+private struct MapResult(alias fun, Range)
+{
+ Range _input;
+
+ this(Range input)
+ {
+ _input = input;
+ }
+}
+
+class B
+{
+ class A { }
+ A a;
+}
+
+class C
+{
+ void visit(B b)
+ {
+ auto as = [b.a];
+ map!((d) { return d; })(as);
+ }
+}
diff --git a/gcc/testsuite/gdc.dg/gdc17.d b/gcc/testsuite/gdc.dg/gdc17.d
new file mode 100644
index 00000000000..0fd58479835
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc17.d
@@ -0,0 +1,37 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=17
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+/**
+ * Parameters are not copied into a frame to be accessed from
+ * the method's __require function.
+ */
+void contractTest(string path)
+{
+ assert(path[0] == 't');
+ assert(path.length == 9);
+ assert(path[8] == 'i');
+}
+
+interface ModuleSaver
+{
+ void save(string str)
+ in
+ {
+ contractTest(str);
+ }
+}
+
+class ModuleWriter : ModuleSaver
+{
+ void save (string str)
+ in {}
+ do
+ {
+ }
+}
+
+void main()
+{
+ (new ModuleWriter()).save ("test.0.mci");
+}
diff --git a/gcc/testsuite/gdc.dg/gdc170.d b/gcc/testsuite/gdc.dg/gdc170.d
new file mode 100644
index 00000000000..a63db31b8fb
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc170.d
@@ -0,0 +1,21 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=170
+// { dg-options "-I $srcdir/gdc.dg" }
+// { dg-do compile }
+
+import imports.gdc170;
+
+void test170()
+{
+ foo!void.foo1!void();
+ foo!void.foo2!void();
+ foo!void.foo3();
+ foo!void.foo3!void();
+ foo!void.foo4();
+ foo!void.foo4!void();
+ foo!void.foo5!void(null);
+ foo!void.foo6!void(null);
+ foo!void.foo7(null);
+ foo!void.foo7!void(null);
+ foo!void.foo8(null);
+ foo!void.foo8!void(null);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc171.d b/gcc/testsuite/gdc.dg/gdc171.d
new file mode 100644
index 00000000000..f8b7fde70a6
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc171.d
@@ -0,0 +1,38 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=171
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+void test171a()
+{
+ int count = 0;
+ short a = -1;
+ while (a != 0)
+ {
+ a >>>= 1;
+ count++;
+ assert(count <= 16);
+ }
+}
+
+void test171b()
+{
+ uint[3] lhs = [99, 201, 300],
+ rhs = [-1, 0, 0];
+ long t = 0;
+
+ for (int i = 0; i < 3; i++)
+ {
+ t += lhs[i];
+ t -= rhs[i];
+ lhs[i] = cast(uint) t;
+ t >>= uint.sizeof * 8;
+ }
+
+ assert(lhs == [100, 200, 300]);
+}
+
+void main()
+{
+ test171a();
+ test171b();
+}
diff --git a/gcc/testsuite/gdc.dg/gdc179.d b/gcc/testsuite/gdc.dg/gdc179.d
new file mode 100644
index 00000000000..72fe0b74e4b
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc179.d
@@ -0,0 +1,32 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=179
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+import core.stdc.stdio;
+
+struct S179a
+{
+ @disable this(this);
+}
+
+struct S179b
+{
+ S179a s1;
+ void connect() { printf("this=%p\n", &this); }
+}
+
+class C179
+{
+ private S179b s2;
+ ref S179b value() @property
+ {
+ printf("this=%p\n", &s2);
+ return s2;
+ }
+}
+
+void main()
+{
+ C179 a = new C179;
+ a.value.connect();
+}
diff --git a/gcc/testsuite/gdc.dg/gdc183.d b/gcc/testsuite/gdc.dg/gdc183.d
new file mode 100644
index 00000000000..aa8a79c53e5
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc183.d
@@ -0,0 +1,60 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=183
+// { dg-do compile }
+
+struct S183a
+{
+ union I183a
+ {
+ struct
+ {
+ double x, y, z;
+ }
+ struct
+ {
+ double a, b, c;
+ }
+ }
+
+ I183a inner;
+
+ this(double x, double y, double z)
+ {
+ this.inner.x = x;
+ this.inner.y = y;
+ this.inner.z = z;
+ }
+}
+
+struct S183b
+{
+ @property get()
+ {
+ union Buf
+ {
+ void[0] result;
+ }
+ const Buf buf = { };
+ return buf.result;
+ }
+}
+
+struct S183c
+{
+ @property get()
+ {
+ union Buf
+ {
+ TypeInfo info;
+ void[0] result;
+ }
+ const Buf buf = { };
+ return buf.result;
+ }
+}
+
+void test183()
+{
+ auto v1 = S183a(0, 0, 0);
+ auto v2 = S183b().get;
+ auto v3 = S183c().get;
+}
diff --git a/gcc/testsuite/gdc.dg/gdc186.d b/gcc/testsuite/gdc.dg/gdc186.d
new file mode 100644
index 00000000000..4a1a91a709c
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc186.d
@@ -0,0 +1,60 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=186
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+struct S186
+{
+ union
+ {
+ struct
+ {
+ ubyte fieldA;
+ byte fieldB = -1;
+ byte fieldC = -1;
+ }
+ size_t _complete;
+ }
+
+ this(size_t complete)
+ {
+ this._complete = complete;
+ }
+}
+
+static if (size_t.sizeof == 8)
+ enum checkval = 0x0200000000000002;
+else
+ enum checkval = 0x02000002;
+
+void check186(in S186 obj, byte fieldB)
+{
+ assert(obj.fieldA == 2);
+ assert(obj.fieldB == 0);
+ assert(obj.fieldC == 0);
+ assert(obj._complete == checkval);
+ assert(fieldB == 0);
+}
+
+void test186(size_t val)
+{
+ S186 obj = S186(val);
+ check186(obj, obj.fieldB);
+
+ assert(obj.fieldA == 2);
+ assert(obj.fieldB == 0);
+ assert(obj.fieldC == 0);
+ assert(obj._complete == checkval);
+
+ obj = S186(val);
+ check186(obj, obj.fieldB);
+
+ assert(obj.fieldA == 2);
+ assert(obj.fieldB == 0);
+ assert(obj.fieldC == 0);
+ assert(obj._complete == checkval);
+}
+
+void main()
+{
+ test186(checkval);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc187.d b/gcc/testsuite/gdc.dg/gdc187.d
new file mode 100644
index 00000000000..2f469ad81f6
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc187.d
@@ -0,0 +1,40 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=187
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+align(1) struct S187b
+{
+ align(1)
+ {
+ uint unpaddedA;
+ ushort unpaddedB;
+ }
+}
+
+struct S187a
+{
+ S187b[3] unpaddedArray;
+ ubyte wontInitialize = ubyte.init;
+}
+
+struct S187
+{
+ S187a interesting;
+}
+
+
+void prepareStack()
+{
+ byte[255] stackGarbage;
+ foreach(i, ref b; stackGarbage)
+ {
+ b = cast(byte)(-i);
+ }
+}
+
+void main()
+{
+ prepareStack();
+ auto a = S187(S187a());
+ assert(a.interesting.wontInitialize == 0);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc19.d b/gcc/testsuite/gdc.dg/gdc19.d
new file mode 100644
index 00000000000..c461e9f1448
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc19.d
@@ -0,0 +1,8 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=19
+// { dg-do compile }
+
+void test19()
+{
+ byte b;
+ --b = b;
+}
diff --git a/gcc/testsuite/gdc.dg/gdc191.d b/gcc/testsuite/gdc.dg/gdc191.d
new file mode 100644
index 00000000000..4d2ca9df0ca
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc191.d
@@ -0,0 +1,201 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=191
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+class C191
+{
+ int count = 0;
+
+ void testA()
+ {
+ class Inner
+ {
+ void test()
+ {
+ void localFunction()
+ {
+ if (++count != 5)
+ testA();
+ }
+ localFunction();
+ }
+ }
+ scope ic = new Inner();
+ ic.test();
+ }
+
+ void testB()
+ {
+ class Inner
+ {
+ void test()
+ {
+ void localFunction()
+ {
+ void anotherLocalFunction()
+ {
+ if (++count != 10)
+ testB();
+ }
+ anotherLocalFunction();
+ }
+ localFunction();
+ }
+ }
+ scope ic = new Inner();
+ ic.test();
+ }
+
+ void testC()
+ {
+ class Inner
+ {
+ int a = 1;
+
+ void test()
+ {
+ void localFunction()
+ {
+ count += a;
+ if (count != 15)
+ testC();
+ assert(a == 1);
+ }
+ localFunction();
+ }
+ }
+ scope ic = new Inner();
+ ic.test();
+ }
+
+ void testD()
+ {
+ class Inner
+ {
+ void test()
+ {
+ int a = 1;
+
+ void localFunction()
+ {
+ count += a;
+ if (count != 20)
+ testD();
+ assert(a == 1);
+ }
+ localFunction();
+ }
+ }
+ scope ic = new Inner();
+ ic.test();
+ }
+
+ void testE()
+ {
+ class Inner
+ {
+ int a = 1;
+
+ void test()
+ {
+ void localFunction()
+ {
+ void anotherLocalFunction()
+ {
+ count += a;
+ if (count != 25)
+ testE();
+ assert(a == 1);
+ }
+
+ anotherLocalFunction();
+ }
+
+ localFunction();
+ }
+ }
+ scope ic = new Inner();
+ ic.test();
+ }
+
+ void testF()
+ {
+ class Inner
+ {
+ void test()
+ {
+ int a = 1;
+
+ void localFunction()
+ {
+ void anotherLocalFunction()
+ {
+ count += a;
+ if (count != 30)
+ testF();
+ assert(a == 1);
+ }
+
+ anotherLocalFunction();
+ }
+
+ localFunction();
+ }
+ }
+ scope ic = new Inner();
+ ic.test();
+ }
+
+ void testG()
+ {
+ class Inner
+ {
+ void test()
+ {
+ void localFunction()
+ {
+ int a = 1;
+
+ void anotherLocalFunction()
+ {
+ count += a;
+ if (count != 35)
+ testG();
+ assert(a == 1);
+ }
+
+ anotherLocalFunction();
+ }
+
+ localFunction();
+ }
+ }
+ scope ic = new Inner();
+ ic.test();
+ }
+}
+
+void main()
+{
+ scope oc = new C191();
+ oc.testA();
+ assert(oc.count == 5);
+
+ oc.testB();
+ assert(oc.count == 10);
+
+ oc.testC();
+ assert(oc.count == 15);
+
+ oc.testD();
+ assert(oc.count == 20);
+
+ oc.testE();
+ assert(oc.count == 25);
+
+ oc.testF();
+ assert(oc.count == 30);
+
+ oc.testG();
+ assert(oc.count == 35);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc194.d b/gcc/testsuite/gdc.dg/gdc194.d
new file mode 100644
index 00000000000..6802895c769
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc194.d
@@ -0,0 +1,9 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=194
+// { dg-do compile }
+
+auto test194(ref bool overflow)
+{
+ import core.checkedint;
+
+ return adds(1, 1, overflow);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc196.d b/gcc/testsuite/gdc.dg/gdc196.d
new file mode 100644
index 00000000000..750cef81c97
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc196.d
@@ -0,0 +1,21 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=196
+// { dg-do assemble }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+class C196
+{
+ int a;
+}
+
+struct S196
+{
+ int a;
+}
+
+void test196()
+{
+ __gshared c = new C196();
+ __gshared s = new S196(0);
+ c.a = 1;
+ s.a = 1;
+}
diff --git a/gcc/testsuite/gdc.dg/gdc198.d b/gcc/testsuite/gdc.dg/gdc198.d
new file mode 100644
index 00000000000..09daf85045d
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc198.d
@@ -0,0 +1,71 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=198
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+struct S198a
+{
+ union
+ {
+ float[3] v;
+ struct
+ {
+ float x;
+ float y;
+ float z;
+ }
+ }
+
+ this(float x_, float y_, float z_)
+ {
+ x = x_;
+ y = y_;
+ z = z_;
+ }
+
+ ref S198a opOpAssign(string op)(S198a operand)
+ if (op == "+")
+ {
+ x += operand.x;
+ y += operand.y;
+ z += operand.z;
+ return this;
+ }
+}
+
+struct S198b
+{
+ @property get()
+ {
+ union Buf
+ {
+ void[0] result;
+ }
+ const Buf buf = { };
+ return buf.result;
+ }
+}
+
+struct S198c
+{
+ @property get()
+ {
+ union Buf
+ {
+ TypeInfo info;
+ void[0] result;
+ }
+ const Buf buf = { };
+ return buf.result;
+ }
+}
+
+
+void main()
+{
+ S198a sum = S198a(0, 0, 0);
+
+ foreach(size_t v; 0 .. 3)
+ sum += S198a(1, 2, 3);
+
+ assert(sum.v == [3, 6, 9]);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc200.d b/gcc/testsuite/gdc.dg/gdc200.d
new file mode 100644
index 00000000000..585d60fe763
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc200.d
@@ -0,0 +1,16 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=200
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+void test200a(double x, double y)
+{
+ const double y2 = x + 1.0;
+ assert(y == y2);
+}
+
+void main()
+{
+ const double x = .012;
+ const double y = x + 1.0;
+ test200a(x, y);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc204.d b/gcc/testsuite/gdc.dg/gdc204.d
new file mode 100644
index 00000000000..5c7554f6409
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc204.d
@@ -0,0 +1,12 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=204
+// { dg-do compile }
+
+interface I204
+{
+ void f();
+}
+
+class C204 : I204
+{
+ void f();
+}
diff --git a/gcc/testsuite/gdc.dg/gdc210.d b/gcc/testsuite/gdc.dg/gdc210.d
new file mode 100644
index 00000000000..0f560731b22
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc210.d
@@ -0,0 +1,62 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=210
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+struct S210
+{
+ ubyte a;
+ uint b;
+}
+
+union U210
+{
+ S210 a;
+ uint b;
+}
+
+S210 test210a()
+{
+ S210 s = S210(1, 2);
+ return s;
+}
+
+S210[2] test210b()
+{
+ S210[2] s = [S210(1, 2), S210(3, 4)];
+ return s;
+}
+
+U210 test210c()
+{
+ U210 s = U210(S210(1, 2));
+ return s;
+}
+
+U210[2] test210d()
+{
+ U210[2] s = [U210(S210(1, 2)), U210(S210(3, 4))];
+ return s;
+}
+
+void main()
+{
+ S210 a = S210(1, 2);
+ assert(a == S210(1, 2));
+ assert(a == test210a());
+ assert(a != S210(2, 1));
+
+ S210[2] b = [S210(1, 2), S210(3, 4)];
+ assert(b == [S210(1, 2), S210(3, 4)]);
+ assert(b == test210b());
+ assert(b != [S210(2, 1), S210(3, 4)]);
+
+ U210 c = U210(S210(1, 2));
+ assert(c == U210(S210(1, 2)));
+ assert(c == test210c());
+ assert(c != U210(S210(2, 1)));
+
+ U210[2] d = [U210(S210(1, 2)), U210(S210(3, 4))];
+ assert(d == [U210(S210(1, 2)), U210(S210(3, 4))]);
+ assert(d == test210d());
+ assert(d != [U210(S210(2, 1)), U210(S210(3, 4))]);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc212.d b/gcc/testsuite/gdc.dg/gdc212.d
new file mode 100644
index 00000000000..417c1fc8f54
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc212.d
@@ -0,0 +1,48 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=212
+// { dg-do compile }
+
+template hasElaborateAssign212(S)
+{
+ enum hasElaborateAssign212 = is(typeof(S.init.opAssign(rvalueOf212!S))) ||
+ is(typeof(lvalueOf212!S)) ;
+}
+
+T rvalueOf212(T)();
+
+T lvalueOf212(T)();
+
+
+template TypeTuple212(TList...)
+{
+ alias TypeTuple212 = TList;
+}
+
+template Tuple212()
+{
+ struct Tuple212
+ {
+ void opAssign(R)(R)
+ {
+ if (hasElaborateAssign212!R)
+ {
+ }
+ }
+ }
+}
+
+ref emplaceRef212()
+{
+ static if (!hasElaborateAssign212!(Tuple212!()))
+ chunk;
+}
+
+class TaskPool212
+{
+ void reduce()
+ {
+ Tuple212!() seed = void;
+ Tuple212!()[] results;
+ foreach(i; TypeTuple212!(0, 1))
+ results[i] = seed;
+ }
+}
diff --git a/gcc/testsuite/gdc.dg/gdc213.d b/gcc/testsuite/gdc.dg/gdc213.d
new file mode 100644
index 00000000000..11e5c63f9e3
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc213.d
@@ -0,0 +1,17 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=213
+// { dg-options "-Wno-psabi" }
+// { dg-do compile }
+
+import core.simd;
+
+struct S213
+{
+ int4 vec;
+}
+
+void test213()
+{
+ S213 s, b;
+
+ assert(s == b);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc218.d b/gcc/testsuite/gdc.dg/gdc218.d
new file mode 100644
index 00000000000..3e7eb16940a
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc218.d
@@ -0,0 +1,41 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=218
+// { dg-do compile }
+
+struct S218a
+{
+ this(int* pdata_)
+ {
+ pdata = pdata_;
+ }
+
+ void opIndexAssign(int, size_t) { }
+ int* pdata;
+};
+
+struct S218
+{
+ S218a getS218a()
+ {
+ return S218a(data.ptr);
+ }
+
+ int[] data;
+ int[] tab2;
+};
+
+S218 f()
+{
+ S218 r;
+
+ for(int i = 0; i < 1; ++i)
+ r.getS218a()[0] = 0;
+
+ return r;
+}
+
+S218 var;
+
+static this()
+{
+ var = f();
+}
diff --git a/gcc/testsuite/gdc.dg/gdc223.d b/gcc/testsuite/gdc.dg/gdc223.d
new file mode 100644
index 00000000000..a5a9dccbe46
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc223.d
@@ -0,0 +1,43 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=223
+// { dg-do compile }
+
+struct S223
+{
+ long[8] field;
+}
+
+class C223
+{
+ long[8] field;
+}
+
+S223 test223_1();
+real test223_2();
+string[long[8]] test223_3();
+C223 test223_4();
+long test223_5();
+long[] test223_6();
+long[8] test223_7();
+C223[8] test223_8();
+void delegate() test223_9();
+
+bool test223()
+{
+ return test223_1() == test223_1() &&
+ test223_1() is test223_1() &&
+ test223_2() == test223_2() &&
+ test223_2() is test223_2() &&
+ test223_3() == test223_3() &&
+ test223_3() is test223_3() &&
+ test223_4() == test223_4() &&
+ test223_4() is test223_4() &&
+ test223_5() == test223_5() &&
+ test223_5() is test223_5() &&
+ test223_6() == test223_6() &&
+ test223_6() is test223_6() &&
+ test223_7()[] is test223_7()[] &&
+ test223_8() == test223_8() &&
+ test223_8()[] is test223_8()[] &&
+ test223_9() == test223_9() &&
+ test223_9() is test223_9();
+}
diff --git a/gcc/testsuite/gdc.dg/gdc231.d b/gcc/testsuite/gdc.dg/gdc231.d
new file mode 100644
index 00000000000..f029fc0212c
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc231.d
@@ -0,0 +1,13 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=231
+// { dg-additional-sources "imports/gdc231.d" }
+// { dg-do compile }
+
+import imports.gdc231;
+
+class Range231 : Widget231
+{
+ override void* getStruct()
+ {
+ return null;
+ }
+}
diff --git a/gcc/testsuite/gdc.dg/gdc239.d b/gcc/testsuite/gdc.dg/gdc239.d
new file mode 100644
index 00000000000..0fcc82e87fa
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc239.d
@@ -0,0 +1,10 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=239
+// { dg-options "-I $srcdir/gdc.dg" }
+// { dg-do compile }
+
+import imports.gdc239;
+
+class C239
+{
+ C239a *foo;
+}
diff --git a/gcc/testsuite/gdc.dg/gdc24.d b/gcc/testsuite/gdc.dg/gdc24.d
new file mode 100644
index 00000000000..b61aae47d92
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc24.d
@@ -0,0 +1,15 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=24
+// { dg-do compile }
+
+void test24()
+{
+ struct S24
+ {
+ char[1] b;
+ }
+
+ S24 a;
+
+ if (*a.b.ptr)
+ return;
+}
diff --git a/gcc/testsuite/gdc.dg/gdc240.d b/gcc/testsuite/gdc.dg/gdc240.d
new file mode 100644
index 00000000000..76f6dcf8db7
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc240.d
@@ -0,0 +1,16 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=240
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+void test240(int a, int b)
+{
+ assert(a == 0);
+ assert(b == 0);
+}
+
+void main()
+{
+ int a = 0;
+ test240(a, a++);
+ assert(a == 1);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc241.d b/gcc/testsuite/gdc.dg/gdc241.d
new file mode 100644
index 00000000000..964d81e8ac3
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc241.d
@@ -0,0 +1,6 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=241
+// { dg-options "-I $srcdir/gdc.dg" }
+// { dg-do compile }
+
+import imports.gdc241a;
+public import imports.gdc241b : S241, C241, E241, N241;
diff --git a/gcc/testsuite/gdc.dg/gdc242a.d b/gcc/testsuite/gdc.dg/gdc242a.d
new file mode 100644
index 00000000000..14486828e3f
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc242a.d
@@ -0,0 +1,24 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=242
+// { dg-do compile }
+
+struct S242a
+{
+ enum M = S242a();
+ void iter() { }
+}
+
+void test242a()
+{
+ return S242a.M.iter;
+}
+
+struct S242b
+{
+ enum M = S242b();
+ void iter() { }
+}
+
+void test242b()
+{
+ S242b.M.iter;
+}
diff --git a/gcc/testsuite/gdc.dg/gdc242b.d b/gcc/testsuite/gdc.dg/gdc242b.d
new file mode 100644
index 00000000000..cfba4b484b3
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc242b.d
@@ -0,0 +1,25 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=242
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+struct S242
+{
+ enum M = S242();
+ int a = 42;
+
+ auto iter()
+ {
+ this.a = 24;
+ return this;
+ }
+}
+
+S242 test242()
+{
+ return S242.M.iter;
+}
+
+void main()
+{
+ assert(test242() == S242(24));
+}
diff --git a/gcc/testsuite/gdc.dg/gdc248.d b/gcc/testsuite/gdc.dg/gdc248.d
new file mode 100644
index 00000000000..0fd0277bd46
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc248.d
@@ -0,0 +1,44 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=248
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+class C248b
+{
+ bool isintegral()
+ {
+ return false;
+ }
+}
+
+class C248a
+{
+ int count = 0;
+
+ C248b getMemtype()
+ {
+ count++;
+ return new C248b();
+ }
+}
+
+class C248
+{
+ C248a sym;
+
+ this()
+ {
+ this.sym = new C248a();
+ }
+
+ bool isintegral()
+ {
+ return sym.getMemtype().isintegral();
+ }
+}
+
+void main()
+{
+ C248 e = new C248();
+ e.isintegral();
+ assert(e.sym.count == 1);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc250.d b/gcc/testsuite/gdc.dg/gdc250.d
new file mode 100644
index 00000000000..c8182da8bb1
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc250.d
@@ -0,0 +1,18 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=250
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+void main()
+{
+ struct S
+ {
+ string data;
+ }
+
+ auto a = S("hello");
+ auto b = S("hello".dup);
+
+ assert(a.data == b.data);
+ assert(a == b);
+ assert([a] == [b]);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc251.d b/gcc/testsuite/gdc.dg/gdc251.d
new file mode 100644
index 00000000000..2e9f18c9c48
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc251.d
@@ -0,0 +1,6 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=251
+// { dg-options "-I $srcdir/gdc.dg" }
+// { dg-do compile }
+
+import imports.gdc251a;
+import imports.gdc251b : C251;
diff --git a/gcc/testsuite/gdc.dg/gdc253a.d b/gcc/testsuite/gdc.dg/gdc253a.d
new file mode 100644
index 00000000000..2439721ff1e
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc253a.d
@@ -0,0 +1,10 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=253
+// { dg-additional-sources "imports/gdc253a.d" }
+// { dg-do compile }
+
+import imports.gdc253a;
+
+class C253 : C253a
+{
+ void test253() { }
+}
diff --git a/gcc/testsuite/gdc.dg/gdc253b.d b/gcc/testsuite/gdc.dg/gdc253b.d
new file mode 100644
index 00000000000..916932d0ea0
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc253b.d
@@ -0,0 +1,19 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=253
+// { dg-additional-sources "imports/gdc253b.d" }
+// { dg-options "-I $srcdir/gdc.dg" }
+// { dg-do compile }
+
+import imports.gdc253b;
+
+interface A253
+{
+ void test253(int[int]);
+}
+
+interface C253 : A253
+{
+}
+
+class D253 : B253, C253
+{
+}
diff --git a/gcc/testsuite/gdc.dg/gdc255.d b/gcc/testsuite/gdc.dg/gdc255.d
new file mode 100644
index 00000000000..8070f8e6b5c
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc255.d
@@ -0,0 +1,83 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=255
+// { dg-do compile }
+
+class C255
+{
+ void f2()
+ {
+ class C1
+ {
+ void f1()
+ {
+ void f0()
+ {
+ class C0
+ {
+ void test255()
+ {
+ f2();
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+class C255a
+{
+ void f3()
+ {
+ class C1
+ {
+ void f2()
+ {
+ void f1()
+ {
+ void f0()
+ {
+ class C0
+ {
+ void test255a()
+ {
+ f3();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+class C255b
+{
+ void f4()
+ {
+ class C2
+ {
+ void f3()
+ {
+ void f2()
+ {
+ class C1
+ {
+ void f1()
+ {
+ void f0()
+ {
+ class C0
+ {
+ void test255b()
+ {
+ f4();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/gcc/testsuite/gdc.dg/gdc256.d b/gcc/testsuite/gdc.dg/gdc256.d
new file mode 100644
index 00000000000..89b1aadd36e
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc256.d
@@ -0,0 +1,5 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=256
+// { dg-options "-I $srcdir/gdc.dg" }
+// { dg-do compile }
+
+import imports.gdcpkg256 : gdc256;
diff --git a/gcc/testsuite/gdc.dg/gdc261.d b/gcc/testsuite/gdc.dg/gdc261.d
new file mode 100644
index 00000000000..593e5feff9c
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc261.d
@@ -0,0 +1,19 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=261
+// { dg-do compile }
+
+void test261()
+{
+ class C1
+ {
+ void f1()
+ {
+ class C2
+ {
+ void f2()
+ {
+ auto v = &f1;
+ }
+ }
+ }
+ }
+}
diff --git a/gcc/testsuite/gdc.dg/gdc27.d b/gcc/testsuite/gdc.dg/gdc27.d
new file mode 100644
index 00000000000..d0ff61e8e1d
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc27.d
@@ -0,0 +1,18 @@
+// { dg-options "-I $srcdir/gdc.dg/imports" }
+// { dg-additional-sources "imports/gdc27.d" }
+// { dg-do compile }
+
+/******************************************/
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=27
+
+import imports.gdc27;
+
+interface I_B : I_A
+{
+ void b();
+}
+
+abstract class C_B : C_A, I_B
+{
+ abstract void b();
+}
diff --git a/gcc/testsuite/gdc.dg/gdc273.d b/gcc/testsuite/gdc.dg/gdc273.d
new file mode 100644
index 00000000000..b5d2b103593
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc273.d
@@ -0,0 +1,19 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=273
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+class B273
+{
+ B273[] members;
+}
+
+class D273 : B273
+{
+}
+
+void main()
+{
+ auto noPointers = ClassInfo.ClassFlags.noPointers;
+ assert((B273.classinfo.m_flags & noPointers) == 0);
+ assert((D273.classinfo.m_flags & noPointers) == 0);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc280.d b/gcc/testsuite/gdc.dg/gdc280.d
new file mode 100644
index 00000000000..5be3af7dfff
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc280.d
@@ -0,0 +1,30 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=280
+// { dg-do compile }
+
+struct RBNode280
+{
+ RBNode280* _parent;
+
+ @property left(RBNode280*)
+ {
+ _parent = &this;
+ }
+}
+
+class RedBlackTree280
+{
+ RBNode280* _end;
+ RBNode280* _begin;
+
+ this(int[] elems...)
+ {
+ _end = new RBNode280;
+
+ foreach (e; elems)
+ {
+ _end.left = _begin;
+ }
+ }
+}
+
+__gshared s = new RedBlackTree280('h');
diff --git a/gcc/testsuite/gdc.dg/gdc284.d b/gcc/testsuite/gdc.dg/gdc284.d
new file mode 100644
index 00000000000..c8854287911
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc284.d
@@ -0,0 +1,10 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=284
+// { dg-options "-Wno-psabi" }
+// { dg-do compile }
+
+alias v284 = __vector(int[2]);
+
+v284 test284(v284 a, ...)
+{
+ return a + a;
+}
diff --git a/gcc/testsuite/gdc.dg/gdc285.d b/gcc/testsuite/gdc.dg/gdc285.d
new file mode 100644
index 00000000000..f94ffb5f152
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc285.d
@@ -0,0 +1,15 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=285
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+inout(char)[] test285(inout(char)* s) @nogc @system pure nothrow
+{
+ import core.stdc.string : strlen;
+ return s ? s[0 .. strlen(s)] : null;
+}
+
+void main()
+{
+ assert(test285(null) == null);
+ assert(test285("foo") == "foo");
+}
diff --git a/gcc/testsuite/gdc.dg/gdc286.d b/gcc/testsuite/gdc.dg/gdc286.d
new file mode 100644
index 00000000000..2536ef6e26a
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc286.d
@@ -0,0 +1,37 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=286
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+void main()
+{
+ struct K286
+ {
+ int count;
+ this(this)
+ {
+ count++;
+ }
+ }
+
+ struct S286
+ {
+ int data;
+ this(K286 key)
+ {
+ data = key.count;
+ }
+ }
+
+ S286 getData(K286 key)
+ {
+ static S286[K286] getCache;
+ auto p = key in getCache;
+ if (p)
+ return *p;
+ return (getCache[key] = S286(key));
+ }
+
+ auto s = getData(K286());
+ if (s.data == 0)
+ assert(0);
+}
diff --git a/gcc/testsuite/gdc.dg/link.d b/gcc/testsuite/gdc.dg/gdc300.d
index 5efd0ad347f..d1aae593387 100644
--- a/gcc/testsuite/gdc.dg/link.d
+++ b/gcc/testsuite/gdc.dg/gdc300.d
@@ -1,16 +1,6 @@
-// { dg-do link { target d_runtime_has_std_library } }
-
-/******************************************/
-
-class C1()
-{
- static struct S1 { A1 a; }
-}
-
-enum E1 = is(C1!());
-
-/******************************************/
// https://bugzilla.gdcproject.org/show_bug.cgi?id=300
+// { dg-additional-options "-fmain" }
+// { dg-do link { target d_runtime_has_std_library } }
struct S300(Range)
{
@@ -33,7 +23,3 @@ void link300()
auto sample = link300a(I());
sample.test(5);
}
-
-/******************************************/
-
-void main() {}
diff --git a/gcc/testsuite/gdc.dg/gdc309.d b/gcc/testsuite/gdc.dg/gdc309.d
new file mode 100644
index 00000000000..bbcb6e7a412
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc309.d
@@ -0,0 +1,41 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=309
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+void main()
+{
+ creal f1 = +0.0 + 0.0i;
+ creal f2 = +0.0 - 0.0i;
+ creal f3 = -0.0 + 0.0i;
+ creal f4 = +0.0 + 0.0i;
+
+ assert(f1 !is f2);
+ assert(f1 !is f3);
+ assert(f2 !is f3);
+ assert(f1 is f4);
+
+ assert(!(f1 is f2));
+ assert(!(f1 is f3));
+ assert(!(f2 is f3));
+ assert(!(f1 !is f4));
+
+ struct CReal
+ {
+ creal value;
+ }
+
+ CReal s1 = CReal(+0.0 + 0.0i);
+ CReal s2 = CReal(+0.0 - 0.0i);
+ CReal s3 = CReal(-0.0 + 0.0i);
+ CReal s4 = CReal(+0.0 + 0.0i);
+
+ assert(s1 !is s2);
+ assert(s1 !is s3);
+ assert(s2 !is s3);
+ assert(s1 is s4);
+
+ assert(!(s1 is s2));
+ assert(!(s1 is s3));
+ assert(!(s2 is s3));
+ assert(!(s1 !is s4));
+}
diff --git a/gcc/testsuite/gdc.dg/gdc31.d b/gcc/testsuite/gdc.dg/gdc31.d
new file mode 100644
index 00000000000..97dc88d551e
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc31.d
@@ -0,0 +1,25 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=31
+// { dg-do compile }
+
+class RedBlackTree(T, alias less)
+{
+ struct Range
+ {
+ @property empty() { }
+ }
+
+ Range opSlice()
+ {
+ return Range();
+ }
+}
+
+auto redBlackTree(alias less, E)()
+{
+ return new RedBlackTree!(E, less);
+}
+
+void test31()
+{
+ redBlackTree!((a){}, double)();
+}
diff --git a/gcc/testsuite/gdc.dg/gdc35.d b/gcc/testsuite/gdc.dg/gdc35.d
new file mode 100644
index 00000000000..773a78a73f5
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc35.d
@@ -0,0 +1,73 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=35
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+/**
+ * Here the BinaryHeap instance uses an alias parameter and therefore
+ * the instance's functions (percolateDown) need to be generated in
+ * topNIndex->BinaryHeap scope and not in the declaration scope
+ * (module->BinaryHeap).
+ */
+void topNIndex()()
+{
+ bool indirectLess(int a, int b)
+ {
+ return a > b;
+ }
+
+ auto a = BinaryHeap!(indirectLess)();
+}
+
+struct BinaryHeap(alias less)
+{
+ void percolateDown()
+ {
+ less(0, 1);
+ }
+}
+
+void test35a()
+{
+ topNIndex();
+}
+
+/*
+ * Similar as test35a but with an additional indirection.
+ * The nested function chain for percolateDown should look like this:
+ * topNIndex2->BinaryHeap2->percolateDown.
+ */
+void topNIndex2()()
+{
+ bool indirectLess(int a, int b)
+ {
+ return a > b;
+ }
+ auto a = BinaryHeap2!(S35b!(indirectLess)())();
+}
+
+struct S35b(alias a)
+{
+ void foo()
+ {
+ a(0, 0);
+ }
+}
+
+struct BinaryHeap2(alias less)
+{
+ void percolateDown()
+ {
+ less.foo();
+ }
+}
+
+void test35b()
+{
+ topNIndex2();
+}
+
+void main()
+{
+ test35a();
+ test35b();
+}
diff --git a/gcc/testsuite/gdc.dg/gdc36.d b/gcc/testsuite/gdc.dg/gdc36.d
new file mode 100644
index 00000000000..fbb876c28b3
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc36.d
@@ -0,0 +1,125 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=36
+// { dg-additional-sources "imports/gdc36.d" }
+// { dg-options "-I $srcdir/gdc.dg" }
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+module gdc36;
+
+import imports.gdc36;
+
+/**
+ * Here getChar is a function in a template where template.isnested == false
+ * but getChar still is a nested function and needs to get a static chain
+ * containing test36a.
+ */
+void test36a()(char val)
+{
+ void error()
+ {
+ }
+
+ void getChar()()
+ {
+ error();
+ }
+
+ void parseString()
+ {
+ getChar();
+ }
+}
+
+/**
+ * Similar as test36a, but a little more complicated:
+ * Here getChar is nested in a struct template which is nested in a function.
+ * getChar's static chain still needs to contain test36b.
+ */
+void test36b()(char val)
+{
+ void error()
+ {
+ }
+
+ struct S(T)
+ {
+ void getChar()
+ {
+ error();
+ }
+ }
+
+
+ void parseString()
+ {
+ S!(int)().getChar();
+ }
+}
+
+/**
+ * If g had accessed a, the frontend would have generated a closure.
+ *
+ * As we do not access it, there's no closure. We have to be careful
+ * not to set a static chain for g containing test36c_1 though,
+ * as g can be called from outside (here from test1c). In the end
+ * we have to treat this as if everything in test36c_1 was declared
+ * at module scope.
+ */
+auto test36c_1()
+{
+ int a;
+ void c() {}
+ class Result
+ {
+ int b;
+ void g() { c(); /*a = 42;*/ }
+ }
+
+ return new Result();
+}
+
+void test36c()
+{
+ test36c_1().g();
+}
+
+/**
+ * empty is a (private) function which is nested in lightPostprocess.
+ * At the same time it's a template instance, so it has to be declared as
+ * weak or otherwise one-only. imports/gdc36.d creates another instance
+ * of Regex!char to verify that.
+ */
+struct Parser(R)
+{
+ @property program()
+ {
+ return Regex!char();
+ }
+}
+
+struct Regex(Char)
+{
+ @trusted lightPostprocess()
+ {
+ struct FixedStack(T)
+ {
+ @property empty() { return false; }
+ }
+ auto counterRange = FixedStack!uint();
+ }
+}
+
+void test36d()
+{
+ auto parser = Parser!(char[])();
+ imports.gdc36.test36d_1;
+}
+
+void main()
+{
+ test36a('n');
+ test36b('n');
+ test36c();
+ test36d();
+}
+
diff --git a/gcc/testsuite/gdc.dg/gdc37.d b/gcc/testsuite/gdc.dg/gdc37.d
new file mode 100644
index 00000000000..171ace527a0
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc37.d
@@ -0,0 +1,16 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=37
+// { dg-do compile }
+
+struct S37
+{
+ int bar(const S37 s)
+ {
+ return 0;
+ }
+}
+
+int test37()
+{
+ S37 s;
+ return s.bar(s);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc4.d b/gcc/testsuite/gdc.dg/gdc4.d
new file mode 100644
index 00000000000..9a7499a1490
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc4.d
@@ -0,0 +1,9 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=4
+// { dg-do compile }
+
+void test4()
+{
+ string str = "allo";
+ static assert(!__traits(compiles, str.reverse));
+ static assert(!__traits(compiles, str.sort));
+}
diff --git a/gcc/testsuite/gdc.dg/gdc43.d b/gcc/testsuite/gdc.dg/gdc43.d
new file mode 100644
index 00000000000..e0d44a21b4e
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc43.d
@@ -0,0 +1,29 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=43
+// { dg-do compile }
+
+void main()
+{
+ import core.vararg;
+ import core.stdc.stdio;
+
+ void formatArray(ref va_list argptr)
+ {
+ auto a = va_arg!(const(float)[])(argptr);
+ foreach(f; a)
+ {
+ printf("%f\n", f);
+ }
+ }
+
+ void doFormat(TypeInfo[] arguments, va_list argptr)
+ {
+ formatArray(argptr);
+ }
+
+ void format(...)
+ {
+ doFormat(_arguments, _argptr);
+ }
+
+ format([1.0f, 2.0f, 3.0f]);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc47.d b/gcc/testsuite/gdc.dg/gdc47.d
new file mode 100644
index 00000000000..e85451af1ac
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc47.d
@@ -0,0 +1,12 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=47
+// { dg-do compile }
+
+template Foo47()
+{
+ void test47()
+ {
+ asm { "nop"; }
+ }
+}
+
+mixin Foo47!();
diff --git a/gcc/testsuite/gdc.dg/gdc51.d b/gcc/testsuite/gdc.dg/gdc51.d
new file mode 100644
index 00000000000..e6ffbd470b0
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc51.d
@@ -0,0 +1,29 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=51
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+struct S51
+{
+ int x;
+ int pad;
+
+ this(this)
+ {
+ ++x;
+ }
+}
+
+void main()
+{
+ S51 s;
+ auto sarr = new S51[1];
+ auto sarr2 = sarr;
+
+ // postblit all fields.
+ sarr2 ~= s;
+
+ assert (sarr2[0].x == 1);
+ assert (sarr2[1].x == 1);
+ assert (sarr[0].x == 0);
+ assert (s.x == 0);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc57.d b/gcc/testsuite/gdc.dg/gdc57.d
new file mode 100644
index 00000000000..b378286066a
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc57.d
@@ -0,0 +1,21 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=57
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+struct S57
+{
+ int a;
+ long b;
+ // Doesn't happen for bigger structs
+}
+
+S57 bar57()
+{
+ return S57(4, 42);
+}
+
+void main()
+{
+ S57 s = bar57();
+ assert (s is S57(4, 42));
+}
diff --git a/gcc/testsuite/gdc.dg/gdc66.d b/gcc/testsuite/gdc.dg/gdc66.d
new file mode 100644
index 00000000000..f499c8352af
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc66.d
@@ -0,0 +1,14 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=66
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+
+void main()
+{
+ int pos = 0;
+
+ foreach(x; 0 .. 64)
+ {
+ ++pos %= 4;
+ assert (pos != 4);
+ }
+}
diff --git a/gcc/testsuite/gdc.dg/gdc67.d b/gcc/testsuite/gdc.dg/gdc67.d
new file mode 100644
index 00000000000..9289abfadc7
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc67.d
@@ -0,0 +1,4 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=67
+// { dg-do compile }
+
+__vector(float[4])[2] d; // ICE
diff --git a/gcc/testsuite/gdc.dg/gdc71.d b/gcc/testsuite/gdc.dg/gdc71.d
new file mode 100644
index 00000000000..c2eb2dd3b7b
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc71.d
@@ -0,0 +1,27 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=71
+// { dg-do compile }
+
+struct CanonicalHuffman
+{
+ int[] table;
+
+ void print()
+ {
+ table.sort!(a => a);
+ }
+}
+
+struct SortedRange(alias pred )
+{
+ auto trisect() { }
+}
+
+auto assumeSorted(alias pred , R)(R )
+{
+ return SortedRange!pred();
+}
+
+SortedRange!(less) sort(alias less, Range)(Range r)
+{
+ return assumeSorted!less(r);
+}
diff --git a/gcc/testsuite/gdc.dg/gdc77.d b/gcc/testsuite/gdc.dg/gdc77.d
new file mode 100644
index 00000000000..6c081753a91
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/gdc77.d
@@ -0,0 +1,11 @@
+// https://bugzilla.gdcproject.org/show_bug.cgi?id=77
+// { dg-do compile }
+
+void fun(size_t n)(ubyte[n] val)
+{
+}
+
+void test77(ubyte[3] buf)
+{
+ fun(buf[0..2]);
+}
diff --git a/gcc/testsuite/gdc.dg/imports/gdc239.d b/gcc/testsuite/gdc.dg/imports/gdc239.d
index 3378d74bd9b..11d2bae9aa1 100644
--- a/gcc/testsuite/gdc.dg/imports/gdc239.d
+++ b/gcc/testsuite/gdc.dg/imports/gdc239.d
@@ -1,9 +1,27 @@
-import std.path : buildNormalizedPath;
+module imports.gdc239;
class C239a
{
auto bar()
{
- auto path = buildNormalizedPath("/", "foo");
+ chainPath();
}
}
+
+auto chainPath()
+{
+ struct OnlyResult { }
+ chain([], OnlyResult(), []);
+}
+
+auto chain(Ranges...)(Ranges rs)
+{
+ static struct Result
+ {
+ Ranges source;
+ this(Ranges)
+ {
+ }
+ }
+ Result(rs);
+}
diff --git a/gcc/testsuite/gdc.dg/imports/gdc241a.d b/gcc/testsuite/gdc.dg/imports/gdc241a.d
index 28ba8ebe8ee..0ed851383a6 100644
--- a/gcc/testsuite/gdc.dg/imports/gdc241a.d
+++ b/gcc/testsuite/gdc.dg/imports/gdc241a.d
@@ -1,4 +1,6 @@
-import compilable;
+module imports.gdc241a;
+
+import gdc241;
S241 *s241; // Use indirectly imported struct
C241 *c241; // Use indirectly imported class
diff --git a/gcc/testsuite/gdc.dg/imports/gdc241b.d b/gcc/testsuite/gdc.dg/imports/gdc241b.d
index 3632575ba0d..c49a04716ca 100644
--- a/gcc/testsuite/gdc.dg/imports/gdc241b.d
+++ b/gcc/testsuite/gdc.dg/imports/gdc241b.d
@@ -1,3 +1,4 @@
+module imports.gdc241b;
class C241 { }
diff --git a/gcc/testsuite/gdc.dg/imports/gdc251a.d b/gcc/testsuite/gdc.dg/imports/gdc251a.d
index 5c2d4d58769..4ba927f91a7 100644
--- a/gcc/testsuite/gdc.dg/imports/gdc251a.d
+++ b/gcc/testsuite/gdc.dg/imports/gdc251a.d
@@ -1,6 +1,6 @@
module imports.gdc251a;
import imports.gdc251b;
-import compilable;
+import gdc251;
C251 config;
diff --git a/gcc/testsuite/gdc.dg/imports/gdc253.d b/gcc/testsuite/gdc.dg/imports/gdc253a.d
index 66492621210..8e629102aa3 100644
--- a/gcc/testsuite/gdc.dg/imports/gdc253.d
+++ b/gcc/testsuite/gdc.dg/imports/gdc253a.d
@@ -1,4 +1,4 @@
-module imports.gdc253;
+module imports.gdc253a;
interface I253a
{
diff --git a/gcc/testsuite/gdc.dg/imports/gdc253b.d b/gcc/testsuite/gdc.dg/imports/gdc253b.d
new file mode 100644
index 00000000000..996b0bf582c
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/imports/gdc253b.d
@@ -0,0 +1,12 @@
+module imports.gdc253b;
+
+import gdc253b;
+
+class B253 : A253
+{
+ void test253(int[int] a)
+ {
+ if (a.get(0, 1))
+ return;
+ }
+}
diff --git a/gcc/testsuite/gdc.dg/imports/gdc36.d b/gcc/testsuite/gdc.dg/imports/gdc36.d
new file mode 100644
index 00000000000..a22fd6f4f6a
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/imports/gdc36.d
@@ -0,0 +1,8 @@
+module imports.gdc36;
+
+private import gdc36;
+
+void test36d_1()
+{
+ auto parser = Parser!(char[])();
+}
diff --git a/gcc/testsuite/gdc.dg/imports/runnable.d b/gcc/testsuite/gdc.dg/imports/runnable.d
deleted file mode 100644
index f28ccdf5b65..00000000000
--- a/gcc/testsuite/gdc.dg/imports/runnable.d
+++ /dev/null
@@ -1,23 +0,0 @@
-module imports.runnable;
-
-private import runnable;
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=36
-
-void test36d_1()
-{
- auto parser = Parser!(char[])();
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=253
-
-class B253 : A253
-{
- void test253(int[int] a)
- {
- if (a.get(0, 1))
- return;
- }
-}
diff --git a/gcc/testsuite/gdc.dg/init1.d b/gcc/testsuite/gdc.dg/init1.d
new file mode 100644
index 00000000000..679ad15460e
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/init1.d
@@ -0,0 +1,9 @@
+// { dg-do run { target hw } }
+// { dg-options "-fno-druntime" }
+// 'a' should not be default initialized to -1.
+static char a = void;
+
+extern (C) void main()
+{
+ assert(a == 0);
+}
diff --git a/gcc/testsuite/gdc.dg/intrinsics.d b/gcc/testsuite/gdc.dg/intrinsics.d
new file mode 100644
index 00000000000..5888361a438
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/intrinsics.d
@@ -0,0 +1,123 @@
+// { dg-do compile }
+// { dg-options "-fdump-tree-original" }
+import core.bitop;
+import core.checkedint;
+import core.math;
+import core.stdc.stdarg;
+
+//////////////////////////////////////////////////////
+// core.bitop
+
+// { dg-final { scan-tree-dump-not " bsf " "original" } }
+int test_bsf(uint a) { return bsf(a); }
+int test_bsf(ulong a) { return bsf(a); }
+// { dg-final { scan-tree-dump-not " bsr " "original" } }
+int test_bsr(uint a) { return bsr(a); }
+int test_bsr(ulong a) { return bsr(a); }
+// { dg-final { scan-tree-dump-not " bt " "original" } }
+int test_bt(size_t *a, size_t b) { return bt(a, b); }
+// { dg-final { scan-tree-dump-not " btc " "original" } }
+int test_btc(size_t *a, size_t b) { return btc(a, b); }
+// { dg-final { scan-tree-dump-not " btr " "original" } }
+int test_btr(size_t *a, size_t b) { return btr(a, b); }
+// { dg-final { scan-tree-dump-not " bts " "original" } }
+int test_bts(size_t *a, size_t b) { return bts(a, b); }
+// { dg-final { scan-tree-dump-not " bswap " "original" } }
+uint test_bswap(uint a) { return bswap(a); }
+ulong test_bswap(ulong a) { return bswap(a); }
+// { dg-final { scan-tree-dump-not " popcnt " "original" } }
+int test_popcnt(uint a) { return popcnt(a); }
+int test_popcnt(ulong a) { return popcnt(a); }
+// { dg-final { scan-tree-dump-not " volatileLoad " "original" } }
+ubyte test_volatileLoad(ubyte *a) { return volatileLoad(a); }
+ushort test_volatileLoad(ushort *a) { return volatileLoad(a); }
+uint test_volatileLoad(uint *a) { return volatileLoad(a); }
+ulong test_volatileLoad(ulong *a) { return volatileLoad(a); }
+// { dg-final { scan-tree-dump-not " volatileStore " "original" } }
+void test_volatileStore(ubyte *a, ubyte b) { return volatileStore(a, b); }
+void test_volatileStore(ushort *a, ushort b) { return volatileStore(a, b); }
+void test_volatileStore(uint *a, uint b) { return volatileStore(a, b); }
+void test_volatileStore(ulong *a, ulong b) { return volatileStore(a, b); }
+// { dg-final { scan-tree-dump-not " rol " "original" } }
+ubyte test_rol(ubyte a, uint b) { return rol!ubyte(a, b); }
+uint test_rol(uint a) { return rol!(1, uint)(a); }
+// { dg-final { scan-tree-dump-not " ror " "original" } }
+ushort test_ror(ushort a, uint b) { return ror!ushort(a, b); }
+ulong test_ror(ulong a) { return ror!(1, ulong)(a); }
+
+//////////////////////////////////////////////////////
+// core.checkedint
+
+// { dg-final { scan-tree-dump-not " adds " "original" } }
+int test_adds(int a, int b, ref bool c) { return adds(a, b, c); }
+long test_adds(long a, long b, ref bool c) { return adds(a, b, c); }
+// { dg-final { scan-tree-dump-not " addu " "original" } }
+uint test_addu(uint a, uint b, ref bool c) { return addu(a, b, c); }
+ulong test_addu(ulong a, ulong b, ref bool c) { return addu(a, b, c); }
+// { dg-final { scan-tree-dump-not " subs " "original" } }
+int test_subs(int a, int b, ref bool c) { return subs(a, b, c); }
+long test_subs(long a, long b, ref bool c) { return subs(a, b, c); }
+// { dg-final { scan-tree-dump-not " subu " "original" } }
+uint test_subu(uint a, uint b, ref bool c) { return subu(a, b, c); }
+ulong test_subu(ulong a, ulong b, ref bool c) { return subu(a, b, c); }
+// { dg-final { scan-tree-dump-not " negs " "original" } }
+int test_negs(int a, ref bool b) { return negs(a, b); }
+long test_negs(long a, ref bool b) { return negs(a, b); }
+// { dg-final { scan-tree-dump-not " muls " "original" } }
+int test_muls(int a, int b, ref bool c) { return muls(a, b, c); }
+long test_muls(long a, long b, ref bool c) { return muls(a, b, c); }
+// { dg-final { scan-tree-dump-not " mulu " "original" } }
+uint test_mulu(uint a, uint b, ref bool c) { return mulu(a, b, c); }
+ulong test_mulu(ulong a, uint b, ref bool c) { return mulu(a, b, c); }
+ulong test_mulu(ulong a, ulong b, ref bool c) { return mulu(a, b, c); }
+
+//////////////////////////////////////////////////////
+// core.math
+
+// { dg-final { scan-tree-dump-not " cos " "original" } }
+float test_cos(float a) { return cos(a); }
+double test_cos(double a) { return cos(a); }
+real test_cos(real a) { return cos(a); }
+// { dg-final { scan-tree-dump-not " sin " "original" } }
+float test_sin(float a) { return sin(a); }
+double test_sin(double a) { return sin(a); }
+real test_sin(real a) { return sin(a); }
+// { dg-final { scan-tree-dump-not " rndtol " "original" } }
+long test_rndtol(float a) { return rndtol(a); }
+long test_rndtol(double a) { return rndtol(a); }
+long test_rndtol(real a) { return rndtol(a); }
+// { dg-final { scan-tree-dump-not " sqrt " "original" } }
+float test_sqrt(float a) { return sqrt(a); }
+double test_sqrt(double a) { return sqrt(a); }
+real test_sqrt(real a) { return sqrt(a); }
+// { dg-final { scan-tree-dump-not " ldexp " "original" } }
+float test_ldexp(float a, int b) { return ldexp(a, b); }
+double test_ldexp(double a, int b) { return ldexp(a, b); }
+real test_ldexp(real a, int b) { return ldexp(a, b); }
+// { dg-final { scan-tree-dump-not " fabs " "original" } }
+float test_fabs(float a) { return fabs(a); }
+double test_fabs(double a) { return fabs(a); }
+real test_fabs(real a) { return fabs(a); }
+// { dg-final { scan-tree-dump-not " rint " "original" } }
+float test_rint(float a) { return rint(a); }
+double test_rint(double a) { return rint(a); }
+real test_rint(real a) { return rint(a); }
+// { dg-final { scan-tree-dump-not " toPrec " "original" } }
+float test_toPrec(float a) { return toPrec!float(a); }
+float test_toPrec(double a) { return toPrec!float(a); }
+float test_toPrec(real a) { return toPrec!float(a); }
+double test_toPrec(float a) { return toPrec!double(a); }
+double test_toPrec(double a) { return toPrec!double(a); }
+double test_toPrec(real a) { return toPrec!double(a); }
+real test_toPrec(float a) { return toPrec!real(a); }
+real test_toPrec(double a) { return toPrec!real(a); }
+real test_toPrec(real a) { return toPrec!real(a); }
+
+//////////////////////////////////////////////////////
+// core.stdc.stdarg
+
+// { dg-final { scan-tree-dump-not " va_arg " "original" } }
+void test_va_arg(...) { int a; return va_arg!int(_argptr, a); }
+int test_va_arg(...) { return va_arg!int(_argptr); }
+// { dg-final { scan-tree-dump-not " va_start " "original" } }
+void test_va_start(int a, ...) { return va_start(_argptr, a); }
diff --git a/gcc/testsuite/gdc.dg/lto/ltotests_0.d b/gcc/testsuite/gdc.dg/lto/ltotests_0.d
index bb18beaa9c8..91737609f10 100644
--- a/gcc/testsuite/gdc.dg/lto/ltotests_0.d
+++ b/gcc/testsuite/gdc.dg/lto/ltotests_0.d
@@ -46,7 +46,7 @@ struct S61b
{
try
other.a();
- catch
+ catch (Throwable)
other.b();
}
}
diff --git a/gcc/testsuite/gdc.dg/pr94970.d b/gcc/testsuite/gdc.dg/pr94970.d
new file mode 100644
index 00000000000..4c3387e3d4b
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/pr94970.d
@@ -0,0 +1,20 @@
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94970
+// { dg-do compile }
+
+struct S94970
+{
+ string index() { return null; }
+ ~this() { }
+}
+
+static m() { return S94970(); }
+
+auto concat()
+{
+ return m.index ~ ' ';
+}
+
+auto newarray()
+{
+ return new int[][](m.index.length, 1);
+}
diff --git a/gcc/testsuite/gdc.dg/pr95173.d b/gcc/testsuite/gdc.dg/pr95173.d
new file mode 100644
index 00000000000..2a4b2ed8232
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/pr95173.d
@@ -0,0 +1,10 @@
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95173
+// { dg-do compile }
+// { dg-options "-Wattributes" }
+
+import gcc.attribute;
+
+@attribute("foo") // { dg-warning "unknown attribute .foo." }
+void f95173()
+{
+}
diff --git a/gcc/testsuite/gdc.dg/pr95250.d b/gcc/testsuite/gdc.dg/pr95250.d
new file mode 100644
index 00000000000..dfb8abb732f
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/pr95250.d
@@ -0,0 +1,18 @@
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95250
+// { dg-do compile }
+
+template Unsigned(T)
+{
+ static assert(false, "Type " ~ T.stringof ~
+ " does not have an Unsigned counterpart");
+}
+
+
+void* f(T)(T a, T b)
+{
+ alias UnsignedVoid = Unsigned!(T);
+ return cast(T)(cast(T)(cast(UnsignedVoid)(a-b) / 2));
+}
+
+static assert(is(typeof(f!(void*)(null, null)) == void*));
+// { dg-error "static assert \(.*\) is false" "" { target *-*-* } .-1 }
diff --git a/gcc/testsuite/gdc.dg/pr96140.d b/gcc/testsuite/gdc.dg/pr96140.d
new file mode 100644
index 00000000000..d25bb5d3360
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/pr96140.d
@@ -0,0 +1,15 @@
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96140
+// { dg-do compile }
+module pr94140;
+
+import core.stdc.stdarg;
+
+void test_va_arg(ref int a, ...)
+{
+ return va_arg!int(_argptr, a);
+}
+
+void test_va_start(ref va_list a, ...)
+{
+ return va_start(a, a);
+}
diff --git a/gcc/testsuite/gdc.dg/pr96152.d b/gcc/testsuite/gdc.dg/pr96152.d
new file mode 100644
index 00000000000..3551614654b
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/pr96152.d
@@ -0,0 +1,32 @@
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96152
+// { dg-additional-options "-fmain -funittest" }
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+auto assocArray(Keys, Values)(Keys keys, Values values)
+{
+ void* aa;
+ {
+ if (values.length > keys.length)
+ values = values[0 .. keys.length];
+ else if (keys.length > values.length)
+ keys = keys[0 .. values.length];
+ aa = aaLiteral(keys, values);
+ }
+ alias Key = typeof(keys[0]);
+ alias Value = typeof(values[0]);
+ return (() @trusted => cast(Value[Key]) aa)();
+}
+
+@safe unittest
+{
+ struct ThrowingElement
+ {
+ int i;
+ static bool b;
+ ~this(){
+ if (b)
+ throw new Exception("");
+ }
+ }
+ assert(assocArray([ThrowingElement()], [0]) == [ThrowingElement(): 0]);
+}
diff --git a/gcc/testsuite/gdc.dg/pr96153.d b/gcc/testsuite/gdc.dg/pr96153.d
new file mode 100644
index 00000000000..c0e3ae024f5
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/pr96153.d
@@ -0,0 +1,31 @@
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96153
+// { dg-additional-options "-fmain -funittest" }
+// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+struct Checked(T, Hook)
+{
+ private T payload;
+ Hook hook;
+
+ size_t toHash() const nothrow @safe
+ {
+ return hashOf(payload) ^ hashOf(hook);
+ }
+}
+
+Checked!(T, Hook) checked(Hook, T)(const T value)
+{
+ return Checked!(T, Hook)(value);
+}
+
+@system unittest
+{
+ static struct Hook3
+ {
+ ulong var1 = ulong.max;
+ uint var2 = uint.max;
+ }
+
+ assert(checked!Hook3(12).toHash() != checked!Hook3(13).toHash());
+ assert(checked!Hook3(13).toHash() == checked!Hook3(13).toHash());
+}
diff --git a/gcc/testsuite/gdc.dg/pr96154a.d b/gcc/testsuite/gdc.dg/pr96154a.d
new file mode 100644
index 00000000000..8c0ca658c55
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/pr96154a.d
@@ -0,0 +1,18 @@
+// { dg-do compile }
+
+import core.stdc.stdarg;
+
+void
+error (int a)
+{
+ va_list vp;
+ va_start (vp, a); // { dg-error "used in function with fixed arguments" }
+}
+
+void
+warn (int a, int b, ...)
+{
+ va_list vp;
+ va_start (vp, a); // { dg-warning "second parameter" }
+ va_end (vp);
+}
diff --git a/gcc/testsuite/gdc.dg/pr96154b.d b/gcc/testsuite/gdc.dg/pr96154b.d
new file mode 100644
index 00000000000..dec7f489308
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/pr96154b.d
@@ -0,0 +1,19 @@
+// { dg-options "-Wno-varargs" }
+// { dg-do compile }
+
+import core.stdc.stdarg;
+
+void
+error (int a)
+{
+ va_list vp;
+ va_start (vp, a); // { dg-error "used in function with fixed arguments" }
+}
+
+void
+warn (int a, int b, ...)
+{
+ va_list vp;
+ va_start (vp, a); // No warning because of -Wno-varargs in effect.
+ va_end (vp);
+}
diff --git a/gcc/testsuite/gdc.dg/pr96254a.d b/gcc/testsuite/gdc.dg/pr96254a.d
new file mode 100644
index 00000000000..e5dd1244b94
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/pr96254a.d
@@ -0,0 +1,28 @@
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96254
+// { dg-do compile }
+struct map(alias fun)
+{
+ @property run()
+ {
+ }
+}
+
+struct Task(Args)
+{
+ Args _args;
+}
+
+template reduce(functions...)
+{
+ auto reduce(Args)(Args args)
+ {
+ alias RTask = Task!(typeof(args));
+ auto task = RTask();
+ }
+}
+
+void main() // { dg-error "'D main' is a nested function and cannot be accessed" }
+{
+ immutable delta = 1;
+ reduce!"a + b"(map!({ immutable x = delta; })());
+}
diff --git a/gcc/testsuite/gdc.dg/pr96254b.d b/gcc/testsuite/gdc.dg/pr96254b.d
new file mode 100644
index 00000000000..02e3c484d26
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/pr96254b.d
@@ -0,0 +1,24 @@
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96254
+// { dg-do compile }
+mixin template test()
+{
+ int next;
+}
+
+void foo(alias l)()
+{
+ l.next = 0; // { dg-error "cannot get frame pointer to 'D main'" }
+}
+
+void bar(alias l, alias t)()
+{
+ l.next = 0; // { dg-error "cannot get frame pointer to 'D main'" }
+}
+
+void main()
+{
+ mixin test l1;
+ mixin test l2;
+ foo!(l1);
+ bar!(l1,l2);
+}
diff --git a/gcc/testsuite/gdc.dg/pr96429.d b/gcc/testsuite/gdc.dg/pr96429.d
new file mode 100644
index 00000000000..af096e26b5a
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/pr96429.d
@@ -0,0 +1,26 @@
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96429
+// { dg-do compile }
+// { dg-options "-fdump-tree-original" }
+ptrdiff_t subbyte(byte* bp1, byte* bp2)
+{
+ // { dg-final { scan-tree-dump "bp1 - bp2;" "original" } }
+ return bp1 - bp2;
+}
+
+ptrdiff_t subshort(short* sp1, short* sp2)
+{
+ // { dg-final { scan-tree-dump "\\\(sp1 - sp2\\\) /\\\[ex\\\] 2;" "original" } }
+ return sp1 - sp2;
+}
+
+ptrdiff_t subint(int* ip1, int* ip2)
+{
+ // { dg-final { scan-tree-dump "\\\(ip1 - ip2\\\) /\\\[ex\\\] 4;" "original" } }
+ return ip1 - ip2;
+}
+
+ptrdiff_t sublong(long* lp1, long* lp2)
+{
+ // { dg-final { scan-tree-dump "\\\(lp1 - lp2\\\) /\\\[ex\\\] 8;" "original" } }
+ return lp1 - lp2;
+}
diff --git a/gcc/testsuite/gdc.dg/runnable.d b/gcc/testsuite/gdc.dg/runnable.d
deleted file mode 100644
index 7307e09a645..00000000000
--- a/gcc/testsuite/gdc.dg/runnable.d
+++ /dev/null
@@ -1,1394 +0,0 @@
-// { dg-additional-sources "imports/runnable.d" }
-// { dg-do run { target hw } }
-// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
-
-module runnable;
-
-import imports.runnable;
-import core.stdc.stdio;
-import gcc.attribute;
-
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=4
-
-void test4()
-{
- string str = "allo";
- static assert(!__traits(compiles, str.reverse));
- static assert(!__traits(compiles, str.sort));
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=17
-
-/**
- * Parameters are not copied into a frame to be accessed from
- * the method's __require function.
- */
-void contractTest(string path)
-{
- assert(path[0] == 't');
- assert(path.length == 9);
- assert(path[8] == 'i');
-}
-
-interface ModuleSaver
-{
- void save(string str)
- in
- {
- contractTest(str);
- }
-}
-
-class ModuleWriter : ModuleSaver
-{
- void save (string str)
- in {}
- body
- {
- }
-}
-
-void test17()
-{
- (new ModuleWriter()).save ("test.0.mci");
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=19
-
-void test19()
-{
- byte b;
- --b = b;
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=24
-
-void test24()
-{
- struct S24
- {
- char[1] b;
- }
-
- S24 a;
-
- if (*a.b.ptr)
- return;
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=31
-
-class RedBlackTree(T, alias less)
-{
- struct Range
- {
- @property empty() { }
- }
-
- Range opSlice()
- {
- return Range();
- }
-}
-
-auto redBlackTree(alias less, E)()
-{
- return new RedBlackTree!(E, less);
-}
-
-void test31()
-{
- redBlackTree!((a){}, double)();
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=35
-
-/**
- * Here the BinaryHeap instance uses an alias parameter and therefore
- * the instance's functions (percolateDown) need to be generated in
- * topNIndex->BinaryHeap scope and not in the declaration scope
- * (module->BinaryHeap).
- */
-void topNIndex()()
-{
- bool indirectLess(int a, int b)
- {
- return a > b;
- }
-
- auto a = BinaryHeap!(indirectLess)();
-}
-
-struct BinaryHeap(alias less)
-{
- void percolateDown()
- {
- less(0, 1);
- }
-}
-
-void test35a()
-{
- topNIndex();
-}
-
-/*
- * Similar as test35a but with an additional indirection.
- * The nested function chain for percolateDown should look like this:
- * topNIndex2->BinaryHeap2->percolateDown.
- */
-void topNIndex2()()
-{
- bool indirectLess(int a, int b)
- {
- return a > b;
- }
- auto a = BinaryHeap2!(S35b!(indirectLess)())();
-}
-
-struct S35b(alias a)
-{
- void foo()
- {
- a(0, 0);
- }
-}
-
-struct BinaryHeap2(alias less)
-{
- void percolateDown()
- {
- less.foo();
- }
-}
-
-void test35b()
-{
- topNIndex2();
-}
-
-void test35()
-{
- test35a();
- test35b();
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=36
-
-/**
- * Here getChar is a function in a template where template.isnested == false
- * but getChar still is a nested function and needs to get a static chain
- * containing test36a.
- */
-void test36a()(char val)
-{
- void error()
- {
- }
-
- void getChar()()
- {
- error();
- }
-
- void parseString()
- {
- getChar();
- }
-}
-
-/**
- * Similar as test36a, but a little more complicated:
- * Here getChar is nested in a struct template which is nested in a function.
- * getChar's static chain still needs to contain test36b.
- */
-void test36b()(char val)
-{
- void error()
- {
- }
-
- struct S(T)
- {
- void getChar()
- {
- error();
- }
- }
-
-
- void parseString()
- {
- S!(int)().getChar();
- }
-}
-
-/**
- * If g had accessed a, the frontend would have generated a closure.
- *
- * As we do not access it, there's no closure. We have to be careful
- * not to set a static chain for g containing test36c_1 though,
- * as g can be called from outside (here from test1c). In the end
- * we have to treat this as if everything in test36c_1 was declared
- * at module scope.
- */
-auto test36c_1()
-{
- int a;
- void c() {};
- class Result
- {
- int b;
- void g() { c(); /*a = 42;*/ }
- }
-
- return new Result();
-}
-
-void test36c()
-{
- test36c_1().g();
-}
-
-/**
- * empty is a (private) function which is nested in lightPostprocess.
- * At the same time it's a template instance, so it has to be declared as
- * weak or otherwise one-only. imports/runnable.d creates another instance
- * of Regex!char to verify that.
- */
-struct Parser(R)
-{
- @property program()
- {
- return Regex!char();
- }
-}
-
-struct Regex(Char)
-{
- @trusted lightPostprocess()
- {
- struct FixedStack(T)
- {
- @property empty() { return false; }
- }
- auto counterRange = FixedStack!uint();
- }
-}
-
-void test36d()
-{
- auto parser = Parser!(char[])();
- imports.runnable.test36d_1;
-}
-
-void test36()
-{
- test36a('n');
- test36b('n');
- test36c();
- test36d();
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=37
-
-struct S37
-{
- int bar(const S37 s)
- {
- return 0;
- }
-}
-
-int test37()
-{
- S37 s;
- return s.bar(s);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=43
-
-void test43()
-{
- import core.vararg;
- import core.stdc.stdio;
-
- void formatArray(ref va_list argptr)
- {
- auto a = va_arg!(const(float)[])(argptr);
- foreach(f; a)
- {
- printf("%f\n", f);
- }
- }
-
- void doFormat(TypeInfo[] arguments, va_list argptr)
- {
- formatArray(argptr);
- }
-
- void format(...)
- {
- doFormat(_arguments, _argptr);
- }
-
- format([1.0f, 2.0f, 3.0f]);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=47
-
-template Foo47()
-{
- void test47()
- {
- asm { "nop"; }
- }
-}
-
-mixin Foo47!();
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=51
-
-struct S51
-{
- int x;
- int pad;
-
- this(this)
- {
- ++x;
- }
-}
-
-void test51()
-{
- S51 s;
- auto sarr = new S51[1];
- auto sarr2 = sarr;
-
- // postblit all fields.
- sarr2 ~= s;
-
- assert (sarr2[0].x == 1);
- assert (sarr2[1].x == 1);
- assert (sarr[0].x == 0);
- assert (s.x == 0);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=57
-
-struct S57
-{
- int a;
- long b;
- // Doesn't happen for bigger structs
-}
-
-S57 bar57()
-{
- return S57(4, 42);
-}
-
-void test57()
-{
- S57 s = bar57();
- assert (s is S57(4, 42));
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=66
-
-void test66()
-{
- int pos = 0;
-
- foreach(x; 0 .. 64)
- {
- ++pos %= 4;
- assert (pos != 4);
- }
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=67
-
-__vector(float[4]) d[2]; // ICE
-
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=115
-
-void test115()
-{
- union U
- {
- float f;
- uint i;
- }
- float a = 123.0;
- const l = U(a);
-
- assert(l.i == U(a).i);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=121
-
-immutable char C121 = void; // ICE
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=127
-
-int[0] test127a; // OK
-int[1][0] test127b; // OK
-int[0][1] test127c; // ICE
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=131
-
-struct S131
-{
- this(string ) { }
- string opAssign(string v) { return v; }
-}
-
-void test131()
-{
- S131[string] s;
- s["foo"] = "bar";
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=133
-
-void delegate()[] D133;
-
-void test133a(void delegate() dg)
-{
- D133 ~= dg;
-}
-
-void test133()
-{
- void nested()
- {}
- test133a(&nested);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=141
-
-bool test141a(int a)
-{
- return a > (a + 1);
-}
-
-void test141()
-{
- assert(test141a(int.min) == false);
- assert(test141a(int.max) == true);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=142
-
-@attribute("noinline")
-int test142a()()
-{
- return 142;
-}
-
-void test142()
-{
- enum E142 = test142a();
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=171
-
-void test171a()
-{
- int count = 0;
- short a = -1;
- while (a != 0)
- {
- a >>>= 1;
- count++;
- assert(count <= 16);
- }
-}
-
-void test171b()
-{
- uint[3] lhs = [99, 201, 300],
- rhs = [-1, 0, 0];
- long t = 0;
-
- for (int i = 0; i < 3; i++)
- {
- t += lhs[i];
- t -= rhs[i];
- lhs[i] = cast(uint) t;
- t >>= uint.sizeof * 8;
- }
-
- assert(lhs == [100, 200, 300]);
-}
-
-void test171()
-{
- test171a();
- test171b();
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=179
-
-struct S179a
-{
- @disable this(this);
-}
-
-struct S179b
-{
- S179a s1;
- void connect() { printf("this=%p\n", &this); }
-}
-
-class C179
-{
- private S179b s2;
- ref S179b value() @property
- {
- printf("this=%p\n", &s2);
- return s2;
- }
-}
-
-void test179()
-{
- C179 a = new C179;
- a.value.connect();
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=183
-
-struct S183a
-{
- union I183a
- {
- struct
- {
- double x, y, z;
- }
- struct
- {
- double a, b, c;
- }
- }
-
- I183a inner;
-
- this(double x, double y, double z)
- {
- this.inner.x = x;
- this.inner.y = y;
- this.inner.z = z;
- }
-}
-
-struct S183b
-{
- @property get()
- {
- union Buf
- {
- void[0] result;
- }
- const Buf buf = { };
- return buf.result;
- }
-}
-
-struct S183c
-{
- @property get()
- {
- union Buf
- {
- TypeInfo info;
- void[0] result;
- }
- const Buf buf = { };
- return buf.result;
- }
-}
-
-void test183()
-{
- auto v1 = S183a(0, 0, 0);
- auto v2 = S183b().get;
- auto v3 = S183c().get;
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=186
-
-struct S186
-{
- union
- {
- struct
- {
- ubyte fieldA;
- byte fieldB = -1;
- byte fieldC = -1;
- }
- size_t _complete;
- }
-
- this(size_t complete)
- {
- this._complete = complete;
- }
-}
-
-static if (size_t.sizeof == 8)
- enum checkval = 0x0200000000000002;
-else
- enum checkval = 0x02000002;
-
-void check186(in S186 obj, byte fieldB)
-{
- assert(obj.fieldA == 2);
- assert(obj.fieldB == 0);
- assert(obj.fieldC == 0);
- assert(obj._complete == checkval);
- assert(fieldB == 0);
-}
-
-void test186a(size_t val)
-{
- S186 obj = S186(val);
- check186(obj, obj.fieldB);
-
- assert(obj.fieldA == 2);
- assert(obj.fieldB == 0);
- assert(obj.fieldC == 0);
- assert(obj._complete == checkval);
-
- obj = S186(val);
- check186(obj, obj.fieldB);
-
- assert(obj.fieldA == 2);
- assert(obj.fieldB == 0);
- assert(obj.fieldC == 0);
- assert(obj._complete == checkval);
-}
-
-void test186()
-{
- test186a(checkval);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=187
-
-align(1) struct S187b
-{
- align(1)
- {
- uint unpaddedA;
- ushort unpaddedB;
- }
-}
-
-struct S187a
-{
- S187b[3] unpaddedArray;
- ubyte wontInitialize = ubyte.init;
-}
-
-struct S187
-{
- S187a interesting;
-}
-
-
-void prepareStack()
-{
- byte[255] stackGarbage;
- foreach(i, ref b; stackGarbage)
- {
- b = cast(byte)(-i);
- }
-}
-
-void test187()
-{
- prepareStack();
- auto a = S187(S187a());
- assert(a.interesting.wontInitialize == 0);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=191
-
-class C191
-{
- int count = 0;
-
- void testA()
- {
- class Inner
- {
- void test()
- {
- void localFunction()
- {
- if (++count != 5)
- testA();
- }
- localFunction();
- }
- }
- scope ic = new Inner();
- ic.test();
- }
-
- void testB()
- {
- class Inner
- {
- void test()
- {
- void localFunction()
- {
- void anotherLocalFunction()
- {
- if (++count != 10)
- testB();
- }
- anotherLocalFunction();
- }
- localFunction();
- }
- }
- scope ic = new Inner();
- ic.test();
- }
-
- void testC()
- {
- class Inner
- {
- int a = 1;
-
- void test()
- {
- void localFunction()
- {
- count += a;
- if (count != 15)
- testC();
- assert(a == 1);
- }
- localFunction();
- }
- }
- scope ic = new Inner();
- ic.test();
- }
-
- void testD()
- {
- class Inner
- {
- void test()
- {
- int a = 1;
-
- void localFunction()
- {
- count += a;
- if (count != 20)
- testD();
- assert(a == 1);
- }
- localFunction();
- }
- }
- scope ic = new Inner();
- ic.test();
- }
-
- void testE()
- {
- class Inner
- {
- int a = 1;
-
- void test()
- {
- void localFunction()
- {
- void anotherLocalFunction()
- {
- count += a;
- if (count != 25)
- testE();
- assert(a == 1);
- }
-
- anotherLocalFunction();
- }
-
- localFunction();
- }
- }
- scope ic = new Inner();
- ic.test();
- }
-
- void testF()
- {
- class Inner
- {
- void test()
- {
- int a = 1;
-
- void localFunction()
- {
- void anotherLocalFunction()
- {
- count += a;
- if (count != 30)
- testF();
- assert(a == 1);
- }
-
- anotherLocalFunction();
- }
-
- localFunction();
- }
- }
- scope ic = new Inner();
- ic.test();
- }
-
- void testG()
- {
- class Inner
- {
- void test()
- {
- void localFunction()
- {
- int a = 1;
-
- void anotherLocalFunction()
- {
- count += a;
- if (count != 35)
- testG();
- assert(a == 1);
- }
-
- anotherLocalFunction();
- }
-
- localFunction();
- }
- }
- scope ic = new Inner();
- ic.test();
- }
-}
-
-void test191()
-{
- scope oc = new C191();
- oc.testA();
- assert(oc.count == 5);
-
- oc.testB();
- assert(oc.count == 10);
-
- oc.testC();
- assert(oc.count == 15);
-
- oc.testD();
- assert(oc.count == 20);
-
- oc.testE();
- assert(oc.count == 25);
-
- oc.testF();
- assert(oc.count == 30);
-
- oc.testG();
- assert(oc.count == 35);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=194
-
-auto test194(ref bool overflow)
-{
- import core.checkedint;
-
- return adds(1, 1, overflow);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=196
-
-class C196
-{
- int a;
-}
-
-struct S196
-{
- int a;
-}
-
-void test196()
-{
- __gshared c = new C196();
- __gshared s = new S196(0);
- c.a = 1;
- s.a = 1;
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=198
-
-struct S198a
-{
- union
- {
- float[3] v;
- struct
- {
- float x;
- float y;
- float z;
- }
- }
-
- this(float x_, float y_, float z_)
- {
- x = x_;
- y = y_;
- z = z_;
- }
-
- ref S198a opOpAssign(string op)(S198a operand)
- if (op == "+")
- {
- x += operand.x;
- y += operand.y;
- z += operand.z;
- return this;
- }
-}
-
-struct S198b
-{
- @property get()
- {
- union Buf
- {
- void[0] result;
- }
- const Buf buf = { };
- return buf.result;
- }
-}
-
-struct S198c
-{
- @property get()
- {
- union Buf
- {
- TypeInfo info;
- void[0] result;
- }
- const Buf buf = { };
- return buf.result;
- }
-}
-
-
-auto test198()
-{
- S198a sum = S198a(0, 0, 0);
-
- foreach(size_t v; 0 .. 3)
- sum += S198a(1, 2, 3);
-
- assert(sum.v == [3, 6, 9]);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=200
-
-void test200a(double x, double y)
-{
- const double y2 = x + 1.0;
- assert(y == y2);
-}
-
-void test200()
-{
- const double x = .012;
- const double y = x + 1.0;
- test200a(x, y);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=210
-
-struct S210
-{
- ubyte a;
- uint b;
-}
-
-union U210
-{
- S210 a;
- uint b;
-}
-
-S210 test210a()
-{
- S210 s = S210(1, 2);
- return s;
-}
-
-S210[2] test210b()
-{
- S210[2] s = [S210(1, 2), S210(3, 4)];
- return s;
-}
-
-U210 test210c()
-{
- U210 s = U210(S210(1, 2));
- return s;
-}
-
-U210[2] test210d()
-{
- U210[2] s = [U210(S210(1, 2)), U210(S210(3, 4))];
- return s;
-}
-
-void test210()
-{
- S210 a = S210(1, 2);
- assert(a == S210(1, 2));
- assert(a == test210a());
- assert(a != S210(2, 1));
-
- S210[2] b = [S210(1, 2), S210(3, 4)];
- assert(b == [S210(1, 2), S210(3, 4)]);
- assert(b == test210b());
- assert(b != [S210(2, 1), S210(3, 4)]);
-
- U210 c = U210(S210(1, 2));
- assert(c == U210(S210(1, 2)));
- assert(c == test210c());
- assert(c != U210(S210(2, 1)));
-
- U210[2] d = [U210(S210(1, 2)), U210(S210(3, 4))];
- assert(d == [U210(S210(1, 2)), U210(S210(3, 4))]);
- assert(d == test210d());
- assert(d != [U210(S210(2, 1)), U210(S210(3, 4))]);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=240
-
-void test240a(int a, int b)
-{
- assert(a == 0);
- assert(b == 0);
-}
-
-void test240()
-{
- int a = 0;
- test240a(a, a++);
- assert(a == 1);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=242
-
-struct S242
-{
- enum M = S242();
- int a = 42;
-
- auto iter()
- {
- this.a = 24;
- return this;
- }
-}
-
-S242 test242a()
-{
- return S242.M.iter;
-}
-
-void test242()
-{
- assert(test242a() == S242(24));
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=248
-
-class C248b
-{
- bool isintegral()
- {
- return false;
- }
-}
-
-class C248a
-{
- int count = 0;
-
- C248b getMemtype()
- {
- count++;
- return new C248b();
- }
-}
-
-class C248
-{
- C248a sym;
-
- this()
- {
- this.sym = new C248a();
- }
-
- bool isintegral()
- {
- return sym.getMemtype().isintegral();
- }
-}
-
-void test248()
-{
- C248 e = new C248();
- e.isintegral();
- assert(e.sym.count == 1);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=250
-
-void test250()
-{
- struct S
- {
- string data;
- }
-
- auto a = S("hello");
- auto b = S("hello".dup);
-
- assert(a.data == b.data);
- assert(a == b);
- assert([a] == [b]);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=253
-
-interface A253
-{
- void test253(int[int]);
-}
-
-interface C253 : A253
-{
-}
-
-class D253 : B253, C253
-{
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=273
-
-class B273
-{
- B273[] members;
-}
-
-class D273 : B273
-{
-}
-
-void test273()
-{
- auto noPointers = ClassInfo.ClassFlags.noPointers;
- assert((B273.classinfo.m_flags & noPointers) == 0);
- assert((D273.classinfo.m_flags & noPointers) == 0);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=285
-
-inout(char)[] test285a(inout(char)* s) @nogc @system pure nothrow
-{
- import core.stdc.string : strlen;
- return s ? s[0 .. strlen(s)] : null;
-}
-
-void test285()
-{
- assert(test285a(null) == null);
- assert(test285a("foo") == "foo");
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=286
-
-void test286()
-{
- struct K286
- {
- int count;
- this(this)
- {
- count++;
- }
- }
-
- struct S286
- {
- int data;
- this(K286 key)
- {
- data = key.count;
- }
- }
-
- S286 getData(K286 key)
- {
- static S286[K286] getCache;
- auto p = key in getCache;
- if (p)
- return *p;
- return (getCache[key] = S286(key));
- }
-
- auto s = getData(K286());
- if (s.data == 0)
- assert(0);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=309
-
-void test309()
-{
- creal f1 = +0.0 + 0.0i;
- creal f2 = +0.0 - 0.0i;
- creal f3 = -0.0 + 0.0i;
- creal f4 = +0.0 + 0.0i;
-
- assert(f1 !is f2);
- assert(f1 !is f3);
- assert(f2 !is f3);
- assert(f1 is f4);
-
- assert(!(f1 is f2));
- assert(!(f1 is f3));
- assert(!(f2 is f3));
- assert(!(f1 !is f4));
-
- struct CReal
- {
- creal value;
- }
-
- CReal s1 = CReal(+0.0 + 0.0i);
- CReal s2 = CReal(+0.0 - 0.0i);
- CReal s3 = CReal(-0.0 + 0.0i);
- CReal s4 = CReal(+0.0 + 0.0i);
-
- assert(s1 !is s2);
- assert(s1 !is s3);
- assert(s2 !is s3);
- assert(s1 is s4);
-
- assert(!(s1 is s2));
- assert(!(s1 is s3));
- assert(!(s2 is s3));
- assert(!(s1 !is s4));
-}
-
-/******************************************/
-
-void main()
-{
- test4();
- test17();
- test35();
- test36();
- test43();
- test51();
- test57();
- test66();
- test115();
- test131();
- test133();
- test141();
- test179();
- test186();
- test187();
- test191();
- test196();
- test198();
- test200();
- test210();
- test240();
- test242();
- test248();
- test250();
- test273();
- test285();
- test286();
- test309();
-
- printf("Success!\n");
-}
diff --git a/gcc/testsuite/gdc.dg/runnable2.d b/gcc/testsuite/gdc.dg/runnable2.d
deleted file mode 100644
index d9463e337c1..00000000000
--- a/gcc/testsuite/gdc.dg/runnable2.d
+++ /dev/null
@@ -1,244 +0,0 @@
-// { dg-do run { target { hw && d_runtime_has_std_library } } }
-
-module runnable;
-
-import core.stdc.stdio;
-import gcc.attribute;
-
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=2
-
-struct S
-{
- string toString() { return "foo"; }
-}
-
-void test2()
-{
- import std.string : format;
- assert(format("%s", S()) == "foo");
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=15
-
-class B
-{
- class A { }
- A a;
-}
-
-class C
-{
- void visit(B b)
- {
- import std.algorithm : map;
- auto as = [b.a];
- as.map!(d => d);
- }
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=16
-
-void test16()
-{
- import std.parallelism : taskPool;
-
- taskPool.reduce!"a+b"([0, 1, 2, 3]);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=18
-
-class C18
-{
- struct Link
- {
- int x;
- int y;
- }
-
- void sort_links()
- {
- import std.algorithm : sort;
- import std.array : empty;
- import std.exception : enforce;
-
- enforce(!_link.empty);
-
- bool lt(Link a, Link b)
- {
- if(a.x > b.x)
- return false;
- if(a.x < b.x)
- return true;
- if(a.y >= b.y)
- return false;
- else
- return true;
- }
- sort!(lt)(_link);
- }
-
- this()
- {
- _link ~= Link(8, 3);
- _link ~= Link(4, 7);
- _link ~= Link(4, 6);
- _link ~= Link(3, 7);
- _link ~= Link(2, 7);
- _link ~= Link(2, 2);
- _link ~= Link(4, 1);
- }
-
- Link[] _link;
-}
-
-void test18()
-{
- C18 foo = new C18;
- foo.sort_links();
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=29
-
-void test29()
-{
- import std.string : format;
- import std.conv : text;
-
- string s;
- for (auto i = 0; i < 100000; i++)
- {
- s = format("%d", i);
- s = text(i);
- }
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=52
-
-class C52
-{
- C52 a;
-
- this()
- {
- printf("Construct: this=%p\n", cast(void*)this);
- a = this;
- }
-
- bool check()
- {
- printf("Check: this=%p a=%p\n", cast(void*)this, cast(void*)a);
- return this is a;
- }
-}
-
-auto test52a()
-{
- import std.conv, std.traits;
-
- struct Scoped
- {
- void[__traits (classInstanceSize, C52) ] Scoped_store = void;
-
- inout(C52) Scoped_payload() inout
- {
- void* alignedStore = cast(void*) Scoped_store.ptr;
- return cast(inout (C52)) alignedStore;
- }
- alias Scoped_payload this;
- }
-
- Scoped result;
- emplace!(Unqual!C52)(result.Scoped_store);
- assert(result.Scoped_payload().check);
- return result;
-}
-
-void test52()
-{
- auto a1 = test52a();
- assert(a1.Scoped_payload().check);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=71
-
-struct Leaf
-{
- ubyte symbol;
- ubyte codeLen;
-}
-
-struct CanonicalHuffman
-{
- Leaf[] table;
-
- void print()
- {
- import std.algorithm;
- import std.range;
-
- auto list = zip(iota(table.length), table.dup).array
- .sort!((a, b) => a[1].symbol < b[1].symbol)
- .uniq!((a, b) => (a[0] & (1 << a[1].codeLen) - 1) == (b[0] & (1 << b[1].codeLen) - 1));
- }
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=77
-
-void fun(ubyte[3] buf)
-{
- import std.bitmanip : bigEndianToNative;
- bigEndianToNative!ushort(buf[0..2]);
-}
-
-void test77()
-{
- fun([1,2,3]);
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=108
-
-@attribute("forceinline")
-void test108()
-{
- import std.stdio : writeln;
- writeln("Here");
-}
-
-/******************************************/
-// https://bugzilla.gdcproject.org/show_bug.cgi?id=122
-
-void test122()
-{
- import std.algorithm : map;
- import std.parallelism : taskPool;
- import std.range : iota;
-
- immutable n = 10000;
- enum delta = 1.0 / n; // XBUG: was 'immutable delta' https://issues.dlang.org/show_bug.cgi?id=17092
- immutable pi = 4.0 * delta * taskPool.reduce!"a + b"(
- map!((int i) { immutable x = (i - 0.5) * delta; return 1.0 / (1.0 + x * x); })(iota(n)));
-}
-
-/******************************************/
-
-void main()
-{
- test2();
- test16();
- test18();
- test52();
- test77();
- test108();
-
- printf("Success!\n");
-}
diff --git a/gcc/testsuite/gdc.dg/simd.d b/gcc/testsuite/gdc.dg/simd.d
index 439c446837a..40d5b5700c3 100644
--- a/gcc/testsuite/gdc.dg/simd.d
+++ b/gcc/testsuite/gdc.dg/simd.d
@@ -2,7 +2,6 @@
// { dg-do run { target hw } }
import core.simd;
import core.stdc.string;
-import std.stdio;
alias TypeTuple(T...) = T;
@@ -1143,7 +1142,6 @@ float4 foo9304(float4 a)
void test9304()
{
auto a = foo9304([0, 1, 2, 3]);
- //writeln(a.array);
assert(a.array == [0,-1,-2,-3]);
}
diff --git a/gcc/testsuite/gdc.test/compilable/b9490.d b/gcc/testsuite/gdc.test/compilable/b9490.d
new file mode 100644
index 00000000000..d0148b1a738
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/b9490.d
@@ -0,0 +1,39 @@
+// https://issues.dlang.org/show_bug.cgi?id=9490
+class A
+{
+ int[1] arr;
+
+ this()
+ {
+ assert(arr.length);
+ assert((arr).length);
+ }
+}
+
+class C
+{
+ struct Foo { int a; void funcToo(){} }
+ Foo foo;
+
+ auto get(){return foo;}
+
+ void test()
+ {
+ // Error: need 'this' to access member a
+ (foo).a = 1;
+ (foo).funcToo();
+ (get()).a = 2;
+ }
+}
+
+struct S { int i; }
+struct S1 { S s; }
+void f(int) { }
+
+void main()
+{
+ S1 s1;
+ f(s1.s.tupleof); // OK
+ f((s1.s).tupleof); // Error: need 'this' to access member s
+}
+
diff --git a/gcc/testsuite/gdc.test/compilable/ice14739.d b/gcc/testsuite/gdc.test/compilable/ice14739.d
new file mode 100644
index 00000000000..cc90da6342e
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/ice14739.d
@@ -0,0 +1,19 @@
+// REQUIRED_ARGS: -o-
+
+void main(string[] args)
+{
+ immutable int a;
+ immutable int b;
+ S!a sa;
+ S!b sb;
+ C!a ca;
+ C!b cb;
+}
+
+struct S(alias a)
+{
+}
+
+class C(alias a)
+{
+}
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail17492.d b/gcc/testsuite/gdc.test/fail_compilation/fail17492.d
index e45c2e59359..80e9e2a2c4a 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail17492.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail17492.d
@@ -1,6 +1,7 @@
/* TEST_OUTPUT:
---
-fail_compilation/fail17492.d(19): Error: class fail17492.C.testE.I already exists at fail_compilation/fail17492.d(12). Perhaps in another function with the same name?
+fail_compilation/fail17492.d(20): Error: class `fail17492.C.testE.I` already exists at fail17492.d(13). Perhaps in another function with the same name?
+fail_compilation/fail17492.d(37): Error: struct `fail17492.S.testE.I` already exists at fail17492.d(30). Perhaps in another function with the same name?
---
https://issues.dlang.org/show_bug.cgi?id=17492
*/
@@ -21,3 +22,20 @@ class C
}
}
}
+
+class S
+{
+ void testE()
+ {
+ struct I
+ {
+ }
+ }
+
+ void testE()
+ {
+ struct I
+ {
+ }
+ }
+}
diff --git a/gcc/testsuite/gdc.test/fail_compilation/ice21060.d b/gcc/testsuite/gdc.test/fail_compilation/ice21060.d
new file mode 100644
index 00000000000..d33889cee3d
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/ice21060.d
@@ -0,0 +1,15 @@
+/*
+EXTRA_FILES: imports/ice21060a/package.d imports/ice21060b/package.d imports/ice21060c/package.d imports/ice21060d/package.d
+TEST_OUTPUT:
+---
+fail_compilation/imports/ice21060b/package.d(3): Error: struct `imports.ice21060d.P21060` already exists at fail_compilation/imports/ice21060d/package.d(3). Perhaps in another function with the same name?
+---
+*/
+struct S21060
+{
+ void print()
+ {
+ import imports.ice21060a;
+ import imports.ice21060b;
+ }
+}
diff --git a/gcc/testsuite/gdc.test/fail_compilation/imports/ice21060a/package.d b/gcc/testsuite/gdc.test/fail_compilation/imports/ice21060a/package.d
new file mode 100644
index 00000000000..b046aebe1d8
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/imports/ice21060a/package.d
@@ -0,0 +1 @@
+import imports.ice21060c;
diff --git a/gcc/testsuite/gdc.test/fail_compilation/imports/ice21060b/package.d b/gcc/testsuite/gdc.test/fail_compilation/imports/ice21060b/package.d
new file mode 100644
index 00000000000..a806fd08a6a
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/imports/ice21060b/package.d
@@ -0,0 +1,5 @@
+module imports.ice21060d;
+
+struct P21060
+{
+}
diff --git a/gcc/testsuite/gdc.test/fail_compilation/imports/ice21060c/package.d b/gcc/testsuite/gdc.test/fail_compilation/imports/ice21060c/package.d
new file mode 100644
index 00000000000..cc6f74ec6bb
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/imports/ice21060c/package.d
@@ -0,0 +1 @@
+import imports.ice21060d;
diff --git a/gcc/testsuite/gdc.test/fail_compilation/imports/ice21060d/package.d b/gcc/testsuite/gdc.test/fail_compilation/imports/ice21060d/package.d
new file mode 100644
index 00000000000..a806fd08a6a
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/imports/ice21060d/package.d
@@ -0,0 +1,5 @@
+module imports.ice21060d;
+
+struct P21060
+{
+}
diff --git a/gcc/testsuite/gdc.test/runnable/b16278.d b/gcc/testsuite/gdc.test/runnable/b16278.d
new file mode 100644
index 00000000000..a0a422daf6b
--- /dev/null
+++ b/gcc/testsuite/gdc.test/runnable/b16278.d
@@ -0,0 +1,6 @@
+// REQUIRED_ARGS: -main
+class A()
+{
+ static struct S { A a; }
+}
+enum e = is(A!());
diff --git a/gcc/testsuite/gfortran.dg/PR85868A.f90 b/gcc/testsuite/gfortran.dg/PR85868A.f90
new file mode 100644
index 00000000000..621b874306b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/PR85868A.f90
@@ -0,0 +1,47 @@
+! { dg-do run }
+!
+! PR fortran/85868
+!
+! Contributed by Harald Anlauf <anlauf@gmx.de>
+!
+
+program test
+
+ implicit none
+
+ integer, parameter :: e(*) = [1, 1, -1, -1, 0, 0, 1]
+
+ integer, pointer :: t(:), u(:)
+ integer :: i
+
+ allocate (t(-1:5))
+ do i = -1, 5
+ t(i) = i
+ end do
+ call p (t, e(1)) ! Pointer with lower bound = -1 from allocation
+ u => t ! Pointer assignment sets same lower bound
+ call p (u, e(2))
+ !
+ u => t(:) ! Pointer assignment with implicit lower bound (1)
+ call p (u, e(3))
+ call p (t(:), e(4)) ! Full array, behaves the same
+ !
+ call p (t(0:), e(5)) ! Array section
+ u => t(0:) ! Pointer assignment with implicit lower bound (1)
+ call p (u, e(6))
+ u(0:) => t(0:) ! Pointer assignment with given lower bound (0)
+ call p (u, e(7))
+ stop
+
+contains
+
+ subroutine p (a, v)
+ integer, pointer, intent(in) :: a(:)
+ integer, intent(in) :: v
+
+ if(a(1)/=v) stop 1001
+ return
+ end subroutine p
+
+end program test
+
diff --git a/gcc/testsuite/gfortran.dg/PR85868B.f90 b/gcc/testsuite/gfortran.dg/PR85868B.f90
new file mode 100644
index 00000000000..288f29fd73e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/PR85868B.f90
@@ -0,0 +1,144 @@
+program main_p
+
+ implicit none
+
+ integer, parameter :: n = 10
+ integer, parameter :: m = 5
+
+ integer, parameter :: b = 3
+ integer, parameter :: t = n+b-1
+
+ integer, parameter :: l = 4
+ integer, parameter :: u = 7
+ integer, parameter :: s = 3
+ integer, parameter :: e = (u-l)/s+1
+
+ call test_f()
+ call test_s()
+ call test_p()
+ call test_a()
+ stop
+
+contains
+
+ subroutine test_f()
+ integer, target :: x(n,n)
+ integer, target :: y(b:t)
+ integer :: i
+
+ x = reshape([(i, i=1,n*n)], [n,n])
+ y = x(:,m)
+ call sub_s(x(:,m), y, 1, n, n)
+ call sub_s(y, x(:,m), b, t, n)
+ return
+ end subroutine test_f
+
+ subroutine test_s()
+ integer, target :: x(n,n)
+ integer, target :: v(e)
+ integer :: i
+
+ x = reshape([(i, i=1,n*n)], [n,n])
+ v = x(l:u:s,m)
+ call sub_s(v, v, 1, e, e)
+ call sub_s(x(l:u:s,m), v, 1, e, e)
+ call sub_s(v, x(l:u:s,m), 1, e, e)
+ return
+ end subroutine test_s
+
+ subroutine test_p()
+ integer, target :: x(n,n)
+ integer, pointer :: p(:)
+ integer :: v(e)
+ integer :: i
+
+ x = reshape([(i, i=1,n*n)], [n,n])
+ v = x(l:u:s,m)
+ p => x(:,m)
+ call sub_s(p(l:u:s), v, 1, e, e)
+ p => x(l:u:s,m)
+ call sub_s(p, v, 1, e, e)
+ p(l:) => x(l:u:s,m)
+ call sub_s(p, v, l, e+l-1, e)
+ p(l:l+e-1) => x(l:u:s,m)
+ call sub_s(p, v, l, e+l-1, e)
+ allocate(p(n))
+ p(:) = x(:,m)
+ call sub_s(p(l:u:s), v, 1, e, e)
+ deallocate(p)
+ allocate(p(e))
+ p(:) = x(l:u:s,m)
+ call sub_s(p, v, 1, e, e)
+ deallocate(p)
+ allocate(p(l:l+e-1))
+ p(:) = x(l:u:s,m)
+ call sub_s(p, v, l, e+l-1, e)
+ deallocate(p)
+ allocate(p(l:l+e-1))
+ p(l:) = x(l:u:s,m)
+ call sub_s(p, v, l, e+l-1, e)
+ deallocate(p)
+ allocate(p(l:l+e-1))
+ p(l:l+e-1) = x(l:u:s,m)
+ call sub_s(p, v, l, e+l-1, e)
+ deallocate(p)
+ return
+ end subroutine test_p
+
+ subroutine test_a()
+ integer :: x(n,n)
+ integer, allocatable, target :: a(:)
+ integer :: v(e)
+ integer :: i
+
+ x = reshape([(i, i=1,n*n)], [n,n])
+ v = x(l:u:s,m)
+ a = x(:,m)
+ call sub_s(a(l:u:s), v, 1, e, e)
+ deallocate(a)
+ allocate(a(n))
+ a(:) = x(:,m)
+ call sub_s(a(l:u:s), v, 1, e, e)
+ deallocate(a)
+ a = x(l:u:s,m)
+ call sub_s(a, v, 1, e, e)
+ deallocate(a)
+ allocate(a(e))
+ a(:) = x(l:u:s,m)
+ call sub_s(a, v, 1, e, e)
+ deallocate(a)
+ allocate(a(l:l+e-1))
+ a(:) = x(l:u:s,m)
+ call sub_s(a, v, l, e+l-1, e)
+ deallocate(a)
+ allocate(a(l:l+e-1))
+ a(l:) = x(l:u:s,m)
+ call sub_s(a, v, l, e+l-1, e)
+ deallocate(a)
+ allocate(a(l:l+e-1))
+ a(l:l+e-1) = x(l:u:s,m)
+ call sub_s(a, v, l, e+l-1, e)
+ deallocate(a)
+ return
+ end subroutine test_a
+
+ subroutine sub_s(a, b, l, u, e)
+ integer, pointer, intent(in) :: a(:)
+ integer, intent(in) :: b(:)
+ integer, intent(in) :: l
+ integer, intent(in) :: u
+ integer, intent(in) :: e
+
+ integer :: i
+
+ if(lbound(a,dim=1)/=l) stop 1001
+ if(ubound(a,dim=1)/=u) stop 1002
+ if(any(shape(a)/=[e])) stop 1003
+ if(size(a, dim=1)/=e) stop 1004
+ if(size(a)/=size(b)) stop 1005
+ do i = l, u
+ if(a(i)/=b(i-l+1)) stop 1006
+ end do
+ end subroutine sub_s
+
+end program main_p
diff --git a/gcc/testsuite/gfortran.dg/PR94022.f90 b/gcc/testsuite/gfortran.dg/PR94022.f90
new file mode 100644
index 00000000000..63b7d904c26
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/PR94022.f90
@@ -0,0 +1,132 @@
+! { dg-do run }
+!
+! Test the fix for PR94022
+!
+
+function isasa_f(a) result(s)
+ implicit none
+
+ integer, intent(in) :: a(..)
+
+ logical :: s
+
+ select rank(a)
+ rank(*)
+ s = .true.
+ rank default
+ s = .false.
+ end select
+ return
+end function isasa_f
+
+function isasa_c(a) result(s) bind(c)
+ use, intrinsic :: iso_c_binding, only: c_int, c_bool
+
+ implicit none
+
+ integer(kind=c_int), intent(in) :: a(..)
+
+ logical(kind=c_bool) :: s
+
+ select rank(a)
+ rank(*)
+ s = .true.
+ rank default
+ s = .false.
+ end select
+ return
+end function isasa_c
+
+program isasa_p
+
+ implicit none
+
+ interface
+ function isasa_f(a) result(s)
+ implicit none
+ integer, intent(in) :: a(..)
+ logical :: s
+ end function isasa_f
+ function isasa_c(a) result(s) bind(c)
+ use, intrinsic :: iso_c_binding, only: c_int, c_bool
+ implicit none
+ integer(kind=c_int), intent(in) :: a(..)
+ logical(kind=c_bool) :: s
+ end function isasa_c
+ end interface
+
+ integer, parameter :: sz = 7
+ integer, parameter :: lb = 3
+ integer, parameter :: ub = 9
+ integer, parameter :: ex = ub-lb+1
+
+ integer :: arr(sz,lb:ub)
+
+ arr = 1
+ if (asaf_a(arr, lb+1, ub-1)) stop 1
+ if (asaf_p(arr, lb+1, ub-1)) stop 2
+ if (asaf_a(arr, 2, ex-1)) stop 3
+ if (asaf_p(arr, 2, ex-1)) stop 4
+ if (asac_a(arr, lb+1, ub-1)) stop 5
+ if (asac_p(arr, lb+1, ub-1)) stop 6
+ if (asac_a(arr, 2, ex-1)) stop 7
+ if (asac_p(arr, 2, ex-1)) stop 8
+
+ stop
+
+contains
+
+ function asaf_a(a, lb, ub) result(s)
+ integer, intent(in) :: lb
+ integer, target, intent(in) :: a(sz,lb:*)
+ integer, intent(in) :: ub
+
+ logical :: s
+
+ s = isasa_f(a(:,lb:ub))
+ return
+ end function asaf_a
+
+ function asaf_p(a, lb, ub) result(s)
+ integer, intent(in) :: lb
+ integer, target, intent(in) :: a(sz,lb:*)
+ integer, intent(in) :: ub
+
+ logical :: s
+
+ integer, pointer :: p(:,:)
+
+ p => a(:,lb:ub)
+ s = isasa_f(p)
+ return
+ end function asaf_p
+
+ function asac_a(a, lb, ub) result(s)
+ integer, intent(in) :: lb
+ integer, target, intent(in) :: a(sz,lb:*)
+ integer, intent(in) :: ub
+
+ logical :: s
+
+ s = logical(isasa_c(a(:,lb:ub)))
+ return
+ end function asac_a
+
+ function asac_p(a, lb, ub) result(s)
+ integer, intent(in) :: lb
+ integer, target, intent(in) :: a(sz,lb:*)
+ integer, intent(in) :: ub
+
+ logical :: s
+
+ integer, pointer :: p(:,:)
+
+ p => a(:,lb:ub)
+ s = logical(isasa_c(p))
+ return
+ end function asac_p
+
+end program isasa_p
+
+
+
diff --git a/gcc/testsuite/gfortran.dg/PR95214.f90 b/gcc/testsuite/gfortran.dg/PR95214.f90
new file mode 100644
index 00000000000..8224767cb67
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/PR95214.f90
@@ -0,0 +1,84 @@
+! { dg-do run }
+!
+! PR fortran/95214
+!
+
+program chr_p
+
+ implicit none
+
+ integer, parameter :: u = 65
+
+ integer, parameter :: n = 26
+
+ character :: c(n)
+ integer :: i
+
+ c = [(achar(i), i=u,u+n-1)]
+ call chr_s(c, c)
+ call gfc_descriptor_c_char(c)
+ call s1(c)
+ call s1s_a(c)
+ call s1s_b(c)
+ call s2(c)
+ stop
+
+contains
+
+ subroutine chr_s(a, b)
+ character, intent(in) :: a(..)
+ character, intent(in) :: b(:)
+
+ integer :: i
+
+ select rank(a)
+ rank(1)
+ do i = 1, size(a)
+ if(a(i)/=b(i)) stop 1
+ end do
+ rank default
+ stop 2
+ end select
+ return
+ end subroutine chr_s
+
+ ! From Bug 66833
+ ! Contributed by Damian Rouson <damian@sourceryinstitute.org>
+ subroutine gfc_descriptor_c_char(a)
+ character a(..)
+ if(rank(a)/=1) stop 3 ! ICE (also for lbound, ubound, and c_loc)
+ end subroutine gfc_descriptor_c_char
+
+
+ ! From Bug 67938
+ ! Contributed by Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de>
+
+ ! example z1.f90
+ subroutine s1(x)
+ character(1) :: x(..)
+ if(any(lbound(x)/=[1])) stop 4
+ if(any(ubound(x)/=[n])) stop 5
+ end subroutine s1
+
+ ! example z1s.f90
+ subroutine s1s_a(x)
+ character :: x(..)
+ if(size(x)/=n) stop 6
+ end subroutine s1s_a
+
+ subroutine s1s_b(x)
+ character(77) :: x(..)
+ if(size(x)/=n) stop 7
+ end subroutine s1s_b
+
+ ! example z2.f90
+ subroutine s2(x)
+ character(1) :: x(..)
+ if(lbound(x, dim=1)/=1) stop 8
+ if(ubound(x, dim=1)/=n) stop 9
+ if(size(x, dim=1)/=n) stop 10
+ end subroutine s2
+
+end program chr_p
+
+
diff --git a/gcc/testsuite/gfortran.dg/PR95331.f90 b/gcc/testsuite/gfortran.dg/PR95331.f90
new file mode 100644
index 00000000000..8024e79fed5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/PR95331.f90
@@ -0,0 +1,163 @@
+! { dg-do run }
+!
+! PR fortran/95331
+!
+
+program main_p
+
+ implicit none
+
+ integer, parameter :: n = 10
+ integer, parameter :: m = 5
+
+ integer, parameter :: b = 3
+ integer, parameter :: t = n+b-1
+
+ integer, parameter :: l = 4
+ integer, parameter :: u = 7
+ integer, parameter :: s = 3
+ integer, parameter :: e = (u-l)/s+1
+
+ call test_f()
+ call test_s()
+ call test_p()
+ call test_a()
+ stop
+
+contains
+
+ subroutine test_f()
+ integer :: x(n,n)
+ integer :: y(b:t)
+ integer :: i
+
+ x = reshape([(i, i=1,n*n)], [n,n])
+ y = x(:,m)
+ call sub_s(x(:,m), y, n)
+ call sub_s(y, x(:,m), n)
+ return
+ end subroutine test_f
+
+ subroutine test_s()
+ integer :: x(n,n)
+ integer :: v(e)
+ integer :: i
+
+ x = reshape([(i, i=1,n*n)], [n,n])
+ v = x(l:u:s,m)
+ call sub_s(v, v, e)
+ call sub_s(x(l:u:s,m), v, e)
+ call sub_s(v, x(l:u:s,m), e)
+ return
+ end subroutine test_s
+
+ subroutine test_p()
+ integer, target :: x(n,n)
+ integer, pointer :: p(:)
+ integer :: v(e)
+ integer :: i
+
+ x = reshape([(i, i=1,n*n)], [n,n])
+ v = x(l:u:s,m)
+ p => x(:,m)
+ call sub_s(p(l:u:s), v, e)
+ p => x(l:u:s,m)
+ call sub_s(p, v, e)
+ p(l:) => x(l:u:s,m)
+ call sub_s(p, v, e)
+ p(l:l+e-1) => x(l:u:s,m)
+ call sub_s(p, v, e)
+ allocate(p(n))
+ p(:) = x(:,m)
+ call sub_s(p(l:u:s), v, e)
+ deallocate(p)
+ allocate(p(e))
+ p(:) = x(l:u:s,m)
+ call sub_s(p, v, e)
+ deallocate(p)
+ allocate(p(l:l+e-1))
+ p(:) = x(l:u:s,m)
+ call sub_s(p, v, e)
+ deallocate(p)
+ allocate(p(l:l+e-1))
+ p(l:) = x(l:u:s,m)
+ call sub_s(p, v, e)
+ deallocate(p)
+ allocate(p(l:l+e-1))
+ p(l:l+e-1) = x(l:u:s,m)
+ call sub_s(p, v, e)
+ deallocate(p)
+ return
+ end subroutine test_p
+
+ subroutine test_a()
+ integer :: x(n,n)
+ integer, allocatable :: a(:)
+ integer :: v(e)
+ integer :: i
+
+ x = reshape([(i, i=1,n*n)], [n,n])
+ v = x(l:u:s,m)
+ a = x(:,m)
+ call sub_s(a(l:u:s), v, e)
+ deallocate(a)
+ allocate(a(n))
+ a(:) = x(:,m)
+ call sub_s(a(l:u:s), v, e)
+ deallocate(a)
+ a = x(l:u:s,m)
+ call sub_s(a, v, e)
+ deallocate(a)
+ allocate(a(e))
+ a(:) = x(l:u:s,m)
+ call sub_s(a, v, e)
+ deallocate(a)
+ allocate(a(l:l+e-1))
+ a(:) = x(l:u:s,m)
+ call sub_s(a, v, e)
+ deallocate(a)
+ allocate(a(l:l+e-1))
+ a(l:) = x(l:u:s,m)
+ call sub_s(a, v, e)
+ deallocate(a)
+ allocate(a(l:l+e-1))
+ a(l:l+e-1) = x(l:u:s,m)
+ call sub_s(a, v, e)
+ deallocate(a)
+ return
+ end subroutine test_a
+
+ subroutine sub_s(a, b, n)
+ class(*), intent(in) :: a(:)
+ integer, intent(in) :: b(:)
+ integer, intent(in) :: n
+
+ integer :: i
+
+ if(lbound(a, dim=1)/=1) stop 1001
+ if(ubound(a, dim=1)/=n) stop 1002
+ if(any(shape(a)/=[n])) stop 1003
+ if(size(a, dim=1)/=n) stop 1004
+ if(size(a)/=size(b)) stop 1005
+ do i = 1, n
+ call vrfy(a(i), b(i))
+ end do
+ return
+ end subroutine sub_s
+
+ subroutine vrfy(a, b)
+ class(*), intent(in) :: a
+ integer, intent(in) :: b
+
+ select type (a)
+ type is (integer)
+ !print *, a, b
+ if(a/=b) stop 2001
+ class default
+ STOP 2002
+ end select
+ return
+ end subroutine vrfy
+
+end program main_p
+
diff --git a/gcc/testsuite/gfortran.dg/assignment_4.f90 b/gcc/testsuite/gfortran.dg/assignment_4.f90
index 77181a2054e..37fdbca9178 100644
--- a/gcc/testsuite/gfortran.dg/assignment_4.f90
+++ b/gcc/testsuite/gfortran.dg/assignment_4.f90
@@ -12,5 +12,5 @@
logical :: r
type(event), pointer :: myEvent
allocate(myEvent)
- r=myEvent%task()
+ r=myEvent%task() ! { dg-warning "uninitialized" }
end
diff --git a/gcc/testsuite/gfortran.dg/char4-subscript.f90 b/gcc/testsuite/gfortran.dg/char4-subscript.f90
new file mode 100644
index 00000000000..fd1cf69754e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/char4-subscript.f90
@@ -0,0 +1,30 @@
+! { dg-do run }
+! { dg-additional-options "-fdump-tree-original" }
+!
+! PR fortran/95837
+!
+type t
+ character(len=:, kind=4), pointer :: str2
+end type t
+type(t) :: var
+
+allocate(character(len=5, kind=4) :: var%str2)
+
+var%str2(1:1) = 4_"d"
+var%str2(2:3) = 4_"ef"
+var%str2(4:4) = achar(int(Z'1F600'), kind=4)
+var%str2(5:5) = achar(int(Z'1F608'), kind=4)
+
+if (var%str2(1:3) /= 4_"def") stop 1
+if (ichar(var%str2(4:4)) /= int(Z'1F600')) stop 2
+if (ichar(var%str2(5:5)) /= int(Z'1F608')) stop 2
+
+deallocate(var%str2)
+end
+
+! Note: the last '\x00' is regarded as string terminator, hence, the tailing \0 byte is not in the dump
+
+! { dg-final { scan-tree-dump { \(\*var\.str2\)\[1\]{lb: 1 sz: 4} = "(d\\x00\\x00|\\x00\\x00\\x00d)"\[1\]{lb: 1 sz: 4};} "original" } }
+! { dg-final { scan-tree-dump { __builtin_memmove \(\(void \*\) &\(\*var.str2\)\[2\]{lb: 1 sz: 4}, \(void \*\) &"(e\\x00\\x00\\x00f\\x00\\x00|\\x00\\x00\\x00e\\x00\\x00\\x00f)"\[1\]{lb: 1 sz: 4}, 8\);} "original" } }
+! { dg-final { scan-tree-dump { \(\*var.str2\)\[4\]{lb: 1 sz: 4} = "(\\x00\\xf6\\x01|\\x00\\x01\\xf6)"\[1\]{lb: 1 sz: 4};} "original" } }
+! { dg-final { scan-tree-dump { \(\*var.str2\)\[5\]{lb: 1 sz: 4} = "(\\b\\xf6\\x01|\\x00\\x01\\xf6\\b)"\[1\]{lb: 1 sz: 4};} "original" } }
diff --git a/gcc/testsuite/gfortran.dg/coarray/pr93671.f90 b/gcc/testsuite/gfortran.dg/coarray/pr93671.f90
new file mode 100644
index 00000000000..8d26ff88753
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/coarray/pr93671.f90
@@ -0,0 +1,24 @@
+! { dg-do run }
+
+! PR/fortran 93671 - ICE on intrinsic assignment to allocatable derived-type
+! component of coarray
+
+ type flux_planes
+ integer, allocatable :: normals
+ end type
+
+ type package
+ type(flux_planes) surface_fluxes(1)
+ end type
+
+ type(package) mail[*], halo_data
+
+ halo_data%surface_fluxes(1)%normals = 1
+ mail = halo_data
+
+ if (any(size(mail%surface_fluxes) /= [1]) .OR. &
+ mail%surface_fluxes(1)%normals /= 1) then
+ stop 1
+ end if
+end
+
diff --git a/gcc/testsuite/gfortran.dg/coarray_lib_comm_1.f90 b/gcc/testsuite/gfortran.dg/coarray_lib_comm_1.f90
index 171a27bd4c3..a8954e7afa3 100644
--- a/gcc/testsuite/gfortran.dg/coarray_lib_comm_1.f90
+++ b/gcc/testsuite/gfortran.dg/coarray_lib_comm_1.f90
@@ -38,8 +38,7 @@ B(1:5) = B(3:7)
if (any (A-B /= 0)) STOP 4
end
-! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, &parm.\[0-9\]+, 4, 4, 1, 0B\\\);" 2 "original" } }
-! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, &p, 4, 4, 1, 0B\\\);" 1 "original" } }
-! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.1, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) b, 1, &parm.\[0-9\]+, 0B, &p, 4, 4, 0, 0B\\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, &parm.\[0-9\]+, 4, 4, 1, 0B\\\);" 3 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.1, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) b, 1, &parm.\[0-9\]+, 0B, &parm.\[0-9\]+, 4, 4, 0, 0B\\\);" 1 "original" } }
! { dg-final { scan-tree-dump-times "_gfortran_caf_sendget \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, 4, 4, 1, 0B\\\);" 1 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/dec_structure_23.f90 b/gcc/testsuite/gfortran.dg/dec_structure_23.f90
index 78db344e0fc..39e5369c056 100644
--- a/gcc/testsuite/gfortran.dg/dec_structure_23.f90
+++ b/gcc/testsuite/gfortran.dg/dec_structure_23.f90
@@ -13,8 +13,8 @@ program p
integer :: nn
real :: rr
structure /s/
- integer x(n) /1/ ! { dg-error "array with nonconstant bounds" }
+ integer x(n) /1/ ! { dg-error "must be constant of INTEGER type" }
integer xx(nn) /1/ ! { dg-error "array with nonconstant bounds" }
- integer xxx(rr) /1.0/ ! { dg-error "array with nonconstant bounds" }
+ integer xxx(rr) /1.0/ ! { dg-error "must be constant of INTEGER type" }
end structure
end
diff --git a/gcc/testsuite/gfortran.dg/dependency_59.f90 b/gcc/testsuite/gfortran.dg/dependency_59.f90
new file mode 100644
index 00000000000..90c6532392c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dependency_59.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! PR 95812 - this caused an ICE.
+! Test case by Jakub Jelinek.
+
+module test
+contains
+ subroutine foo()
+ integer :: a(3)
+ a = 1
+ print *, matmul(1*reshape(a,(/3,1/)), reshape((/1,1,1/),(/1,3/)))
+ end subroutine foo
+ subroutine bar()
+ call foo()
+ end subroutine bar
+end module test
diff --git a/gcc/testsuite/gfortran.dg/diagnostic-format-json-1.F90 b/gcc/testsuite/gfortran.dg/diagnostic-format-json-1.F90
index 7fade1f65fc..606fe0f891a 100644
--- a/gcc/testsuite/gfortran.dg/diagnostic-format-json-1.F90
+++ b/gcc/testsuite/gfortran.dg/diagnostic-format-json-1.F90
@@ -8,17 +8,22 @@
! We can't rely on any ordering of the keys.
! { dg-regexp "\"kind\": \"error\"" }
+! { dg-regexp "\"column-origin\": 1" }
! { dg-regexp "\"message\": \"#error message\"" }
! { dg-regexp "\"caret\": \{" }
! { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-1.F90\"" }
! { dg-regexp "\"line\": 4" }
! { dg-regexp "\"column\": 2" }
+! { dg-regexp "\"display-column\": 2" }
+! { dg-regexp "\"byte-column\": 2" }
! { dg-regexp "\"finish\": \{" }
! { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-1.F90\"" }
! { dg-regexp "\"line\": 4" }
! { dg-regexp "\"column\": 6" }
+! { dg-regexp "\"display-column\": 6" }
+! { dg-regexp "\"byte-column\": 6" }
! { dg-regexp "\"locations\": \[\[\{\}, \]*\]" }
! { dg-regexp "\"children\": \[\[\]\[\]\]" }
diff --git a/gcc/testsuite/gfortran.dg/diagnostic-format-json-2.F90 b/gcc/testsuite/gfortran.dg/diagnostic-format-json-2.F90
index bebcf68d431..56615f0ca5a 100644
--- a/gcc/testsuite/gfortran.dg/diagnostic-format-json-2.F90
+++ b/gcc/testsuite/gfortran.dg/diagnostic-format-json-2.F90
@@ -8,6 +8,7 @@
! We can't rely on any ordering of the keys.
! { dg-regexp "\"kind\": \"warning\"" }
+! { dg-regexp "\"column-origin\": 1" }
! { dg-regexp "\"message\": \"#warning message\"" }
! { dg-regexp "\"option\": \"-Wcpp\"" }
! { dg-regexp "\"option_url\": \"\[^\n\r\"\]*#index-Wcpp\"" }
@@ -16,11 +17,15 @@
! { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-2.F90\"" }
! { dg-regexp "\"line\": 4" }
! { dg-regexp "\"column\": 2" }
+! { dg-regexp "\"display-column\": 2" }
+! { dg-regexp "\"byte-column\": 2" }
! { dg-regexp "\"finish\": \{" }
! { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-2.F90\"" }
! { dg-regexp "\"line\": 4" }
! { dg-regexp "\"column\": 8" }
+! { dg-regexp "\"display-column\": 8" }
+! { dg-regexp "\"byte-column\": 8" }
! { dg-regexp "\"locations\": \[\[\{\}, \]*\]" }
! { dg-regexp "\"children\": \[\[\]\[\]\]" }
diff --git a/gcc/testsuite/gfortran.dg/diagnostic-format-json-3.F90 b/gcc/testsuite/gfortran.dg/diagnostic-format-json-3.F90
index 7ab78eb570b..50214759091 100644
--- a/gcc/testsuite/gfortran.dg/diagnostic-format-json-3.F90
+++ b/gcc/testsuite/gfortran.dg/diagnostic-format-json-3.F90
@@ -8,6 +8,7 @@
! We can't rely on any ordering of the keys.
! { dg-regexp "\"kind\": \"error\"" }
+! { dg-regexp "\"column-origin\": 1" }
! { dg-regexp "\"message\": \"#warning message\"" }
! { dg-regexp "\"option\": \"-Werror=cpp\"" }
! { dg-regexp "\"option_url\": \"\[^\n\r\"\]*#index-Wcpp\"" }
@@ -16,11 +17,15 @@
! { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-3.F90\"" }
! { dg-regexp "\"line\": 4" }
! { dg-regexp "\"column\": 2" }
+! { dg-regexp "\"display-column\": 2" }
+! { dg-regexp "\"byte-column\": 2" }
! { dg-regexp "\"finish\": \{" }
! { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-3.F90\"" }
! { dg-regexp "\"line\": 4" }
! { dg-regexp "\"column\": 8" }
+! { dg-regexp "\"display-column\": 8" }
+! { dg-regexp "\"byte-column\": 8" }
! { dg-regexp "\"locations\": \[\[\{\}, \]*\]" }
! { dg-regexp "\"children\": \[\[\]\[\]\]" }
diff --git a/gcc/testsuite/gfortran.dg/do_check_13.f90 b/gcc/testsuite/gfortran.dg/do_check_13.f90
new file mode 100644
index 00000000000..5ff7cdb4bb4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/do_check_13.f90
@@ -0,0 +1,86 @@
+program main
+ implicit none
+ integer :: i1, i2, i3, i4, i5, i6, i7
+ integer :: j
+ do i1=1,10
+ call sub1 ! { dg-error "Index variable 'i1' redefined" }
+ end do
+ do i2=1,10
+ call sub2 ! { dg-error "Index variable 'i2' redefined" }
+ end do
+ do i3=1,10
+ j = fcn3() ! { dg-error "Index variable 'i3' redefined" }
+ end do
+ do i4=1,10
+ j = fcn4() ! { dg-error "Index variable 'i4' redefined" }
+ end do
+ do i5=1,10
+ call sub5 ! { dg-error "Index variable 'i5' set to undefined" }
+ end do
+
+ call sub6
+
+ do i7=1,10
+ call sub7 ! { dg-error "Index variable 'i7' not definable" }
+ end do
+contains
+ subroutine sub1
+ i1 = 5 ! { dg-error "Index variable 'i1' redefined" }
+ end subroutine sub1
+
+ subroutine sub2
+ do i2=1,5 ! { dg-error "Index variable 'i2' redefined" }
+ end do
+ end subroutine sub2
+
+ integer function fcn3()
+ i3 = 1 ! { dg-error "Index variable 'i3' redefined" }
+ fcn3 = i3
+ end function fcn3
+
+ integer function fcn4()
+ open (10,file="foo.dat", iostat=i4) ! { dg-error "Index variable 'i4' redefined" }
+ fcn4 = 12
+ end function fcn4
+
+ subroutine sub5
+ integer :: k
+ k = intentout(i5) ! { dg-error "Index variable 'i5' set to undefined" }
+ end subroutine sub5
+
+ subroutine sub6
+ do i6=1,10
+ call sub6a ! { dg-error "Index variable 'i6' redefined" }
+ end do
+ end subroutine sub6
+
+ subroutine sub6a
+ i6 = 5 ! { dg-error "Index variable 'i6' redefined" }
+ end subroutine sub6a
+
+ subroutine sub7
+ integer :: k
+ k = intentinout (i7) ! { dg-error "Index variable 'i7' not definable" }
+ end subroutine sub7
+
+ integer function intentout(i)
+ integer, intent(out) :: i
+ end function intentout
+
+ integer function intentinout(i)
+ integer, intent(inout) :: i
+ end function intentinout
+end program main
+
+module foo
+ integer :: j1
+contains
+ subroutine mod_sub_1
+ do j1=1,10
+ call aux ! { dg-error "Index variable 'j1' redefined" }
+ end do
+ end subroutine mod_sub_1
+ subroutine aux
+ j1 = 3 ! { dg-error "Index variable 'j1' redefined" }
+ end subroutine aux
+end module foo
diff --git a/gcc/testsuite/gfortran.dg/do_check_14.f90 b/gcc/testsuite/gfortran.dg/do_check_14.f90
new file mode 100644
index 00000000000..43425f19dec
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/do_check_14.f90
@@ -0,0 +1,56 @@
+! { dg-do compile }
+! PR fortran/96469 - make sure that all legal variants pass.
+
+module x
+ implicit none
+contains
+ subroutine sub_intent_in(i)
+ integer, intent(in) :: i
+ end subroutine sub_intent_in
+ subroutine sub_intent_unspec(i)
+ integer :: i
+ end subroutine sub_intent_unspec
+ integer function fcn_intent_in(i)
+ integer, intent(in) :: i
+ fcn_intent_in = i + 42
+ end function fcn_intent_in
+ integer function fcn_intent_unspec (i)
+ integer :: i
+ fcn_intent_unspec = i + 42
+ end function fcn_intent_unspec
+end module x
+
+program main
+ use x
+ implicit none
+ integer :: i1, i2, i3, i4
+ integer :: k, l
+ do i1=1,10
+ call sub1
+ end do
+ do i2=1,10
+ call sub2
+ end do
+ do i3 = 1,10
+ k = fcn3()
+ end do
+ do i4=1,10
+ l = fcn4()
+ end do
+contains
+ subroutine sub1
+ call sub_intent_in (i1)
+ end subroutine sub1
+ subroutine sub2
+ integer :: m
+ m = fcn_intent_in (i2)
+ print *,m
+ end subroutine sub2
+ integer function fcn3()
+ call sub_intent_unspec (i3)
+ fcn3 = 42
+ end function fcn3
+ integer function fcn4()
+ fcn4 = fcn_intent_unspec (i4)
+ end function fcn4
+end program main
diff --git a/gcc/testsuite/gfortran.dg/do_check_15.f90 b/gcc/testsuite/gfortran.dg/do_check_15.f90
new file mode 100644
index 00000000000..f67452b4660
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/do_check_15.f90
@@ -0,0 +1,58 @@
+! { dg-do compile }
+! PR fortran/96556 - this used to cause an ICE.
+! Test case by Juergen Reuter.
+module polarizations
+
+ implicit none
+ private
+
+ type :: smatrix_t
+ private
+ integer :: dim = 0
+ integer :: n_entry = 0
+ integer, dimension(:,:), allocatable :: index
+ contains
+ procedure :: write => smatrix_write
+ end type smatrix_t
+
+ type, extends (smatrix_t) :: pmatrix_t
+ private
+ contains
+ procedure :: write => pmatrix_write
+ procedure :: normalize => pmatrix_normalize
+ end type pmatrix_t
+
+contains
+
+ subroutine msg_error (string)
+ character(len=*), intent(in), optional :: string
+ end subroutine msg_error
+
+ subroutine smatrix_write (object)
+ class(smatrix_t), intent(in) :: object
+ end subroutine smatrix_write
+
+ subroutine pmatrix_write (object)
+ class(pmatrix_t), intent(in) :: object
+ call object%smatrix_t%write ()
+ end subroutine pmatrix_write
+
+ subroutine pmatrix_normalize (pmatrix)
+ class(pmatrix_t), intent(inout) :: pmatrix
+ integer :: i, hmax
+ logical :: fermion, ok
+ do i = 1, pmatrix%n_entry
+ associate (index => pmatrix%index(:,i))
+ if (index(1) == index(2)) then
+ call error ("diagonal must be real")
+ end if
+ end associate
+ end do
+ contains
+ subroutine error (msg)
+ character(*), intent(in) :: msg
+ call pmatrix%write ()
+ end subroutine error
+ end subroutine pmatrix_normalize
+
+end module polarizations
diff --git a/gcc/testsuite/gfortran.dg/do_check_4.f90 b/gcc/testsuite/gfortran.dg/do_check_4.f90
index 65bc92c7e1a..5b087e4dde3 100644
--- a/gcc/testsuite/gfortran.dg/do_check_4.f90
+++ b/gcc/testsuite/gfortran.dg/do_check_4.f90
@@ -5,17 +5,23 @@
! PR fortran/34656
! Run-time check for modifing loop variables
!
+
+module x
+ integer :: i
+contains
+ SUBROUTINE do_something()
+ IMPLICIT NONE
+ DO i=1,10
+ ENDDO
+ END SUBROUTINE do_something
+end module x
+
PROGRAM test
+ use x
IMPLICIT NONE
- INTEGER :: i
DO i=1,100
- CALL do_something()
+ CALL do_something()
ENDDO
-CONTAINS
- SUBROUTINE do_something()
- IMPLICIT NONE
- DO i=1,10
- ENDDO
- END SUBROUTINE do_something
-END PROGRAM test
+end PROGRAM test
+
! { dg-output "Fortran runtime error: Loop variable has been modified" }
diff --git a/gcc/testsuite/gfortran.dg/elemental_optional_args_6.f90 b/gcc/testsuite/gfortran.dg/elemental_optional_args_6.f90
index c19c1df3e2b..56a9db56be2 100644
--- a/gcc/testsuite/gfortran.dg/elemental_optional_args_6.f90
+++ b/gcc/testsuite/gfortran.dg/elemental_optional_args_6.f90
@@ -21,8 +21,8 @@ contains
integer, optional :: arg1(:)
integer :: arg2(:)
! print *, fun1 (arg1, arg2)
- if (size (fun1 (arg1, arg2)) /= 2) STOP 1 ! { dg-warning "is an array and OPTIONAL" }
- if (any (fun1 (arg1, arg2) /= [1,2])) STOP 2 ! { dg-warning "is an array and OPTIONAL" }
+ if (size (fun1 (arg1, arg2)) /= 2) STOP 1
+ if (any (fun1 (arg1, arg2) /= [1,2])) STOP 2
end subroutine
elemental function fun1 (arg1, arg2)
diff --git a/gcc/testsuite/gfortran.dg/equiv_11.f90 b/gcc/testsuite/gfortran.dg/equiv_11.f90
new file mode 100644
index 00000000000..0f4a1ab5c32
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/equiv_11.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! { dg-options "-fsecond-underscore" }
+! PR fortran/95106
+
+module m2345678901234567890123456789012345678901234567890123456789_123
+ implicit none
+ real :: a(4), u(3,2)
+ real :: b(4), v(4,2)
+ equivalence (a(1),u(1,1)), (b(1),v(1,1))
+end
+! { dg-final { scan-assembler {m2345678901234567890123456789012345678901234567890123456789_123.eq.0__} } }
+! { dg-final { scan-assembler {m2345678901234567890123456789012345678901234567890123456789_123.eq.1__} } }
diff --git a/gcc/testsuite/gfortran.dg/erf_3.F90 b/gcc/testsuite/gfortran.dg/erf_3.F90
index 69ac8430d96..2e3d58b445b 100644
--- a/gcc/testsuite/gfortran.dg/erf_3.F90
+++ b/gcc/testsuite/gfortran.dg/erf_3.F90
@@ -1,4 +1,3 @@
-! { dg-do run { xfail ia64-*-linux* } }
! { dg-options "-fno-range-check -ffree-line-length-none -O0" }
! { dg-add-options ieee }
! { dg-skip-if "PR libfortran/59313" { hppa*-*-hpux* } }
@@ -6,8 +5,6 @@
! Check that simplification functions and runtime library agree on ERF,
! ERFC and ERFC_SCALED, for quadruple-precision.
!
-! XFAILed for IA64 Linux because of a glibc bug:
-! http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59227
program test
use, intrinsic :: iso_fortran_env
diff --git a/gcc/testsuite/gfortran.dg/error_recovery_1.f90 b/gcc/testsuite/gfortran.dg/error_recovery_1.f90
index 7f19ab51e50..9e2540c0787 100644
--- a/gcc/testsuite/gfortran.dg/error_recovery_1.f90
+++ b/gcc/testsuite/gfortran.dg/error_recovery_1.f90
@@ -2,14 +2,14 @@
! PR fortran/24549 (and duplicate PR fortran/27487)
module gfcbug29_import
interface
- subroutine foo (x)
+ subroutine foo (x) ! { dg-warning "wrong number of arguments" }
something :: dp ! { dg-error "Unclassifiable statement" }
real (kind=dp) :: x ! { dg-error "has not been declared or is a variable, which does not reduce to a constant expression" }
end subroutine foo
end interface
end module gfcbug29_import
-subroutine FOO
+subroutine FOO ! { dg-warning "wrong number of arguments" }
X :: I
equivalence (I,I)
end
diff --git a/gcc/testsuite/gfortran.dg/finalize_28.f90 b/gcc/testsuite/gfortran.dg/finalize_28.f90
index 597413b2dd3..f0c9665252f 100644
--- a/gcc/testsuite/gfortran.dg/finalize_28.f90
+++ b/gcc/testsuite/gfortran.dg/finalize_28.f90
@@ -21,4 +21,4 @@ contains
integer, intent(out) :: edges(:,:)
end subroutine coo_dump_edges
end module coo_graphs
-! { dg-final { scan-tree-dump-times "__builtin_free" 5 "original" } }
+! { dg-final { scan-tree-dump-times "__builtin_free" 6 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/finalize_33.f90 b/gcc/testsuite/gfortran.dg/finalize_33.f90
index 2205f9eed7f..3857e4485ee 100644
--- a/gcc/testsuite/gfortran.dg/finalize_33.f90
+++ b/gcc/testsuite/gfortran.dg/finalize_33.f90
@@ -116,4 +116,4 @@ contains
! (iii) mci_template
end program main_ut
! { dg-final { scan-tree-dump-times "__builtin_malloc" 17 "original" } }
-! { dg-final { scan-tree-dump-times "__builtin_free" 19 "original" } }
+! { dg-final { scan-tree-dump-times "__builtin_free" 20 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/finalize_34.f90 b/gcc/testsuite/gfortran.dg/finalize_34.f90
index e2f02a5c51c..8fb801d4235 100644
--- a/gcc/testsuite/gfortran.dg/finalize_34.f90
+++ b/gcc/testsuite/gfortran.dg/finalize_34.f90
@@ -22,4 +22,4 @@ program main
use testmodule
type(evtlist_type), dimension(10) :: a
end program main
-! { dg-final { scan-tree-dump-times "__builtin_free" 8 "original" } }
+! { dg-final { scan-tree-dump-times "__builtin_free" 24 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/finalize_35.f90 b/gcc/testsuite/gfortran.dg/finalize_35.f90
new file mode 100644
index 00000000000..66435c43ecc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/finalize_35.f90
@@ -0,0 +1,48 @@
+! { dg-do compile }
+! { dg-additional-options "-fdump-tree-original" }
+! PR 94361 - this left open some memory leaks. Original test case by
+! Antony Lewis.
+
+module debug
+ private
+
+ Type TypeWithFinal
+ contains
+ FINAL :: finalizer !No leak if this line is commented
+ end type TypeWithFinal
+
+ Type Tester
+ real, dimension(:), allocatable :: Dat
+ Type(TypeWithFinal) :: X
+ end Type Tester
+
+ Type :: TestType2
+ Type(Tester) :: T
+ end type TestType2
+ public Leaker
+contains
+
+ subroutine Leaker
+ type(TestType2) :: Test
+
+ allocate(Test%T%Dat(1000))
+ end subroutine Leaker
+
+ subroutine finalizer(this)
+ Type(TypeWithFinal) :: this
+ end subroutine finalizer
+
+end module debug
+
+
+program run
+ use debug
+ implicit none
+ integer i
+
+ do i=1, 1000
+ call Leaker()
+ end do
+
+end program run
+! { dg-final { scan-tree-dump-times "__builtin_free\\ \\(ptr2" 2 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/finalize_36.f90 b/gcc/testsuite/gfortran.dg/finalize_36.f90
new file mode 100644
index 00000000000..432f5472aeb
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/finalize_36.f90
@@ -0,0 +1,39 @@
+! { dg-do run }
+! { dg-additional-options "-fdump-tree-original" }
+! PR 94109
+! This used to leak memory. Test case by Antony Lewis.
+ module debug
+ implicit none
+
+ Type Tester
+ real, dimension(:), allocatable :: Dat, Dat2
+ end Type
+
+ Type TestType2
+ Type(Tester) :: T
+ end type TestType2
+
+ contains
+
+ subroutine Leaker
+ class(TestType2), pointer :: ActiveState
+ Type(Tester) :: Temp
+
+ allocate(Temp%Dat2(10000))
+
+ allocate(TestType2::ActiveState)
+ ActiveState%T = Temp
+ deallocate(ActiveState)
+
+ end subroutine
+
+ end module
+
+
+ program run
+ use debug
+
+ call Leaker()
+
+ end program
+! { dg-final { scan-tree-dump-times "__builtin_free\\ \\(ptr2" 4 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/findloc_8.f90 b/gcc/testsuite/gfortran.dg/findloc_8.f90
new file mode 100644
index 00000000000..dffb36d61e5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/findloc_8.f90
@@ -0,0 +1,29 @@
+! PR libfortran/95390
+! { dg-do run { target fortran_real_10 } }
+
+ complex(kind=10) :: a(6), b, d(2,2)
+ logical :: m(6), n, o(2,2)
+ integer :: c(1), e(2)
+ a = (/ 1., 2., 17., 2., 2., 6. /)
+ b = 17.
+ c = findloc (a, b)
+ if (c(1) /= 3) stop 1
+ m = (/ .true., .false., .true., .true., .true., .true. /)
+ n = .true.
+ b = 2.
+ c = findloc (a, b, m)
+ if (c(1) /= 4) stop 2
+ c = findloc (a, b, n)
+ if (c(1) /= 2) stop 3
+ d = reshape((/ 1., 2., 2., 3. /), (/ 2, 2 /))
+ e = findloc (d, b, 1)
+ if (e(1) /= 2 .or. e(2) /= 1) stop 4
+ o = reshape((/ .true., .false., .true., .true. /), (/ 2, 2 /))
+ e = findloc (d, b, 1, o)
+ if (e(1) /= 0 .or. e(2) /= 1) stop 5
+ e = findloc (d, b, 1, n)
+ if (e(1) /= 2 .or. e(2) /= 1) stop 6
+ n = .false.
+ e = findloc (d, b, 1, n)
+ if (e(1) /= 0 .or. e(2) /= 0) stop 7
+end
diff --git a/gcc/testsuite/gfortran.dg/fmt_en.f90 b/gcc/testsuite/gfortran.dg/fmt_en.f90
index 89011b32368..d7e51b3fa21 100644
--- a/gcc/testsuite/gfortran.dg/fmt_en.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_en.f90
@@ -10,7 +10,6 @@ use ISO_FORTRAN_ENV
integer :: n_tst = 0, n_cnt = 0, n_skip = 0
character(len=20) :: s, s1
- open (unit = 10, file = 'fmt_en.res')
! Check that the default rounding mode is to nearest and to even on tie.
do i=1,size(real_kinds)
if (i == 1) then
@@ -149,8 +148,7 @@ use ISO_FORTRAN_ENV
! print *, n_tst, n_cnt, n_skip
if (n_cnt /= 0) STOP 1
- if (all(.not. l_skip)) write (10, *) "All kinds rounded to nearest"
- close (10)
+ if (all(.not. l_skip)) print *, "All kinds rounded to nearest"
contains
subroutine checkfmt(fmt, x, cmp)
@@ -182,4 +180,4 @@ contains
end subroutine
end program
-! { dg-final { scan-file fmt_en.res "All kinds rounded to nearest" { xfail hppa*-*-hpux* } } }
+! { dg-output "All kinds rounded to nearest" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
diff --git a/gcc/testsuite/gfortran.dg/fmt_en_rd.f90 b/gcc/testsuite/gfortran.dg/fmt_en_rd.f90
new file mode 100644
index 00000000000..ea914e0901c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/fmt_en_rd.f90
@@ -0,0 +1,185 @@
+! { dg-do run }
+! PR60128 Invalid outputs with EN descriptors
+! Test case provided by Walt Brainerd.
+program pr60128
+use ISO_FORTRAN_ENV
+ implicit none
+ integer, parameter :: j(size(real_kinds)+4)=[REAL_KINDS, [4, 4, 4, 4]]
+ logical :: l_skip(4) = .false.
+ integer :: i
+ integer :: n_tst = 0, n_cnt = 0, n_skip = 0
+ character(len=20,kind=4) :: s, s1
+
+! Check that the default rounding mode is to nearest and to even on tie.
+ do i=1,size(real_kinds)
+ if (i == 1) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(1)), &
+ real(9.49999905,kind=j(1)), &
+ real(9.5,kind=j(1)), real(8.5,kind=j(1))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(1)), &
+ real(98765.0,kind=j(1))
+ else if (i == 2) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(2)), &
+ real(9.49999905,kind=j(2)), &
+ real(9.5,kind=j(2)), real(8.5,kind=j(2))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(2)), &
+ real(98765.0,kind=j(2))
+ else if (i == 3) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(3)), &
+ real(9.49999905,kind=j(3)), &
+ real(9.5,kind=j(3)), real(8.5,kind=j(3))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(3)), &
+ real(98765.0,kind=j(3))
+ else if (i == 4) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(4)), &
+ real(9.49999905,kind=j(4)), &
+ real(9.5,kind=j(4)), real(8.5,kind=j(4))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(4)), &
+ real(98765.0,kind=j(4))
+ end if
+ if (s /= 4_'-9.5 9.5 10. 8.' .or. s1 /= 4_' 987.4E+03 98.76E+03') then
+ l_skip(i) = .true.
+ print "('Unsupported rounding for real(',i0,')')", j(i)
+ end if
+ end do
+
+
+! Original test.
+ call checkfmt("(en15.2)", -.44444, 4_" -444.44E-03")
+
+! Test for the bug in comment 6.
+ call checkfmt("(rd,en15.0)", 1.0, 4_" 1.E+00")
+ call checkfmt("(rd,en15.0)", 1.00000012, 4_" 1.E+00")
+ call checkfmt("(rd,en15.0)", 0.99999994, 4_" 999.E-03")
+ call checkfmt("(rd,en15.0)", 10.0, 4_" 10.E+00")
+ call checkfmt("(rd,en15.0)", 10.0000010, 4_" 10.E+00")
+ call checkfmt("(rd,en15.0)", 9.99999905, 4_" 9.E+00")
+ call checkfmt("(ru,en15.0)", 100.0, 4_" 100.E+00")
+ call checkfmt("(rd,en15.0)", 100.000008, 4_" 100.E+00")
+ call checkfmt("(rd,en15.0)", 99.9999924, 4_" 99.E+00")
+ call checkfmt("(rd,en15.0)", 1000.0, 4_" 1.E+03")
+ call checkfmt("(rd,en15.0)", 1000.00006, 4_" 1.E+03")
+ call checkfmt("(rd,en15.0)", 999.999939, 4_" 999.E+00")
+ call checkfmt("(rd,en15.0)", 9.5, 4_" 9.E+00")
+ call checkfmt("(rd,en15.0)", 9.50000095, 4_" 9.E+00")
+ call checkfmt("(rd,en15.0)", 9.49999905, 4_" 9.E+00")
+ call checkfmt("(rd,en15.0)", 99.5, 4_" 99.E+00")
+ call checkfmt("(rd,en15.0)", 99.5000076, 4_" 99.E+00")
+ call checkfmt("(rd,en15.0)", 99.4999924, 4_" 99.E+00")
+ call checkfmt("(rd,en15.0)", 999.5, 4_" 999.E+00")
+ call checkfmt("(rd,en15.0)", 999.500061, 4_" 999.E+00")
+ call checkfmt("(rd,en15.0)", 999.499939, 4_" 999.E+00")
+ call checkfmt("(rd,en15.0)", 9500.0, 4_" 9.E+03")
+ call checkfmt("(rd,en15.0)", 9500.00098, 4_" 9.E+03")
+ call checkfmt("(rd,en15.0)", 9499.99902, 4_" 9.E+03")
+ call checkfmt("(rd,en15.1)", 9950.0, 4_" 9.9E+03")
+ call checkfmt("(rd,en15.2)", 9995.0, 4_" 9.99E+03")
+ call checkfmt("(rd,en15.3)", 9999.5, 4_" 9.999E+03")
+ call checkfmt("(rd,en15.1)", 9.5, 4_" 9.5E+00")
+ call checkfmt("(rd,en15.1)", 9.50000095, 4_" 9.5E+00")
+ call checkfmt("(rd,en15.1)", 9.49999905, 4_" 9.4E+00")
+ call checkfmt("(rd,en15.1)", 0.099951, 4_" 99.9E-03")
+ call checkfmt("(rd,en15.1)", 0.009951, 4_" 9.9E-03")
+ call checkfmt("(rd,en15.1)", 0.000999951,4_" 999.9E-06")
+
+ call checkfmt("(rd,en15.0)", -1.0, 4_" -1.E+00")
+ call checkfmt("(rd,en15.0)", -1.00000012, 4_" -2.E+00")
+ call checkfmt("(rd,en15.0)", -0.99999994, 4_" -1.E+00")
+ call checkfmt("(rd,en15.0)", -10.0, 4_" -10.E+00")
+ call checkfmt("(rd,en15.0)", -10.0000010, 4_" -11.E+00")
+ call checkfmt("(rd,en15.0)", -9.99999905, 4_" -10.E+00")
+ call checkfmt("(rd,en15.0)", -100.0, 4_" -100.E+00")
+ call checkfmt("(rd,en15.0)", -100.000008, 4_" -101.E+00")
+ call checkfmt("(rd,en15.0)", -99.9999924, 4_" -100.E+00")
+ call checkfmt("(rd,en15.0)", -1000.0, 4_" -1.E+03")
+ call checkfmt("(rd,en15.0)", -1000.00006, 4_" -2.E+03")
+ call checkfmt("(rd,en15.0)", -999.999939, 4_" -1.E+03")
+ call checkfmt("(rd,en15.0)", -9.5, 4_" -10.E+00")
+ call checkfmt("(rd,en15.0)", -9.50000095, 4_" -10.E+00")
+ call checkfmt("(rd,en15.0)", -9.49999905, 4_" -10.E+00")
+ call checkfmt("(rd,en15.0)", -99.5, 4_" -100.E+00")
+ call checkfmt("(rd,en15.0)", -99.5000076, 4_" -100.E+00")
+ call checkfmt("(rd,en15.0)", -99.4999924, 4_" -100.E+00")
+ call checkfmt("(rd,en15.0)", -999.5, 4_" -1.E+03")
+ call checkfmt("(rd,en15.0)", -999.500061, 4_" -1.E+03")
+ call checkfmt("(rd,en15.0)", -999.499939, 4_" -1.E+03")
+ call checkfmt("(rd,en15.0)", -9500.0, 4_" -10.E+03")
+ call checkfmt("(rd,en15.0)", -9500.00098, 4_" -10.E+03")
+ call checkfmt("(rd,en15.0)", -9499.99902, 4_" -10.E+03")
+ call checkfmt("(rd,en15.1)", -9950.0, 4_" -10.0E+03")
+ call checkfmt("(rd,en15.2)", -9995.0, 4_" -10.00E+03")
+ call checkfmt("(rd,en15.3)", -9999.5, 4_" -10.000E+03")
+ call checkfmt("(rd,en15.1)", -9.5, 4_" -9.5E+00")
+ call checkfmt("(rd,en15.1)", -9.50000095, 4_" -9.6E+00")
+ call checkfmt("(rd,en15.1)", -9.49999905, 4_" -9.5E+00")
+ call checkfmt("(rd,en15.1)", -0.099951, 4_" -100.0E-03")
+ call checkfmt("(rd,en15.1)", -0.009951, 4_" -10.0E-03")
+ call checkfmt("(rd,en15.1)", -0.000999951,4_" -1.0E-03")
+
+ call checkfmt("(rd,en15.1)", 987350., 4_" 987.3E+03")
+ call checkfmt("(rd,en15.2)", 98735., 4_" 98.73E+03")
+ call checkfmt("(rd,en15.3)", 9873.5, 4_" 9.873E+03")
+ call checkfmt("(rd,en15.1)", 987650., 4_" 987.6E+03")
+ call checkfmt("(rd,en15.2)", 98765., 4_" 98.76E+03")
+ call checkfmt("(rd,en15.3)", 9876.5, 4_" 9.876E+03")
+ call checkfmt("(rd,en15.1)", 3.125E-02, 4_" 31.2E-03")
+ call checkfmt("(rd,en15.1)", 9.375E-02, 4_" 93.7E-03")
+ call checkfmt("(rd,en15.2)", 1.5625E-02, 4_" 15.62E-03")
+ call checkfmt("(rd,en15.2)", 4.6875E-02, 4_" 46.87E-03")
+ call checkfmt("(rd,en15.3)", 7.8125E-03, 4_" 7.812E-03")
+ call checkfmt("(rd,en15.3)", 2.34375E-02, 4_" 23.437E-03")
+ call checkfmt("(rd,en15.3)", 9.765625E-04,4_" 976.562E-06")
+ call checkfmt("(rd,en15.6)", 2.9296875E-03,4_" 2.929687E-03")
+
+ call checkfmt("(rd,en15.1)", -987350., 4_" -987.4E+03")
+ call checkfmt("(rd,en15.2)", -98735., 4_" -98.74E+03")
+ call checkfmt("(rd,en15.3)", -9873.5, 4_" -9.874E+03")
+ call checkfmt("(rd,en15.1)", -987650., 4_" -987.7E+03")
+ call checkfmt("(rd,en15.2)", -98765., 4_" -98.77E+03")
+ call checkfmt("(rd,en15.3)", -9876.5, 4_" -9.877E+03")
+ call checkfmt("(rd,en15.1)", -3.125E-02, 4_" -31.3E-03")
+ call checkfmt("(rd,en15.1)", -9.375E-02, 4_" -93.8E-03")
+ call checkfmt("(rd,en15.2)", -1.5625E-02, 4_" -15.63E-03")
+ call checkfmt("(rd,en15.2)", -4.6875E-02, 4_" -46.88E-03")
+ call checkfmt("(rd,en15.3)", -7.8125E-03, 4_" -7.813E-03")
+ call checkfmt("(rd,en15.3)", -2.34375E-02, 4_" -23.438E-03")
+ call checkfmt("(rd,en15.3)", -9.765625E-04,4_" -976.563E-06")
+ call checkfmt("(rd,en15.6)", -2.9296875E-03,4_" -2.929688E-03")
+
+ print *, n_tst, n_cnt, n_skip
+ if (n_cnt /= 0) stop n_cnt
+ if (all(.not. l_skip)) print *, "All kinds rounded down"
+
+contains
+ subroutine checkfmt(fmt, x, cmp)
+ implicit none
+ integer :: i
+ character(len=*), intent(in) :: fmt
+ real, intent(in) :: x
+ character(len=*, kind=4), intent(in) :: cmp
+ do i=1,size(real_kinds)
+ if (l_skip(i)) cycle
+ if (i == 1) then
+ write(s, fmt) real(x,kind=j(1))
+ else if (i == 2) then
+ write(s, fmt) real(x,kind=j(2))
+ else if (i == 3) then
+ write(s, fmt) real(x,kind=j(3))
+ else if (i == 4) then
+ write(s, fmt) real(x,kind=j(4))
+ end if
+ n_tst = n_tst + 1
+ if (s /= cmp) then
+ if (l_skip(i)) then
+ n_skip = n_skip + 1
+ else
+ print "(a,1x,a,' expected: ',1x,a)", fmt, s, cmp
+ n_cnt = n_cnt + 1
+ end if
+ end if
+ end do
+
+ end subroutine
+end program
+! { dg-output "All kinds rounded down" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
+! { dg-final { cleanup-saved-temps } }
diff --git a/gcc/testsuite/gfortran.dg/fmt_en_rn.f90 b/gcc/testsuite/gfortran.dg/fmt_en_rn.f90
new file mode 100644
index 00000000000..b0ada5c672d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/fmt_en_rn.f90
@@ -0,0 +1,185 @@
+! { dg-do run }
+! PR60128 Invalid outputs with EN descriptors
+! Test case provided by Walt Brainerd.
+program pr60128
+use ISO_FORTRAN_ENV
+ implicit none
+ integer, parameter :: j(size(real_kinds)+4)=[REAL_KINDS, [4, 4, 4, 4]]
+ logical :: l_skip(4) = .false.
+ integer :: i
+ integer :: n_tst = 0, n_cnt = 0, n_skip = 0
+ character(len=20,kind=4) :: s, s1
+
+! Check that the default rounding mode is to nearest and to even on tie.
+ do i=1,size(real_kinds)
+ if (i == 1) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(1)), &
+ real(9.49999905,kind=j(1)), &
+ real(9.5,kind=j(1)), real(8.5,kind=j(1))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(1)), &
+ real(98765.0,kind=j(1))
+ else if (i == 2) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(2)), &
+ real(9.49999905,kind=j(2)), &
+ real(9.5,kind=j(2)), real(8.5,kind=j(2))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(2)), &
+ real(98765.0,kind=j(2))
+ else if (i == 3) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(3)), &
+ real(9.49999905,kind=j(3)), &
+ real(9.5,kind=j(3)), real(8.5,kind=j(3))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(3)), &
+ real(98765.0,kind=j(3))
+ else if (i == 4) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(4)), &
+ real(9.49999905,kind=j(4)), &
+ real(9.5,kind=j(4)), real(8.5,kind=j(4))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(4)), &
+ real(98765.0,kind=j(4))
+ end if
+ if (s /= 4_'-9.5 9.5 10. 8.' .or. s1 /= 4_' 987.4E+03 98.76E+03') then
+ l_skip(i) = .true.
+ print "('Unsupported rounding for real(',i0,')')", j(i)
+ end if
+ end do
+
+
+! Original test.
+ call checkfmt("(en15.2)", -.44444, 4_" -444.44E-03")
+
+! Test for the bug in comment 6.
+ call checkfmt("(rn,en15.0)", 1.0, 4_" 1.E+00")
+ call checkfmt("(rn,en15.0)", 1.00000012, 4_" 1.E+00")
+ call checkfmt("(rn,en15.0)", 0.99999994, 4_" 1.E+00")
+ call checkfmt("(rn,en15.0)", 10.0, 4_" 10.E+00")
+ call checkfmt("(rn,en15.0)", 10.0000010, 4_" 10.E+00")
+ call checkfmt("(rn,en15.0)", 9.99999905, 4_" 10.E+00")
+ call checkfmt("(rn,en15.0)", 100.0, 4_" 100.E+00")
+ call checkfmt("(rn,en15.0)", 100.000008, 4_" 100.E+00")
+ call checkfmt("(rn,en15.0)", 99.9999924, 4_" 100.E+00")
+ call checkfmt("(rn,en15.0)", 1000.0, 4_" 1.E+03")
+ call checkfmt("(rn,en15.0)", 1000.00006, 4_" 1.E+03")
+ call checkfmt("(rn,en15.0)", 999.999939, 4_" 1.E+03")
+ call checkfmt("(rn,en15.0)", 9.5, 4_" 10.E+00")
+ call checkfmt("(rn,en15.0)", 9.50000095, 4_" 10.E+00")
+ call checkfmt("(rn,en15.0)", 9.49999905, 4_" 9.E+00")
+ call checkfmt("(rn,en15.0)", 99.5, 4_" 100.E+00")
+ call checkfmt("(rn,en15.0)", 99.5000076, 4_" 100.E+00")
+ call checkfmt("(rn,en15.0)", 99.4999924, 4_" 99.E+00")
+ call checkfmt("(rn,en15.0)", 999.5, 4_" 1.E+03")
+ call checkfmt("(rn,en15.0)", 999.500061, 4_" 1.E+03")
+ call checkfmt("(rn,en15.0)", 999.499939, 4_" 999.E+00")
+ call checkfmt("(rn,en15.0)", 9500.0, 4_" 10.E+03")
+ call checkfmt("(rn,en15.0)", 9500.00098, 4_" 10.E+03")
+ call checkfmt("(rn,en15.0)", 9499.99902, 4_" 9.E+03")
+ call checkfmt("(rn,en15.1)", 9950.0, 4_" 10.0E+03")
+ call checkfmt("(rn,en15.2)", 9995.0, 4_" 10.00E+03")
+ call checkfmt("(rn,en15.3)", 9999.5, 4_" 10.000E+03")
+ call checkfmt("(rn,en15.1)", 9.5, 4_" 9.5E+00")
+ call checkfmt("(rn,en15.1)", 9.50000095, 4_" 9.5E+00")
+ call checkfmt("(rn,en15.1)", 9.49999905, 4_" 9.5E+00")
+ call checkfmt("(rn,en15.1)", 0.099951, 4_" 100.0E-03")
+ call checkfmt("(rn,en15.1)", 0.009951, 4_" 10.0E-03")
+ call checkfmt("(rn,en15.1)", 0.000999951,4_" 1.0E-03")
+
+ call checkfmt("(rn,en15.0)", -1.0, 4_" -1.E+00")
+ call checkfmt("(rn,en15.0)", -1.00000012, 4_" -1.E+00")
+ call checkfmt("(rn,en15.0)", -0.99999994, 4_" -1.E+00")
+ call checkfmt("(rn,en15.0)", -10.0, 4_" -10.E+00")
+ call checkfmt("(rn,en15.0)", -10.0000010, 4_" -10.E+00")
+ call checkfmt("(rn,en15.0)", -9.99999905, 4_" -10.E+00")
+ call checkfmt("(rn,en15.0)", -100.0, 4_" -100.E+00")
+ call checkfmt("(rn,en15.0)", -100.000008, 4_" -100.E+00")
+ call checkfmt("(rn,en15.0)", -99.9999924, 4_" -100.E+00")
+ call checkfmt("(rn,en15.0)", -1000.0, 4_" -1.E+03")
+ call checkfmt("(rn,en15.0)", -1000.00006, 4_" -1.E+03")
+ call checkfmt("(rn,en15.0)", -999.999939, 4_" -1.E+03")
+ call checkfmt("(rn,en15.0)", -9.5, 4_" -10.E+00")
+ call checkfmt("(rn,en15.0)", -9.50000095, 4_" -10.E+00")
+ call checkfmt("(rn,en15.0)", -9.49999905, 4_" -9.E+00")
+ call checkfmt("(rn,en15.0)", -99.5, 4_" -100.E+00")
+ call checkfmt("(rn,en15.0)", -99.5000076, 4_" -100.E+00")
+ call checkfmt("(rn,en15.0)", -99.4999924, 4_" -99.E+00")
+ call checkfmt("(rn,en15.0)", -999.5, 4_" -1.E+03")
+ call checkfmt("(rn,en15.0)", -999.500061, 4_" -1.E+03")
+ call checkfmt("(rn,en15.0)", -999.499939, 4_" -999.E+00")
+ call checkfmt("(rn,en15.0)", -9500.0, 4_" -10.E+03")
+ call checkfmt("(rn,en15.0)", -9500.00098, 4_" -10.E+03")
+ call checkfmt("(rn,en15.0)", -9499.99902, 4_" -9.E+03")
+ call checkfmt("(rn,en15.1)", -9950.0, 4_" -10.0E+03")
+ call checkfmt("(rn,en15.2)", -9995.0, 4_" -10.00E+03")
+ call checkfmt("(rn,en15.3)", -9999.5, 4_" -10.000E+03")
+ call checkfmt("(rn,en15.1)", -9.5, 4_" -9.5E+00")
+ call checkfmt("(rn,en15.1)", -9.50000095, 4_" -9.5E+00")
+ call checkfmt("(rn,en15.1)", -9.49999905, 4_" -9.5E+00")
+ call checkfmt("(rn,en15.1)", -0.099951, 4_" -100.0E-03")
+ call checkfmt("(rn,en15.1)", -0.009951, 4_" -10.0E-03")
+ call checkfmt("(rn,en15.1)", -0.000999951,4_" -1.0E-03")
+
+ call checkfmt("(rn,en15.1)", 987350., 4_" 987.4E+03")
+ call checkfmt("(rn,en15.2)", 98735., 4_" 98.74E+03")
+ call checkfmt("(rn,en15.3)", 9873.5, 4_" 9.874E+03")
+ call checkfmt("(rn,en15.1)", 987650., 4_" 987.6E+03")
+ call checkfmt("(rn,en15.2)", 98765., 4_" 98.76E+03")
+ call checkfmt("(rn,en15.3)", 9876.5, 4_" 9.876E+03")
+ call checkfmt("(rn,en15.1)", 3.125E-02, 4_" 31.2E-03")
+ call checkfmt("(rn,en15.1)", 9.375E-02, 4_" 93.8E-03")
+ call checkfmt("(rn,en15.2)", 1.5625E-02, 4_" 15.62E-03")
+ call checkfmt("(rn,en15.2)", 4.6875E-02, 4_" 46.88E-03")
+ call checkfmt("(rn,en15.3)", 7.8125E-03, 4_" 7.812E-03")
+ call checkfmt("(rn,en15.3)", 2.34375E-02, 4_" 23.438E-03")
+ call checkfmt("(rn,en15.3)", 9.765625E-04,4_" 976.562E-06")
+ call checkfmt("(rn,en15.6)", 2.9296875E-03,4_" 2.929688E-03")
+
+ call checkfmt("(rn,en15.1)", -987350., 4_" -987.4E+03")
+ call checkfmt("(rn,en15.2)", -98735., 4_" -98.74E+03")
+ call checkfmt("(rn,en15.3)", -9873.5, 4_" -9.874E+03")
+ call checkfmt("(rn,en15.1)", -987650., 4_" -987.6E+03")
+ call checkfmt("(rn,en15.2)", -98765., 4_" -98.76E+03")
+ call checkfmt("(rn,en15.3)", -9876.5, 4_" -9.876E+03")
+ call checkfmt("(rn,en15.1)", -3.125E-02, 4_" -31.2E-03")
+ call checkfmt("(rn,en15.1)", -9.375E-02, 4_" -93.8E-03")
+ call checkfmt("(rn,en15.2)", -1.5625E-02, 4_" -15.62E-03")
+ call checkfmt("(rn,en15.2)", -4.6875E-02, 4_" -46.88E-03")
+ call checkfmt("(rn,en15.3)", -7.8125E-03, 4_" -7.812E-03")
+ call checkfmt("(rn,en15.3)", -2.34375E-02, 4_" -23.438E-03")
+ call checkfmt("(rn,en15.3)", -9.765625E-04,4_" -976.562E-06")
+ call checkfmt("(rn,en15.6)", -2.9296875E-03,4_" -2.929688E-03")
+
+ print *, n_tst, n_cnt, n_skip
+ if (n_cnt /= 0) stop n_cnt
+ if (all(.not. l_skip)) print *, "All kinds rounded to nearest"
+
+contains
+ subroutine checkfmt(fmt, x, cmp)
+ implicit none
+ integer :: i
+ character(len=*), intent(in) :: fmt
+ real, intent(in) :: x
+ character(len=*, kind=4), intent(in) :: cmp
+ do i=1,size(real_kinds)
+ if (l_skip(i)) cycle
+ if (i == 1) then
+ write(s, fmt) real(x,kind=j(1))
+ else if (i == 2) then
+ write(s, fmt) real(x,kind=j(2))
+ else if (i == 3) then
+ write(s, fmt) real(x,kind=j(3))
+ else if (i == 4) then
+ write(s, fmt) real(x,kind=j(4))
+ end if
+ n_tst = n_tst + 1
+ if (s /= cmp) then
+ if (l_skip(i)) then
+ n_skip = n_skip + 1
+ else
+ print "(a,1x,a,' expected: ',1x,a)", fmt, s, cmp
+ n_cnt = n_cnt + 1
+ end if
+ end if
+ end do
+
+ end subroutine
+end program
+! { dg-output "All kinds rounded to nearest" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
+! { dg-final { cleanup-saved-temps } }
diff --git a/gcc/testsuite/gfortran.dg/fmt_en_ru.f90 b/gcc/testsuite/gfortran.dg/fmt_en_ru.f90
new file mode 100644
index 00000000000..7834e2880bd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/fmt_en_ru.f90
@@ -0,0 +1,185 @@
+! { dg-do run }
+! PR60128 Invalid outputs with EN descriptors
+! Test case provided by Walt Brainerd.
+program pr60128
+use ISO_FORTRAN_ENV
+ implicit none
+ integer, parameter :: j(size(real_kinds)+4)=[REAL_KINDS, [4, 4, 4, 4]]
+ logical :: l_skip(4) = .false.
+ integer :: i
+ integer :: n_tst = 0, n_cnt = 0, n_skip = 0
+ character(len=20,kind=4) :: s, s1
+
+! Check that the default rounding mode is to nearest and to even on tie.
+ do i=1,size(real_kinds)
+ if (i == 1) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(1)), &
+ real(9.49999905,kind=j(1)), &
+ real(9.5,kind=j(1)), real(8.5,kind=j(1))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(1)), &
+ real(98765.0,kind=j(1))
+ else if (i == 2) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(2)), &
+ real(9.49999905,kind=j(2)), &
+ real(9.5,kind=j(2)), real(8.5,kind=j(2))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(2)), &
+ real(98765.0,kind=j(2))
+ else if (i == 3) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(3)), &
+ real(9.49999905,kind=j(3)), &
+ real(9.5,kind=j(3)), real(8.5,kind=j(3))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(3)), &
+ real(98765.0,kind=j(3))
+ else if (i == 4) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(4)), &
+ real(9.49999905,kind=j(4)), &
+ real(9.5,kind=j(4)), real(8.5,kind=j(4))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(4)), &
+ real(98765.0,kind=j(4))
+ end if
+ if (s /= 4_'-9.5 9.5 10. 8.' .or. s1 /= 4_' 987.4E+03 98.76E+03') then
+ l_skip(i) = .true.
+ print "('Unsupported rounding for real(',i0,')')", j(i)
+ end if
+ end do
+
+
+! Original test.
+ call checkfmt("(en15.2)", -.44444, 4_" -444.44E-03")
+
+! Test for the bug in comment 6.
+ call checkfmt("(ru,en15.0)", 1.0, 4_" 1.E+00")
+ call checkfmt("(ru,en15.0)", 1.00000012, 4_" 2.E+00")
+ call checkfmt("(ru,en15.0)", 0.99999994, 4_" 1.E+00")
+ call checkfmt("(ru,en15.0)", 10.0, 4_" 10.E+00")
+ call checkfmt("(ru,en15.0)", 10.0000010, 4_" 11.E+00")
+ call checkfmt("(ru,en15.0)", 9.99999905, 4_" 10.E+00")
+ call checkfmt("(ru,en15.0)", 100.0, 4_" 100.E+00")
+ call checkfmt("(ru,en15.0)", 100.000008, 4_" 101.E+00")
+ call checkfmt("(ru,en15.0)", 99.9999924, 4_" 100.E+00")
+ call checkfmt("(ru,en15.0)", 1000.0, 4_" 1.E+03")
+ call checkfmt("(ru,en15.0)", 1000.00006, 4_" 2.E+03")
+ call checkfmt("(ru,en15.0)", 999.999939, 4_" 1.E+03")
+ call checkfmt("(ru,en15.0)", 9.5, 4_" 10.E+00")
+ call checkfmt("(ru,en15.0)", 9.50000095, 4_" 10.E+00")
+ call checkfmt("(ru,en15.0)", 9.49999905, 4_" 10.E+00")
+ call checkfmt("(ru,en15.0)", 99.5, 4_" 100.E+00")
+ call checkfmt("(ru,en15.0)", 99.5000076, 4_" 100.E+00")
+ call checkfmt("(ru,en15.0)", 99.4999924, 4_" 100.E+00")
+ call checkfmt("(ru,en15.0)", 999.5, 4_" 1.E+03")
+ call checkfmt("(ru,en15.0)", 999.500061, 4_" 1.E+03")
+ call checkfmt("(ru,en15.0)", 999.499939, 4_" 1.E+03")
+ call checkfmt("(ru,en15.0)", 9500.0, 4_" 10.E+03")
+ call checkfmt("(ru,en15.0)", 9500.00098, 4_" 10.E+03")
+ call checkfmt("(ru,en15.0)", 9499.99902, 4_" 10.E+03")
+ call checkfmt("(ru,en15.1)", 9950.0, 4_" 10.0E+03")
+ call checkfmt("(ru,en15.2)", 9995.0, 4_" 10.00E+03")
+ call checkfmt("(ru,en15.3)", 9999.5, 4_" 10.000E+03")
+ call checkfmt("(ru,en15.1)", 9.5, 4_" 9.5E+00")
+ call checkfmt("(ru,en15.1)", 9.50000095, 4_" 9.6E+00")
+ call checkfmt("(ru,en15.1)", 9.49999905, 4_" 9.5E+00")
+ call checkfmt("(ru,en15.1)", 0.099951, 4_" 100.0E-03")
+ call checkfmt("(ru,en15.1)", 0.009951, 4_" 10.0E-03")
+ call checkfmt("(ru,en15.1)", 0.000999951,4_" 1.0E-03")
+
+ call checkfmt("(ru,en15.0)", -1.0, 4_" -1.E+00")
+ call checkfmt("(ru,en15.0)", -1.00000012, 4_" -1.E+00")
+ call checkfmt("(ru,en15.0)", -0.99999994, 4_" -999.E-03")
+ call checkfmt("(ru,en15.0)", -10.0, 4_" -10.E+00")
+ call checkfmt("(ru,en15.0)", -10.0000010, 4_" -10.E+00")
+ call checkfmt("(ru,en15.0)", -9.99999905, 4_" -9.E+00")
+ call checkfmt("(ru,en15.0)", -100.0, 4_" -100.E+00")
+ call checkfmt("(ru,en15.0)", -100.000008, 4_" -100.E+00")
+ call checkfmt("(ru,en15.0)", -99.9999924, 4_" -99.E+00")
+ call checkfmt("(ru,en15.0)", -1000.0, 4_" -1.E+03")
+ call checkfmt("(ru,en15.0)", -1000.00006, 4_" -1.E+03")
+ call checkfmt("(ru,en15.0)", -999.999939, 4_" -999.E+00")
+ call checkfmt("(ru,en15.0)", -9.5, 4_" -9.E+00")
+ call checkfmt("(ru,en15.0)", -9.50000095, 4_" -9.E+00")
+ call checkfmt("(ru,en15.0)", -9.49999905, 4_" -9.E+00")
+ call checkfmt("(ru,en15.0)", -99.5, 4_" -99.E+00")
+ call checkfmt("(ru,en15.0)", -99.5000076, 4_" -99.E+00")
+ call checkfmt("(ru,en15.0)", -99.4999924, 4_" -99.E+00")
+ call checkfmt("(ru,en15.0)", -999.5, 4_" -999.E+00")
+ call checkfmt("(ru,en15.0)", -999.500061, 4_" -999.E+00")
+ call checkfmt("(ru,en15.0)", -999.499939, 4_" -999.E+00")
+ call checkfmt("(ru,en15.0)", -9500.0, 4_" -9.E+03")
+ call checkfmt("(ru,en15.0)", -9500.00098, 4_" -9.E+03")
+ call checkfmt("(ru,en15.0)", -9499.99902, 4_" -9.E+03")
+ call checkfmt("(ru,en15.1)", -9950.0, 4_" -9.9E+03")
+ call checkfmt("(ru,en15.2)", -9995.0, 4_" -9.99E+03")
+ call checkfmt("(ru,en15.3)", -9999.5, 4_" -9.999E+03")
+ call checkfmt("(ru,en15.1)", -9.5, 4_" -9.5E+00")
+ call checkfmt("(ru,en15.1)", -9.50000095, 4_" -9.5E+00")
+ call checkfmt("(ru,en15.1)", -9.49999905, 4_" -9.4E+00")
+ call checkfmt("(ru,en15.1)", -0.099951, 4_" -99.9E-03")
+ call checkfmt("(ru,en15.1)", -0.009951, 4_" -9.9E-03")
+ call checkfmt("(ru,en15.1)", -0.000999951,4_" -999.9E-06")
+
+ call checkfmt("(ru,en15.1)", 987350., 4_" 987.4E+03")
+ call checkfmt("(ru,en15.2)", 98735., 4_" 98.74E+03")
+ call checkfmt("(ru,en15.3)", 9873.5, 4_" 9.874E+03")
+ call checkfmt("(ru,en15.1)", 987650., 4_" 987.7E+03")
+ call checkfmt("(ru,en15.2)", 98765., 4_" 98.77E+03")
+ call checkfmt("(ru,en15.3)", 9876.5, 4_" 9.877E+03")
+ call checkfmt("(ru,en15.1)", 3.125E-02, 4_" 31.3E-03")
+ call checkfmt("(ru,en15.1)", 9.375E-02, 4_" 93.8E-03")
+ call checkfmt("(ru,en15.2)", 1.5625E-02, 4_" 15.63E-03")
+ call checkfmt("(ru,en15.2)", 4.6875E-02, 4_" 46.88E-03")
+ call checkfmt("(ru,en15.3)", 7.8125E-03, 4_" 7.813E-03")
+ call checkfmt("(ru,en15.3)", 2.34375E-02, 4_" 23.438E-03")
+ call checkfmt("(ru,en15.3)", 9.765625E-04,4_" 976.563E-06")
+ call checkfmt("(ru,en15.6)", 2.9296875E-03,4_" 2.929688E-03")
+
+ call checkfmt("(ru,en15.1)", -987350., 4_" -987.3E+03")
+ call checkfmt("(ru,en15.2)", -98735., 4_" -98.73E+03")
+ call checkfmt("(ru,en15.3)", -9873.5, 4_" -9.873E+03")
+ call checkfmt("(ru,en15.1)", -987650., 4_" -987.6E+03")
+ call checkfmt("(ru,en15.2)", -98765., 4_" -98.76E+03")
+ call checkfmt("(ru,en15.3)", -9876.5, 4_" -9.876E+03")
+ call checkfmt("(ru,en15.1)", -3.125E-02, 4_" -31.2E-03")
+ call checkfmt("(ru,en15.1)", -9.375E-02, 4_" -93.7E-03")
+ call checkfmt("(ru,en15.2)", -1.5625E-02, 4_" -15.62E-03")
+ call checkfmt("(ru,en15.2)", -4.6875E-02, 4_" -46.87E-03")
+ call checkfmt("(ru,en15.3)", -7.8125E-03, 4_" -7.812E-03")
+ call checkfmt("(ru,en15.3)", -2.34375E-02, 4_" -23.437E-03")
+ call checkfmt("(ru,en15.3)", -9.765625E-04,4_" -976.562E-06")
+ call checkfmt("(ru,en15.6)", -2.9296875E-03,4_" -2.929687E-03")
+
+ print *, n_tst, n_cnt, n_skip
+ if (n_cnt /= 0) stop n_cnt
+ if (all(.not. l_skip)) print *, "All kinds rounded up"
+
+contains
+ subroutine checkfmt(fmt, x, cmp)
+ implicit none
+ integer :: i
+ character(len=*), intent(in) :: fmt
+ real, intent(in) :: x
+ character(len=*, kind=4), intent(in) :: cmp
+ do i=1,size(real_kinds)
+ if (l_skip(i)) cycle
+ if (i == 1) then
+ write(s, fmt) real(x,kind=j(1))
+ else if (i == 2) then
+ write(s, fmt) real(x,kind=j(2))
+ else if (i == 3) then
+ write(s, fmt) real(x,kind=j(3))
+ else if (i == 4) then
+ write(s, fmt) real(x,kind=j(4))
+ end if
+ n_tst = n_tst + 1
+ if (s /= cmp) then
+ if (l_skip(i)) then
+ n_skip = n_skip + 1
+ else
+ print "(a,1x,a,' expected: ',1x,a)", fmt, s, cmp
+ n_cnt = n_cnt + 1
+ end if
+ end if
+ end do
+
+ end subroutine
+end program
+! { dg-output "All kinds rounded up" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
+! { dg-final { cleanup-saved-temps } }
diff --git a/gcc/testsuite/gfortran.dg/fmt_en_rz.f90 b/gcc/testsuite/gfortran.dg/fmt_en_rz.f90
new file mode 100644
index 00000000000..c07847cad6d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/fmt_en_rz.f90
@@ -0,0 +1,185 @@
+! { dg-do run }
+! PR60128 Invalid outputs with EN descriptors
+! Test case provided by Walt Brainerd.
+program pr60128
+use ISO_FORTRAN_ENV
+ implicit none
+ integer, parameter :: j(size(real_kinds)+4)=[REAL_KINDS, [4, 4, 4, 4]]
+ logical :: l_skip(4) = .false.
+ integer :: i
+ integer :: n_tst = 0, n_cnt = 0, n_skip = 0
+ character(len=20,kind=4) :: s, s1
+
+! Check that the default rounding mode is to nearest and to even on tie.
+ do i=1,size(real_kinds)
+ if (i == 1) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(1)), &
+ real(9.49999905,kind=j(1)), &
+ real(9.5,kind=j(1)), real(8.5,kind=j(1))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(1)), &
+ real(98765.0,kind=j(1))
+ else if (i == 2) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(2)), &
+ real(9.49999905,kind=j(2)), &
+ real(9.5,kind=j(2)), real(8.5,kind=j(2))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(2)), &
+ real(98765.0,kind=j(2))
+ else if (i == 3) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(3)), &
+ real(9.49999905,kind=j(3)), &
+ real(9.5,kind=j(3)), real(8.5,kind=j(3))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(3)), &
+ real(98765.0,kind=j(3))
+ else if (i == 4) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(4)), &
+ real(9.49999905,kind=j(4)), &
+ real(9.5,kind=j(4)), real(8.5,kind=j(4))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(4)), &
+ real(98765.0,kind=j(4))
+ end if
+ if (s /= 4_'-9.5 9.5 10. 8.' .or. s1 /= 4_' 987.4E+03 98.76E+03') then
+ l_skip(i) = .true.
+ print "('Unsupported rounding for real(',i0,')')", j(i)
+ end if
+ end do
+
+
+! Original test.
+ call checkfmt("(en15.2)", -.44444, 4_" -444.44E-03")
+
+! Test for the bug in comment 6.
+ call checkfmt("(rz,en15.0)", 1.0, 4_" 1.E+00")
+ call checkfmt("(rz,en15.0)", 1.00000012, 4_" 1.E+00")
+ call checkfmt("(rz,en15.0)", 0.99999994, 4_" 999.E-03")
+ call checkfmt("(rz,en15.0)", 10.0, 4_" 10.E+00")
+ call checkfmt("(rz,en15.0)", 10.0000010, 4_" 10.E+00")
+ call checkfmt("(rz,en15.0)", 9.99999905, 4_" 9.E+00")
+ call checkfmt("(rz,en15.0)", 100.0, 4_" 100.E+00")
+ call checkfmt("(rz,en15.0)", 100.000008, 4_" 100.E+00")
+ call checkfmt("(rz,en15.0)", 99.9999924, 4_" 99.E+00")
+ call checkfmt("(rz,en15.0)", 1000.0, 4_" 1.E+03")
+ call checkfmt("(rz,en15.0)", 1000.00006, 4_" 1.E+03")
+ call checkfmt("(rz,en15.0)", 999.999939, 4_" 999.E+00")
+ call checkfmt("(rz,en15.0)", 9.5, 4_" 9.E+00")
+ call checkfmt("(rz,en15.0)", 9.50000095, 4_" 9.E+00")
+ call checkfmt("(rz,en15.0)", 9.49999905, 4_" 9.E+00")
+ call checkfmt("(rz,en15.0)", 99.5, 4_" 99.E+00")
+ call checkfmt("(rz,en15.0)", 99.5000076, 4_" 99.E+00")
+ call checkfmt("(rz,en15.0)", 99.4999924, 4_" 99.E+00")
+ call checkfmt("(rz,en15.0)", 999.5, 4_" 999.E+00")
+ call checkfmt("(rz,en15.0)", 999.500061, 4_" 999.E+00")
+ call checkfmt("(rz,en15.0)", 999.499939, 4_" 999.E+00")
+ call checkfmt("(rz,en15.0)", 9500.0, 4_" 9.E+03")
+ call checkfmt("(rz,en15.0)", 9500.00098, 4_" 9.E+03")
+ call checkfmt("(rz,en15.0)", 9499.99902, 4_" 9.E+03")
+ call checkfmt("(rz,en15.1)", 9950.0, 4_" 9.9E+03")
+ call checkfmt("(rz,en15.2)", 9995.0, 4_" 9.99E+03")
+ call checkfmt("(rz,en15.3)", 9999.5, 4_" 9.999E+03")
+ call checkfmt("(rz,en15.1)", 9.5, 4_" 9.5E+00")
+ call checkfmt("(rz,en15.1)", 9.50000095, 4_" 9.5E+00")
+ call checkfmt("(rz,en15.1)", 9.49999905, 4_" 9.4E+00")
+ call checkfmt("(rz,en15.1)", 0.099951, 4_" 99.9E-03")
+ call checkfmt("(rz,en15.1)", 0.009951, 4_" 9.9E-03")
+ call checkfmt("(rz,en15.1)", 0.000999951,4_" 999.9E-06")
+
+ call checkfmt("(rz,en15.0)", -1.0, 4_" -1.E+00")
+ call checkfmt("(rz,en15.0)", -1.00000012, 4_" -1.E+00")
+ call checkfmt("(rz,en15.0)", -0.99999994, 4_" -999.E-03")
+ call checkfmt("(rz,en15.0)", -10.0, 4_" -10.E+00")
+ call checkfmt("(rz,en15.0)", -10.0000010, 4_" -10.E+00")
+ call checkfmt("(rz,en15.0)", -9.99999905, 4_" -9.E+00")
+ call checkfmt("(rz,en15.0)", -100.0, 4_" -100.E+00")
+ call checkfmt("(rz,en15.0)", -100.000008, 4_" -100.E+00")
+ call checkfmt("(rz,en15.0)", -99.9999924, 4_" -99.E+00")
+ call checkfmt("(rz,en15.0)", -1000.0, 4_" -1.E+03")
+ call checkfmt("(rz,en15.0)", -1000.00006, 4_" -1.E+03")
+ call checkfmt("(rz,en15.0)", -999.999939, 4_" -999.E+00")
+ call checkfmt("(rz,en15.0)", -9.5, 4_" -9.E+00")
+ call checkfmt("(rz,en15.0)", -9.50000095, 4_" -9.E+00")
+ call checkfmt("(rz,en15.0)", -9.49999905, 4_" -9.E+00")
+ call checkfmt("(rz,en15.0)", -99.5, 4_" -99.E+00")
+ call checkfmt("(rz,en15.0)", -99.5000076, 4_" -99.E+00")
+ call checkfmt("(rz,en15.0)", -99.4999924, 4_" -99.E+00")
+ call checkfmt("(rz,en15.0)", -999.5, 4_" -999.E+00")
+ call checkfmt("(rz,en15.0)", -999.500061, 4_" -999.E+00")
+ call checkfmt("(rz,en15.0)", -999.499939, 4_" -999.E+00")
+ call checkfmt("(rz,en15.0)", -9500.0, 4_" -9.E+03")
+ call checkfmt("(rz,en15.0)", -9500.00098, 4_" -9.E+03")
+ call checkfmt("(rz,en15.0)", -9499.99902, 4_" -9.E+03")
+ call checkfmt("(rz,en15.1)", -9950.0, 4_" -9.9E+03")
+ call checkfmt("(rz,en15.2)", -9995.0, 4_" -9.99E+03")
+ call checkfmt("(rz,en15.3)", -9999.5, 4_" -9.999E+03")
+ call checkfmt("(rz,en15.1)", -9.5, 4_" -9.5E+00")
+ call checkfmt("(rz,en15.1)", -9.50000095, 4_" -9.5E+00")
+ call checkfmt("(rz,en15.1)", -9.49999905, 4_" -9.4E+00")
+ call checkfmt("(rz,en15.1)", -0.099951, 4_" -99.9E-03")
+ call checkfmt("(rz,en15.1)", -0.009951, 4_" -9.9E-03")
+ call checkfmt("(rz,en15.1)", -0.000999951,4_" -999.9E-06")
+
+ call checkfmt("(rz,en15.1)", 987350., 4_" 987.3E+03")
+ call checkfmt("(rz,en15.2)", 98735., 4_" 98.73E+03")
+ call checkfmt("(rz,en15.3)", 9873.5, 4_" 9.873E+03")
+ call checkfmt("(rz,en15.1)", 987650., 4_" 987.6E+03")
+ call checkfmt("(rz,en15.2)", 98765., 4_" 98.76E+03")
+ call checkfmt("(rz,en15.3)", 9876.5, 4_" 9.876E+03")
+ call checkfmt("(rz,en15.1)", 3.125E-02, 4_" 31.2E-03")
+ call checkfmt("(rz,en15.1)", 9.375E-02, 4_" 93.7E-03")
+ call checkfmt("(rz,en15.2)", 1.5625E-02, 4_" 15.62E-03")
+ call checkfmt("(rz,en15.2)", 4.6875E-02, 4_" 46.87E-03")
+ call checkfmt("(rz,en15.3)", 7.8125E-03, 4_" 7.812E-03")
+ call checkfmt("(rz,en15.3)", 2.34375E-02, 4_" 23.437E-03")
+ call checkfmt("(rz,en15.3)", 9.765625E-04,4_" 976.562E-06")
+ call checkfmt("(rz,en15.6)", 2.9296875E-03,4_" 2.929687E-03")
+
+ call checkfmt("(rz,en15.1)", -987350., 4_" -987.3E+03")
+ call checkfmt("(rz,en15.2)", -98735., 4_" -98.73E+03")
+ call checkfmt("(rz,en15.3)", -9873.5, 4_" -9.873E+03")
+ call checkfmt("(rz,en15.1)", -987650., 4_" -987.6E+03")
+ call checkfmt("(rz,en15.2)", -98765., 4_" -98.76E+03")
+ call checkfmt("(rz,en15.3)", -9876.5, 4_" -9.876E+03")
+ call checkfmt("(rz,en15.1)", -3.125E-02, 4_" -31.2E-03")
+ call checkfmt("(rz,en15.1)", -9.375E-02, 4_" -93.7E-03")
+ call checkfmt("(rz,en15.2)", -1.5625E-02, 4_" -15.62E-03")
+ call checkfmt("(rz,en15.2)", -4.6875E-02, 4_" -46.87E-03")
+ call checkfmt("(rz,en15.3)", -7.8125E-03, 4_" -7.812E-03")
+ call checkfmt("(rz,en15.3)", -2.34375E-02, 4_" -23.437E-03")
+ call checkfmt("(rz,en15.3)", -9.765625E-04,4_" -976.562E-06")
+ call checkfmt("(rz,en15.6)", -2.9296875E-03,4_" -2.929687E-03")
+
+ print *, n_tst, n_cnt, n_skip
+ if (n_cnt /= 0) stop n_cnt
+ if (all(.not. l_skip)) print *, "All kinds rounded to zero"
+
+contains
+ subroutine checkfmt(fmt, x, cmp)
+ implicit none
+ integer :: i
+ character(len=*), intent(in) :: fmt
+ real, intent(in) :: x
+ character(len=*, kind=4), intent(in) :: cmp
+ do i=1,size(real_kinds)
+ if (l_skip(i)) cycle
+ if (i == 1) then
+ write(s, fmt) real(x,kind=j(1))
+ else if (i == 2) then
+ write(s, fmt) real(x,kind=j(2))
+ else if (i == 3) then
+ write(s, fmt) real(x,kind=j(3))
+ else if (i == 4) then
+ write(s, fmt) real(x,kind=j(4))
+ end if
+ n_tst = n_tst + 1
+ if (s /= cmp) then
+ if (l_skip(i)) then
+ n_skip = n_skip + 1
+ else
+ print "(a,1x,a,' expected: ',1x,a)", fmt, s, cmp
+ n_cnt = n_cnt + 1
+ end if
+ end if
+ end do
+
+ end subroutine
+end program
+! { dg-output "All kinds rounded to zero" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
+! { dg-final { cleanup-saved-temps } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/attach-descriptor.f90 b/gcc/testsuite/gfortran.dg/goacc/attach-descriptor.f90
new file mode 100644
index 00000000000..373bdcb2114
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/attach-descriptor.f90
@@ -0,0 +1,29 @@
+! { dg-additional-options "-fdump-tree-original -fdump-tree-gimple" }
+
+program att
+ implicit none
+ type t
+ integer :: arr1(10)
+ integer, allocatable :: arr2(:)
+ end type t
+ type(t) :: myvar
+ integer, target :: tarr(10)
+ integer, pointer :: myptr(:)
+
+ !$acc enter data attach(myvar%arr2, myptr)
+! { dg-final { scan-tree-dump-times "(?n)#pragma acc enter data map\\(attach:myvar\\.arr2 \\\[bias: 0\\\]\\) map\\(to:myptr \\\[pointer set, len: \[0-9\]+\\\]\\) map\\(attach:\\(integer\\(kind=4\\)\\\[0:\\\] \\*\\) myptr\\.data \\\[bias: 0\\\]\\);$" 1 "original" } }
+! { dg-final { scan-tree-dump-times "(?n)#pragma omp target oacc_enter_exit_data map\\(attach:myvar\\.arr2 \\\[bias: 0\\\]\\) map\\(to:myptr \\\[pointer set, len: \[0-9\]+\\\]\\) map\\(attach:myptr\\.data \\\[bias: 0\\\]\\)$" 1 "gimple" } }
+
+ !$acc exit data detach(myvar%arr2, myptr)
+! { dg-final { scan-tree-dump-times "(?n)#pragma acc exit data map\\(detach:myvar\\.arr2 \\\[bias: 0\\\]\\) map\\(to:myptr \\\[pointer set, len: \[0-9\]+\\\]\\) map\\(detach:\\(integer\\(kind=4\\)\\\[0:\\\] \\*\\) myptr\\.data \\\[bias: 0\\\]\\);$" 1 "original" } }
+! { dg-final { scan-tree-dump-times "(?n)#pragma omp target oacc_enter_exit_data map\\(detach:myvar\\.arr2 \\\[bias: 0\\\]\\) map\\(to:myptr \\\[pointer set, len: \[0-9\]+\\\]\\) map\\(detach:myptr\\.data \\\[bias: 0\\\]\\)$" 1 "gimple" } }
+
+ ! Test valid usage and processing of the finalize clause.
+ !$acc exit data detach(myvar%arr2, myptr) finalize
+! { dg-final { scan-tree-dump-times "(?n)#pragma acc exit data map\\(detach:myvar\\.arr2 \\\[bias: 0\\\]\\) map\\(to:myptr \\\[pointer set, len: \[0-9\]+\\\]\\) map\\(detach:\\(integer\\(kind=4\\)\\\[0:\\\] \\*\\) myptr\\.data \\\[bias: 0\\\]\\) finalize;$" 1 "original" } }
+ ! For array-descriptor detaches, we no longer generate a "release" mapping
+ ! for the pointed-to data for gimplify.c to turn into "delete". Make sure
+ ! the mapping still isn't there.
+! { dg-final { scan-tree-dump-times "(?n)#pragma omp target oacc_enter_exit_data map\\(force_detach:myvar\\.arr2 \\\[bias: 0\\\]\\) map\\(to:myptr \\\[pointer set, len: \[0-9\]+\\\]\\) map\\(force_detach:myptr\\.data \\\[bias: 0\\\]\\) finalize$" 1 "gimple" } }
+
+end program att
diff --git a/gcc/testsuite/gfortran.dg/goacc/finalize-1.f b/gcc/testsuite/gfortran.dg/goacc/finalize-1.f
index 1e2e3e94b8a..a7788580819 100644
--- a/gcc/testsuite/gfortran.dg/goacc/finalize-1.f
+++ b/gcc/testsuite/gfortran.dg/goacc/finalize-1.f
@@ -20,8 +20,8 @@
! { dg-final { scan-tree-dump-times "(?n)#pragma omp target oacc_enter_exit_data map\\(delete:del_f \\\[len: \[0-9\]+\\\]\\) finalize$" 1 "gimple" } }
!$ACC EXIT DATA FINALIZE DELETE (del_f_p(2:5))
-! { dg-final { scan-tree-dump-times "(?n)#pragma acc exit data map\\(release:\\*\\(c_char \\*\\) parm\\.0\\.data \\\[len: \[^\\\]\]+\\\]\\) map\\(to:del_f_p \\\[pointer set, len: \[0-9\]+\\\]\\) map\\(alloc:\\(integer\\(kind=1\\)\\\[0:\\\] \\* restrict\\) del_f_p\\.data \\\[pointer assign, bias: \\(sizetype\\) parm\\.0\\.data - \\(sizetype\\) del_f_p\\.data\\\]\\) finalize;$" 1 "original" } }
-! { dg-final { scan-tree-dump-times "(?n)#pragma omp target oacc_enter_exit_data map\\(delete:MEM\\\[\\(c_char \\*\\)\[^\\\]\]+\\\] \\\[len: \[^\\\]\]+\\\]\\) finalize$" 1 "gimple" } }
+! { dg-final { scan-tree-dump-times "(?n)#pragma acc exit data map\\(release:\\*\\(c_char \\*\\) parm\\.0\\.data \\\[len: \[^\\\]\]+\\\]\\) map\\(to:del_f_p \\\[pointer set, len: \[0-9\]+\\\]\\) map\\(alloc:\\(integer\\(kind=1\\)\\\[0:\\\] \\* restrict\\) del_f_p\\.data \\\[pointer assign, bias: \\(.*int.*\\) parm\\.0\\.data - \\(.*int.*\\) del_f_p\\.data\\\]\\) finalize;$" 1 "original" } }
+! { dg-final { scan-tree-dump-times "(?n)#pragma omp target oacc_enter_exit_data map\\(delete:MEM\\\[\\(c_char \\*\\)\[^\\\]\]+\\\] \\\[len: \[^\\\]\]+\\\]\\) map\\(to:del_f_p \\\[pointer set, len: \[0-9\]+\\\]\\) map\\(alloc:del_f_p\\.data \\\[pointer assign, bias: \[^\\\]\]+\\\]\\) finalize$" 1 "gimple" } }
!$ACC EXIT DATA COPYOUT (cpo_r)
! { dg-final { scan-tree-dump-times "(?n)#pragma acc exit data map\\(from:cpo_r\\);$" 1 "original" } }
@@ -32,6 +32,6 @@
! { dg-final { scan-tree-dump-times "(?n)#pragma omp target oacc_enter_exit_data map\\(force_from:cpo_f \\\[len: \[0-9\]+\\\]\\) finalize$" 1 "gimple" } }
!$ACC EXIT DATA COPYOUT (cpo_f_p(4:10)) FINALIZE
-! { dg-final { scan-tree-dump-times "(?n)#pragma acc exit data map\\(from:\\*\\(c_char \\*\\) parm\\.1\\.data \\\[len: \[^\\\]\]+\\\]\\) map\\(to:cpo_f_p \\\[pointer set, len: \[0-9\]+\\\]\\) map\\(alloc:\\(integer\\(kind=1\\)\\\[0:\\\] \\* restrict\\) cpo_f_p\\.data \\\[pointer assign, bias: \\(sizetype\\) parm\\.1\\.data - \\(sizetype\\) cpo_f_p\\.data\\\]\\) finalize;$" 1 "original" } }
-! { dg-final { scan-tree-dump-times "(?n)#pragma omp target oacc_enter_exit_data map\\(force_from:MEM\\\[\\(c_char \\*\\)\[^\\\]\]+\\\] \\\[len: \[^\\\]\]+\\\]\\) finalize$" 1 "gimple" } }
+! { dg-final { scan-tree-dump-times "(?n)#pragma acc exit data map\\(from:\\*\\(c_char \\*\\) parm\\.1\\.data \\\[len: \[^\\\]\]+\\\]\\) map\\(to:cpo_f_p \\\[pointer set, len: \[0-9\]+\\\]\\) map\\(alloc:\\(integer\\(kind=1\\)\\\[0:\\\] \\* restrict\\) cpo_f_p\\.data \\\[pointer assign, bias: \\(.*int.*\\) parm\\.1\\.data - \\(.*int.*\\) cpo_f_p\\.data\\\]\\) finalize;$" 1 "original" } }
+! { dg-final { scan-tree-dump-times "(?n)#pragma omp target oacc_enter_exit_data map\\(force_from:MEM\\\[\\(c_char \\*\\)\[^\\\]\]+\\\] \\\[len: \[^\\\]\]+\\\]\\) map\\(to:cpo_f_p \\\[pointer set, len: \[0-9\]+\\\]\\) map\\(alloc:cpo_f_p\\.data \\\[pointer assign, bias: \[^\\\]\]+\\\]\\) finalize$" 1 "gimple" } }
END SUBROUTINE f
diff --git a/gcc/testsuite/gfortran.dg/goacc/mapping-tests-3.f90 b/gcc/testsuite/gfortran.dg/goacc/mapping-tests-3.f90
new file mode 100644
index 00000000000..890ca781967
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/mapping-tests-3.f90
@@ -0,0 +1,15 @@
+! { dg-additional-options "-fdump-tree-gimple" }
+
+subroutine foo
+ type one
+ integer i, j
+ end type
+ type two
+ type(one) A, B
+ end type
+
+ type(two) x
+
+ !$acc enter data copyin(x%A)
+! { dg-final { scan-tree-dump-times "omp target oacc_enter_exit_data map\\(struct:x \\\[len: 1\\\]\\) map\\(to:x.a \\\[len: \[0-9\]+\\\]\\)" 1 "gimple" } }
+end
diff --git a/gcc/testsuite/gfortran.dg/goacc/mapping-tests-4.f90 b/gcc/testsuite/gfortran.dg/goacc/mapping-tests-4.f90
new file mode 100644
index 00000000000..17cc4841d4e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/mapping-tests-4.f90
@@ -0,0 +1,17 @@
+subroutine foo
+ type one
+ integer i, j
+ end type
+ type two
+ type(one) A, B
+ end type
+
+ type(two) x
+
+! This is accepted at present, although it represents a probably-unintentional
+! overlapping subcopy.
+ !$acc enter data copyin(x%A, x%A%i)
+! But this raises an error.
+ !$acc enter data copyin(x%A, x%A%i, x%A%i)
+! { dg-error ".x.a.i. appears more than once in map clauses" "" { target *-*-* } .-1 }
+end
diff --git a/gcc/testsuite/gfortran.dg/goacc/pure-elemental-procedures-2.f90 b/gcc/testsuite/gfortran.dg/goacc/pure-elemental-procedures-2.f90
new file mode 100644
index 00000000000..97d92c3becc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/pure-elemental-procedures-2.f90
@@ -0,0 +1,27 @@
+pure elemental subroutine foo()
+!$acc routine vector ! { dg-error "ROUTINE with GANG, WORKER, or VECTOR clause is not permitted in PURE procedure" }
+end
+
+elemental subroutine foo2()
+!$acc routine (myfoo2) gang ! { dg-error "Invalid NAME 'myfoo2' in" }
+end
+
+elemental subroutine foo2a()
+!$acc routine gang ! { dg-error "ROUTINE with GANG, WORKER, or VECTOR clause is not permitted in PURE procedure" }
+end
+
+pure subroutine foo3()
+!$acc routine vector ! { dg-error "ROUTINE with GANG, WORKER, or VECTOR clause is not permitted in PURE procedure" }
+end
+
+elemental impure subroutine foo4()
+!$acc routine vector ! OK: impure
+end
+
+pure subroutine foo5()
+!$acc routine seq ! OK: seq
+end
+
+pure subroutine foo6()
+!$acc routine ! OK (implied 'seq')
+end
diff --git a/gcc/testsuite/gfortran.dg/goacc/uninit-dim-clause.f95 b/gcc/testsuite/gfortran.dg/goacc/uninit-dim-clause.f95
index 5dea42b2e7e..c77d47a3900 100644
--- a/gcc/testsuite/gfortran.dg/goacc/uninit-dim-clause.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/uninit-dim-clause.f95
@@ -4,13 +4,13 @@ subroutine acc_parallel
implicit none
integer :: i, j, k
- !$acc parallel num_gangs(i) ! { dg-warning "is used uninitialized in this function" }
+ !$acc parallel num_gangs(i) ! { dg-warning "is used uninitialized" }
!$acc end parallel
- !$acc parallel num_workers(j) ! { dg-warning "is used uninitialized in this function" }
+ !$acc parallel num_workers(j) ! { dg-warning "is used uninitialized" }
!$acc end parallel
- !$acc parallel vector_length(k) ! { dg-warning "is used uninitialized in this function" }
+ !$acc parallel vector_length(k) ! { dg-warning "is used uninitialized" }
!$acc end parallel
end subroutine acc_parallel
@@ -18,12 +18,12 @@ subroutine acc_kernels
implicit none
integer :: i, j, k
- !$acc kernels num_gangs(i) ! { dg-warning "is used uninitialized in this function" }
+ !$acc kernels num_gangs(i) ! { dg-warning "is used uninitialized" }
!$acc end kernels
- !$acc kernels num_workers(j) ! { dg-warning "is used uninitialized in this function" }
+ !$acc kernels num_workers(j) ! { dg-warning "is used uninitialized" }
!$acc end kernels
- !$acc kernels vector_length(k) ! { dg-warning "is used uninitialized in this function" }
+ !$acc kernels vector_length(k) ! { dg-warning "is used uninitialized" }
!$acc end kernels
end subroutine acc_kernels
diff --git a/gcc/testsuite/gfortran.dg/goacc/uninit-firstprivate-clause.f95 b/gcc/testsuite/gfortran.dg/goacc/uninit-firstprivate-clause.f95
index 14d960a1f38..cd5d189a1aa 100644
--- a/gcc/testsuite/gfortran.dg/goacc/uninit-firstprivate-clause.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/uninit-firstprivate-clause.f95
@@ -12,7 +12,7 @@ end subroutine test
subroutine test2
INTEGER :: i
- !$acc parallel firstprivate (i) ! { dg-warning "is used uninitialized in this function" }
+ !$acc parallel firstprivate (i) ! { dg-warning "is used uninitialized" }
i = 1
!$acc end parallel
end subroutine test2
diff --git a/gcc/testsuite/gfortran.dg/goacc/uninit-if-clause.f95 b/gcc/testsuite/gfortran.dg/goacc/uninit-if-clause.f95
index 60dc53e7850..73eb4ee1de1 100644
--- a/gcc/testsuite/gfortran.dg/goacc/uninit-if-clause.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/uninit-if-clause.f95
@@ -6,15 +6,15 @@ program test
logical :: b, b2, b3, b4
integer :: data, data2
- !$acc parallel if(b) ! { dg-warning "is used uninitialized in this function" }
+ !$acc parallel if(b) ! { dg-warning "is used uninitialized" }
!$acc end parallel
- !$acc kernels if(b2) ! { dg-warning "is used uninitialized in this function" }
+ !$acc kernels if(b2) ! { dg-warning "is used uninitialized" }
!$acc end kernels
- !$acc data if(b3) ! { dg-warning "is used uninitialized in this function" }
+ !$acc data if(b3) ! { dg-warning "is used uninitialized" }
!$acc end data
- !$acc update if(b4) self(data2) ! { dg-warning "is used uninitialized in this function" }
+ !$acc update if(b4) self(data2) ! { dg-warning "is used uninitialized" }
end program test
diff --git a/gcc/testsuite/gfortran.dg/goacc/uninit-use-device-clause.f95 b/gcc/testsuite/gfortran.dg/goacc/uninit-use-device-clause.f95
index 48d08a5a55d..35310d14c52 100644
--- a/gcc/testsuite/gfortran.dg/goacc/uninit-use-device-clause.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/uninit-use-device-clause.f95
@@ -4,7 +4,7 @@
subroutine test
integer, pointer :: p
- !$acc host_data use_device(p) ! { dg-warning "is used uninitialized in this function" }
+ !$acc host_data use_device(p) ! { dg-warning "is used uninitialized" }
!$acc end host_data
end subroutine test
diff --git a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.24.1.f90 b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.24.1.f90
index 52a2cbb82da..3837aab6cca 100644
--- a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.24.1.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.24.1.f90
@@ -19,7 +19,7 @@
X=1 ! O.K. - X is THREADPRIVATE
Z(I) = Y ! Error - cannot reference I or Y here
! { dg-error "'i' not specified" "" { target *-*-* } .-1 } */
-! { dg-error "enclosing 'parallel'" "" { target *-*-* } omp_parallel } */
+! { dg-message "note: enclosing 'parallel'" "" { target *-*-* } omp_parallel } */
! { dg-error "'y' not specified" "" { target *-*-* } .-3 } */
!$OMP DO firstprivate(y)
DO I = 1,10
diff --git a/gcc/testsuite/gfortran.dg/gomp/cancel-2.f90 b/gcc/testsuite/gfortran.dg/gomp/cancel-2.f90
new file mode 100644
index 00000000000..481b1aa5d2f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/cancel-2.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+
+subroutine foo ()
+ !$omp parallel
+ !$omp cancel parallel if (.true.)
+ !$omp cancel parallel if (cancel: .true.)
+
+ !$omp cancel parallel if (.true.) if (.true.) ! { dg-error "Failed to match clause" }
+ !$omp cancel parallel if (cancel: .true.) if (cancel: .true.) ! { dg-error "Failed to match clause" }
+ !$omp cancel parallel if (cancel: .true.) if (.true.) ! { dg-error "IF clause without modifier at .1. used together with IF clauses with modifiers" }
+ !$omp cancel parallel if (cancel: .true.) if (parallel: .true.) ! { dg-error "IF clause modifier PARALLEL at .1. not appropriate for the current OpenMP construct" }
+ !$omp cancel parallel if (.true.) if (cancel: .true.) ! { dg-error "Failed to match clause at" }
+ !$omp cancel parallel if (parallel: .true.) if (cancel: .true.) ! { dg-error "IF clause modifier PARALLEL at .1. not appropriate for the current OpenMP construct" }
+ !$omp end parallel
+end subroutine
diff --git a/gcc/testsuite/gfortran.dg/gomp/cancel-3.f90 b/gcc/testsuite/gfortran.dg/gomp/cancel-3.f90
new file mode 100644
index 00000000000..78b54d88b12
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/cancel-3.f90
@@ -0,0 +1,35 @@
+! { dg-do compile }
+! { dg-additional-options "-fdump-tree-original" }
+
+subroutine foo ()
+ !$omp parallel
+ !$omp cancel parallel if (.true.)
+ !$omp cancel parallel if (cancel: .true.)
+ !$omp cancel parallel if (.false.)
+ !$omp cancel parallel if (cancel: .false.)
+ !$omp end parallel
+
+ !$omp sections
+ !$omp cancel sections if (cancel: .true.)
+ stop
+ !$omp end sections
+
+ !$omp do
+ do i = 1, 10
+ !$omp cancel do if (.false.)
+ end do
+
+ !$omp task
+ !$omp cancel taskgroup if (cancel: .false.)
+ !$omp end task
+ !$omp task
+ !$omp cancel taskgroup
+ !$omp end task
+end subroutine
+
+! { dg-final { scan-tree-dump-times "__builtin_GOMP_cancel \\(1, 1\\);" 2 "original" } }
+! { dg-final { scan-tree-dump-times "__builtin_GOMP_cancel \\(1, 0\\);" 2 "original" } }
+! { dg-final { scan-tree-dump-times "__builtin_GOMP_cancel \\(4, 1\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "__builtin_GOMP_cancel \\(2, 0\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "__builtin_GOMP_cancel \\(8, 0\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "__builtin_GOMP_cancel \\(8, 1\\);" 1 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/gomp/collapse1.f90 b/gcc/testsuite/gfortran.dg/gomp/collapse1.f90
index f16a780ad99..1a06eaba823 100644
--- a/gcc/testsuite/gfortran.dg/gomp/collapse1.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/collapse1.f90
@@ -31,7 +31,7 @@ subroutine collapse1
do i = 1, 3
do j = 4, 6
end do
- k = 4
+ k = 4 ! { dg-error "loops not perfectly nested" }
end do
!$omp parallel do collapse(2)
do i = 1, 3
diff --git a/gcc/testsuite/gfortran.dg/gomp/collapse2.f90 b/gcc/testsuite/gfortran.dg/gomp/collapse2.f90
new file mode 100644
index 00000000000..1ab934e3d0d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/collapse2.f90
@@ -0,0 +1,32 @@
+program p
+ integer :: i, j, k
+ real :: x
+ !$omp parallel do collapse(3)
+ do i = 1, 8
+ do j = 1, 8
+ do k = 1, 8
+ end do
+ x = 5 ! { dg-error "loops not perfectly nested" }
+ end do
+ end do
+ !$omp parallel do ordered(3)
+ do i = 1, 8
+ do j = 1, 8
+ do k = 1, 8
+ end do
+ end do
+ x = 5 ! { dg-error "loops not perfectly nested" }
+ end do
+ !$omp parallel do collapse(2) ! { dg-error "not enough DO loops for collapsed" }
+ do i = 1, 8
+ x = 5
+ do j = 1, 8
+ end do
+ end do
+ !$omp parallel do ordered(2) ! { dg-error "not enough DO loops for collapsed" }
+ do i = 1, 8
+ x = 5
+ do j = 1, 8
+ end do
+ end do
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/combined-if.f90 b/gcc/testsuite/gfortran.dg/gomp/combined-if.f90
new file mode 100644
index 00000000000..0bb6c28b286
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/combined-if.f90
@@ -0,0 +1,109 @@
+! { dg-do compile }
+! { dg-additional-options "-fdump-tree-omplower" }
+
+module combined_if
+ implicit none
+
+ integer, parameter :: N = 100
+ integer, parameter :: LIMIT = 60
+ integer :: i, j
+ integer, dimension(N) :: a = (/ (i, i = 1,N) /)
+contains
+ subroutine test_parallel_loop_simd
+ do j = 1, N
+ !$omp parallel do simd if(j .lt. LIMIT)
+ do i = 1, N
+ a(i) = a(i) + 1
+ end do
+ end do
+ end subroutine
+
+ subroutine test_target_parallel
+ do j = 1, N
+ !$omp target parallel if(j .lt. LIMIT) map(tofrom: a(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1
+ end do
+ !$omp end target parallel
+ end do
+ end subroutine
+
+ subroutine test_target_parallel_loop
+ do j = 1, N
+ !$omp target parallel do if(j .lt. LIMIT) map(tofrom: a(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1
+ end do
+ end do
+ end subroutine
+
+ subroutine test_target_parallel_loop_simd
+ do j = 1, N
+ !$omp target parallel do simd if(j .lt. LIMIT) map(tofrom: a(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1
+ end do
+ end do
+ end subroutine
+
+ subroutine test_target_simd
+ do j = 1, N
+ !$omp target simd if(j .lt. LIMIT) map(tofrom: a(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1
+ end do
+ end do
+ end subroutine
+
+ subroutine test_target_teams
+ do j = 1, N
+ !$omp target teams if(j .lt. LIMIT) map(tofrom: a(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1
+ end do
+ !$omp end target teams
+ end do
+ end subroutine
+
+ subroutine test_target_teams_distribute
+ do j = 1, N
+ !$omp target teams distribute if(j .lt. LIMIT) map(tofrom: a(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1
+ end do
+ end do
+ end subroutine
+
+ subroutine test_target_teams_distibute_simd
+ do j = 1, N
+ !$omp target teams distribute simd if(j .lt. LIMIT) map(tofrom: a(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1
+ end do
+ end do
+ end subroutine
+
+ subroutine test_target_teams_distribute_parallel_loop
+ do j = 1, N
+ !$omp target teams distribute parallel do if(j .lt. LIMIT) map(tofrom: a(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1
+ end do
+ end do
+ end subroutine
+
+ subroutine test_target_teams_distribute_parallel_loop_simd
+ do j = 1, N
+ !$omp target teams distribute parallel do simd if(j .lt. LIMIT) map(tofrom: a(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1
+ end do
+ end do
+ end subroutine
+
+end module
+
+! { dg-final { scan-tree-dump-times "(?n)#pragma omp target.* if\\(" 9 "omplower" } }
+! { dg-final { scan-tree-dump-times "(?n)#pragma omp simd.* if\\(" 4 "omplower" { target { ! offload_nvptx } } } }
+! { dg-final { scan-tree-dump-times "(?n)#pragma omp simd.* if\\(" 7 "omplower" { target { offload_nvptx } } } }
+! { dg-final { scan-tree-dump-times "(?n)#pragma omp parallel.* if\\(" 6 "omplower" } }
diff --git a/gcc/testsuite/gfortran.dg/gomp/crayptr3.f90 b/gcc/testsuite/gfortran.dg/gomp/crayptr3.f90
index 15bf864997f..9a28bbc3cf2 100644
--- a/gcc/testsuite/gfortran.dg/gomp/crayptr3.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/crayptr3.f90
@@ -16,7 +16,7 @@
a = 1
!$omp end parallel
-!$omp parallel default (none) ! { dg-error "enclosing 'parallel'" }
+!$omp parallel default (none) ! { dg-message "note: enclosing 'parallel'" }
a = 1 ! { dg-error "'ip' not specified in enclosing 'parallel'" }
!$omp end parallel
end
diff --git a/gcc/testsuite/gfortran.dg/gomp/gomp.exp b/gcc/testsuite/gfortran.dg/gomp/gomp.exp
index f3a67992512..1b0fc0d3a1b 100644
--- a/gcc/testsuite/gfortran.dg/gomp/gomp.exp
+++ b/gcc/testsuite/gfortran.dg/gomp/gomp.exp
@@ -30,7 +30,7 @@ dg-init
# Main loop.
gfortran-dg-runtest [lsort \
- [find $srcdir/$subdir *.\[fF\]{,90,95,03,08} ] ] "" "-fopenmp -Wno-hsa"
+ [find $srcdir/$subdir *.\[fF\]{,90,95,03,08} ] ] "" "-fopenmp"
# All done.
dg-finish
diff --git a/gcc/testsuite/gfortran.dg/gomp/gridify-1.f90 b/gcc/testsuite/gfortran.dg/gomp/gridify-1.f90
deleted file mode 100644
index 7def27980ba..00000000000
--- a/gcc/testsuite/gfortran.dg/gomp/gridify-1.f90
+++ /dev/null
@@ -1,16 +0,0 @@
-! { dg-do compile }
-! { dg-require-effective-target offload_hsa }
-! { dg-options "-fopenmp -fdump-tree-omplower-details" } */
-
-subroutine vector_square(n, a, b)
- integer i, n, b(n), a(n)
-!$omp target teams
-!$omp distribute parallel do
- do i=1,n
- b(i) = a(i) * a(i)
- enddo
-!$omp end distribute parallel do
-!$omp end target teams
-end subroutine vector_square
-
-! { dg-final { scan-tree-dump "Target construct will be turned into a gridified HSA kernel" "omplower" } }
diff --git a/gcc/testsuite/gfortran.dg/gomp/if-1.f90 b/gcc/testsuite/gfortran.dg/gomp/if-1.f90
new file mode 100644
index 00000000000..ddf903f616e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/if-1.f90
@@ -0,0 +1,122 @@
+! { dg-do compile }
+
+subroutine foo (a, b, p, q)
+ logical, value :: a
+ logical :: b
+ integer :: p(:)
+ integer, pointer :: q(:)
+ integer :: i
+ !$omp parallel if (a)
+ !$omp end parallel
+ !$omp parallel if (parallel:a)
+ !$omp end parallel
+ !$omp parallel do simd if (a)
+ do i = 1, 16
+ end do
+ !$omp end parallel do simd
+ !$omp parallel do simd if (parallel : a)
+ do i = 1, 16
+ end do
+ !$omp end parallel do simd
+ !$omp parallel do simd if (simd : a)
+ do i = 1, 16
+ end do
+ !$omp end parallel do simd
+ !$omp parallel do simd if (simd : a) if (parallel:b)
+ do i = 1, 16
+ end do
+ !$omp end parallel do simd
+ !$omp task if (a)
+ !$omp end task
+ !$omp task if (task: a)
+ !$omp end task
+ !$omp taskloop if (a)
+ do i = 1, 16
+ end do
+ !$omp end taskloop
+ !$omp taskloop if (taskloop : a)
+ do i = 1, 16
+ end do
+ !$omp end taskloop
+ !$omp taskloop simd if (a)
+ do i = 1, 16
+ end do
+ !$omp end taskloop simd
+ !$omp taskloop simd if (taskloop : a)
+ do i = 1, 16
+ end do
+ !$omp end taskloop simd
+ !$omp taskloop simd if (simd : a)
+ do i = 1, 16
+ end do
+ !$omp end taskloop simd
+ !$omp taskloop simd if (taskloop:b) if (simd : a)
+ do i = 1, 16
+ end do
+ !$omp end taskloop simd
+ !$omp target if (a)
+ !$omp end target
+ !$omp target if (target: a)
+ !$omp end target
+ !$omp target simd if (a)
+ do i = 1, 16
+ end do
+ !$omp end target simd
+ !$omp target simd if (simd : a) if (target: b)
+ do i = 1, 16
+ end do
+ !$omp end target simd
+ !$omp target teams distribute parallel do simd if (a)
+ do i = 1, 16
+ end do
+ !$omp end target teams distribute parallel do simd
+ !$omp target teams distribute parallel do simd if (parallel : a) if (target: b)
+ do i = 1, 16
+ end do
+ !$omp end target teams distribute parallel do simd
+ !$omp target teams distribute parallel do simd if (simd : a) if (target: b)
+ do i = 1, 16
+ end do
+ !$omp end target teams distribute parallel do simd
+
+ !$omp target data if (a) map (p(1:2))
+ !$omp end target data
+ !$omp target data if (target data: a) map (p(1:2))
+ !$omp end target data
+ !$omp target enter data if (a) map (to: p(1:2))
+ !$omp target enter data if (target enter data: a) map (to: p(1:2))
+ !$omp target exit data if (a) map (from: p(1:2))
+ !$omp target exit data if (target exit data: a) map (from: p(1:2))
+ !$omp target update if (a) to (q(1:3))
+ !$omp target update if (target update:a) to (q(1:3))
+ !$omp parallel
+ !$omp cancel parallel if (a)
+ !$omp end parallel
+ !$omp parallel
+ !$omp cancel parallel if (cancel:a)
+ !$omp end parallel
+ !$omp do
+ do i = 1, 16
+ !$omp cancel do if (a)
+ end do
+ !$omp do
+ do i = 1, 16
+ !$omp cancel do if (cancel: a)
+ end do
+ !$omp sections
+ !$omp section
+ !$omp cancel sections if (a)
+ !$omp end sections
+ !$omp sections
+ !$omp section
+ !$omp cancel sections if (cancel: a)
+ !$omp end sections
+ !$omp taskgroup
+ !$omp task
+ !$omp cancel taskgroup if (a)
+ !$omp end task
+ !$omp task
+ !$omp cancel taskgroup if (cancel: a)
+ !$omp end task
+ !$omp end taskgroup
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-1.f90 b/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-1.f90
new file mode 100644
index 00000000000..7a024061ec6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-1.f90
@@ -0,0 +1,82 @@
+subroutine foo (p)
+ implicit none
+ logical :: p(:)
+ integer a, b, c, d, e, f, g, h;
+ integer :: i
+ a = -1; b = -1; c = -1; d = -1; e = -1; f = -1; g = -1; h = -1
+ !$omp teams
+ !$omp distribute lastprivate (conditional: a) ! { dg-error "conditional 'lastprivate' clause on 'distribute' construct" }
+ do i = 1, 32
+ if (p(i)) &
+ a = i
+ end do
+ !$omp distribute simd lastprivate (conditional: b) ! { dg-error "conditional 'lastprivate' clause on 'distribute' construct" }
+ do i = 1, 32
+ if (p(i)) &
+ b = i
+ end do
+ !$omp distribute parallel do lastprivate (conditional: c) ! { dg-error "conditional 'lastprivate' clause on 'distribute' construct" }
+ do i = 1, 32
+ if (p(i)) &
+ c = i
+ end do
+ !$omp distribute parallel do simd lastprivate (conditional: d) ! { dg-error "conditional 'lastprivate' clause on 'distribute' construct" }
+ do i = 1, 32
+ if (p(i)) &
+ d = i
+ end do
+ !$omp end teams
+
+ !$omp teams distribute parallel do lastprivate (conditional: e) ! { dg-error "conditional 'lastprivate' clause on 'distribute' construct" }
+ do i = 1, 32
+ if (p(i)) &
+ e = i
+ end do
+
+ !$omp parallel
+ !$omp master
+ !$omp taskloop lastprivate (conditional: f) ! { dg-error "conditional 'lastprivate' clause on 'taskloop' construct" }
+ do i = 1, 32
+ if (p(i)) &
+ f = i
+ end do
+! !$omp master taskloop simd lastprivate (conditional: g) ! { dg!error "conditional 'lastprivate' clause on 'taskloop' construct" }
+! do i = 1, 32
+! if (p(i)) &
+! g = i
+! end do
+ !$omp end master
+ !$omp end parallel
+
+! !$omp parallel master taskloop simd lastprivate (conditional: h) ! { dg!error "conditional 'lastprivate' clause on 'taskloop' construct" }
+! do i = 1, 32
+! if (p(i)) &
+! h = i
+! end do
+! !$omp end parallel master taskloop simd
+end subroutine
+
+!struct S { int a, b; };
+
+subroutine bar (p)
+ implicit none
+ logical :: p(:)
+ type s_t
+ integer :: a, b
+ end type s_t
+ type(s_t) s, t
+ integer i
+ s = s_t(-1, -1)
+ t = s_t( 1, 2)
+ !$omp parallel do lastprivate (conditional: s) ! { dg-error "non-scalar variable 's' in conditional 'lastprivate' clause" }
+ do i = 1, 32
+ if (p(i)) then
+ block
+ type(s_t) u
+ u = t
+ u%b = i
+ s = u
+ end block
+ end if
+ end do
+end subroutine
diff --git a/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-2.f90 b/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-2.f90
new file mode 100644
index 00000000000..5c95d8f77d8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-2.f90
@@ -0,0 +1,46 @@
+! { dg-additional-options "-fdump-tree-original" }
+subroutine foo (p)
+ logical :: p(:)
+ integer i
+ integer a, b, c, d, e, f, g, h
+ a = -1; b = -1; c = -1; d = -1; e = -1; f = -1; g = -1; h = -1
+ !$omp parallel
+ !$omp do lastprivate (conditional: a)
+ do i = 1, 32
+ if (p(i)) &
+ a = i
+ end do
+ !$omp end parallel
+ !$omp simd lastprivate (conditional: b)
+ do i = 1, 32
+ if (p(i)) &
+ b = i
+ end do
+ !$omp parallel
+ !$omp do simd lastprivate (conditional: c)
+ do i = 1, 32
+ if (p(i)) &
+ c = i
+ end do
+ !$omp end parallel
+ !$omp parallel do lastprivate (conditional: d)
+ do i = 1, 32
+ if (p(i)) &
+ d = i
+ end do
+ !$omp end parallel do
+ !$omp parallel do simd lastprivate (conditional: e)
+ do i = 1, 32
+ if (p(i)) &
+ e = i
+ end do
+ !$omp end parallel do simd
+end subroutine
+
+! { dg-final { scan-tree-dump-times "#pragma omp for lastprivate\\(conditional:a\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp simd linear\\(i:1\\) lastprivate\\(conditional:b\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp for lastprivate\\(conditional:c\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp simd linear\\(i:1\\) lastprivate\\(conditional:c\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp parallel lastprivate\\(conditional:d\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp parallel lastprivate\\(conditional:e\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp simd linear\\(i:1\\) lastprivate\\(conditional:e\\)" 1 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-3.f90 b/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-3.f90
new file mode 100644
index 00000000000..932249c9225
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-3.f90
@@ -0,0 +1,61 @@
+subroutine foo
+ integer i, j, k
+ !$omp parallel
+ !$omp do lastprivate (conditional: i) ! { dg-warning "conditional 'lastprivate' on loop iterator 'i' ignored" }
+ do i = 1, 32
+ end do
+ !$omp do collapse (3) lastprivate (conditional: i) ! { dg-warning "conditional 'lastprivate' on loop iterator 'i' ignored" }
+ do i = 1, 32
+ do j = 1, 32
+ do k = 1, 32
+ end do
+ end do
+ end do
+ !$omp do collapse (3) lastprivate (conditional: j) ! { dg-warning "conditional 'lastprivate' on loop iterator 'j' ignored" }
+ do i = 1, 32
+ do j = 1, 32
+ do k = 1, 32
+ end do
+ end do
+ end do
+ !$omp do collapse (3) lastprivate (conditional: k) ! { dg-warning "conditional 'lastprivate' on loop iterator 'k' ignored" }
+ do i = 1, 32
+ do j = 1, 32
+ do k = 1, 32
+ end do
+ end do
+ end do
+ !$omp end parallel
+
+ !$omp parallel do lastprivate (conditional: i) ! { dg-warning "conditional 'lastprivate' on loop iterator 'i' ignored" }
+ do i = 1, 32
+ end do
+ !$omp end parallel do
+
+ !$omp parallel do collapse (3) lastprivate (conditional: i) ! { dg-warning "conditional 'lastprivate' on loop iterator 'i' ignored" }
+ do i = 1, 32
+ do j = 1, 32
+ do k = 1, 32
+ end do
+ end do
+ end do
+ !$omp end parallel do
+
+ !$omp parallel do collapse (3) lastprivate (conditional: j) ! { dg-warning "conditional 'lastprivate' on loop iterator 'j' ignored" }
+ do i = 1, 32
+ do j = 1, 32
+ do k = 1, 32
+ end do
+ end do
+ end do
+ !$omp end parallel do
+
+ !$omp parallel do collapse (3) lastprivate (conditional: k) ! { dg-warning "conditional 'lastprivate' on loop iterator 'k' ignored" }
+ do i = 1, 32
+ do j = 1, 32
+ do k = 1, 32
+ end do
+ end do
+ end do
+ !$omp end parallel do
+end subroutine
diff --git a/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-4.f90 b/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-4.f90
new file mode 100644
index 00000000000..1e8c6c7e41a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-4.f90
@@ -0,0 +1,28 @@
+module m
+integer x, w
+end module m
+
+subroutine foo
+ use m
+ interface
+ logical function bar(i)
+ integer i
+ end function
+ end interface
+ integer y, i, z
+ logical tmp
+ y = 5
+ !$omp teams num_teams(1) firstprivate (x) shared (y) shared (w)
+ !$omp parallel do firstprivate (x, y, z, w) lastprivate (conditional: x, y, z, w)
+ do i = 1, 64
+ if (bar (i)) then
+ x = i;
+ y = i + 1;
+ z = i + 2;
+ w = i + 3;
+ end if
+ tmp = bar (y);
+ tmp = bar (z);
+ end do
+ !$omp end teams
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-5.f90 b/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-5.f90
new file mode 100644
index 00000000000..e2f3cb7dd90
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-5.f90
@@ -0,0 +1,47 @@
+! { dg-do compile }
+! { dg-options "-O2 -fopenmp -fdump-tree-ompexp" }
+! { dg-final { scan-tree-dump-times "GOMP_loop_start " 3 "ompexp" } }
+! { dg-final { scan-tree-dump-times "GOMP_loop_end_nowait " 3 "ompexp" } }
+
+module m
+ logical r
+end module m
+
+subroutine foo (a)
+ use m
+ implicit none
+ logical a(:)
+ integer :: i
+ !$omp do lastprivate(conditional: r)
+ do i = 1, 64
+ if (a(i)) &
+ r = a(i)
+ end do
+ !$omp end do nowait
+end
+
+subroutine bar (a)
+ use m
+ implicit none
+ logical a(:)
+ integer :: i
+ !$omp do lastprivate(conditional: r) schedule (static, 4)
+ do i = 1, 64
+ if (a(i)) &
+ r = a(i)
+ end do
+ !$omp end do nowait
+end
+
+subroutine baz (a)
+ use m
+ implicit none
+ logical a(:)
+ integer :: i
+ !$omp do lastprivate(conditional: r) schedule (runtime)
+ do i = 1, 64
+ if (a(i)) &
+ r = a(i)
+ end do
+ !$omp end do nowait
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/map-1.f90 b/gcc/testsuite/gfortran.dg/gomp/map-1.f90
index e78b56c8f39..831feffcc43 100644
--- a/gcc/testsuite/gfortran.dg/gomp/map-1.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/map-1.f90
@@ -57,18 +57,20 @@ subroutine test(aas)
!$omp target map(j(:))
!$omp end target
- !$omp target map(j(1:9:2)) ! { dg-error "Stride should not be specified for array section in MAP clause" }
+ !$omp target map(j(1:9:2))
+ ! { dg-error "Array is not contiguous" "" { target *-*-* } 60 }
+ ! { dg-error "Stride should not be specified for array section in MAP clause" "" { target *-*-* } 60 }
!$omp end target
!$omp target map(aas(5:))
!$omp end target
- ! { dg-error "Rightmost upper bound of assumed size array section not specified" "" { target *-*-* } 63 }
- ! { dg-error "'aas' in MAP clause at \\\(1\\\) is not a proper array section" "" { target *-*-* } 63 }
+ ! { dg-error "Rightmost upper bound of assumed size array section not specified" "" { target *-*-* } 65 }
+ ! { dg-error "'aas' in MAP clause at \\\(1\\\) is not a proper array section" "" { target *-*-* } 65 }
!$omp target map(aas(:))
!$omp end target
- ! { dg-error "Rightmost upper bound of assumed size array section not specified" "" { target *-*-* } 68 }
- ! { dg-error "'aas' in MAP clause at \\\(1\\\) is not a proper array section" "" { target *-*-* } 68 }
+ ! { dg-error "Rightmost upper bound of assumed size array section not specified" "" { target *-*-* } 70 }
+ ! { dg-error "'aas' in MAP clause at \\\(1\\\) is not a proper array section" "" { target *-*-* } 70 }
!$omp target map(aas) ! { dg-error "Assumed size array" }
!$omp end target
@@ -81,29 +83,28 @@ subroutine test(aas)
!$omp target map(k(5:))
!$omp end target
- ! { dg-error "Rank mismatch in array reference" "" { target *-*-* } 82 }
- ! { dg-error "'k' in MAP clause at \\\(1\\\) is not a proper array section" "" { target *-*-* } 82 }
+ ! { dg-error "Rank mismatch in array reference" "" { target *-*-* } 84 }
+ ! { dg-error "'k' in MAP clause at \\\(1\\\) is not a proper array section" "" { target *-*-* } 84 }
!$omp target map(k(5:,:,3))
!$omp end target
- ! { dg-error "Rank mismatch in array reference" "" { target *-*-* } 87 }
- ! { dg-error "'k' in MAP clause at \\\(1\\\) is not a proper array section" "" { target *-*-* } 87 }
+ ! { dg-error "Rank mismatch in array reference" "" { target *-*-* } 89 }
+ ! { dg-error "'k' in MAP clause at \\\(1\\\) is not a proper array section" "" { target *-*-* } 89 }
!$omp target map(tt)
!$omp end target
- !$omp target map(tt%i) ! { dg-error "Syntax error in OpenMP variable list" }
+ !$omp target map(tt%k) ! { dg-error "not a member of" }
!$omp end target ! { dg-error "Unexpected !\\\$OMP END TARGET statement" }
- !$omp target map(tt%j) ! { dg-error "Syntax error in OpenMP variable list" }
- !$omp end target ! { dg-error "Unexpected !\\\$OMP END TARGET statement" }
+ !$omp target map(tt%j)
+ !$omp end target
- ! broken test
- !$omp target map(tt%j(1)) ! { dg-error "Syntax error in OpenMP variable list" }
- !$omp end target ! { dg-error "Unexpected !\\\$OMP END TARGET statement" }
+ !$omp target map(tt%j(1))
+ !$omp end target
- !$omp target map(tt%j(1:)) ! { dg-error "Syntax error in OpenMP variable list" }
- !$omp end target ! { dg-error "Unexpected !\\\$OMP END TARGET statement" }
+ !$omp target map(tt%j(1:))
+ !$omp end target
!$omp target map(tp) ! { dg-error "THREADPRIVATE object 'tp' in MAP clause" }
!$omp end target
diff --git a/gcc/testsuite/gfortran.dg/gomp/map-2.f90 b/gcc/testsuite/gfortran.dg/gomp/map-2.f90
new file mode 100644
index 00000000000..73c4f5a87d0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/map-2.f90
@@ -0,0 +1,6 @@
+type t
+ integer :: i
+end type t
+type(t) v
+!$omp target enter data map(to:v%i, v%i) ! { dg-error "appears more than once in map clauses" }
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/map-3.f90 b/gcc/testsuite/gfortran.dg/gomp/map-3.f90
new file mode 100644
index 00000000000..13f63647bda
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/map-3.f90
@@ -0,0 +1,38 @@
+! { dg-additional-options "-fdump-tree-original" }
+
+subroutine bar
+integer, target :: x
+integer, allocatable, target :: y(:,:), z(:,:)
+x = 7
+!$omp target enter data map(to:x)
+
+x = 8
+!$omp target data map(always, to: x)
+call foo(x)
+!$omp end target data
+
+!$omp target data use_device_ptr(x)
+call foo2(x)
+!$omp end target data
+
+!$omp target data use_device_addr(x)
+call foo2(x)
+!$omp end target data
+!$omp target exit data map(release:x)
+
+!$omp target data map(y) use_device_addr(y)
+call foo3(y)
+!$omp end target data
+
+!$omp target data map(z) use_device_ptr(z)
+call foo3(z)
+!$omp end target data
+end
+
+! { dg-final { scan-tree-dump-times "#pragma omp target enter data map\\(to:x\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp target data map\\(always,to:x\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp target data use_device_ptr\\(x\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp target data use_device_addr\\(x\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp target exit data map\\(release:x\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp target data map\\(tofrom:\\*\\(c_char \\*\\) y.data \\\[len: .*\\) map\\(to:y \\\[pointer set, len: .*\\) map\\(alloc:.*y.data \\\[pointer assign, bias: 0\\\]\\) use_device_addr\\(y\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp target data map\\(tofrom:\\*\\(c_char \\*\\) z.data \\\[len: .*\\) map\\(to:z \\\[pointer set, len: .*\\) map\\(alloc:.*z.data \\\[pointer assign, bias: 0\\\]\\) use_device_ptr\\(z\\)" 1 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/gomp/map-4.f90 b/gcc/testsuite/gfortran.dg/gomp/map-4.f90
new file mode 100644
index 00000000000..3aa1c8096d7
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/map-4.f90
@@ -0,0 +1,7 @@
+!$omp target enter data device(1) if (.true.) nowait ! { dg-error "TARGET ENTER DATA must contain at least one MAP clause" }
+
+!$omp target data device(1) ! { dg-error "TARGET DATA must contain at least one MAP, USE_DEVICE_PTR, or USE_DEVICE_ADDR clause" }
+!$omp endtarget data
+
+!$omp target exit data device(1) if (.true.) nowait ! { dg-error "TARGET EXIT DATA must contain at least one MAP clause" }
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/map-alloc-comp-1.f90 b/gcc/testsuite/gfortran.dg/gomp/map-alloc-comp-1.f90
new file mode 100644
index 00000000000..0c4429677bd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/map-alloc-comp-1.f90
@@ -0,0 +1,14 @@
+!
+! ALLOCATABLE COMPONENTS:
+! - OpenMP 5: Permitted (and automatically recursively mapped)
+! -> Not yet supported.
+! - OpenMP 4.5: Not permitted.
+!
+implicit none (type, external)
+type sct
+ integer, allocatable :: c
+end type
+type(sct) var
+
+!$omp target enter data map(to:var) ! { dg-error "allocatable components is not permitted in map clause" }
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/nontemporal-1.f90 b/gcc/testsuite/gfortran.dg/gomp/nontemporal-1.f90
new file mode 100644
index 00000000000..21a94db0ba8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/nontemporal-1.f90
@@ -0,0 +1,25 @@
+! { dg-do compile }
+! { dg-additional-options "-O2 -fdump-tree-original" }
+
+module m
+ integer :: a(:), b(1024), c(1024), d(1024)
+ allocatable :: a
+end module m
+
+subroutine foo
+ use m
+ implicit none
+ integer :: i
+ !$omp simd nontemporal (a, b)
+ do i = 1, 1024
+ a(i) = b(i) + c(i)
+ end do
+
+ !$omp simd nontemporal (d)
+ do i = 1, 1024
+ d(i) = 2 * c(i)
+ end do
+end subroutine foo
+
+! { dg-final { scan-tree-dump-times "#pragma omp simd linear\\(i:1\\) nontemporal\\(a\\) nontemporal\\(b\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp simd linear\\(i:1\\) nontemporal\\(d\\)" 1 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/gomp/nontemporal-2.f90 b/gcc/testsuite/gfortran.dg/gomp/nontemporal-2.f90
new file mode 100644
index 00000000000..c880bedb1e2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/nontemporal-2.f90
@@ -0,0 +1,26 @@
+! { dg-do compile }
+
+module m
+ integer, allocatable :: a(:), b(:), c(:), d(:)
+end module m
+
+subroutine foo
+ use m
+ implicit none
+ integer :: i
+
+ !$omp simd nontemporal (a, b) aligned (a, b, c)
+ do i = 1, ubound(a, dim=1)
+ a(i) = b(i) + c(i)
+ end do
+
+ !$omp simd nontemporal (d) nontemporal (d) ! { dg-error "'d' present on multiple clauses" }
+ do i = 1, ubound(d, dim=1)
+ d(i) = 2 * c(i)
+ end do
+
+ !$omp simd nontemporal (a, b, b) ! { dg-error "'b' present on multiple clauses" }
+ do i = 1, ubound(a, dim=1)
+ a(i) = a(i) + b(i) + c(i)
+ end do
+end subroutine foo
diff --git a/gcc/testsuite/gfortran.dg/gomp/openmp-simd-4.f90 b/gcc/testsuite/gfortran.dg/gomp/openmp-simd-4.f90
new file mode 100644
index 00000000000..4a17fb9820e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/openmp-simd-4.f90
@@ -0,0 +1,65 @@
+! { dg-do compile }
+
+integer :: i, j, k
+integer :: x(5), y(2,5)
+
+!$omp parallel do private(i)
+do i = 1, 5
+ x(i) = 42
+end do
+
+!$omp parallel do lastprivate(i)
+do i = 1, 5
+ x(i) = 42
+end do
+
+
+!$omp simd private(i)
+do i = 1, 5
+ x(i) = 42
+end do
+
+!$omp simd linear(i)
+do i = 1, 5
+ x(i) = 42
+end do
+
+!$omp simd lastprivate(i)
+do i = 1, 5
+ x(i) = 42
+end do
+
+
+!$omp simd private(i) lastprivate(j) collapse(2)
+do i = 1, 5
+ do j = 1, 2
+ y(j, i) = 52
+ end do
+end do
+
+!$omp simd lastprivate(i) private(j) collapse(2)
+do i = 1, 5
+ do j = 1, 2
+ y(j, i) = 52
+ end do
+end do
+
+!$omp parallel do firstprivate(i)
+do i = 1, 5 ! { dg-error "PARALLEL DO iteration variable present on clause other than PRIVATE or LASTPRIVATE" }
+ x(i) = 42
+end do
+
+!$omp parallel do simd firstprivate(i)
+do i = 1, 5 ! { dg-error "PARALLEL DO SIMD iteration variable present on clause other than PRIVATE, LASTPRIVATE or LINEAR" }
+ x(i) = 42
+end do
+
+!$omp simd linear(i) collapse(2)
+do i = 1, 5 ! { dg-error "SIMD iteration variable present on clause other than PRIVATE or LASTPRIVATE" }
+ do j = 1, 2
+ y(j, i) = 52
+ end do
+end do
+
+
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/order-3.f90 b/gcc/testsuite/gfortran.dg/gomp/order-3.f90
new file mode 100644
index 00000000000..06df89fc392
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/order-3.f90
@@ -0,0 +1,227 @@
+module my_omp_mod
+ use iso_c_binding, only: c_loc
+ implicit none
+ integer :: v
+ interface
+ integer function omp_get_thread_num () bind(C)
+ end
+ integer function omp_get_num_threads () bind(C)
+ end
+ integer function omp_get_cancellation () bind(C)
+ end
+ integer function omp_target_is_present (ptr, device_num) bind(C)
+ use iso_c_binding, only: c_ptr
+ type(c_ptr), value :: ptr
+ integer :: device_num
+ end
+ end interface
+contains
+ subroutine foo ()
+ end
+end
+
+subroutine f1 (a, b)
+ use my_omp_mod
+ implicit none
+ integer :: a(:), b(:,:)
+ target :: a
+ integer i, j
+ !$omp simd order(concurrent)
+ do i = 1, 64
+ !$omp parallel ! { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" }
+ call foo ()
+ !$omp end parallel
+ end do
+ !$omp end simd
+ !$omp simd order(concurrent)
+ do i = 1, 64
+ !$omp simd
+ do j = 1, 64
+ b(j, i) = i + j
+ end do
+ end do
+ !$omp simd order(concurrent)
+ do i = 1, 64
+ !$omp critical ! { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" }
+ call foo ()
+ !$omp end critical
+ end do
+ !$omp simd order(concurrent)
+ do i = 1, 64
+ !$omp ordered simd ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" }
+ call foo ()
+ !$omp end ordered
+ end do
+ !$omp simd order(concurrent)
+ do i = 1, 64
+ !$omp atomic ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" }
+ v = v + 1
+ end do
+ !$omp simd order(concurrent)
+ do i = 1, 64
+ !$omp atomic read ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" }
+ a(i) = v
+ end do
+ !$omp simd order(concurrent)
+ do i = 1, 64
+ !$omp atomic write ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" }
+ v = a(i)
+ end do
+ !$omp simd order(concurrent)
+ do i = 1, 64
+ a(i) = a(i) + omp_get_thread_num () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" }
+ end do
+ !$omp simd order(concurrent)
+ do i = 1, 64
+ a(i) = a(i) + omp_get_num_threads () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" }
+ end do
+ !$omp simd order(concurrent)
+ do i = 1, 64
+ a(i) = a(i) + omp_target_is_present (c_loc(a(i)), 0) ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" }
+ end do
+ !$omp simd order(concurrent)
+ do i = 1, 64
+ a(i) = a(i) + omp_get_cancellation () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" }
+ end do
+end
+
+subroutine f2 (a, b)
+ use my_omp_mod
+ implicit none
+ integer a(:), b(:,:)
+ target :: a
+ integer i, j
+ !$omp do simd order(concurrent)
+ do i = 1, 64
+ !$omp parallel ! { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" }
+ call foo ()
+ !$omp end parallel
+ end do
+ !$omp do simd order(concurrent)
+ do i = 1, 64
+ !$omp simd
+ do j = 1, 64
+ b (j, i) = i + j
+ end do
+ end do
+ !$omp do simd order(concurrent)
+ do i = 1, 64
+ !$omp critical ! { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" }
+ call foo ()
+ !$omp end critical
+ end do
+ !$omp do simd order(concurrent)
+ do i = 1, 64
+ !$omp ordered simd ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" }
+ call foo ()
+ !$omp end ordered
+ end do
+ !$omp do simd order(concurrent)
+ do i = 1, 64
+ !$omp atomic ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" }
+ v = v + 1
+ end do
+ !$omp do simd order(concurrent)
+ do i = 1, 64
+ !$omp atomic read ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" }
+ a(i) = v
+ end do
+ !$omp do simd order(concurrent)
+ do i = 1, 64
+ !$omp atomic write ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" }
+ v = a(i)
+ end do
+ !$omp do simd order(concurrent)
+ do i = 1, 64
+ a(i) = a(i) + omp_get_thread_num () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" }
+ end do
+ !$omp do simd order(concurrent)
+ do i = 1, 64
+ a(i) = a(i) + omp_get_num_threads () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" }
+ end do
+ !$omp do simd order(concurrent)
+ do i = 1, 64
+ a(i) = a(i) + omp_target_is_present (c_loc(a(i)), 0) ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" }
+ end do
+ !$omp do simd order(concurrent)
+ do i = 1, 64
+ a(i) = a(i) + omp_get_cancellation () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" }
+ end do
+end
+
+subroutine f3 (a, b)
+ use my_omp_mod
+ implicit none
+ integer :: a(:), b(:,:)
+ target :: a
+ integer i, j
+ !$omp do order(concurrent)
+ do i = 1, 64
+ !$omp parallel
+ call foo ()
+ !$omp end parallel
+ end do
+ !$omp do order(concurrent)
+ do i = 1, 64
+ !$omp simd
+ do j = 1, 64
+ b(j, i) = i + j
+ end do
+ end do
+ !$omp do order(concurrent)
+ do i = 1, 64
+ !$omp critical ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" }
+ call foo ()
+ !$omp end critical
+ end do
+ !$omp do order(concurrent)
+ do i = 1, 64
+ !$omp ordered simd ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" }
+ call foo ()
+ !$omp end ordered
+ end do
+ !$omp do order(concurrent)
+ do i = 1, 64
+ !$omp atomic ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" }
+ v = v + 1
+ end do
+ !$omp do order(concurrent)
+ do i = 1, 64
+ !$omp atomic read ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" }
+ a(i) = v
+ end do
+ !$omp do order(concurrent)
+ do i = 1, 64
+ !$omp atomic write ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" }
+ v = a(i)
+ end do
+ !$omp do order(concurrent)
+ do i = 1, 64
+ !$omp task ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" }
+ a(i) = a(i) + 1
+ !$omp end task
+ end do
+ !$omp do order(concurrent)
+ do i = 1, 64
+ !$omp taskloop ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" }
+ do j = 1, 64
+ b(j, i) = i + j
+ end do
+ end do
+ !$omp do order(concurrent)
+ do i = 1, 64
+ a(i) = a(i) + omp_get_thread_num () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" }
+ end do
+ !$omp do order(concurrent)
+ do i = 1, 64
+ a(i) = a(i) + omp_get_num_threads () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" }
+ end do
+ !$omp do order(concurrent)
+ do i = 1, 64
+ a(i) = a(i) + omp_target_is_present (c_loc(a(i)), 0) ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" }
+ end do
+ !$omp do order(concurrent)
+ do i = 1, 64
+ a(i) = a(i) + omp_get_cancellation () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" }
+ end do
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/order-4.f90 b/gcc/testsuite/gfortran.dg/gomp/order-4.f90
new file mode 100644
index 00000000000..e4580e38b89
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/order-4.f90
@@ -0,0 +1,34 @@
+module m
+ integer t;
+ !$omp threadprivate(t)
+end
+
+subroutine f1
+ use m
+ implicit none
+ integer :: i
+ !$omp simd order(concurrent) ! { dg-message "note: enclosing region" } */
+ do i = 1, 64
+ t = t + 1 ! { dg-error "threadprivate variable 't' used in a region with 'order\\(concurrent\\)' clause" } */
+ end do
+end
+
+subroutine f2
+ use m
+ implicit none
+ integer :: i
+ !$omp do simd order(concurrent) ! { dg-message "note: enclosing region" } */
+ do i = 1, 64
+ t = t + 1 ! { dg-error "threadprivate variable 't' used in a region with 'order\\(concurrent\\)' clause" } */
+ end do
+end
+
+subroutine f3
+ use m
+ implicit none
+ integer :: i
+ !$omp do order(concurrent) ! { dg-message "note: enclosing region" } */
+ do i = 1, 64
+ t = t + 1 ! { dg-error "threadprivate variable 't' used in a region with 'order\\(concurrent\\)' clause" } */
+ end do
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr33439.f90 b/gcc/testsuite/gfortran.dg/gomp/pr33439.f90
index 42fa22184b3..12a73d22d1a 100644
--- a/gcc/testsuite/gfortran.dg/gomp/pr33439.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/pr33439.f90
@@ -5,7 +5,7 @@
subroutine pr33439_1
integer :: s, i
s = 4
-!$omp parallel default(none) ! { dg-error "enclosing 'parallel'" }
+!$omp parallel default(none) ! { dg-message "note: enclosing 'parallel'" }
call somethingelse
!$omp do schedule(static, s) ! { dg-error "not specified in enclosing 'parallel'" }
do i = 1, 8
@@ -18,7 +18,7 @@ end subroutine pr33439_1
subroutine pr33439_2
integer :: s, i
s = 4
-!$omp parallel default(none) ! { dg-error "enclosing 'parallel'" }
+!$omp parallel default(none) ! { dg-message "note: enclosing 'parallel'" }
!$omp do schedule(static, s) ! { dg-error "not specified in enclosing 'parallel'" }
do i = 1, 8
call something
@@ -30,7 +30,8 @@ end subroutine pr33439_2
subroutine pr33439_3
integer :: s, i
s = 4
-!$omp parallel do default(none) schedule(static, s) ! { dg-error "enclosing 'parallel'" }
+!$omp parallel do default(none) schedule(static, s) ! { dg-message "note: enclosing 'parallel'" }
+! ! { dg-error "'s' not specified in enclosing 'parallel'" "" { target *-*-* } .-1 }
do i = 1, 8
call something
end do
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90 b/gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90
index 1caa93df8c3..ef90d132653 100644
--- a/gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90
@@ -11,14 +11,14 @@ subroutine foo(a, b)
!$omp parallel default(none) private (x)
x = a(4)
!$omp end parallel
-!$omp parallel default(none) private (x) ! { dg-error "enclosing 'parallel'" }
+!$omp parallel default(none) private (x) ! { dg-message "note: enclosing 'parallel'" }
x = b(5) ! { dg-error "not specified in" }
!$omp end parallel
!$omp parallel default(none) private (x)
x = c(6)
!$omp end parallel
d => a
-!$omp parallel default(none) private (x) ! { dg-error "enclosing 'parallel'" }
+!$omp parallel default(none) private (x) ! { dg-message "note: enclosing 'parallel'" }
x = d(7) ! { dg-error "not specified in" }
!$omp end parallel
end
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr44085.f90 b/gcc/testsuite/gfortran.dg/gomp/pr44085.f90
index db8fbbc9544..90094d6ef47 100644
--- a/gcc/testsuite/gfortran.dg/gomp/pr44085.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/pr44085.f90
@@ -8,7 +8,7 @@
common /thrs/ thr3, thr4
!$omp threadprivate (thr1, thr2, /thrs/)
-!$omp task untied ! { dg-error "enclosing task" }
+!$omp task untied ! { dg-message "note: enclosing task" }
thr1 = thr1 + 1 ! { dg-error "used in untied task" }
thr2 = thr2 + 2 ! { dg-error "used in untied task" }
thr3 = thr3 + 3 ! { dg-error "used in untied task" }
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr44536.f90 b/gcc/testsuite/gfortran.dg/gomp/pr44536.f90
index 4fcf5d1102b..c1d83cdeae5 100644
--- a/gcc/testsuite/gfortran.dg/gomp/pr44536.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/pr44536.f90
@@ -4,7 +4,7 @@
subroutine foo (a, i, j)
integer, dimension(:) :: a
integer :: i, j
-!$omp parallel default(none) shared(i, j) ! { dg-error "enclosing 'parallel'" }
+!$omp parallel default(none) shared(i, j) ! { dg-message "note: enclosing 'parallel'" }
j=a(i) ! { dg-error "not specified in" }
!$omp end parallel
end subroutine
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr79154-1.f90 b/gcc/testsuite/gfortran.dg/gomp/pr79154-1.f90
index 69a0009e13c..ea147bfa78e 100644
--- a/gcc/testsuite/gfortran.dg/gomp/pr79154-1.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/pr79154-1.f90
@@ -2,7 +2,7 @@
! { dg-do compile }
pure real function foo (a, b) ! { dg-warning "GCC does not currently support mixed size types for 'simd' functions" "" { target aarch64*-*-* } }
-!$omp declare simd(foo) ! { dg-bogus "may not appear in PURE or ELEMENTAL" }
+!$omp declare simd(foo) ! { dg-bogus "may not appear in PURE" }
real, intent(in) :: a, b
foo = a + b
end function foo
@@ -10,23 +10,28 @@ pure function bar (a, b)
real, intent(in) :: a(8), b(8)
real :: bar(8)
integer :: i
-!$omp simd ! { dg-bogus "may not appear in PURE or ELEMENTAL" }
+!$omp simd ! { dg-bogus "may not appear in PURE" }
do i = 1, 8
bar(i) = a(i) + b(i)
end do
end function bar
pure real function baz (a, b)
-!$omp declare target ! { dg-bogus "may not appear in PURE or ELEMENTAL" }
+!$omp declare target ! { dg-bogus "may not appear in PURE" }
real, intent(in) :: a, b
baz = a + b
end function baz
elemental real function fooe (a, b) ! { dg-warning "GCC does not currently support mixed size types for 'simd' functions" "" { target aarch64*-*-* } }
-!$omp declare simd(fooe) ! { dg-bogus "may not appear in PURE or ELEMENTAL" }
+!$omp declare simd(fooe) ! { dg-bogus "may not appear in PURE" }
real, intent(in) :: a, b
fooe = a + b
end function fooe
elemental real function baze (a, b)
-!$omp declare target ! { dg-bogus "may not appear in PURE or ELEMENTAL" }
+!$omp declare target ! { dg-bogus "may not appear in PURE" }
real, intent(in) :: a, b
baze = a + b
end function baze
+elemental impure real function bazei (a, b)
+!$omp declare target ! { dg-bogus "may not appear in PURE" }
+ real, intent(in) :: a, b
+ baze = a + b
+end function bazei
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr79154-2.f90 b/gcc/testsuite/gfortran.dg/gomp/pr79154-2.f90
index 67344f0c028..38d3fe5c384 100644
--- a/gcc/testsuite/gfortran.dg/gomp/pr79154-2.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/pr79154-2.f90
@@ -3,14 +3,14 @@
pure real function foo (a, b)
real, intent(in) :: a, b
-!$omp taskwait ! { dg-error "may not appear in PURE or ELEMENTAL" }
+!$omp taskwait ! { dg-error "may not appear in PURE" }
foo = a + b
end function foo
pure function bar (a, b)
real, intent(in) :: a(8), b(8)
real :: bar(8)
integer :: i
-!$omp do simd ! { dg-error "may not appear in PURE or ELEMENTAL" }
+!$omp do simd ! { dg-error "may not appear in PURE" }
do i = 1, 8
bar(i) = a(i) + b(i)
end do
@@ -19,26 +19,38 @@ pure function baz (a, b)
real, intent(in) :: a(8), b(8)
real :: baz(8)
integer :: i
-!$omp do ! { dg-error "may not appear in PURE or ELEMENTAL" }
+!$omp do ! { dg-error "may not appear in PURE" }
do i = 1, 8
baz(i) = a(i) + b(i)
end do
-!$omp end do ! { dg-error "may not appear in PURE or ELEMENTAL" }
+!$omp end do ! { dg-error "may not appear in PURE" }
end function baz
pure real function baz2 (a, b)
real, intent(in) :: a, b
-!$omp target map(from:baz2) ! { dg-error "may not appear in PURE or ELEMENTAL" }
+!$omp target map(from:baz2) ! { dg-error "may not appear in PURE" }
baz2 = a + b
-!$omp end target ! { dg-error "may not appear in PURE or ELEMENTAL" }
+!$omp end target ! { dg-error "may not appear in PURE" }
end function baz2
+! ELEMENTAL implies PURE
elemental real function fooe (a, b)
real, intent(in) :: a, b
-!$omp taskyield ! { dg-error "may not appear in PURE or ELEMENTAL" }
+!$omp taskyield ! { dg-error "may not appear in PURE" }
fooe = a + b
end function fooe
elemental real function baze (a, b)
real, intent(in) :: a, b
-!$omp target map(from:baz) ! { dg-error "may not appear in PURE or ELEMENTAL" }
+!$omp target map(from:baz) ! { dg-error "may not appear in PURE" }
baze = a + b
-!$omp end target ! { dg-error "may not appear in PURE or ELEMENTAL" }
+!$omp end target ! { dg-error "may not appear in PURE" }
end function baze
+elemental impure real function fooei (a, b)
+ real, intent(in) :: a, b
+!$omp taskyield ! { dg-bogus "may not appear in PURE" }
+ fooe = a + b
+end function fooei
+elemental impure real function bazei (a, b)
+ real, intent(in) :: a, b
+!$omp target map(from:baz) ! { dg-bogus "may not appear in PURE" }
+ baze = a + b
+!$omp end target ! { dg-bogus "may not appear in PURE" }
+end function bazei
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr79154-simd.f90 b/gcc/testsuite/gfortran.dg/gomp/pr79154-simd.f90
new file mode 100644
index 00000000000..d6b72d6f3da
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr79154-simd.f90
@@ -0,0 +1,16 @@
+! { dg-options "-fno-openmp -fopenmp-simd" }
+!
+pure subroutine bar(a)
+ integer, intent(in) :: a(:)
+ !$omp target enter data map(to:a) ! Ignored with -fopenmp-simd otherwise invalid in PURE
+end
+
+pure subroutine foo(a,b)
+ integer, intent(out) :: a(5)
+ integer, intent(in) :: b(5)
+ !$omp target teams distribute simd ! { dg-error "may not appear in PURE procedures" }
+ do i=1, 5
+ a(i) = b(i)
+ end do
+ !$omp end target teams distribute
+end subroutine
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr94672.f90 b/gcc/testsuite/gfortran.dg/gomp/pr94672.f90
new file mode 100644
index 00000000000..d1b066ca1ef
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr94672.f90
@@ -0,0 +1,127 @@
+! { dg-do compile }
+
+SUBROUTINE foo(n,array)
+ IMPLICIT NONE
+ INTEGER, INTENT (IN) :: n
+ REAL, INTENT(INOUT),OPTIONAL:: array(:)
+ INTEGER:: i
+
+ !$OMP PARALLEL DO DEFAULT(none) SHARED(array,n) PRIVATE(i)
+ DO i = 1,n
+ IF (PRESENT(array)) THEN
+ array(i) = array(i) + i
+ ENDIF
+ ENDDO
+ !$OMP END PARALLEL DO
+END SUBROUTINE foo
+
+subroutine s1 (array)
+ real, optional :: array(:)
+ !$omp parallel default(none) firstprivate (array)
+ if (present (array)) array(:) = 3
+ !$omp end parallel
+end subroutine
+
+subroutine s2 (array)
+ real, optional :: array(:)
+ !$omp parallel default(none) shared (array)
+ !$omp master
+ if (present (array)) array(:) = 3
+ !$omp end master
+ !$omp end parallel
+end subroutine
+
+subroutine s3 (array)
+ real, optional :: array(:)
+ !$omp parallel default(none) private (array)
+ if (present (array)) array(:) = 3
+ !$omp end parallel
+end subroutine
+
+subroutine s4 (arg)
+ real, optional :: arg
+ !$omp parallel default(none) firstprivate (arg)
+ if (present (arg)) arg = 3
+ !$omp end parallel
+end subroutine
+
+subroutine s5 (arg)
+ real, optional :: arg
+ !$omp parallel default(none) shared (arg)
+ !$omp master
+ if (present (arg)) arg = 3
+ !$omp end master
+ !$omp end parallel
+end subroutine
+
+subroutine s6 (arg)
+ real, optional :: arg
+ !$omp parallel default(none) private (arg)
+ if (present (arg)) arg = 3
+ !$omp end parallel
+end subroutine
+
+subroutine s7 (arg)
+ real, value, optional :: arg
+ !$omp parallel default(none) firstprivate (arg)
+ if (present (arg)) arg = 3
+ !$omp end parallel
+end subroutine
+
+subroutine s8 (arg)
+ real, value, optional :: arg
+ !$omp parallel default(none) shared (arg)
+ !$omp master
+ if (present (arg)) arg = 3
+ !$omp end master
+ !$omp end parallel
+end subroutine
+
+subroutine s9 (arg)
+ real, value, optional :: arg
+ !$omp parallel default(none) private (arg)
+ if (present (arg)) arg = 3
+ !$omp end parallel
+end subroutine
+
+subroutine s10 (arg)
+ real, optional :: arg(..)
+ !$omp parallel default(none) private (arg)
+ if (present (arg)) stop 10
+ !$omp end parallel
+end subroutine
+
+subroutine w1 (array)
+ real, optional :: array(:)
+ !$omp parallel default(none) ! { dg-message "note: enclosing 'parallel'" }
+ if (.not.present (array)) stop 1 ! { dg-error "'array' not specified in enclosing 'parallel'" }
+ !$omp end parallel
+end subroutine
+
+subroutine w2 (array2)
+ real, optional :: array2(*)
+ !$omp parallel default(none) ! { dg-message "note: enclosing 'parallel'" "TODO" { xfail *-*-* } }
+ if (.not.present (array2)) stop 2 ! { dg-error "'array2' not specified in enclosing 'parallel'" "TODO" { xfail *-*-* } }
+ !$omp end parallel
+end subroutine
+
+subroutine w3 (arg)
+ real, optional :: arg
+ !$omp parallel default(none) ! { dg-message "note: enclosing 'parallel'" }
+ if (.not.present (arg)) stop 3 ! { dg-error "'arg' not specified in enclosing 'parallel'" }
+ !$omp end parallel
+end subroutine
+
+subroutine w4 (arg2)
+ real, value, optional :: arg2
+ !$omp parallel default(none) ! { dg-message "note: enclosing 'parallel" "TODO" { xfail *-*-* } }
+ if (.not.present (arg2)) stop 4 ! { dg-error "'arg2' not specified in enclosing 'parallel'" "TODO" { xfail *-*-*} }
+ !$omp end parallel
+end subroutine
+
+subroutine w5 (array3)
+ real, optional :: array3(..)
+ !$omp parallel default(none) ! { dg-message "note: enclosing 'parallel'" }
+ if (.not.present (array3)) stop 5 ! { dg-error "'array3' not specified in enclosing 'parallel'" }
+ !$omp end parallel
+end subroutine
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr95869.f90 b/gcc/testsuite/gfortran.dg/gomp/pr95869.f90
new file mode 100644
index 00000000000..daa8d214094
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr95869.f90
@@ -0,0 +1,18 @@
+! PR fortran/95869
+! { dg-do compile }
+
+program pr95869
+ implicit none
+
+ integer, parameter :: N = 100
+ integer, parameter :: LIMIT = 60
+ integer :: i, j
+ integer, dimension(N) :: a = (/ (i, i = 1,N) /)
+ do j = 1, N
+ !$omp target parallel if(j .lt. LIMIT) map(tofrom: a(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1
+ end do
+ !$omp end target parallel
+ end do
+end program
diff --git a/gcc/testsuite/gfortran.dg/gomp/requires-1.f90 b/gcc/testsuite/gfortran.dg/gomp/requires-1.f90
new file mode 100644
index 00000000000..b115a654e71
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/requires-1.f90
@@ -0,0 +1,13 @@
+subroutine foo
+!$omp requires unified_address
+!$omp requires unified_shared_memory
+!$omp requires unified_shared_memory unified_address
+!$omp requires dynamic_allocators,reverse_offload
+end
+
+subroutine bar
+!$omp requires unified_shared_memory unified_address
+!$omp requires atomic_default_mem_order(seq_cst)
+end
+
+! { dg-prune-output "not yet supported" }
diff --git a/gcc/testsuite/gfortran.dg/gomp/requires-2.f90 b/gcc/testsuite/gfortran.dg/gomp/requires-2.f90
new file mode 100644
index 00000000000..7b63d4a8b3b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/requires-2.f90
@@ -0,0 +1,14 @@
+!$omp requires ! { dg-error "Clause expected" }
+!$omp requires unified_shared_memory,unified_shared_memory ! { dg-error "specified more than once" }
+!$omp requires unified_address unified_address ! { dg-error "specified more than once" }
+!$omp requires reverse_offload reverse_offload ! { dg-error "specified more than once" }
+!$omp requires foobarbaz ! { dg-error "Expected UNIFIED_ADDRESS, UNIFIED_SHARED_MEMORY, DYNAMIC_ALLOCATORS, REVERSE_OFFLOAD, or ATOMIC_DEFAULT_MEM_ORDER clause" }
+!$omp requires dynamic_allocators , dynamic_allocators ! { dg-error "specified more than once" }
+!$omp requires atomic_default_mem_order(seq_cst) atomic_default_mem_order(seq_cst) ! { dg-error "specified more than once" }
+!$omp requires atomic_default_mem_order (seq_cst)
+!$omp requires atomic_default_mem_order (seq_cst)
+!$omp requires atomic_default_mem_order (acq_rel) ! { dg-error "overrides a previous 'atomic_default_mem_order\\(seq_cst\\)'" }
+!$omp requires atomic_default_mem_order (foo) ! { dg-error "Expected SEQ_CST, ACQ_REL or RELAXED for ATOMIC_DEFAULT_MEM_ORDER clause" }
+end
+
+! { dg-prune-output "not yet supported" }
diff --git a/gcc/testsuite/gfortran.dg/gomp/requires-3.f90 b/gcc/testsuite/gfortran.dg/gomp/requires-3.f90
new file mode 100644
index 00000000000..4429aab2ee6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/requires-3.f90
@@ -0,0 +1,4 @@
+!$omp requires atomic_default_mem_order(acquire) ! { dg-error "Expected SEQ_CST, ACQ_REL or RELAXED for ATOMIC_DEFAULT_MEM_ORDER clause" }
+!$omp requires atomic_default_mem_order(release) ! { dg-error "Expected SEQ_CST, ACQ_REL or RELAXED for ATOMIC_DEFAULT_MEM_ORDER clause" }
+!$omp requires atomic_default_mem_order(foobar) ! { dg-error "Expected SEQ_CST, ACQ_REL or RELAXED for ATOMIC_DEFAULT_MEM_ORDER clause" }
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/requires-4.f90 b/gcc/testsuite/gfortran.dg/gomp/requires-4.f90
new file mode 100644
index 00000000000..e0eb4dbc603
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/requires-4.f90
@@ -0,0 +1,36 @@
+subroutine bar
+!$omp requires unified_shared_memory,unified_address,reverse_offload
+end
+
+module m
+!$omp requires unified_shared_memory,unified_address,reverse_offload
+end module m
+
+subroutine foo
+ !$omp target
+ !$omp end target
+! { dg-error "OpenMP device constructs/routines but does not set !.OMP REQUIRES REVERSE_OFFSET but other program units do" "" { target *-*-* } 9 }
+! { dg-error "OpenMP device constructs/routines but does not set !.OMP REQUIRES UNIFIED_ADDRESS but other program units do" "" { target *-*-* } 9 }
+! { dg-error "OpenMP device constructs/routines but does not set !.OMP REQUIRES UNIFIED_SHARED_MEMORY but other program units do" "" { target *-*-* } 9 }
+end
+
+subroutine foobar
+i = 5 ! < execution statement
+!$omp requires atomic_default_mem_order(seq_cst) ! { dg-error "Unexpected ..OMP REQUIRES statement" }
+end
+
+program main
+!$omp requires dynamic_allocators ! OK
+!$omp requires unified_shared_memory
+!$omp requires unified_address
+!$omp requires reverse_offload
+contains
+ subroutine foo
+ !$target
+ !$end target
+ end subroutine
+ subroutine bar
+ !$omp requires unified_addres ! { dg-error "must appear in the specification part of a program unit" }
+ end subroutine bar
+end
+! { dg-prune-output "not yet supported" }
diff --git a/gcc/testsuite/gfortran.dg/gomp/requires-5.f90 b/gcc/testsuite/gfortran.dg/gomp/requires-5.f90
new file mode 100644
index 00000000000..ade2a3613c6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/requires-5.f90
@@ -0,0 +1,16 @@
+subroutine bar
+!$omp requires atomic_default_mem_order(seq_cst)
+!$omp requires unified_shared_memory
+end
+
+subroutine foo
+!$omp requires unified_shared_memory
+!$omp requires unified_shared_memory
+!$omp requires atomic_default_mem_order(relaxed)
+!$omp requires atomic_default_mem_order(relaxed)
+!$omp requires atomic_default_mem_order(seq_cst) ! { dg-error "overrides a previous 'atomic_default_mem_order\\(seq_cst\\)'" }
+ !$omp target
+ !$omp end target
+end
+
+! { dg-prune-output "not yet supported" }
diff --git a/gcc/testsuite/gfortran.dg/gomp/requires-6.f90 b/gcc/testsuite/gfortran.dg/gomp/requires-6.f90
new file mode 100644
index 00000000000..cabd3d94a90
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/requires-6.f90
@@ -0,0 +1,16 @@
+subroutine bar
+!$omp atomic
+ i = i + 5
+end
+
+subroutine foo
+!$omp requires atomic_default_mem_order(seq_cst)
+end
+
+subroutine foobar
+!$omp atomic
+ i = i + 5
+!$omp requires atomic_default_mem_order(acq_rel) ! { dg-error "Unexpected !.OMP REQUIRES statement" }
+end
+
+! { dg-prune-output "not yet supported" }
diff --git a/gcc/testsuite/gfortran.dg/gomp/requires-7.f90 b/gcc/testsuite/gfortran.dg/gomp/requires-7.f90
new file mode 100644
index 00000000000..3d75b89e00b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/requires-7.f90
@@ -0,0 +1,41 @@
+subroutine bar2
+ block
+ !$omp requires unified_shared_memory ! { dg-error "must appear in the specification part of a program unit" }
+ end block
+end
+
+subroutine bar
+contains
+ subroutine foo
+ !$omp requires unified_shared_memory ! { dg-error "must appear in the specification part of a program unit" }
+ end
+end
+
+module m
+contains
+ subroutine foo
+ !$omp requires unified_shared_memory ! { dg-error "must appear in the specification part of a program unit" }
+ end
+end
+
+module m2
+ interface
+ module subroutine foo()
+ end
+ end interface
+end
+
+submodule (m2) m2_sub
+ !$omp requires unified_shared_memory
+contains
+ module procedure foo
+ end
+end
+
+program main
+contains
+ subroutine foo
+ !$omp requires unified_shared_memory ! { dg-error "must appear in the specification part of a program unit" }
+ end
+end
+! { dg-prune-output "not yet supported" }
diff --git a/gcc/testsuite/gfortran.dg/gomp/requires-8.f90 b/gcc/testsuite/gfortran.dg/gomp/requires-8.f90
new file mode 100644
index 00000000000..3c32ae9860e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/requires-8.f90
@@ -0,0 +1,22 @@
+module m ! { dg-error "has OpenMP device constructs/routines but does not set !.OMP REQUIRES UNIFIED_SHARED_MEMORY but other program units do" }
+ !$omp requires reverse_offload
+contains
+ subroutine foo
+ interface
+ subroutine bar2
+ !$!omp requires dynamic_allocators
+ end subroutine
+ end interface
+ !$omp target
+ call bar2()
+ !$omp end target
+ end subroutine foo
+end module m
+
+subroutine bar ! { dg-error "has OpenMP device constructs/routines but does not set !.OMP REQUIRES REVERSE_OFFSET but other program units do" }
+ !use m
+ !$omp requires unified_shared_memory
+ !$omp declare target
+end subroutine bar
+
+! { dg-prune-output "not yet supported" }
diff --git a/gcc/testsuite/gfortran.dg/gomp/requires-9.f90 b/gcc/testsuite/gfortran.dg/gomp/requires-9.f90
new file mode 100644
index 00000000000..a2b0f50ae73
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/requires-9.f90
@@ -0,0 +1,85 @@
+! { dg-additional-options "-fdump-tree-original" }
+
+module relaxed
+ !$omp requires atomic_default_mem_order(relaxed)
+end module relaxed
+
+module seq
+ !$omp requires atomic_default_mem_order(seq_cst)
+end module seq
+
+module acq
+ !$omp requires atomic_default_mem_order(acq_rel)
+end module acq
+
+subroutine sub1
+ !$omp atomic ! <= relaxed
+ i1 = i1 + 5
+end subroutine
+
+subroutine sub2
+ !$omp atomic seq_cst
+ i2 = i2 + 5
+end subroutine
+
+subroutine sub3
+ use relaxed
+ !$omp atomic
+ i3 = i3 + 5
+end subroutine
+
+subroutine sub4
+ use relaxed
+ !$omp atomic seq_cst
+ i4 = i4 + 5
+end subroutine
+
+subroutine sub5
+ use seq
+ !$omp atomic
+ i5 = i5 + 5
+contains
+ subroutine bar
+ block
+ !$omp atomic
+ i5b = i5b + 5
+ end block
+ end
+end subroutine
+
+subroutine sub6
+ use seq
+ !$omp atomic seq_cst
+ i6 = i6 + 5
+end subroutine
+
+subroutine sub7
+ use acq
+ !$omp atomic
+ i7 = i7 + 5
+contains
+ subroutine foobar
+ block
+ !$omp atomic
+ i7b = i7b + 5
+ end block
+ end
+end subroutine
+
+subroutine sub8
+ use acq
+ !$omp atomic seq_cst
+ i8 = i8 + 5
+end subroutine
+
+! { dg-final { scan-tree-dump-times "#pragma omp atomic relaxed\[\n\r]\[^\n\r]*&i1 =" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp atomic seq_cst\[\n\r]\[^\n\r]*&i2 =" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp atomic relaxed\[\n\r]\[^\n\r]*&i3 =" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp atomic seq_cst\[\n\r]\[^\n\r]*&i4 =" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp atomic seq_cst\[\n\r]\[^\n\r]*&i5 =" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp atomic seq_cst\[\n\r]\[^\n\r]*&i5 =" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp atomic seq_cst\[\n\r]\[^\n\r]*&i5b =" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp atomic seq_cst\[\n\r]\[^\n\r]*&i6 =" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp atomic acq_rel\[\n\r]\[^\n\r]*&i7 =" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp atomic acq_rel\[\n\r]\[^\n\r]*&i7b =" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp atomic seq_cst\[\n\r]\[^\n\r]*&i8 =" 1 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/gomp/sharing-1.f90 b/gcc/testsuite/gfortran.dg/gomp/sharing-1.f90
index ad9149ebe39..f4958b81d6c 100644
--- a/gcc/testsuite/gfortran.dg/gomp/sharing-1.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/sharing-1.f90
@@ -9,7 +9,7 @@
!$omp threadprivate (/thrblk/, thrpriv)
s = 1
!$omp parallel do default (none) &
-!$omp & private (p) shared (s) ! { dg-error "enclosing 'parallel'" }
+!$omp & private (p) shared (s) ! { dg-message "note: enclosing 'parallel'" }
do i = 1, 64
call foo (thrpriv) ! Predetermined - threadprivate
call foo (thr) ! Predetermined - threadprivate
diff --git a/gcc/testsuite/gfortran.dg/gomp/sharing-2.f90 b/gcc/testsuite/gfortran.dg/gomp/sharing-2.f90
index bf5519070d4..acc8d37771c 100644
--- a/gcc/testsuite/gfortran.dg/gomp/sharing-2.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/sharing-2.f90
@@ -9,7 +9,7 @@
j = 8
end do
!$omp end parallel do
-!$omp parallel default (none) shared (a) ! { dg-error "enclosing 'parallel'" }
+!$omp parallel default (none) shared (a) ! { dg-message "note: enclosing 'parallel'" }
i = 1
j = 1
k = 1
@@ -28,7 +28,7 @@
end do
!$omp end single
!$omp end parallel
-!$omp parallel default (none) shared (a) ! { dg-error "enclosing 'parallel'" }
+!$omp parallel default (none) shared (a) ! { dg-message "note: enclosing 'parallel'" }
i = 1 ! { dg-error "not specified in" }
j = 1 ! { dg-error "not specified in" }
k = 1 ! { dg-error "not specified in" }
@@ -54,21 +54,21 @@
j = 1
k = 1
!$omp end parallel
-!$omp parallel default (none) shared (a) ! { dg-error "enclosing 'parallel'" }
+!$omp parallel default (none) shared (a) ! { dg-message "note: enclosing 'parallel'" }
i = 1 ! { dg-error "not specified in" }
!$omp do
do i = 1, 10
a(i, 1) = i + 1
end do
!$omp end parallel
-!$omp parallel default (none) shared (a) ! { dg-error "enclosing 'parallel'" }
+!$omp parallel default (none) shared (a) ! { dg-message "note: enclosing 'parallel'" }
i = 1 ! { dg-error "not specified in" }
!$omp parallel do default (none) shared (a)
do i = 1, 10
a(i, 1) = i + 1
end do
!$omp end parallel
-!$omp parallel default (none) shared (a) ! { dg-error "enclosing 'parallel'" }
+!$omp parallel default (none) shared (a) ! { dg-message "note: enclosing 'parallel'" }
i = 1 ! { dg-error "not specified in" }
!$omp parallel default (none) shared (a, i)
i = 2
diff --git a/gcc/testsuite/gfortran.dg/gomp/sharing-3.f90 b/gcc/testsuite/gfortran.dg/gomp/sharing-3.f90
index 221ec002371..a9abc7b5a33 100644
--- a/gcc/testsuite/gfortran.dg/gomp/sharing-3.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/sharing-3.f90
@@ -25,7 +25,7 @@ subroutine foo (vara, varb, varc, vard, n)
vard(1) = 1
vare(1) = 1
!$omp end parallel
- !$omp parallel default(none) ! { dg-error "enclosing 'parallel'" }
+ !$omp parallel default(none) ! { dg-message "note: enclosing 'parallel'" }
!$omp master
vara(1) = 1 ! { dg-error "not specified" }
varb(1) = 1 ! Assumed-size is predetermined
diff --git a/gcc/testsuite/gfortran.dg/gomp/target-exit-data.f90 b/gcc/testsuite/gfortran.dg/gomp/target-exit-data.f90
new file mode 100644
index 00000000000..ed57d0072d7
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/target-exit-data.f90
@@ -0,0 +1,20 @@
+! { dg-do compile }
+! { dg-additional-options "-fdump-tree-omplower" }
+!
+! PR middle-end/94635
+
+integer, allocatable :: one(:), two(:), three(:)
+
+!$omp target enter data map(alloc:one)
+!$omp target enter data map(alloc:two)
+!$omp target enter data map(to:three)
+
+! ...
+!$omp target exit data map(delete:one)
+!$omp target exit data map(release:two)
+!$omp target exit data map(from:three)
+end
+
+! { dg-final { scan-tree-dump "omp target exit data map\\(delete:.*\\) map\\(delete:one \\\[len: .*\\\]\\)" "omplower" } }
+! { dg-final { scan-tree-dump "omp target exit data map\\(release:.*\\) map\\(release:two \\\[len: .*\\\]\\)" "omplower" } }
+! { dg-final { scan-tree-dump "omp target exit data map\\(from:.*\\) map\\(release:three \\\[len: .*\\\]\\)" "omplower" } }
diff --git a/gcc/testsuite/gfortran.dg/implicit_pure_5.c b/gcc/testsuite/gfortran.dg/implicit_pure_5.c
new file mode 100644
index 00000000000..67a6d9ca45e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/implicit_pure_5.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+extern int num_calls;
+int side_effect_c()
+{
+ num_calls ++;
+}
diff --git a/gcc/testsuite/gfortran.dg/implicit_pure_5.f90 b/gcc/testsuite/gfortran.dg/implicit_pure_5.f90
new file mode 100644
index 00000000000..7f1c887e3f9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/implicit_pure_5.f90
@@ -0,0 +1,63 @@
+! { dg-do run }
+! { dg-additional-sources implicit_pure_5.c }
+! PR fortran/96018 - a wrongly marked implicit_pure
+! function caused wrong code.
+module wrapper
+ use, intrinsic :: iso_c_binding, only : c_int
+ implicit none
+ integer(kind=c_int), bind(C) :: num_calls
+contains
+
+ integer function call_side_effect() result(ierr)
+ call side_effect(ierr)
+ end function call_side_effect
+
+ integer function inner_3d(array) result(ierr)
+ real, intent(in) :: array(:,:,:)
+ integer dimensions(3)
+ dimensions = shape(array)
+ ierr = call_side_effect()
+ end function inner_3d
+
+ integer function inner_4d(array) result(ierr)
+ real, intent(in) :: array(:,:,:,:)
+ integer dimensions(4)
+ dimensions = shape(array)
+ ierr = call_side_effect()
+ end function inner_4d
+
+ subroutine write_3d()
+ real :: array(1,1,1)
+ integer ierr
+ ierr = inner_3d(array)
+ ierr = call_side_effect()
+ end subroutine write_3d
+
+ subroutine write_4d()
+ real array(1,1,1,1)
+ integer ierr
+ ierr = inner_4d(array)
+ ierr = call_side_effect()
+ end subroutine write_4d
+
+ subroutine side_effect(ierr)
+ integer, intent(out) :: ierr ! Error code
+ interface
+ integer(c_int) function side_effect_c() bind(C,name='side_effect_c')
+ use, intrinsic :: iso_c_binding, only: c_int
+ end function side_effect_c
+ end interface
+ ierr = side_effect_c()
+ end subroutine side_effect
+
+end module wrapper
+
+program self_contained
+ use wrapper
+ implicit none
+ call write_3d()
+ if (num_calls /= 2) stop 1
+ call write_4d()
+ if (num_calls /= 4) stop 2
+end program self_contained
+
diff --git a/gcc/testsuite/gfortran.dg/interface_47.f90 b/gcc/testsuite/gfortran.dg/interface_47.f90
new file mode 100644
index 00000000000..6f1d1a74ffc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/interface_47.f90
@@ -0,0 +1,19 @@
+! PR fortran/27318
+! { dg-do compile }
+! This tests for mismatch between the interface for a global
+! procedure and the procedure itself.
+
+module test
+implicit none
+interface
+ subroutine hello(n) ! { dg-warning "INTENT mismatch" }
+ integer :: n
+ end subroutine hello
+end interface
+end module test
+
+subroutine hello(n) ! { dg-warning "INTENT mismatch" }
+ integer, intent(in) :: n
+ integer :: i
+ do i = 1,n; print *, 'hello'; end do
+end subroutine hello
diff --git a/gcc/testsuite/gfortran.dg/interface_48.f90 b/gcc/testsuite/gfortran.dg/interface_48.f90
new file mode 100644
index 00000000000..f7513324172
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/interface_48.f90
@@ -0,0 +1,31 @@
+! { dg-do compile }
+! PR 96073 - this used to cause an ICE.
+! Test case by Jürgen Reuter.
+
+module m
+ implicit none
+ private
+
+ interface
+ subroutine GetXminM (set, xmin)
+ integer, intent(in) :: set
+ real, intent(out) :: xmin
+ end subroutine GetXminM
+ end interface
+ interface
+ subroutine foo(a) ! { dg-warning "Type mismatch" }
+ integer, intent(in) :: a
+ end subroutine foo
+ end interface
+
+contains
+
+ subroutine s ()
+ real :: xmin
+ integer :: set
+ external :: GetXminM, foo
+ call GetXminM (set, xmin)
+ call foo(1.0) ! { dg-warning "Type mismatch" }
+ end subroutine s
+
+end module m
diff --git a/gcc/testsuite/gfortran.dg/loop_interchange_2.f b/gcc/testsuite/gfortran.dg/loop_interchange_2.f
new file mode 100644
index 00000000000..5869c29aa4b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/loop_interchange_2.f
@@ -0,0 +1,20 @@
+C { dg-do compile }
+C { dg-options "-std=legacy -O3 -floop-interchange" }
+C PR 50439 - this used to hang. Test case by Pat Haugen.
+
+ subroutine comnul
+C-----------------------------------------------------------------------
+ implicit real*8 (a-h,o-z)
+ parameter(zero=0.0d0,half=0.5d0,one=1.0d0)
+ common/secom/rtc(9,18,10,5),rts(9,18,10,5)
+ save
+C-----------------------------------------------------------------------
+ do 110 i1=1,9
+ do 110 i2=1,18
+ do 110 i3=1,10
+ do 110 i4=1,5
+ rtc(i1,i2,i3,i4)=zero
+ rts(i1,i2,i3,i4)=zero
+ 110 continue
+ return
+ end
diff --git a/gcc/testsuite/gfortran.dg/missing_optional_dummy_6a.f90 b/gcc/testsuite/gfortran.dg/missing_optional_dummy_6a.f90
index 0e08ed3aa0c..c08c97a2c7e 100644
--- a/gcc/testsuite/gfortran.dg/missing_optional_dummy_6a.f90
+++ b/gcc/testsuite/gfortran.dg/missing_optional_dummy_6a.f90
@@ -53,7 +53,6 @@ end program test
! { dg-final { scan-tree-dump-times "assumed_shape2 \\(es1" 0 "original" } }
! { dg-final { scan-tree-dump-times "explicit_shape2 \\(es1" 1 "original" } }
-! { dg-final { scan-tree-dump-times "= as1 != 0B" 2 "original" } }
+! { dg-final { scan-tree-dump-times "= as1.0 != 0B" 2 "original" } }
! { dg-final { scan-tree-dump-times "assumed_shape2 \\(as1" 0 "original" } }
! { dg-final { scan-tree-dump-times "explicit_shape2 \\(as1" 0 "original" } }
-
diff --git a/gcc/testsuite/gfortran.dg/module_procedure_4.f90 b/gcc/testsuite/gfortran.dg/module_procedure_4.f90
new file mode 100644
index 00000000000..c30bbfe5d50
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/module_procedure_4.f90
@@ -0,0 +1,63 @@
+! { dg-do run }
+!
+! Test the fix for PR96320 in which the assumed shape of 'arg' in the
+! interface for 'bar' was mirrored by the 'arg' in the module procedure
+! incorrectly have deferred shape.
+!
+! Contributed by Damian Rouson <damian@sourceryinstitute.org>
+!
+module foobar
+ type foo
+ contains
+ procedure, nopass :: bar1
+ procedure, nopass :: bar2
+ procedure, nopass :: bar3
+ end type
+
+ interface
+
+ module subroutine bar1(arg)
+ character(len=*) arg(:)
+ end subroutine
+
+ module subroutine bar2(arg)
+ character(len=*) arg(3:)
+ end subroutine
+
+ module subroutine bar3(arg)
+ character(len=*) arg(2)
+ end subroutine
+
+ end interface
+contains
+
+ module procedure bar1
+ if (lbound(arg, 1) .ne. 1) stop 1
+ if (arg(3) .ne. 'hijk') stop 2
+ end procedure
+
+! Make sure that the lower bound of an assumed shape array dummy,
+! if defined, is passed to the module procedure.
+
+ module procedure bar2
+ if (lbound(arg, 1) .ne. 3) stop 3
+ if (arg(3) .ne. 'abcd') stop 4
+ end procedure
+
+! This makes sure that an dummy with explicit shape has the upper
+! bound correctly set in the module procedure.
+
+ module procedure bar3
+ if (lbound(arg, 1) .ne. 1) stop 5
+ if (arg(3) .ne. 'hijk') stop 6 ! { dg-warning "is out of bounds" }
+ end procedure
+
+end module
+
+ use foobar
+ character(4) :: list(3) = ['abcd', 'efgh' , 'hijk']
+ type(foo) :: f
+ call f%bar1(list)
+ call f%bar2(list)
+ call f%bar3(list)
+end
diff --git a/gcc/testsuite/gfortran.dg/namelist_97.f90 b/gcc/testsuite/gfortran.dg/namelist_97.f90
new file mode 100644
index 00000000000..3c6ad7ce3c1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_97.f90
@@ -0,0 +1,16 @@
+! { dg-do run }
+!
+! PR95195 - improve runtime error when writing a namelist to an unformatted file
+
+program test
+ character(len=11) :: my_form = 'unformatted'
+ integer :: i = 1, j = 2, k = 3
+ character(80) :: iomsg
+ namelist /nml1/ i, j, k
+ open (unit=10, file='namelist_97.dat', form=my_form)
+ write (unit=10, nml=nml1, iostat=iostat, iomsg=iomsg)
+ close (unit=10, status='delete')
+ if (iostat == 0) stop 1
+ if (iomsg /= "Namelist formatting for unit connected with FORM='UNFORMATTED'") &
+ stop 2
+end program test
diff --git a/gcc/testsuite/gfortran.dg/pr39695_1.f90 b/gcc/testsuite/gfortran.dg/pr39695_1.f90
new file mode 100644
index 00000000000..4c4b3045f69
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr39695_1.f90
@@ -0,0 +1,8 @@
+! { dg-do compile }
+!
+
+function f()
+ intrinsic :: sin
+ procedure(sin), pointer :: f ! { dg-error "Procedure pointer 'f'" }
+ f => sin
+end function f
diff --git a/gcc/testsuite/gfortran.dg/pr39695_2.f90 b/gcc/testsuite/gfortran.dg/pr39695_2.f90
new file mode 100644
index 00000000000..8534724959a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr39695_2.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+!
+
+function g()
+ interface
+ subroutine g()
+ end subroutine g
+ end interface
+ pointer g
+ real g ! { dg-error "Symbol 'g' at .1. cannot have a type" }
+end function
+
diff --git a/gcc/testsuite/gfortran.dg/pr39695_3.f90 b/gcc/testsuite/gfortran.dg/pr39695_3.f90
new file mode 100644
index 00000000000..661e2540bb3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr39695_3.f90
@@ -0,0 +1,11 @@
+! { dg-do compile }
+!
+
+function g()
+ interface
+ subroutine g() ! { dg-error "RESULT attribute in 'g'" }
+ end subroutine g
+ end interface
+ real g ! { dg-error "Symbol 'g' at .1. cannot have a type" }
+end function
+
diff --git a/gcc/testsuite/gfortran.dg/pr39695_4.f90 b/gcc/testsuite/gfortran.dg/pr39695_4.f90
new file mode 100644
index 00000000000..ecb0a43929f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr39695_4.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+!
+
+function g()
+ implicit none
+ interface
+ function g()
+ integer g
+ end function g
+ end interface
+ pointer g
+ real g ! { dg-error "Symbol 'g' at .1. already has basic type of INTEGER" }
+end function
+
diff --git a/gcc/testsuite/gfortran.dg/pr45337_1.f90 b/gcc/testsuite/gfortran.dg/pr45337_1.f90
new file mode 100644
index 00000000000..2bb8ff244cc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr45337_1.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+
+module ptrmod
+contains
+subroutine lengthX(x, i) ! { dg-error "Dummy 'x' at .1. cannot have an initializer" }
+ implicit none
+ real, pointer, intent(out) :: x(:)=>null()
+ integer :: i
+ x=>null()
+ allocate(x(i))
+ x=i
+end subroutine
+end module
+
diff --git a/gcc/testsuite/gfortran.dg/pr45337_2.f90 b/gcc/testsuite/gfortran.dg/pr45337_2.f90
new file mode 100644
index 00000000000..ca7a6f53ad6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr45337_2.f90
@@ -0,0 +1,18 @@
+! { dg-do compile }
+
+type t
+end type t
+type t2
+ integer :: j = 7
+end type t2
+contains
+ subroutine x(a, b, c)
+ intent(out) :: a, b, c
+ type(t) :: a = t()
+ type(t2) :: b = t2()
+ type(t2) :: c
+ end subroutine x
+end
+
+! { dg-error "Dummy .a. at .1. cannot have an initializer" " " { target *-*-* } 9 }
+! { dg-error "Dummy .b. at .1. cannot have an initializer" " " { target *-*-* } 9 }
diff --git a/gcc/testsuite/gfortran.dg/pr50392.f b/gcc/testsuite/gfortran.dg/pr50392.f
new file mode 100644
index 00000000000..2cb883e41a3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr50392.f
@@ -0,0 +1,12 @@
+! { dg-do compile }
+!
+ function kf()
+ integer kf
+ assign 1 to kf ! { dg-warning "Deleted feature: ASSIGN statement at" }
+ kf = 2
+ goto kf ! { dg-warning "Deleted feature: Assigned GOTO statement at" }
+ kf = 1
+ 1 continue
+ kf = 0
+ end
+
diff --git a/gcc/testsuite/gfortran.dg/pr53298.f90 b/gcc/testsuite/gfortran.dg/pr53298.f90
new file mode 100644
index 00000000000..998f88df926
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr53298.f90
@@ -0,0 +1,14 @@
+! { dg-do run }
+
+program test
+ character(len=5) :: str(3)
+ str = ["abcde", "12345", "ABCDE" ]
+ call f(str(:))
+contains
+ subroutine f(x)
+ character(len=*) :: x(:)
+ write(*,*) x(:)(1:)
+ end subroutine f
+end program test
+
+! { dg-output "abcde12345ABCDE" }
diff --git a/gcc/testsuite/gfortran.dg/pr59107.f90 b/gcc/testsuite/gfortran.dg/pr59107.f90
new file mode 100644
index 00000000000..a84328f0851
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr59107.f90
@@ -0,0 +1,11 @@
+! { dg-compile }
+! { dg-options "-Wsurprising" }
+
+! There should be no surprising warnings
+
+program p
+ Integer :: nargs
+ intrinsic :: command_argument_count
+ nargs = command_argument_count()
+end
+
diff --git a/gcc/testsuite/gfortran.dg/pr66545_2.f90 b/gcc/testsuite/gfortran.dg/pr66545_2.f90
index e15d8ba792c..c15a2b36511 100644
--- a/gcc/testsuite/gfortran.dg/pr66545_2.f90
+++ b/gcc/testsuite/gfortran.dg/pr66545_2.f90
@@ -11,13 +11,13 @@ end program foo
subroutine p1
complex :: c5
complex :: c6
- c5 = (c5) ! { dg-warning "used uninitialized in this" }
- c6 = c6 ! { dg-warning "used uninitialized in this" }
+ c5 = (c5) ! { dg-warning "used uninitialized" }
+ c6 = c6 ! { dg-warning "used uninitialized" }
end subroutine p1
subroutine q1
real :: r5
real :: r6
- r5 = (r5) ! { dg-warning "used uninitialized in this" }
- r6 = r6 ! { dg-warning "used uninitialized in this" }
+ r5 = (r5) ! { dg-warning "used uninitialized" }
+ r6 = r6 ! { dg-warning "used uninitialized" }
end subroutine q1
diff --git a/gcc/testsuite/gfortran.dg/pr71706.f90 b/gcc/testsuite/gfortran.dg/pr71706.f90
new file mode 100644
index 00000000000..860c1c8be80
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr71706.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=lib -fcheck=all -fdefault-integer-8" }
+! PR fortran/71706 - ICE on using sync images with -fcheck=bounds
+
+program p
+ integer, volatile :: me = 1
+ sync images (me)
+ sync images (int (me, 2))
+ sync images (int (me, 8))
+end
diff --git a/gcc/testsuite/gfortran.dg/pr88025.f90 b/gcc/testsuite/gfortran.dg/pr88025.f90
index 96172fae76a..c51390f1434 100644
--- a/gcc/testsuite/gfortran.dg/pr88025.f90
+++ b/gcc/testsuite/gfortran.dg/pr88025.f90
@@ -2,6 +2,6 @@
! PR fortran/88025
program p
type t
- character(('')) :: c = 'c' ! { dg-error "must be of INTEGER type" }
+ character(('')) :: c = 'c' ! { dg-error "Scalar INTEGER expression expected" }
end type
end
diff --git a/gcc/testsuite/gfortran.dg/pr88379.f90 b/gcc/testsuite/gfortran.dg/pr88379.f90
new file mode 100644
index 00000000000..48a23af50c5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr88379.f90
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=single" }
+! PR fortran/88379 - ICE with allocatable coarray, class and associate
+
+program p
+ type t
+ end type t
+ class(t), allocatable :: x[:]
+ associate (y => x)
+ end associate
+end
diff --git a/gcc/testsuite/gfortran.dg/pr89574.f90 b/gcc/testsuite/gfortran.dg/pr89574.f90
new file mode 100644
index 00000000000..48dd0680a48
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr89574.f90
@@ -0,0 +1,29 @@
+! { dg-do compile }
+! PR fortran/89574 - ICE in conv_function_val, at fortran/trans-expr.c:3792
+
+module mod1
+contains
+ subroutine init
+ end subroutine
+end module
+
+module mod2
+contains
+ subroutine init
+ end subroutine
+end module
+
+module init
+ use mod1, only : test_init1 => init
+ use mod2, only : test_init2 => init
+ implicit none
+contains
+ subroutine sub
+ call test_init1
+ call test_init2
+ call init
+ contains
+ subroutine init
+ end subroutine
+ end subroutine
+end module
diff --git a/gcc/testsuite/gfortran.dg/pr91589.f90 b/gcc/testsuite/gfortran.dg/pr91589.f90
index d02cb64bfc2..375d895e0b7 100644
--- a/gcc/testsuite/gfortran.dg/pr91589.f90
+++ b/gcc/testsuite/gfortran.dg/pr91589.f90
@@ -10,6 +10,6 @@ program p
integer :: a
end type
type(t) :: x = t(1)
- call sub (x%a%a) ! { dg-error "Syntax error in argument list" }
+ call sub (x%a%a) ! { dg-error "is not an inquiry reference" }
end
diff --git a/gcc/testsuite/gfortran.dg/pr92993.f90 b/gcc/testsuite/gfortran.dg/pr92993.f90
new file mode 100644
index 00000000000..b73355357b5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr92993.f90
@@ -0,0 +1,21 @@
+! { dg-do compile }
+!
+! Original by G. Steinmetz
+
+function f(x)
+ integer, intent(in) :: x
+ integer :: f
+ f = x
+end
+
+program p
+ interface
+ function f(x) ! { dg-error "POINTER attribute mismatch in function result" }
+ integer, intent(in) :: x
+ integer, pointer :: f
+ end
+ end interface
+ integer :: a(2) = [1, 2]
+ if ( a(2) .ne. f(a(2)) ) stop 1
+end
+
diff --git a/gcc/testsuite/gfortran.dg/pr93337.f90 b/gcc/testsuite/gfortran.dg/pr93337.f90
new file mode 100644
index 00000000000..5cfb9297990
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr93337.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! PR fortran/93337 - ICE in gfc_dt_upper_string, at fortran/module.c:441
+
+program p
+ type t
+ character(:), allocatable :: a
+ end type t
+ class(t) :: x ! { dg-error "must be dummy, allocatable or pointer" }
+ x = x ! { dg-error "must not be polymorphic in intrinsic assignment" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr93366.f90 b/gcc/testsuite/gfortran.dg/pr93366.f90
new file mode 100644
index 00000000000..3cb6d1d16da
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr93366.f90
@@ -0,0 +1,18 @@
+! { dg-do compile }
+!
+! PR fortran/93366 - ICE on invalid, reject invalid use of NULL() as argument
+
+program p
+ print *, kind (null()) ! { dg-error "NULL at" }
+ print *, [ merge(null(), [1] ,.true.) ] ! { dg-error "NULL at" }
+ print *, [ merge([1] , null(),.true.) ] ! { dg-error "NULL at" }
+ print *, [ merge(null(), null(),.true.) ] ! { dg-error "NULL at" }
+ print *, shape (null()) ! { dg-error "NULL at" }
+ print *, sizeof (null()) ! { dg-error "NULL at" }
+ print *, spread (null(),1,1) ! { dg-error "NULL at" }
+ print *, transfer ( 1 , null()) ! { dg-error "NULL at" }
+ print *, transfer ([1], null()) ! { dg-error "NULL at" }
+ print *, transfer (null(), 1) ! { dg-error "NULL at" }
+ print *, transfer (null(), [1]) ! { dg-error "NULL at" }
+ print *, transfer (null(), null()) ! { dg-error "NULL at" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr93423.f90 b/gcc/testsuite/gfortran.dg/pr93423.f90
new file mode 100644
index 00000000000..fed5914daba
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr93423.f90
@@ -0,0 +1,21 @@
+! { dg-do compile }
+! PR fortran/93423 - ICE on invalid with argument list for module procedure
+
+module t
+ type :: b
+ contains
+ procedure :: p => bp
+ end type b
+ interface
+ module function bp(s)
+ class(b), intent(inout) :: s
+ integer, pointer :: bp
+ end function
+ end interface
+end module t
+
+submodule (t) ts
+contains
+ module procedure bp(s) ! { dg-error "must be in a generic module interface" }
+ end procedure bp ! { dg-error "Expecting END SUBMODULE statement" }
+end submodule ts
diff --git a/gcc/testsuite/gfortran.dg/pr93497.f90 b/gcc/testsuite/gfortran.dg/pr93497.f90
new file mode 100644
index 00000000000..612b41cd8ca
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr93497.f90
@@ -0,0 +1,8 @@
+! { dg-do compile }
+
+program p
+ print *, [character(((/1/))) :: 'a','b'] ! { dg-error "Scalar INTEGER expression expected" }
+ print *, [character(([1])) :: 'a','b'] ! { dg-error "Scalar INTEGER expression expected" }
+ print *, [character(1+[1]) :: 'a','b'] ! { dg-error "Scalar INTEGER expression expected" }
+end
+
diff --git a/gcc/testsuite/gfortran.dg/pr93499.f90 b/gcc/testsuite/gfortran.dg/pr93499.f90
new file mode 100644
index 00000000000..e3e1eda7781
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr93499.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! PR 93499 - this used to ICE. Original test case by Gerhard Steinmetz.
+
+program p
+ integer :: a((0.)/0) ! { dg-error "must be constant of INTEGER type" }
+ type t(n)
+ integer, len :: n
+ end type t
+ type(t((0)/0)) :: x ! { dg-error "does not simplify to an INTEGER constant" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr93714_1.f90 b/gcc/testsuite/gfortran.dg/pr93714_1.f90
index 40f4a4bf89f..e55812c76de 100644
--- a/gcc/testsuite/gfortran.dg/pr93714_1.f90
+++ b/gcc/testsuite/gfortran.dg/pr93714_1.f90
@@ -7,5 +7,5 @@ program test
character, pointer :: b => a
end program
-! { dg-error "must be of INTEGER type" " " { target *-*-* } 6 }
-! { dg-error "does not have the TARGET attribute" " " { target *-*-* } 7 }
+! { dg-error "Scalar INTEGER expression expected" " " { target *-*-* } 6 }
+! { dg-error "Different types in pointer assignment" " " { target *-*-* } 7 }
diff --git a/gcc/testsuite/gfortran.dg/pr93714_2.f90 b/gcc/testsuite/gfortran.dg/pr93714_2.f90
index 86658f28859..23d53508f1f 100644
--- a/gcc/testsuite/gfortran.dg/pr93714_2.f90
+++ b/gcc/testsuite/gfortran.dg/pr93714_2.f90
@@ -7,5 +7,5 @@ program test
character(:), pointer :: b => a
end program
-! { dg-error "must be of INTEGER type" " " { target *-*-* } 6 }
-! { dg-error "does not have the TARGET attribute" " " { target *-*-* } 7 }
+! { dg-error "Scalar INTEGER expression expected" " " { target *-*-* } 6 }
+! { dg-error "Different types in pointer assignment" " " { target *-*-* } 7 }
diff --git a/gcc/testsuite/gfortran.dg/pr94397.F90 b/gcc/testsuite/gfortran.dg/pr94397.F90
new file mode 100644
index 00000000000..fda10c1a88b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr94397.F90
@@ -0,0 +1,26 @@
+! { dg-do run }
+!
+
+module m
+ implicit none
+contains
+ function is_real8(a)
+ class(*) :: a
+ logical :: is_real8
+ is_real8 = .false.
+ select type(a)
+ type is(real(kind(1.0_8)))
+ is_real8 = .true.
+ end select
+ end function is_real8
+end module m
+
+program test
+ use m
+
+ if (is_real8(1.0_4)) stop 1
+ if (.not. is_real8(1.0_8)) stop 2
+#ifdef __GFC_REAL_16__
+ if (is_real8(1.0_16)) stop 3
+#endif
+end program
diff --git a/gcc/testsuite/gfortran.dg/pr95053.f b/gcc/testsuite/gfortran.dg/pr95053.f
new file mode 100644
index 00000000000..1d15c669467
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95053.f
@@ -0,0 +1,7 @@
+! { dg-do compile }
+! PR fortran/95053 - ICE in gfc_divide(): Bad basic type
+!
+ 123 FORMAT ('A'/'B')
+ 132 FORMAT (A/
+ + ' B')
+ END
diff --git a/gcc/testsuite/gfortran.dg/pr95053_2.f90 b/gcc/testsuite/gfortran.dg/pr95053_2.f90
new file mode 100644
index 00000000000..7bb941ab46e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95053_2.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! PR 95053 - make sure we do not regress on 521.wrf_r from spec2017
+!
+function f (x)
+ real, parameter :: cldeps = 0.
+ f = 0.
+ if (cldeps > 0.) then
+ f = floor (x/cldeps) * cldeps
+ end if
+end function f
diff --git a/gcc/testsuite/gfortran.dg/pr95053_3.f90 b/gcc/testsuite/gfortran.dg/pr95053_3.f90
new file mode 100644
index 00000000000..eae3d8fc41e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95053_3.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+! Related to PR 93499 - this used to ICE.
+
+program p
+ type t(n)
+ integer, kind :: n
+ end type t
+ type u(n)
+ integer, len :: n
+ end type u
+ type(t((0)/0)) :: x ! { dg-error "does not simplify to an INTEGER" }
+ type(t((0.)/0)) :: y ! { dg-error "must be of INTEGER type" }
+ type(u(0/(0.))) :: z ! { dg-error "must be of INTEGER type" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95088.f90 b/gcc/testsuite/gfortran.dg/pr95088.f90
new file mode 100644
index 00000000000..318fc3f3677
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95088.f90
@@ -0,0 +1,31 @@
+! { dg-do compile }
+! { dg-options "-fsecond-underscore" }
+! PR fortran/95088 - ICE in gfc_build_class_symbol, at fortran/class.c:653
+
+module m2345678901234567890123456789012345678901234567890123456789_123
+ type t2345678901234567890123456789012345678901234567890123456789_123 &
+ (n2345678901234567890123456789012345678901234567890123456789_123,&
+ r2345678901234567890123456789012345678901234567890123456789_123,&
+ k2345678901234567890123456789012345678901234567890123456789_123,&
+ l2345678901234567890123456789012345678901234567890123456789_123 )
+ integer, kind :: n2345678901234567890123456789012345678901234567890123456789_123
+ integer, kind :: r2345678901234567890123456789012345678901234567890123456789_123
+ integer, kind :: k2345678901234567890123456789012345678901234567890123456789_123
+ integer, len :: l2345678901234567890123456789012345678901234567890123456789_123
+ complex (kind = r2345678901234567890123456789012345678901234567890123456789_123) &
+ :: z2345678901234567890123456789012345678901234567890123456789_123
+ character(kind = k2345678901234567890123456789012345678901234567890123456789_123, &
+ len = l2345678901234567890123456789012345678901234567890123456789_123) &
+ :: c2345678901234567890123456789012345678901234567890123456789_123
+ end type
+ type, extends (t2345678901234567890123456789012345678901234567890123456789_123) :: &
+ a2345678901234567890123456789012345678901234567890123456789_123
+ end type
+ interface
+ module subroutine s2345678901234567890123456789012345678901234567890123456789_123 &
+ (x2345678901234567890123456789012345678901234567890123456789_123)
+ class(a2345678901234567890123456789012345678901234567890123456789_123(16,8,4,1234567890)) :: &
+ x2345678901234567890123456789012345678901234567890123456789_123
+ end
+ end interface
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95089.f90 b/gcc/testsuite/gfortran.dg/pr95089.f90
new file mode 100644
index 00000000000..1cd20f0ccc5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95089.f90
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=lib" }
+!
+! PR fortran/95089 - ICE in gfc_get_derived_type, at fortran/trans-types.c:2843
+
+module m23456789012345678901234567890123456789012345678901234567890123
+ type t23456789012345678901234567890123456789012345678901234567890123
+ type (t23456789012345678901234567890123456789012345678901234567890123), &
+ pointer :: z23456789012345678901234567890123456789012345678901234567890123
+ end type t23456789012345678901234567890123456789012345678901234567890123
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95090.f90 b/gcc/testsuite/gfortran.dg/pr95090.f90
new file mode 100644
index 00000000000..ec77802ec51
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95090.f90
@@ -0,0 +1,19 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=lib -fsecond-underscore" }
+! PR fortran/95090 - ICE: identifier overflow
+
+module m2345678901234567890123456789012345678901234567890123456789_123
+ type t2345678901234567890123456789012345678901234567890123456789_123 &
+ (n2345678901234567890123456789012345678901234567890123456789_123)
+ integer, len :: n2345678901234567890123456789012345678901234567890123456789_123 = 8
+ end type
+ integer :: a2345678901234567890123456789012345678901234567890123456789_123
+ integer :: b2345678901234567890123456789012345678901234567890123456789_123(3)[*]
+ data b2345678901234567890123456789012345678901234567890123456789_123 /1,2,3/
+contains
+ subroutine s2345678901234567890123456789012345678901234567890123456789_123
+ type(t2345678901234567890123456789012345678901234567890123456789_123 &
+ (n2345678901234567890123456789012345678901234567890123456789_123)) :: &
+ z2345678901234567890123456789012345678901234567890123456789_123
+ end
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95091.f90 b/gcc/testsuite/gfortran.dg/pr95091.f90
new file mode 100644
index 00000000000..1c48dca2f4a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95091.f90
@@ -0,0 +1,19 @@
+! { dg-do compile }
+! { dg-options "-fsecond-underscore" }
+! PR fortran/95091 - ICE in gfc_hash_value
+
+module m2345678901234567890123456789012345678901234567890123456789_123
+ type t2345678901234567890123456789012345678901234567890123456789_123
+ end type t2345678901234567890123456789012345678901234567890123456789_123
+ interface
+ module subroutine s2345678901234567890123456789012345678901234567890123456789_123 &
+ (x2345678901234567890123456789012345678901234567890123456789_123)
+ end
+ end interface
+end
+submodule(m2345678901234567890123456789012345678901234567890123456789_123) &
+ n2345678901234567890123456789012345678901234567890123456789_123
+ type, extends(t2345678901234567890123456789012345678901234567890123456789_123) :: &
+ u2345678901234567890123456789012345678901234567890123456789_123
+ end type
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95104.f90 b/gcc/testsuite/gfortran.dg/pr95104.f90
new file mode 100644
index 00000000000..20bdd910f46
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95104.f90
@@ -0,0 +1,8 @@
+! { dg-do run }
+! PR libfortran/95104 - Segfault on a legal WAIT statement
+
+program test
+ wait (10, iostat=ios)
+ if (ios /= 0) stop 1
+ close (10)
+end program test
diff --git a/gcc/testsuite/gfortran.dg/pr95340.f90 b/gcc/testsuite/gfortran.dg/pr95340.f90
new file mode 100644
index 00000000000..edcdc935057
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95340.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! PR fortran/95340 - ICE in gfc_match_select_rank, at fortran/match.c:6690
+
+program p
+ type t
+ end type t
+ class(t) :: z ! { dg-error "must be dummy, allocatable or pointer" }
+ select rank (z) ! { dg-error "must be an assumed rank variable" }
+ end select ! { dg-error "Expecting END PROGRAM" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95373_1.f90 b/gcc/testsuite/gfortran.dg/pr95373_1.f90
new file mode 100644
index 00000000000..59a9e7a81e0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95373_1.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! { dg-options "-std=f95" }
+! PR fortran/95373 - ICE in build_reference_type, at tree.c:7942
+
+subroutine s (x)
+ complex, parameter :: z = 3
+ real(z% kind) :: x ! { dg-error "Fortran 2003: KIND part_ref" }
+ type t
+ real :: kind
+ logical :: re
+ end type t
+ type(t) :: b
+ print *, b% kind, b% re
+ print *, z% re ! { dg-error "Fortran 2008: RE or IM part_ref" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95373_2.f90 b/gcc/testsuite/gfortran.dg/pr95373_2.f90
new file mode 100644
index 00000000000..b0f3da0a20d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95373_2.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! { dg-options "-std=f2003" }
+! PR fortran/95373 - ICE in build_reference_type, at tree.c:7942
+
+subroutine s (x)
+ complex, parameter :: z = 3
+ real(z% kind) :: x
+ type t
+ real :: kind
+ logical :: re
+ end type t
+ type(t) :: b
+ print *, b% kind, b% re
+ print *, z% re ! { dg-error "Fortran 2008: RE or IM part_ref" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95446.f90 b/gcc/testsuite/gfortran.dg/pr95446.f90
new file mode 100644
index 00000000000..86e1019d7af
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95446.f90
@@ -0,0 +1,38 @@
+! { dg-do compile }
+! { dg-options "-pedantic-errors" }
+!
+! Contributed by Martin Diehl <m.diehl@mpie.de>
+
+program elemental_optional
+ implicit none
+ integer :: m(5), r(5)
+
+ m = 1
+
+ r = outer()
+ r = outer(m)
+
+ contains
+
+ function outer(o) result(l)
+ integer, intent(in), optional :: o(:)
+ integer :: u(5), l(5)
+
+ l = inner(o,u)
+
+ end function outer
+
+ elemental function inner(a,b) result(x)
+ integer, intent(in), optional :: a
+ integer, intent(in) :: b
+ integer :: x
+
+ if(present(a)) then
+ x = a*b
+ else
+ x = b
+ endif
+ end function inner
+
+end program elemental_optional
+
diff --git a/gcc/testsuite/gfortran.dg/pr95500.f90 b/gcc/testsuite/gfortran.dg/pr95500.f90
new file mode 100644
index 00000000000..e9eb7c65c86
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95500.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! PR fortran/95500 - ICE compiling extra interface on intrinsic
+
+program test_intrinsic
+ implicit none
+ intrinsic :: alog
+ intrinsic :: dlog
+ real (4), parameter :: one = 1
+
+ interface ln
+ procedure :: alog, dlog
+ end interface ln
+
+ write (*,*) 'ln 1', ln (one)
+end program test_intrinsic
diff --git a/gcc/testsuite/gfortran.dg/pr95503.f90 b/gcc/testsuite/gfortran.dg/pr95503.f90
new file mode 100644
index 00000000000..4a202b405c4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95503.f90
@@ -0,0 +1,7 @@
+! { dg-do compile }
+! PR fortran/95503 - ICE in gfc_is_simply_contiguous
+
+program p
+ complex, target :: a
+ real, pointer, contiguous :: b => a%re ! { dg-error "not an array pointer" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95544.f90 b/gcc/testsuite/gfortran.dg/pr95544.f90
new file mode 100644
index 00000000000..01b9fc5cc9f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95544.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! PR fortran/95544 - ICE in gfc_can_put_var_on_stack, at fortran/trans-decl.c:494
+
+program test
+ character(:), allocatable :: z
+ character(:), pointer :: p
+ character(1), pointer :: c
+ print *, adjustl (null(z)) ! { dg-error "is not permitted as actual argument" }
+ print *, adjustr (null(z)) ! { dg-error "is not permitted as actual argument" }
+ print *, len (null(p)) ! { dg-error "is not permitted as actual argument" }
+ print *, len (null(z)) ! { dg-error "is not permitted as actual argument" }
+ print *, len_trim(null(c)) ! { dg-error "is not permitted as actual argument" }
+ print *, len_trim(null(z)) ! { dg-error "is not permitted as actual argument" }
+ print *, trim (null(z)) ! { dg-error "is not permitted as actual argument" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95584.f90 b/gcc/testsuite/gfortran.dg/pr95584.f90
new file mode 100644
index 00000000000..4504f7b500c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95584.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+
+program p
+ interface s
+ subroutine g(x, *)
+ end
+ subroutine h(y, *)
+ end
+ end interface
+end
+
+! { dg-warning "Obsolescent feature: Alternate-return argument" " " { target *-*-* } 5 }
+! { dg-warning "Obsolescent feature: Alternate-return argument" " " { target *-*-* } 7 }
+! { dg-error ".1." " " { target *-*-* } 5 }
+! { dg-error "Ambiguous interfaces in generic interface" " " { target *-*-* } 7 }
+
diff --git a/gcc/testsuite/gfortran.dg/pr95585.f90 b/gcc/testsuite/gfortran.dg/pr95585.f90
new file mode 100644
index 00000000000..b0e6cdc5bea
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95585.f90
@@ -0,0 +1,6 @@
+! { dg-do compile }
+
+program test
+ integer, parameter :: a(2) = reshape([1, 2], a) ! { dg-error "before its definition" }
+end program
+
diff --git a/gcc/testsuite/gfortran.dg/pr95586_1.f90 b/gcc/testsuite/gfortran.dg/pr95586_1.f90
new file mode 100644
index 00000000000..009eb3e88f0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95586_1.f90
@@ -0,0 +1,9 @@
+! { dg-do compile }
+!
+
+program test
+ implicit type(t) (1) ! { dg-error "Syntax error" }
+ type t
+ end type
+end program
+
diff --git a/gcc/testsuite/gfortran.dg/pr95586_2.f90 b/gcc/testsuite/gfortran.dg/pr95586_2.f90
new file mode 100644
index 00000000000..81ea6e9fa56
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95586_2.f90
@@ -0,0 +1,11 @@
+! { dg-do compile }
+!
+
+program test
+ integer, parameter :: n1 = 1
+ implicit type(t) (n1) ! { dg-error "Syntax error" }
+ type t
+ end type
+end program
+
+
diff --git a/gcc/testsuite/gfortran.dg/pr95587.f90 b/gcc/testsuite/gfortran.dg/pr95587.f90
new file mode 100644
index 00000000000..a543fb92a18
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95587.f90
@@ -0,0 +1,13 @@
+! { dg-do compile }
+! PR fortran/95587 - ICE in gfc_target_encode_expr, at fortran/target-memory.c:362
+
+program p
+ type t
+ end type t
+ class(*), allocatable :: x, y
+ class(t), allocatable :: u, v
+ class(t), pointer :: c, d
+ equivalence (x, y) ! { dg-error "conflicts with ALLOCATABLE" }
+ equivalence (u, v) ! { dg-error "conflicts with ALLOCATABLE" }
+ equivalence (c, d) ! { dg-error "conflicts with POINTER" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95611.f90 b/gcc/testsuite/gfortran.dg/pr95611.f90
new file mode 100644
index 00000000000..b7a54514ca3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95611.f90
@@ -0,0 +1,7 @@
+! { dg-do compile }
+! PR fortran/95611 - ICE in access_attr_decl, at fortran/decl.c:9075
+
+module m
+ public operator (.a.)
+ public operator (.a.) ! { dg-error "has already been specified" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95612.f90 b/gcc/testsuite/gfortran.dg/pr95612.f90
new file mode 100644
index 00000000000..b3cac8c1d81
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95612.f90
@@ -0,0 +1,7 @@
+! { dg-do compile }
+
+program p
+ integer, pointer :: y(:) => shape(1) ! { dg-error "Zero-sized array detected at .1. where an entity with the TARGET attribute is expected" }
+ integer, pointer :: z(:) => shape([1]) ! { dg-error "Pointer assignment target in initialization expression does not have the TARGET attribute at .1." }
+end
+
diff --git a/gcc/testsuite/gfortran.dg/pr95687.f90 b/gcc/testsuite/gfortran.dg/pr95687.f90
new file mode 100644
index 00000000000..a674533179a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95687.f90
@@ -0,0 +1,19 @@
+! { dg-do compile }
+! { dg-options "-fsecond-underscore" }
+! PR fortran/95687 - ICE in get_unique_hashed_string, at fortran/class.c:508
+
+module m2345678901234567890123456789012345678901234567890123456789_123
+ interface
+ module subroutine s2345678901234567890123456789012345678901234567890123456789_123
+ end
+ end interface
+end
+submodule(m2345678901234567890123456789012345678901234567890123456789_123) &
+ n2345678901234567890123456789012345678901234567890123456789_123
+ type t2345678901234567890123456789012345678901234567890123456789_123 &
+ (a2345678901234567890123456789012345678901234567890123456789_123)
+ integer, kind :: a2345678901234567890123456789012345678901234567890123456789_123 = 4
+ end type
+ class(t2345678901234567890123456789012345678901234567890123456789_123(3)), pointer :: &
+ x2345678901234567890123456789012345678901234567890123456789_123
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95688.f90 b/gcc/testsuite/gfortran.dg/pr95688.f90
new file mode 100644
index 00000000000..ce8fd3e9890
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95688.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! { dg-options "-fsecond-underscore" }
+! PR fortran/95688 - ICE in gfc_get_string, at fortran/iresolve.c:70
+
+module m2345678901234567890123456789012345678901234567890123456789_123
+ interface
+ module subroutine s2345678901234567890123456789012345678901234567890123456789_123
+ end
+ end interface
+end
+submodule(m2345678901234567890123456789012345678901234567890123456789_123) &
+ n2345678901234567890123456789012345678901234567890123456789_123
+ character(:), pointer :: &
+ x2345678901234567890123456789012345678901234567890123456789_123 => null()
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95689.f90 b/gcc/testsuite/gfortran.dg/pr95689.f90
new file mode 100644
index 00000000000..287ae50b0cb
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95689.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+! { dg-options "-fsecond-underscore" }
+! PR fortran/95689 - ICE in check_sym_interfaces, at fortran/interface.c:2015
+
+module m2345678901234567890123456789012345678901234567890123456789_123
+ type t2345678901234567890123456789012345678901234567890123456789_123
+ end type
+ interface
+ module subroutine s2345678901234567890123456789012345678901234567890123456789_123 &
+ (x2345678901234567890123456789012345678901234567890123456789_123)
+ end
+ end interface
+end
+submodule(m2345678901234567890123456789012345678901234567890123456789_123) &
+ t2345678901234567890123456789012345678901234567890123456789_123
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95690.f90 b/gcc/testsuite/gfortran.dg/pr95690.f90
new file mode 100644
index 00000000000..da809a0d3b3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95690.f90
@@ -0,0 +1,9 @@
+! { dg-do compile }
+module m
+contains
+ subroutine s
+ print *, (erfc) ! { dg-error "not a floating constant" "" { target i?86-*-* x86_64-*-* *-*-solaris* } }
+ end ! { dg-error "not a floating constant" "" { target { ! "i?86-*-* x86_64-*-* *-*-solaris*" } } }
+ function erfc()
+ end
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95707.f90 b/gcc/testsuite/gfortran.dg/pr95707.f90
new file mode 100644
index 00000000000..3279a6320cf
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95707.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+! { dg-options "-fsecond-underscore" }
+! PR fortran/95707 - ICE in finish_equivalences, at fortran/trans-common.c:1319
+
+module m2345678901234567890123456789012345678901234567890123456789_123
+ interface
+ module subroutine s2345678901234567890123456789012345678901234567890123456789_123
+ end
+ end interface
+end
+submodule(m2345678901234567890123456789012345678901234567890123456789_123) &
+ n2345678901234567890123456789012345678901234567890123456789_123
+ real :: a(4), u(3,2)
+ real :: b(4), v(4,2)
+ equivalence (a(1),u(1,1)), (b(1),v(1,1))
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95708.f90 b/gcc/testsuite/gfortran.dg/pr95708.f90
new file mode 100644
index 00000000000..32bd324ce15
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95708.f90
@@ -0,0 +1,6 @@
+! { dg-do compile }
+!
+
+program test
+ procedure(team_num) :: g ! { dg-error "must be explicit" }
+end program
diff --git a/gcc/testsuite/gfortran.dg/pr95709.f90 b/gcc/testsuite/gfortran.dg/pr95709.f90
new file mode 100644
index 00000000000..e5876067524
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95709.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+! { dg-options "-std=legacy" }
+! PR fortran/95709 - ICE in gfc_resolve_code, at fortran/resolve.c:11807
+
+program p
+ integer, parameter :: i(1) = 1
+ integer, parameter :: j = 1
+ integer :: k(1) = 1
+ goto i(1) ! { dg-error "requires a scalar INTEGER variable" }
+ goto j ! { dg-error "requires a scalar INTEGER variable" }
+ goto k(1) ! { dg-error "requires a scalar INTEGER variable" }
+ goto i%kind, (1) ! { dg-error "requires a scalar INTEGER variable" }
+1 continue
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95826.f90 b/gcc/testsuite/gfortran.dg/pr95826.f90
new file mode 100644
index 00000000000..8de04e65df0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95826.f90
@@ -0,0 +1,20 @@
+! { dg-do compile }
+! { dg-options "-fsecond-underscore" }
+! PR fortran/95826 - ICE in gfc_match_decl_type_spec, at fortran/decl.c:4290
+
+program p
+ type t2345678901234567890123456789012345678901234567890123456789_123 &
+ (a2345678901234567890123456789012345678901234567890123456789_123, &
+ b2345678901234567890123456789012345678901234567890123456789_123)
+ integer, kind :: &
+ a2345678901234567890123456789012345678901234567890123456789_123
+ integer, len :: &
+ b2345678901234567890123456789012345678901234567890123456789_123
+ end type
+ integer, parameter :: &
+ n2345678901234567890123456789012345678901234567890123456789_123 = 16
+ type(t2345678901234567890123456789012345678901234567890123456789_123 &
+ (n2345678901234567890123456789012345678901234567890123456789_123,:)), &
+ allocatable :: &
+ x2345678901234567890123456789012345678901234567890123456789_123
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95827.f90 b/gcc/testsuite/gfortran.dg/pr95827.f90
new file mode 100644
index 00000000000..545e344c46d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95827.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=lib -fsecond-underscore" }
+! PR fortran/95827 - ICE in gfc_get_string, at fortran/iresolve.c:70
+
+module m2345678901234567890123456789012345678901234567890123456789_123
+ interface
+ module subroutine s2345678901234567890123456789012345678901234567890123456789_123
+ end
+ end interface
+end
+submodule(m2345678901234567890123456789012345678901234567890123456789_123) &
+ n2345678901234567890123456789012345678901234567890123456789_123
+ integer :: x2345678901234567890123456789012345678901234567890123456789_123[*]
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95828.f90 b/gcc/testsuite/gfortran.dg/pr95828.f90
new file mode 100644
index 00000000000..e85b2f11869
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95828.f90
@@ -0,0 +1,21 @@
+! { dg-do compile }
+! { dg-options "-fsecond-underscore" }
+! PR fortran/95828 - ICE in resolve_select_rank, at fortran/resolve.c:9774
+
+module m2345678901234567890123456789012345678901234567890123456789_123
+ type t2345678901234567890123456789012345678901234567890123456789_123
+ end type
+contains
+ subroutine s2345678901234567890123456789012345678901234567890123456789_123 &
+ (x2345678901234567890123456789012345678901234567890123456789_123)
+ type (t2345678901234567890123456789012345678901234567890123456789_123) :: &
+ x2345678901234567890123456789012345678901234567890123456789_123(..)
+
+ select rank (y2345678901234567890123456789012345678901234567890123456789_123 &
+ => x2345678901234567890123456789012345678901234567890123456789_123)
+ rank (2)
+ rank (3)
+ rank default
+ end select
+ end
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95829.f90 b/gcc/testsuite/gfortran.dg/pr95829.f90
new file mode 100644
index 00000000000..081d647c7c0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95829.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+!
+! Declaration of b used to be a bogus failure.
+
+subroutine s (a, b, c, d, e, f, g)
+ type(*) :: a
+ type(* ) :: b
+ type( *) :: c
+ type( * ) :: d
+ type(* ) :: e
+ type( *) :: f
+ type( * ) :: g
+end
+
diff --git a/gcc/testsuite/gfortran.dg/pr95880.f90 b/gcc/testsuite/gfortran.dg/pr95880.f90
new file mode 100644
index 00000000000..b7a573cba05
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95880.f90
@@ -0,0 +1,9 @@
+! { dg-do compile }
+! PR fortran/95880 - ICE in gfc_add_type, at fortran/symbol.c:2030
+
+module m
+end
+block data
+ use m
+ integer m ! { dg-error "cannot have a type" }
+end block data
diff --git a/gcc/testsuite/gfortran.dg/pr95881.f90 b/gcc/testsuite/gfortran.dg/pr95881.f90
new file mode 100644
index 00000000000..9f171764948
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95881.f90
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=lib" }
+! PR fortran/95881 - ICE in resolve_symbol, at fortran/resolve.c:15175
+
+program p
+ type t
+ real, allocatable :: a[:]
+ end type t
+ class(t) :: x ! { dg-error "must be dummy, allocatable or pointer" }
+ allocate (x%a[*])
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95978.f90 b/gcc/testsuite/gfortran.dg/pr95978.f90
new file mode 100644
index 00000000000..47bd7067096
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95978.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! PR fortran/95978 - ICE in gfc_match_data, at fortran/decl.c:731
+
+program p
+ type t
+ integer :: a
+ type(t), allocatable :: b
+ data c /t(1)/ ! { dg-error "Unexpected DATA statement" }
+ end type t
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95980.f90 b/gcc/testsuite/gfortran.dg/pr95980.f90
new file mode 100644
index 00000000000..7c8260a96e0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95980.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! PR fortran/95980 - ICE in get_unique_type_string, at fortran/class.c:485
+
+program p
+ type t
+ end type t
+ class(t) :: x ! { dg-error "must be dummy, allocatable or pointer" }
+ select type (y => x)
+ end select
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95980_2.f90 b/gcc/testsuite/gfortran.dg/pr95980_2.f90
new file mode 100644
index 00000000000..d1fe9c76bd0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95980_2.f90
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! PR fortran/95980 - ICE in get_unique_type_string, at fortran/class.c:485
+
+program p
+ type t
+ integer :: a
+ end type t
+ class(t) :: x ! { dg-error "must be dummy, allocatable or pointer" }
+ select type (y => x)
+ end select
+end
diff --git a/gcc/testsuite/gfortran.dg/pr95981.f90 b/gcc/testsuite/gfortran.dg/pr95981.f90
new file mode 100644
index 00000000000..7da6e9bd3dd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95981.f90
@@ -0,0 +1,9 @@
+! { dg-do compile }
+
+program p
+ type t
+ end type
+ class(t) :: x(:) ! { dg-error "must be dummy, allocatable or pointer" }
+ type(t) :: y(size(x,1)) ! { dg-error "must be constant of INTEGER type" }
+end
+
diff --git a/gcc/testsuite/gfortran.dg/pr96038.f90 b/gcc/testsuite/gfortran.dg/pr96038.f90
new file mode 100644
index 00000000000..f1098f33c1b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr96038.f90
@@ -0,0 +1,8 @@
+! { dg-do compile }
+
+function ifoo()
+ parameter (n = 50)
+ integer n
+ ifoo = n
+end
+
diff --git a/gcc/testsuite/gfortran.dg/pr96085.f90 b/gcc/testsuite/gfortran.dg/pr96085.f90
new file mode 100644
index 00000000000..82b1cdec0f6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr96085.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! { dg-options "-std=legacy" }
+! PR fortran/96085 - ICE in gfc_finish_var_decl, at fortran/trans-decl.c:694
+
+module m
+ integer, parameter :: a = 1
+contains
+ subroutine s
+ assign 2 to a ! { dg-error "requires a scalar default INTEGER variable" }
+2 print *, a
+ end
+end
diff --git a/gcc/testsuite/gfortran.dg/pr96086.f90 b/gcc/testsuite/gfortran.dg/pr96086.f90
new file mode 100644
index 00000000000..b80967a7a07
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr96086.f90
@@ -0,0 +1,8 @@
+! { dg-do compile }
+! PR fortran/96086 - ICE in gfc_match_select_rank, at fortran/match.c:6645
+
+subroutine s
+ class(*) :: x(..) ! { dg-error "Assumed-rank array" }
+ select rank (y => x) ! { dg-error "CLASS variable" }
+ end select
+end
diff --git a/gcc/testsuite/gfortran.dg/pr96102.f90 b/gcc/testsuite/gfortran.dg/pr96102.f90
new file mode 100644
index 00000000000..0cf52226d85
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr96102.f90
@@ -0,0 +1,27 @@
+! { dg-do compile }
+!
+! Test the fix for PR96102 in which the two lines with errors previously
+! caused a segfault.
+!
+! Contributed by Gerhardt Steinmetz <gscfq@t-online.de>
+!
+!
+module m
+ type mytype
+ integer :: i
+ end type
+ type(mytype) :: d = mytype (42) ! { dg-error "is host associated" }
+ integer :: n = 2 ! { dg-error "is host associated" }
+contains
+ subroutine s
+ if ( n /= 0 ) stop 1 ! { dg-error "internal procedure of the same name" }
+ if ( d%i /= 0 ) stop 2 ! { dg-error "internal procedure of the same name" }
+ contains
+ integer function n()
+ n = 0
+ end
+ type(mytype) function d()
+ d = mytype (0)
+ end
+ end
+end
diff --git a/gcc/testsuite/gfortran.dg/pr96312.f90 b/gcc/testsuite/gfortran.dg/pr96312.f90
new file mode 100644
index 00000000000..d6d8e79119f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr96312.f90
@@ -0,0 +1,30 @@
+! { dg-do compile }
+! { dg-options "-O1 -Wall" }
+!
+! PR fortran/96312. The line with the call to 'matmul' gave the warning
+! ‘tmp.dim[0].lbound’ is used uninitialized in this function
+!
+! Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+!
+module moda
+contains
+ PURE SUBROUTINE funca(arr, sz)
+ REAL, ALLOCATABLE, DIMENSION(:, :), INTENT(OUT) :: arr
+ integer, intent(in) :: sz
+ allocate(arr(sz, sz))
+ arr(:, :) = 0.
+ END SUBROUTINE
+end module
+
+module modc
+ use moda, only: funca
+contains
+ PURE SUBROUTINE funcb(oarr)
+ REAL, DIMENSION(:), INTENT(OUT) :: oarr
+ REAL, ALLOCATABLE, DIMENSION(:, :) :: arr
+ real, allocatable, dimension(:) :: tmp
+ CALL funca(arr, ubound(oarr, 1))
+ tmp = matmul(transpose(arr),oarr)
+ oarr = tmp*1.
+ END SUBROUTINE funcb
+end module
diff --git a/gcc/testsuite/gfortran.dg/pr96319.f90 b/gcc/testsuite/gfortran.dg/pr96319.f90
new file mode 100644
index 00000000000..6d8d3b476eb
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr96319.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! { dg-options "-Wconversion -Wconversion-extra" }
+
+program test
+ LOGICAL(1) :: a
+ logical(4) :: t = .true.
+ logical(4) :: b
+ logical(1) :: f = .false.
+ a = t
+ b = f
+end program test
+
diff --git a/gcc/testsuite/gfortran.dg/pr96325.f90 b/gcc/testsuite/gfortran.dg/pr96325.f90
new file mode 100644
index 00000000000..62f4cfbf3b2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr96325.f90
@@ -0,0 +1,21 @@
+! { dg-do compile }
+!
+! Test the fix for PR96325 in which the typebound procedure reference
+! 'foo' was applied to an intrinsic type component without generating
+! an error. The result of the expression was the value of the arg..
+!
+! Contributed by Gerhardt Steinmetz <gscfq@t-online.de>
+!
+ implicit none
+
+ type t2
+ integer r1
+ end type
+
+ type(t2) :: t
+ integer :: a
+
+ a = t%r1%foo(1) { dg-error "is not an inquiry reference" }
+ if (a == 42) stop
+
+ end
diff --git a/gcc/testsuite/gfortran.dg/random_seed_4.f90 b/gcc/testsuite/gfortran.dg/random_seed_4.f90
new file mode 100644
index 00000000000..4c3afe5f928
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/random_seed_4.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+! PR fortran/95037
+! This led to a segfault or a confusing error message. Original
+! test case by Bill Long.
+
+subroutine my_random_seed_v (size, put, get)
+integer, optional :: size
+integer, optional :: put(1)
+integer, optional :: get(1)
+call random_seed (size, get=get) ! { dg-error "too small" }
+call random_seed (size, put=put) ! { dg-error "too small" }
+call random_seed (size, get=get, put=put) ! { dg-error "too small" }
+end subroutine my_random_seed_v
+
diff --git a/gcc/testsuite/gfortran.dg/recursive_check_16.f90 b/gcc/testsuite/gfortran.dg/recursive_check_16.f90
new file mode 100644
index 00000000000..d8e9d69ea7b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/recursive_check_16.f90
@@ -0,0 +1,25 @@
+! { dg-do run }
+! ! { dg-options "-fcheck=recursion" }
+! PR 95743 - this used cause a runtime error.
+! Test case by Antoine Lemoine
+
+program test_recursive_call
+ implicit none
+
+ type t_tree_node
+ type(t_tree_node), dimension(:), allocatable :: child
+ end type
+
+ type t_tree
+ type(t_tree_node), allocatable :: root
+ end type
+
+ type(t_tree), allocatable :: tree
+
+ allocate(tree)
+ allocate(tree%root)
+ allocate(tree%root%child(1))
+ ! If the line below is removed, the code works fine.
+ allocate(tree%root%child(1)%child(1))
+ deallocate(tree)
+end program
diff --git a/gcc/testsuite/gfortran.dg/round_3.f08 b/gcc/testsuite/gfortran.dg/round_3.f08
index 57d83395531..4a0a692fa7b 100644
--- a/gcc/testsuite/gfortran.dg/round_3.f08
+++ b/gcc/testsuite/gfortran.dg/round_3.f08
@@ -110,6 +110,30 @@ program pr48615
call checkfmt("(RU,E17.1)", nearest(2.0, 1.0), " 0.3E+01")
call checkfmt("(RD,E17.1)", nearest(3.0, -1.0), " 0.2E+01")
+ call checkfmt("(G12.2)", 99.0, " 99. ")
+ call checkfmt("(G12.2)", 99.5, " 0.10E+03")
+ call checkfmt("(G12.2)", 100.0, " 0.10E+03")
+ call checkfmt("(G12.2)", -99.0, " -99. ")
+ call checkfmt("(G12.2)", -99.5, " -0.10E+03")
+ call checkfmt("(G12.2)", -100.0, " -0.10E+03")
+ call checkfmt("(RU,G12.2)", 99.0, " 99. ") ! pr93567
+ call checkfmt("(RU,G12.2)", 99.01, " 0.10E+03")
+ call checkfmt("(RU,G12.2)", -99.0, " -99. ")
+ call checkfmt("(RU,G12.2)", -99.01, " -99. ")
+ call checkfmt("(RU,G12.2)", -100.01, " -0.10E+03")
+ call checkfmt("(RU,G12.4)", 99.0 , " 99.00 ")
+ call checkfmt("(RU,G12.4)", 99.01, " 99.02 ")
+ call checkfmt("(RD,G12.2)", 99.0, " 99. ")
+ call checkfmt("(RD,G12.2)", 99.01, " 99. ")
+ call checkfmt("(RD,G12.2)", 100.01, " 0.10E+03")
+ call checkfmt("(RD,G12.2)", -99.0, " -99. ")
+ call checkfmt("(RD,G12.2)", -99.01, " -0.10E+03")
+ call checkfmt("(RD,G12.2)", -100.00, " -0.10E+03")
+ call checkfmt("(Rz,G12.2)", 99.01, " 99. ")
+ call checkfmt("(Rz,G12.2)", 100.01, " 0.10E+03")
+ call checkfmt("(Rz,G12.2)", -99.01, " -99. ")
+ call checkfmt("(Rz,G12.2)", -100.01, " -0.10E+03")
+
contains
subroutine checkfmt(fmt, x, cmp)
character(len=*), intent(in) :: fmt
@@ -119,6 +143,6 @@ contains
write(s, fmt) x
if (s /= cmp) STOP 1
- !if (s /= cmp) print "(a,1x,a,' expected: ',1x)", fmt, s, cmp
+ !if (s /= cmp) print "(a,1x,a,' expected: ',1x,a)", fmt, s, cmp
end subroutine
end program
diff --git a/gcc/testsuite/gfortran.dg/select_type_49.f90 b/gcc/testsuite/gfortran.dg/select_type_49.f90
new file mode 100644
index 00000000000..31203cd18fc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/select_type_49.f90
@@ -0,0 +1,43 @@
+! { dg-do run }
+! { dg-additional-options "-fdump-tree-original" }
+! PR 95366 - this did not work due the wrong hashes
+! being generated for CHARACTER variables.
+MODULE mod1
+ implicit none
+ integer :: tst(3)
+CONTAINS
+ subroutine showpoly(poly)
+ CLASS(*), INTENT(IN) :: poly(:)
+ SELECT TYPE (poly)
+ TYPE IS(INTEGER)
+ tst(1) = tst(1) + 1
+ TYPE IS(character(*))
+ tst(2) = tst(2) + 1
+ class default
+ tst(3) = tst(3) + 1
+ end select
+ end subroutine showpoly
+END MODULE mod1
+MODULE mod2
+ implicit none
+CONTAINS
+subroutine polytest2()
+ use mod1
+ integer :: a(1)
+ character(len=42) :: c(1)
+ call showpoly(a)
+ if (any(tst /= [1,0,0])) stop 1
+ call showpoly(c)
+ if (any(tst /= [1,1,0])) stop 2
+end subroutine polytest2
+END MODULE mod2
+PROGRAM testpoly
+ use mod2
+ CALL polytest2()
+END PROGRAM testpoly
+! The value of the hashes are also checked. If you get
+! a failure here, be aware that changing that value is
+! an ABI change.
+
+! { dg-final { scan-tree-dump-times "== 17759" 1 "original" } }
+! { dg-final { scan-tree-dump-times "== 85893463" 1 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/use_15.f90 b/gcc/testsuite/gfortran.dg/use_15.f90
index eb5aa87cc8b..9722db4ddb3 100644
--- a/gcc/testsuite/gfortran.dg/use_15.f90
+++ b/gcc/testsuite/gfortran.dg/use_15.f90
@@ -34,4 +34,4 @@ subroutine my_sub3 (a) ! { dg-error "\(1\)" }
print *, a
end subroutine
-END
+END ! { dg-error "is an ambiguous reference" }
diff --git a/gcc/testsuite/gfortran.dg/vect/pr95403.f b/gcc/testsuite/gfortran.dg/vect/pr95403.f
new file mode 100644
index 00000000000..248958b524c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/vect/pr95403.f
@@ -0,0 +1,16 @@
+! { dg-do compile }
+ subroutine deuldlag(xi,et,ze,xlag,xeul,xj,xs)
+ real*8 shp(3,20),xs(3,3),xlag(3,20),xeul(3,20)
+ do i=1,3
+ do j=1,3
+ enddo
+ enddo
+ do i=1,3
+ do j=1,3
+ xs(i,j)=0.d0
+ do k=1,20
+ xs(i,j)=xs(i,j)+xeul(i,k)*shp(j,k)
+ enddo
+ enddo
+ enddo
+ end
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/forall_5.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/forall_5.f90
index 9b33e21e8fc..c162d44348b 100644
--- a/gcc/testsuite/gfortran.fortran-torture/execute/forall_5.f90
+++ b/gcc/testsuite/gfortran.fortran-torture/execute/forall_5.f90
@@ -4,23 +4,23 @@ program forall_5
integer, pointer, dimension(:)::p
end type
- type (element) q(5)
+ type (element) :: q(5), r(5)
integer, target, dimension(25)::t
n = 5
do i = 1,5
- q(i)%p => t((i-1)*n + 1:i*n)
+ r(i)%p => t((i-1)*n + 1:i*n)
enddo
forall (i = 2:5)
- q(i)%p => q(i-1)%p
+ q(i)%p => r(i-1)%p
end forall
do i = 1, 25
t(i) = i
enddo
- if (any(q(1)%p .ne. (/1,2,3,4,5/))) STOP 1
+ if (any(r(1)%p .ne. (/1,2,3,4,5/))) STOP 1
if (any(q(2)%p .ne. (/1,2,3,4,5/))) STOP 2
if (any(q(3)%p .ne. (/6,7,8,9,10/))) STOP 3
if (any(q(4)%p .ne. (/11,12,13,14,15/))) STOP 4
diff --git a/gcc/testsuite/gnat.dg/addr15.adb b/gcc/testsuite/gnat.dg/addr15.adb
new file mode 100644
index 00000000000..bb79dff862f
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/addr15.adb
@@ -0,0 +1,19 @@
+-- { dg-do run }
+
+with System; use System;
+
+procedure Addr15 is
+
+ function Get_Bound (Param : Integer) return Integer is (Param);
+
+ type Alpha_Typ is array (1 .. Get_Bound (1)) of Integer;
+ type Beta_Typ is array (1 .. Get_Bound (0)) of Integer;
+
+ Alpha : Alpha_Typ;
+ Beta : aliased Beta_Typ;
+
+begin
+ if Alpha'Address = Beta'Address then
+ raise Program_Error;
+ end if;
+end;
diff --git a/gcc/testsuite/gnat.dg/aggr30.adb b/gcc/testsuite/gnat.dg/aggr30.adb
new file mode 100644
index 00000000000..a69c8b651ea
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/aggr30.adb
@@ -0,0 +1,20 @@
+-- { dg-do compile }
+-- { dg-options "-fdump-tree-gimple" }
+
+package body Aggr30 is
+
+ Null_Constant : constant Rec := (Data => (others => 0),
+ Padding => (others => 0));
+ procedure Init is
+ begin
+ Instance := Null_Constant;
+ end;
+
+ procedure Init_Volatile is
+ begin
+ Instance_Volatile := Null_Constant;
+ end;
+
+end Aggr30;
+
+-- { dg-final { scan-tree-dump-times "= {}" 2 "gimple"} }
diff --git a/gcc/testsuite/gnat.dg/aggr30.ads b/gcc/testsuite/gnat.dg/aggr30.ads
new file mode 100644
index 00000000000..998403487e7
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/aggr30.ads
@@ -0,0 +1,25 @@
+with Interfaces;
+
+package Aggr30 is
+
+ type Data_Type is array (1 .. 4) of Interfaces.Unsigned_8;
+
+ type Padding_Type is array (5 .. 4096) of Interfaces.Unsigned_8;
+
+ type Rec is record
+ Data : Data_Type;
+ Padding : Padding_Type;
+ end record;
+
+ procedure Init;
+
+ procedure Init_Volatile;
+
+private
+
+ Instance : Rec;
+
+ Instance_Volatile : Rec;
+ pragma Volatile (Instance_Volatile);
+
+end Aggr30;
diff --git a/gcc/testsuite/gnat.dg/array39.adb b/gcc/testsuite/gnat.dg/array39.adb
new file mode 100644
index 00000000000..3e886c1f606
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/array39.adb
@@ -0,0 +1,13 @@
+-- { dg-do run }
+
+with Array39_Pkg; use Array39_Pkg;
+
+procedure Array39 is
+ T : Tsk;
+ R : Rec2;
+begin
+ T.E (R, 1);
+ if R.A (1) /= Val then
+ raise Program_Error;
+ end if;
+end;
diff --git a/gcc/testsuite/gnat.dg/array39_pkg.adb b/gcc/testsuite/gnat.dg/array39_pkg.adb
new file mode 100644
index 00000000000..32fe8e2a555
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/array39_pkg.adb
@@ -0,0 +1,20 @@
+package body Array39_Pkg is
+
+ task Body Tsk is
+ begin
+ select
+ accept E (R : out Rec2; L : Index2) do
+ declare
+ A : Arr2 (Index2);
+ LL : Index2 := L;
+ begin
+ for I in 1 .. LL loop
+ A (I) := Val;
+ end loop;
+ R := (D => LL, A => A (1 .. LL));
+ end;
+ end E;
+ end select;
+ end Tsk;
+
+end Array39_Pkg;
diff --git a/gcc/testsuite/gnat.dg/array39_pkg.ads b/gcc/testsuite/gnat.dg/array39_pkg.ads
new file mode 100644
index 00000000000..e5cc4b835e5
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/array39_pkg.ads
@@ -0,0 +1,25 @@
+package Array39_Pkg is
+
+ subtype Index1 is Natural range 0 .. 2;
+
+ type Arr1 is array (Index1 range <>) of Integer;
+
+ type Rec1 (D : Index1 := 0) is record
+ A : Arr1 (1 .. D);
+ end record;
+
+ subtype Index2 is Natural range 0 .. 7;
+
+ type Arr2 is array (Index2 range <>) of Rec1;
+
+ type Rec2 (D : Index2 := 0) is record
+ A : Arr2 (1 .. D);
+ end record;
+
+ Val : Rec1 := (D => 1, A => (others => 1));
+
+ task type Tsk is
+ entry E (R : out Rec2; L : Index2);
+ end Tsk;
+
+end Array39_Pkg;
diff --git a/gcc/testsuite/gnat.dg/array40.adb b/gcc/testsuite/gnat.dg/array40.adb
new file mode 100644
index 00000000000..227288d368f
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/array40.adb
@@ -0,0 +1,21 @@
+-- { dg-do run }
+-- { dg-options "-gnatws" }
+
+with System.Storage_Elements;
+with Array40_Pkg; use Array40_Pkg;
+
+procedure Array40 is
+
+ use System;
+ use System.Storage_Elements;
+
+begin
+ if A(1)'Size /= 40 then
+ raise Program_Error;
+ end if;
+
+ if (A(2)'Address - A(1)'Address) * System.Storage_Unit /= 40 then
+ raise Program_Error;
+ end if;
+
+end;
diff --git a/gcc/testsuite/gnat.dg/array40_pkg.ads b/gcc/testsuite/gnat.dg/array40_pkg.ads
new file mode 100644
index 00000000000..a3cec8b43f4
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/array40_pkg.ads
@@ -0,0 +1,12 @@
+package Array40_Pkg is
+
+ type Rec is record
+ I : Integer;
+ end record;
+
+ type Arr is array (1 .. 4) of Rec;
+ for Arr'Component_Size use 40;
+
+ A : Arr;
+
+end Array40_Pkg;
diff --git a/gcc/testsuite/gnat.dg/debug16.adb b/gcc/testsuite/gnat.dg/debug16.adb
new file mode 100644
index 00000000000..8752002ec9b
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/debug16.adb
@@ -0,0 +1,27 @@
+-- { dg-do compile }
+-- { dg-skip-if "No Dwarf" { { hppa*-*-hpux* } && { ! lp64 } } }
+-- { dg-options "-cargs -O0 -g -dA -fgnat-encodings=minimal -margs" }
+
+procedure Debug16 is
+
+ type Number_T (Exists : Boolean := False) is
+ record
+ case Exists is
+ when True =>
+ Value : Natural range 0 .. 255;
+ when False =>
+ null;
+ end case;
+ end record;
+ pragma Pack (Number_T);
+
+ X : Number_T;
+
+begin
+ X := (Exists => True, Value => 10);
+ if X.Exists then -- STOP
+ X.Value := X.Value + 1;
+ end if;
+end;
+
+-- { dg-final { scan-assembler-times "DW_AT_discr" 4 } }
diff --git a/gcc/testsuite/gnat.dg/openacc1.adb b/gcc/testsuite/gnat.dg/openacc1.adb
deleted file mode 100644
index ce27a5f4824..00000000000
--- a/gcc/testsuite/gnat.dg/openacc1.adb
+++ /dev/null
@@ -1,12 +0,0 @@
--- { dg-do compile }
-
-procedure OpenAcc1 is
- type Integer_Array is array (1 .. 32) of Integer;
- Data : Integer_Array;
-begin
- for i in Data'Range loop
- pragma Acc_Parallel;
- pragma Acc_Loop(Worker);
- Data (i) := i;
- end loop;
-end;
diff --git a/gcc/testsuite/gnat.dg/opt83.adb b/gcc/testsuite/gnat.dg/opt83.adb
new file mode 100644
index 00000000000..d71672f622c
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt83.adb
@@ -0,0 +1,33 @@
+-- { dg-do compile }
+-- { dg-options "-O2" }
+
+-- rpo fre3 used to loop indefinitely replacing _2 with _8 and back,
+-- given MEM[(struct test__e &)_2][0]{lb: _7 sz: 16}._tag = A23s_29;
+-- and an earlier _8 = &*_2[0]{lb: _7 sz: 16}.
+
+procedure Opt83 is
+
+ type E is tagged record
+ I : Natural := 0;
+ end record;
+
+ type A is array (Natural range <>) of aliased E;
+
+ F : E;
+
+ R : access A;
+
+ procedure N is
+ begin
+ if R = null then
+ R := new A (0 .. 4);
+ end if;
+ end N;
+
+begin
+
+ N;
+
+ R (0) := F;
+
+end Opt83;
diff --git a/gcc/testsuite/gnat.dg/opt84.adb b/gcc/testsuite/gnat.dg/opt84.adb
new file mode 100644
index 00000000000..45bce7eb625
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt84.adb
@@ -0,0 +1,74 @@
+-- { dg-do compile }
+-- { dg-options "-O2" }
+
+with Ada.Text_IO;
+with Interfaces;
+
+procedure Opt84 is
+
+ type Integer_8 is new Interfaces.Integer_8;
+ type Integer_16 is new Interfaces.Integer_16;
+ type Integer_32 is new Interfaces.Integer_32;
+
+ type Float_32 is new Interfaces.IEEE_Float_32;
+
+ type Natural_4 is range 0 .. 2 ** 4 - 1;
+ for Natural_4'Size use 4;
+
+ type Rec_Type is
+ record
+ Field_A_Int_8 : Integer_8;
+ Field_B_Nat_4 : Natural_4;
+ Field_C_Nat_4 : Natural_4;
+ Field_D_Int_32 : Integer_32;
+ Field_E_Int_32 : Integer_32;
+ Field_F_Float_32 : Float_32;
+ Field_G_Float_32 : Float_32;
+ Field_H_Float_32 : Float_32;
+ Field_I_Float_32 : Float_32;
+ Field_J_Int_16 : Integer_16;
+ Field_K_Int_16 : Integer_16;
+ Field_L_Int_16 : Integer_16;
+ Field_M_Int_16 : Integer_16;
+ Field_N_Float_32 : Float_32;
+ Field_O_Float_32 : Float_32;
+ end record;
+ pragma Pack (Rec_Type);
+ for Rec_Type'Alignment use 1;
+
+ procedure Print
+ (Item : in Rec_Type) is
+ begin
+ Ada.Text_IO.Put_Line (Item.Field_F_Float_32'Image);
+ Ada.Text_IO.Put_Line (Item.Field_G_Float_32'Image);
+ Ada.Text_IO.Put_Line (Item.Field_H_Float_32'Image);
+ Ada.Text_IO.Put_Line (Item.Field_I_Float_32'Image);
+ end Print;
+
+ procedure Test_Foo is
+ Source : Rec_Type;
+ Dest : Rec_Type;
+ begin
+ Source.Field_A_Int_8 := 0;
+ Dest.Field_A_Int_8 := 1;
+ Dest.Field_B_Nat_4 := Source.Field_B_Nat_4;
+ Dest.Field_C_Nat_4 := Source.Field_C_Nat_4;
+ Dest.Field_D_Int_32 := Source.Field_D_Int_32;
+ Dest.Field_E_Int_32 := Source.Field_E_Int_32;
+ Dest.Field_F_Float_32 := Source.Field_F_Float_32;
+ Dest.Field_G_Float_32 := Source.Field_G_Float_32;
+ Dest.Field_H_Float_32 := Source.Field_H_Float_32;
+ Dest.Field_I_Float_32 := Source.Field_I_Float_32;
+ Dest.Field_J_Int_16 := Source.Field_J_Int_16;
+ Dest.Field_K_Int_16 := Source.Field_K_Int_16;
+ Dest.Field_L_Int_16 := Source.Field_L_Int_16;
+ Dest.Field_M_Int_16 := Source.Field_M_Int_16;
+ Dest.Field_N_Float_32 := Source.Field_N_Float_32;
+ Dest.Field_O_Float_32 := Source.Field_O_Float_32;
+ Print (Source);
+ Print (Dest);
+ end Test_Foo;
+
+begin
+ Test_Foo;
+end;
diff --git a/gcc/testsuite/gnat.dg/opt85.adb b/gcc/testsuite/gnat.dg/opt85.adb
new file mode 100644
index 00000000000..94213a45819
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt85.adb
@@ -0,0 +1,20 @@
+-- { dg-do compile }
+-- { dg-options "-O" }
+
+package body Opt85 is
+
+ function Conversion_Of (Value : Integer) return Data_Type is
+ begin
+ return (Value => Interfaces.Integer_16 (Value));
+ end;
+
+ function Create (Value : Integer) return Record_Type is
+ Rec : constant Record_Type :=
+ (Ada.Finalization.Controlled with
+ Header => (others => False),
+ Data => Conversion_Of (Value));
+ begin
+ return Rec;
+ end;
+
+end Opt85;
diff --git a/gcc/testsuite/gnat.dg/opt85.ads b/gcc/testsuite/gnat.dg/opt85.ads
new file mode 100644
index 00000000000..00b5c284da8
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt85.ads
@@ -0,0 +1,27 @@
+with Ada.Finalization;
+with Interfaces;
+with System;
+
+package Opt85 is
+
+ type Data_Type is record
+ Value : Interfaces.Integer_16;
+ end record;
+ for Data_Type use record
+ Value at 0 range 0 .. 15;
+ end record;
+ for Data_Type'Alignment use 1;
+ for Data_Type'Size use 2 * System.Storage_Unit;
+ for Data_Type'Bit_Order use System.High_Order_First;
+ for Data_Type'Scalar_Storage_Order use System.High_Order_First;
+
+ type Header_Type is array (1 .. 1) of Boolean;
+
+ type Record_Type is new Ada.Finalization.Controlled with record
+ Header : Header_Type;
+ Data : Data_Type;
+ end record;
+
+ function Create (Value : Integer) return Record_Type;
+
+end Opt85;
diff --git a/gcc/testsuite/gnat.dg/opt86_pkg.ads b/gcc/testsuite/gnat.dg/opt86_pkg.ads
new file mode 100644
index 00000000000..92ce45b9202
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt86_pkg.ads
@@ -0,0 +1,8 @@
+package Opt86_Pkg is
+
+ type Enum is (Val0, Val1, Val2, Val3, Val4, Val5, Val6, Val7,
+ Val8, Val9, Val10, Val11, Val12, Val13, Val14, Val15,
+ Val16, Val17, Val18, Val19, Val20, Val21, Val22, Val23,
+ Val24, Val25, Val26, Val27, Val28, Val29, Val30, Val31);
+
+end Opt86_Pkg;
diff --git a/gcc/testsuite/gnat.dg/opt86a.adb b/gcc/testsuite/gnat.dg/opt86a.adb
new file mode 100644
index 00000000000..d8cd35ebc8b
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt86a.adb
@@ -0,0 +1,36 @@
+-- { dg-do compile }
+-- { dg-options "-O2 -fdump-tree-optimized" }
+
+with Ada.Command_Line; use Ada.Command_Line;
+with Opt86_Pkg; use Opt86_Pkg;
+
+procedure Opt86a is
+
+ S1, S2, S3, S4 : Enum;
+
+begin
+
+ S1 := Enum'Value (Argument (1));
+ S2 := Enum'Value (Argument (2));
+ S3 := Enum'Value (Argument (3));
+ S4 := Enum'Value (Argument (4));
+
+ if S1 in Val2 | Val3 | Val9 then
+ raise Program_Error;
+ end if;
+
+ if S2 not in Val2 | Val3 | Val9 then
+ raise Program_Error;
+ end if;
+
+ if S3 = Val1 or else S3 = Val4 or else S3 = Val8 then
+ raise Program_Error;
+ end if;
+
+ if S4 /= Val1 and S4 /= Val4 and S4 /= Val8 then
+ raise Program_Error;
+ end if;
+
+end;
+
+-- { dg-final { scan-tree-dump-times ">>" 4 "optimized" } }
diff --git a/gcc/testsuite/gnat.dg/opt86b.adb b/gcc/testsuite/gnat.dg/opt86b.adb
new file mode 100644
index 00000000000..fe46f2e28c6
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt86b.adb
@@ -0,0 +1,37 @@
+-- { dg-do compile }
+-- { dg-options "-O2 -fdump-tree-optimized" }
+
+with Ada.Command_Line; use Ada.Command_Line;
+with Opt86_Pkg; use Opt86_Pkg;
+
+procedure Opt86B is
+
+ S1, S2, S3, S4 : Enum;
+
+begin
+
+ S1 := Enum'Value (Argument (1));
+ S2 := Enum'Value (Argument (2));
+ S3 := Enum'Value (Argument (3));
+ S4 := Enum'Value (Argument (4));
+
+ if S1 in Val2 | Val3 | Val9 | Val29 then
+ raise Program_Error;
+ end if;
+
+ if S2 not in Val2 | Val3 | Val9 | Val29 then
+ raise Program_Error;
+ end if;
+
+ if S3 = Val1 or S3 = Val4 or S3 = Val8 or S3 = Val13 then
+ raise Program_Error;
+ end if;
+
+ if S4 /= Val1 and S4 /= Val4 and S4 /= Val8 and S4 /= Val13 then
+ raise Program_Error;
+ end if;
+
+end;
+
+-- { dg-final { scan-tree-dump-not "> 29" "optimized" } }
+-- { dg-final { scan-tree-dump-not "> 13" "optimized" } }
diff --git a/gcc/testsuite/gnat.dg/opt86c.adb b/gcc/testsuite/gnat.dg/opt86c.adb
new file mode 100644
index 00000000000..77691441eb3
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt86c.adb
@@ -0,0 +1,37 @@
+-- { dg-do compile }
+-- { dg-options "-O2 -fdump-tree-optimized" }
+
+with Ada.Command_Line; use Ada.Command_Line;
+with Opt86_Pkg; use Opt86_Pkg;
+
+procedure Opt86c is
+
+ S1, S2, S3, S4 : Enum;
+
+begin
+
+ S1 := Enum'Value (Argument (1));
+ S2 := Enum'Value (Argument (2));
+ S3 := Enum'Value (Argument (3));
+ S4 := Enum'Value (Argument (4));
+
+ if S1 in Val16 | Val8 | Val26 | Val2 | Val10 then
+ raise Program_Error;
+ end if;
+
+ if S2 not in Val16 | Val8 | Val26 | Val2 | Val10 then
+ raise Program_Error;
+ end if;
+
+ if S3 = Val3 or S3 = Val25 or S3 = Val13 or S3 = Val29 or S3 = Val11 then
+ raise Program_Error;
+ end if;
+
+ if S4 /= Val3 and S4 /= Val25 and S4 /= Val13 and S4 /= Val29 and s4 /= Val11 then
+ raise Program_Error;
+ end if;
+
+end;
+
+-- { dg-final { scan-tree-dump-not "> 26" "optimized" } }
+-- { dg-final { scan-tree-dump-not "> 29" "optimized" } }
diff --git a/gcc/testsuite/gnat.dg/opt87.adb b/gcc/testsuite/gnat.dg/opt87.adb
new file mode 100644
index 00000000000..eb228dce6cc
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt87.adb
@@ -0,0 +1,12 @@
+-- { dg-do compile }
+-- { dg-require-effective-target store_merge }
+-- { dg-options "-O2 -gnatn -fdump-tree-store-merging" }
+
+with Opt87_Pkg; use Opt87_Pkg;
+
+procedure Opt87 is
+begin
+ Print ("problem detected", "level 1");
+end;
+
+-- { dg-final { scan-tree-dump "1 stores to replace old one of 6 stores" "store-merging" } }
diff --git a/gcc/testsuite/gnat.dg/opt87_pkg.adb b/gcc/testsuite/gnat.dg/opt87_pkg.adb
new file mode 100644
index 00000000000..4bfdd0a8eff
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt87_pkg.adb
@@ -0,0 +1,12 @@
+with Text_IO; use Text_IO;
+
+package body Opt87_Pkg is
+
+ procedure Print (Msg : String; Location : String) is
+ Final_Msg : constant String :=
+ Ascii.Cr & "info: " & Msg & " (" & Location & ")" & Ascii.Cr;
+ begin
+ Put_Line (Final_Msg);
+ end;
+
+end Opt87_Pkg;
diff --git a/gcc/testsuite/gnat.dg/opt87_pkg.ads b/gcc/testsuite/gnat.dg/opt87_pkg.ads
new file mode 100644
index 00000000000..9b3462fe7b9
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt87_pkg.ads
@@ -0,0 +1,6 @@
+package Opt87_Pkg is
+
+ procedure Print (Msg : String; Location : String);
+ pragma Inline (Print);
+
+end Opt87_Pkg;
diff --git a/gcc/testsuite/gnat.dg/renaming16.adb b/gcc/testsuite/gnat.dg/renaming16.adb
new file mode 100644
index 00000000000..1c30e4dae6a
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/renaming16.adb
@@ -0,0 +1,11 @@
+-- { dg-do compile }
+
+with Renaming16_Pkg; use Renaming16_Pkg;
+
+procedure Renaming16 is
+ Results : Bindings_Query_Results_Type;
+begin
+ for I in Create_Bindings_Iterator (Results) loop
+ null;
+ end loop;
+end;
diff --git a/gcc/testsuite/gnat.dg/renaming16_pkg.ads b/gcc/testsuite/gnat.dg/renaming16_pkg.ads
new file mode 100644
index 00000000000..0d978c3c3d3
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/renaming16_pkg.ads
@@ -0,0 +1,34 @@
+with Ada.Iterator_Interfaces;
+
+package Renaming16_Pkg is
+
+ type Results_Type is tagged null record;
+
+ type Cursor is access constant Results_Type'Class;
+
+ not overriding
+ function Has_Element (Position : Cursor) return Boolean;
+
+ package Base_Iterators is
+ new Ada.Iterator_Interfaces (Cursor, Has_Element);
+
+ -- Can be with null record
+ type Bindings_Iterator is
+ new Base_Iterators.Forward_Iterator with
+ record
+ Ref: Cursor;
+ end record;
+
+ not overriding
+ function Create_Bindings_Iterator
+ (Results : in out Results_Type'Class)
+ return Bindings_Iterator;
+
+ overriding function First (Object: Bindings_Iterator) return Cursor;
+ overriding function Next (Object: Bindings_Iterator; Position: Cursor) return Cursor;
+
+ function Whatever return Boolean;
+ subtype Bindings_Query_Results_Type is Results_Type
+ with Dynamic_Predicate => Whatever;
+
+end Renaming16_Pkg;
diff --git a/gcc/testsuite/gnat.dg/rep_clause8.adb b/gcc/testsuite/gnat.dg/rep_clause8.adb
index 11d1266cb39..f886e37e2f6 100644
--- a/gcc/testsuite/gnat.dg/rep_clause8.adb
+++ b/gcc/testsuite/gnat.dg/rep_clause8.adb
@@ -9,8 +9,8 @@ procedure Rep_Clause8 is
generic
type Formal_Root is new Root with private;
package Gen_Derived is
- type Deriv is new Formal_Root with null record
- with Size => 300; -- { dg-error "representation item not allowed for generic type" }
+ type Deriv is new Formal_Root with null record -- { dg-error "representation item not allowed for generic type" }
+ with Size => 300;
end Gen_Derived;
package Inst_Derived is new Gen_Derived (Root);
diff --git a/gcc/testsuite/go.dg/arrayclear.go b/gcc/testsuite/go.dg/arrayclear.go
index 6daebc0b8f5..aa5ba0761d7 100644
--- a/gcc/testsuite/go.dg/arrayclear.go
+++ b/gcc/testsuite/go.dg/arrayclear.go
@@ -1,5 +1,8 @@
// { dg-do compile }
// { dg-options "-fgo-debug-optimization" }
+// This comment is necessary to work around a dejagnu bug. Otherwise, the
+// column of the second error message would equal the row of the first one, and
+// since the errors are also identical, dejagnu is not able to distinguish them.
package p
diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue4085b.go b/gcc/testsuite/go.test/test/fixedbugs/issue4085b.go
index 6bf315fcc2f..6304ce073aa 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/issue4085b.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/issue4085b.go
@@ -21,9 +21,11 @@ func main() {
shouldPanic("cap out of range", func() { _ = make(T, 0, int64(n)) })
var t *byte
if unsafe.Sizeof(t) == 8 {
- var n2 int64 = 1 << 50
+ // Test mem > maxAlloc
+ var n2 int64 = 1 << 59
shouldPanic("len out of range", func() { _ = make(T, int(n2)) })
shouldPanic("cap out of range", func() { _ = make(T, 0, int(n2)) })
+ // Test elem.size*cap overflow
n2 = 1<<63 - 1
shouldPanic("len out of range", func() { _ = make(T, int(n2)) })
shouldPanic("cap out of range", func() { _ = make(T, 0, int(n2)) })
diff --git a/gcc/testsuite/jit.dg/all-non-failing-tests.h b/gcc/testsuite/jit.dg/all-non-failing-tests.h
index ad469dad699..632ab8cfb2e 100644
--- a/gcc/testsuite/jit.dg/all-non-failing-tests.h
+++ b/gcc/testsuite/jit.dg/all-non-failing-tests.h
@@ -67,6 +67,16 @@
#undef create_code
#undef verify_code
+/* test-builtin-memcpy.c */
+#define create_code create_code_builtin_memcpy
+#define verify_code verify_code_builtin_memcpy
+#include "test-builtin-memcpy.c"
+#undef create_code
+#undef verify_code
+
+/* test-builtin-unreachable.c: We don't add this one, since it touches
+ the optimization level of the context as a whole. */
+
/* test-calling-external-function.c */
#define create_code create_code_calling_external_function
#define verify_code verify_code_calling_external_function
@@ -220,6 +230,20 @@
#undef create_code
#undef verify_code
+/* test-pr95306-builtin-types.c. */
+#define create_code create_code_pr95306_builtin_types
+#define verify_code verify_code_pr95306_builtin_types
+#include "test-pr95306-builtin-types.c"
+#undef create_code
+#undef verify_code
+
+/* test-pr95314-rvalue-reuse.c. */
+#define create_code create_code_pr95314_rvalue_reuse
+#define verify_code verify_code_pr95314_rvalue_reuse
+#include "test-pr95314-rvalue-reuse.c"
+#undef create_code
+#undef verify_code
+
/* test-reading-struct.c */
#define create_code create_code_reading_struct
#define verify_code verify_code_reading_struct
@@ -318,6 +342,9 @@ const struct testcase testcases[] = {
{"autovectorize",
create_code_autovectorize,
verify_code_autovectorize},
+ {"builtin-memcpy",
+ create_code_builtin_memcpy,
+ verify_code_builtin_memcpy},
{"calling_external_function",
create_code_calling_external_function,
verify_code_calling_external_function},
@@ -381,6 +408,12 @@ const struct testcase testcases[] = {
{"pr66779",
create_code_pr66779,
verify_code_pr66779},
+ {"pr95306_builtin_types",
+ create_code_pr95306_builtin_types,
+ verify_code_pr95306_builtin_types},
+ {"pr95314_rvalue_reuse",
+ create_code_pr95314_rvalue_reuse,
+ verify_code_pr95314_rvalue_reuse},
{"reading_struct ",
create_code_reading_struct ,
verify_code_reading_struct },
diff --git a/gcc/testsuite/jit.dg/jit.exp b/gcc/testsuite/jit.dg/jit.exp
index 13e8ab4dbfe..2d8c884b6b8 100644
--- a/gcc/testsuite/jit.dg/jit.exp
+++ b/gcc/testsuite/jit.dg/jit.exp
@@ -38,6 +38,11 @@ load_lib gcc.exp
load_lib g++.exp
load_lib dejagnu.exp
+# Skip these tests for targets that don't support -lgccjit
+if { ![check_effective_target_lgccjit] } {
+ return
+}
+
# Look for lines of the form:
# definitely lost: 11,316 bytes in 235 blocks
# indirectly lost: 352 bytes in 4 blocks
@@ -197,37 +202,37 @@ proc fixed_host_execute {args} {
set timetol 0
exp_continue
}
- -re "^$prefix\tNOTE:${text}*" {
+ -re "^$prefix\tNOTE:\[^\r\n\]+\r\n" {
regsub "\[\n\r\t\]*NOTE: $text\r\n" $expect_out(0,string) "" output
- set output [string range $output 6 end]
+ set output [string range $output 6 end-2]
verbose "$output" 2
set timetol 0
exp_continue
}
- -re "^$prefix\tPASSED:${text}*" {
+ -re "^$prefix\tPASSED:\[^\r\n\]+\r\n" {
regsub "\[\n\r\t\]*PASSED: $text\r\n" $expect_out(0,string) "" output
- set output [string range $output 8 end]
+ set output [string range $output 8 end-2]
pass "$output"
set timetol 0
exp_continue
}
- -re "^$prefix\tFAILED:${text}*" {
+ -re "^$prefix\tFAILED:\[^\r\n\]+\r\n" {
regsub "\[\n\r\t\]*FAILED: $text\r\n" $expect_out(0,string) "" output
- set output [string range $output 8 end]
+ set output [string range $output 8 end-2]
fail "$output"
set timetol 0
exp_continue
}
- -re "^$prefix\tUNTESTED:${text}*" {
+ -re "^$prefix\tUNTESTED:\[^\r\n\]+\r\n" {
regsub "\[\n\r\t\]*TESTED: $text\r\n" $expect_out(0,string) "" output
- set output [string range $output 8 end]
+ set output [string range $output 8 end-2]
untested "$output"
set timetol 0
exp_continue
}
- -re "^$prefix\tUNRESOLVED:${text}*" {
+ -re "^$prefix\tUNRESOLVED:\[^\r\n\]+\r\n" {
regsub "\[\n\r\t\]*UNRESOLVED: $text\r\n" $expect_out(0,string) "" output
- set output [string range $output 8 end]
+ set output [string range $output 8 end-2]
unresolved "$output"
set timetol 0
exp_continue
diff --git a/gcc/testsuite/jit.dg/test-builtin-memcpy.c b/gcc/testsuite/jit.dg/test-builtin-memcpy.c
new file mode 100644
index 00000000000..ba4fa59fb1b
--- /dev/null
+++ b/gcc/testsuite/jit.dg/test-builtin-memcpy.c
@@ -0,0 +1,69 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "libgccjit.h"
+
+#include "harness.h"
+
+void
+create_code (gcc_jit_context *ctxt, void *user_data)
+{
+ /* Let's try to inject the equivalent of:
+ void *
+ test_memcpy (void *dest, const void *src, size_t n)
+ {
+ return __builtin_memcpy (dest, src, n);
+ }
+ */
+ gcc_jit_type *t_void_ptr
+ = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_VOID_PTR);
+ gcc_jit_type *t_const_void_ptr
+ = gcc_jit_type_get_pointer (gcc_jit_type_get_const
+ (gcc_jit_context_get_type
+ (ctxt, GCC_JIT_TYPE_VOID)));
+ gcc_jit_type *t_size_t
+ = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_SIZE_T);
+
+ gcc_jit_param *dest
+ = gcc_jit_context_new_param (ctxt, NULL, t_void_ptr, "dest");
+ gcc_jit_param *src
+ = gcc_jit_context_new_param (ctxt, NULL, t_const_void_ptr, "src");
+ gcc_jit_param *n = gcc_jit_context_new_param (ctxt, NULL, t_size_t, "n");
+ gcc_jit_param *params[3] = {dest, src, n};
+ gcc_jit_function *func =
+ gcc_jit_context_new_function (ctxt, NULL,
+ GCC_JIT_FUNCTION_EXPORTED,
+ t_void_ptr,
+ "test_memcpy",
+ 3, params, 0);
+
+ gcc_jit_function *jit_memcpy
+ = gcc_jit_context_get_builtin_function (ctxt, "__builtin_memcpy");
+
+
+ gcc_jit_block *b_initial
+ = gcc_jit_function_new_block (func, "initial");
+ gcc_jit_rvalue *args[3] = {gcc_jit_param_as_rvalue (dest),
+ gcc_jit_param_as_rvalue (src),
+ gcc_jit_param_as_rvalue (n)};
+ gcc_jit_rvalue *call
+ = gcc_jit_context_new_call (ctxt, NULL, jit_memcpy, 3, args);
+ gcc_jit_block_end_with_return (b_initial, NULL, call);
+}
+
+void
+verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
+{
+ typedef void *(*test_memcpy_type) (void *, const void *, size_t);
+ CHECK_NON_NULL (result);
+ test_memcpy_type test_memcpy =
+ (test_memcpy_type)gcc_jit_result_get_code (result, "test_memcpy");
+ CHECK_NON_NULL (test_memcpy);
+
+ int dst = 13;
+ int src = 42;
+ void *out = test_memcpy (&dst, &src, sizeof(int));
+ CHECK_VALUE(out, &dst);
+ CHECK_VALUE(dst, 42);
+}
diff --git a/gcc/testsuite/jit.dg/test-builtin-unreachable.c b/gcc/testsuite/jit.dg/test-builtin-unreachable.c
new file mode 100644
index 00000000000..09e55e608da
--- /dev/null
+++ b/gcc/testsuite/jit.dg/test-builtin-unreachable.c
@@ -0,0 +1,49 @@
+#include <libgccjit.h>
+
+#include "harness.h"
+
+/* Verify that we can compile a function that uses __builtin_unreachable
+ (PR jit/95426).
+
+ Compile the equivalent of this C:
+
+ int test_pr95426_unreachable (int i)
+ {
+ __builtin_unreachable ();
+ return i;
+ }
+*/
+
+void
+create_code (gcc_jit_context *ctxt, void *user_data)
+{
+ gcc_jit_context_set_int_option (ctxt,
+ GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL,
+ 0);
+
+ gcc_jit_type *int_type = gcc_jit_context_get_type(ctxt, GCC_JIT_TYPE_INT);
+ gcc_jit_param *param_i
+ = gcc_jit_context_new_param (ctxt, NULL, int_type, "i");
+ gcc_jit_function *test_fn
+ = gcc_jit_context_new_function (ctxt, NULL, GCC_JIT_FUNCTION_EXPORTED,
+ int_type,
+ "test_pr95426_unreachable",
+ 1, &param_i, 0);
+
+ gcc_jit_block *bb = gcc_jit_function_new_block(test_fn, "start");
+ gcc_jit_function *func___builtin_unreachable
+ = gcc_jit_context_get_builtin_function(ctxt, "__builtin_unreachable");
+ gcc_jit_rvalue *call___builtin_unreachable
+ = gcc_jit_context_new_call(ctxt, NULL, func___builtin_unreachable,
+ 0, NULL);
+ gcc_jit_block_add_eval(bb, NULL, call___builtin_unreachable);
+ gcc_jit_block_end_with_return (bb, NULL, gcc_jit_param_as_rvalue(param_i));
+}
+
+void
+verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
+{
+ CHECK_NON_NULL (result);
+ CHECK_NON_NULL (gcc_jit_result_get_code (result, "test_pr95426_unreachable"));
+ /* Don't actually run the code. */
+}
diff --git a/gcc/testsuite/jit.dg/test-error-gcc_jit_context_get_builtin_function-unimplemented-type.c b/gcc/testsuite/jit.dg/test-error-gcc_jit_context_get_builtin_function-unimplemented-type.c
new file mode 100644
index 00000000000..89b59d4c7a8
--- /dev/null
+++ b/gcc/testsuite/jit.dg/test-error-gcc_jit_context_get_builtin_function-unimplemented-type.c
@@ -0,0 +1,20 @@
+#include "libgccjit.h"
+
+#include "harness.h"
+
+void
+create_code (gcc_jit_context *ctxt, void *user_data)
+{
+ gcc_jit_context_get_builtin_function(ctxt, "__builtin_fork");
+}
+
+extern void
+verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
+{
+ CHECK_VALUE (result, NULL);
+
+ /* Verify that the correct error message was emitted. */
+ CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt),
+ "unimplemented primitive type for builtin"
+ " (type: BT_PID)");
+}
diff --git a/gcc/testsuite/jit.dg/test-error-gcc_jit_context_new_global-void-type.c b/gcc/testsuite/jit.dg/test-error-gcc_jit_context_new_global-void-type.c
new file mode 100644
index 00000000000..c310da6a885
--- /dev/null
+++ b/gcc/testsuite/jit.dg/test-error-gcc_jit_context_new_global-void-type.c
@@ -0,0 +1,25 @@
+#include <libgccjit.h>
+
+#include "harness.h"
+
+/* Try to create a "void" global; the API ought to complain. */
+
+void
+create_code (gcc_jit_context *ctxt, void *user_data)
+{
+ gcc_jit_type *void_type
+ = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_VOID);
+ gcc_jit_context_new_global (ctxt, NULL, GCC_JIT_GLOBAL_EXPORTED,
+ void_type, "i");
+}
+
+void
+verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
+{
+ CHECK_VALUE (result, NULL);
+
+ /* Verify that the correct error message was emitted. */
+ CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt),
+ "gcc_jit_context_new_global:"
+ " void type for global \"i\"");
+}
diff --git a/gcc/testsuite/jit.dg/test-error-gcc_jit_function_new_local-void-type.c b/gcc/testsuite/jit.dg/test-error-gcc_jit_function_new_local-void-type.c
new file mode 100644
index 00000000000..254abc0c146
--- /dev/null
+++ b/gcc/testsuite/jit.dg/test-error-gcc_jit_function_new_local-void-type.c
@@ -0,0 +1,27 @@
+#include <libgccjit.h>
+
+#include "harness.h"
+
+/* Try to create a "void" local; the API ought to complain. */
+
+void
+create_code (gcc_jit_context *ctxt, void *user_data)
+{
+ gcc_jit_type *void_type
+ = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_VOID);
+ gcc_jit_function *func
+ = gcc_jit_context_new_function (ctxt, NULL, GCC_JIT_FUNCTION_EXPORTED,
+ void_type, "test_fn", 0, NULL, 0);
+ gcc_jit_function_new_local(func, NULL, void_type, "i");
+}
+
+void
+verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
+{
+ CHECK_VALUE (result, NULL);
+
+ /* Verify that the correct error message was emitted. */
+ CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt),
+ "gcc_jit_function_new_local:"
+ " void type for local \"i\"");
+}
diff --git a/gcc/testsuite/jit.dg/test-fuzzer.c b/gcc/testsuite/jit.dg/test-fuzzer.c
index 6943d3ed232..4fd49dacf6d 100644
--- a/gcc/testsuite/jit.dg/test-fuzzer.c
+++ b/gcc/testsuite/jit.dg/test-fuzzer.c
@@ -96,7 +96,6 @@ fuzzer_init (fuzzer *f, gcc_jit_context *ctxt, unsigned int seed)
for (i = 0; i < num_types; i++)
{
gcc_jit_type *type = make_random_type (f);
- assert (type);
f->types[f->num_types++] = type;
}
@@ -188,7 +187,6 @@ get_random_type (fuzzer *f)
if (i < NUM_TYPES)
return gcc_jit_context_get_type (f->ctxt, types[i]);
assert ((i - NUM_TYPES) < f->num_types);
- assert (f->types[i - NUM_TYPES]);
return f->types[i - NUM_TYPES];
}
diff --git a/gcc/testsuite/jit.dg/test-pr95306-builtin-types.c b/gcc/testsuite/jit.dg/test-pr95306-builtin-types.c
new file mode 100644
index 00000000000..960163ed7d4
--- /dev/null
+++ b/gcc/testsuite/jit.dg/test-pr95306-builtin-types.c
@@ -0,0 +1,23 @@
+#include "libgccjit.h"
+
+#include "harness.h"
+
+void
+create_code (gcc_jit_context *ctxt, void *user_data)
+{
+#define CHECK_BUILTIN(NAME) \
+ CHECK_NON_NULL (gcc_jit_context_get_builtin_function (ctxt, NAME));
+
+ CHECK_BUILTIN ("__atomic_load");
+ CHECK_BUILTIN ("__builtin_memcpy");
+ CHECK_BUILTIN ("__builtin_sadd_overflow");
+
+#undef CHECK_BUILTIN
+}
+
+extern void
+verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
+{
+ /* Verify that no errors were emitted. */
+ CHECK_NON_NULL (result);
+}
diff --git a/gcc/testsuite/jit.dg/test-pr95314-rvalue-reuse.c b/gcc/testsuite/jit.dg/test-pr95314-rvalue-reuse.c
new file mode 100644
index 00000000000..6bed0bc52a4
--- /dev/null
+++ b/gcc/testsuite/jit.dg/test-pr95314-rvalue-reuse.c
@@ -0,0 +1,56 @@
+#include <libgccjit.h>
+#include "harness.h"
+
+void create_code (gcc_jit_context *ctxt, void *user_data)
+{
+ gcc_jit_type *t_int = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_INT);
+ gcc_jit_type *t_void = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_VOID);
+ gcc_jit_type *t_const_char_ptr
+ = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_CONST_CHAR_PTR);
+ gcc_jit_lvalue *global
+ = gcc_jit_context_new_global (ctxt, NULL, GCC_JIT_GLOBAL_INTERNAL,
+ t_const_char_ptr, "pr95314_global");
+
+ gcc_jit_rvalue *global_ref = gcc_jit_lvalue_get_address(global, NULL);
+
+ gcc_jit_param *param_string
+ = gcc_jit_context_new_param (ctxt, NULL, t_const_char_ptr, "string");
+ gcc_jit_function *puts_func
+ = gcc_jit_context_new_function (ctxt, NULL, GCC_JIT_FUNCTION_IMPORTED,
+ t_int, "puts", 1, &param_string, 0);
+
+#define NUM_INNER_FNS 3
+ gcc_jit_function *inner_fns[NUM_INNER_FNS];
+ for (int i = 0; i < NUM_INNER_FNS; i++)
+ {
+ char fnname[128];
+ sprintf (fnname, "pr95314_inner_%i", i);
+ inner_fns[i]
+ = gcc_jit_context_new_function (ctxt, NULL, GCC_JIT_FUNCTION_INTERNAL,
+ t_void, fnname, 0, NULL, 0);
+ gcc_jit_block *block = gcc_jit_function_new_block (inner_fns[i], NULL);
+ gcc_jit_rvalue *arg
+ = gcc_jit_context_new_cast (ctxt, NULL, global_ref, t_const_char_ptr);
+ gcc_jit_block_add_eval (block, NULL,
+ gcc_jit_context_new_call (ctxt, NULL, puts_func,
+ 1, &arg));
+ gcc_jit_block_end_with_void_return (block, NULL);
+ }
+
+ gcc_jit_function *outer_func
+ = gcc_jit_context_new_function (ctxt, NULL, GCC_JIT_FUNCTION_EXPORTED,
+ t_void, "pr95314_outer", 0, NULL, 0);
+ gcc_jit_block *block = gcc_jit_function_new_block (outer_func, NULL);
+ for (int i = 0; i < NUM_INNER_FNS; i++)
+ gcc_jit_block_add_eval (block, NULL,
+ gcc_jit_context_new_call (ctxt, NULL, inner_fns[i],
+ 0, NULL));
+ gcc_jit_block_end_with_void_return (block, NULL);
+}
+
+void
+verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
+{
+ CHECK_NON_NULL (result);
+ (void)gcc_jit_result_get_code (result, "pr95314_outer");
+}
diff --git a/gcc/testsuite/lib/brig.exp b/gcc/testsuite/lib/brig.exp
index fbfb1da947a..de47f13e42c 100644
--- a/gcc/testsuite/lib/brig.exp
+++ b/gcc/testsuite/lib/brig.exp
@@ -29,7 +29,7 @@ proc brig_target_compile { source dest type options } {
# We cannot assume all inputs are .hsail as the dg machinery
# calls this for a some c files to check linker plugin support or
# similar.
- set brig_source ${tmpdir}/[file tail ${source}].brig
+ set brig_source ${tmpdir}/[file rootname [file tail ${source}]].brig
exec HSAILasm $source -o ${brig_source}
set source ${brig_source}
# Change the testname the .brig.
diff --git a/gcc/testsuite/lib/c-compat.exp b/gcc/testsuite/lib/c-compat.exp
index 9493c214aea..2b673179115 100644
--- a/gcc/testsuite/lib/c-compat.exp
+++ b/gcc/testsuite/lib/c-compat.exp
@@ -36,24 +36,34 @@ load_lib target-libpath.exp
proc compat-use-alt-compiler { } {
global GCC_UNDER_TEST ALT_CC_UNDER_TEST
global compat_same_alt compat_alt_caret compat_alt_color compat_no_line_no
- global compat_alt_urls
+ global compat_alt_urls compat_alt_plain_output
global TEST_ALWAYS_FLAGS
# We don't need to do this if the alternate compiler is actually
# the same as the compiler under test.
if { $compat_same_alt == 0 } then {
set GCC_UNDER_TEST $ALT_CC_UNDER_TEST
+
+ # These flags are no longer added to TEST_ALWAYS_FLAGS by prune.exp
+ # because they are subsumed by -fdiagnostics-plain-output. Add them back
+ # for compatibility testing with older compilers that do not understand
+ # -fdiagnostics-plain-output.
+ set TEST_ALWAYS_FLAGS "-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers -fdiagnostics-color=never -fdiagnostics-urls=never $TEST_ALWAYS_FLAGS"
+
if { $compat_alt_caret == 0 } then {
- regsub -- "-fno-diagnostics-show-caret" $TEST_ALWAYS_FLAGS "" TEST_ALWAYS_FLAGS
+ regsub -all -- "-fno-diagnostics-show-caret" $TEST_ALWAYS_FLAGS "" TEST_ALWAYS_FLAGS
}
if { $compat_alt_color == 0 } then {
- regsub -- "-fdiagnostics-color=never" $TEST_ALWAYS_FLAGS "" TEST_ALWAYS_FLAGS
+ regsub -all -- "-fdiagnostics-color=never" $TEST_ALWAYS_FLAGS "" TEST_ALWAYS_FLAGS
}
if { $compat_alt_urls == 0 } then {
- regsub -- "-fdiagnostics-urls=never" $TEST_ALWAYS_FLAGS "" TEST_ALWAYS_FLAGS
+ regsub -all -- "-fdiagnostics-urls=never" $TEST_ALWAYS_FLAGS "" TEST_ALWAYS_FLAGS
}
if { $compat_no_line_no == 0 } then {
- regsub -- "-fno-diagnostics-show-line-numbers" $TEST_ALWAYS_FLAGS "" TEST_ALWAYS_FLAGS
+ regsub -all -- "-fno-diagnostics-show-line-numbers" $TEST_ALWAYS_FLAGS "" TEST_ALWAYS_FLAGS
+ }
+ if { $compat_alt_plain_output == 0 } then {
+ regsub -all -- "-fdiagnostics-plain-output" $TEST_ALWAYS_FLAGS "" TEST_ALWAYS_FLAGS
}
restore_gcc_exec_prefix_env_var
}
@@ -85,12 +95,14 @@ proc compat_setup_dfp { } {
global compat_alt_caret
global compat_alt_color
global compat_alt_urls
+ global compat_alt_plain_output
global compat_no_line_no
global TEST_ALWAYS_FLAGS compat_save_TEST_ALWAYS_FLAGS
set compat_alt_caret 0
set compat_alt_color 0
set compat_alt_urls 0
+ set compat_alt_plain_output 0
set compat_no_line_no 0
set compat_save_TEST_ALWAYS_FLAGS $TEST_ALWAYS_FLAGS
@@ -119,6 +131,10 @@ proc compat_setup_dfp { } {
int dummy; } "-fno-diagnostics-show-line-numbers"] != 0 } {
set compat_no_line_no 1
}
+ if { [check_no_compiler_messages_nocache compat_alt_has_plain_output object {
+ int dummy; } "-fdiagnostics-plain-output"] != 0 } {
+ set compat_alt_plain_output 1
+ }
compat-use-tst-compiler
}
diff --git a/gcc/testsuite/lib/gcc-defs.exp b/gcc/testsuite/lib/gcc-defs.exp
index 180a9ab3a52..380a18b3f6a 100644
--- a/gcc/testsuite/lib/gcc-defs.exp
+++ b/gcc/testsuite/lib/gcc-defs.exp
@@ -285,11 +285,74 @@ proc dg-additional-files { args } {
set additional_files [lindex $args 1]
}
+set gcc_adjusted_linker_flags 0
+
+# Add -Wl, before any file names in $opts. Return the modified list.
+
+proc gcc_adjust_linker_flags_list { args } {
+ set opts [lindex $args 0]
+ set nopts {}
+ set skip ""
+ foreach opt [split $opts " "] {
+ if { $opt == "" } then {
+ continue
+ } elseif { $skip != "" } then {
+ set skip ""
+ } elseif { $opt == "-Xlinker" } then {
+ set skip $opt
+ } elseif { ![string match "-*" $opt] \
+ && [file isfile $opt] } {
+ set opt "-Wl,$opt"
+ }
+ lappend nopts $opt
+ }
+ return $nopts
+}
+
+# Add -Wl, before any file names in the target board's ldflags, libs,
+# and ldscript, as well as in global testglue and wrap_flags, so that
+# default object files or libraries do not change the names of gcc
+# auxiliary outputs.
+
+proc gcc_adjust_linker_flags {} {
+ global gcc_adjusted_linker_flags
+ if {$gcc_adjusted_linker_flags} {
+ return
+ }
+ set gcc_adjusted_linker_flags 1
+
+ if {![is_remote host]} {
+ set dest [target_info name]
+ foreach i { ldflags libs ldscript } {
+ if {[board_info $dest exists $i]} {
+ set opts [board_info $dest $i]
+ set nopts [gcc_adjust_linker_flags_list $opts]
+ if { $nopts != $opts } {
+ unset_currtarget_info $i
+ set_currtarget_info $i "$nopts"
+ }
+ }
+ }
+ foreach i { gluefile wrap_flags } {
+ global $i
+ if {[info exists $i]} {
+ set opts [set $i]
+ set nopts [gcc_adjust_linker_flags_list $opts]
+ if { $nopts != $opts } {
+ set $i $nopts
+ }
+ }
+ }
+ }
+}
+
# Return an updated version of OPTIONS that mentions any additional
# source files registered with dg-additional-sources. SOURCE is the
# name of the test case.
proc dg-additional-files-options { options source } {
+ gcc_adjust_linker_flags
+
global additional_sources
global additional_sources_used
global additional_files
@@ -305,6 +368,10 @@ proc dg-additional-files-options { options source } {
set to_download [concat $to_download $additional_sources]
set additional_sources_used "$additional_sources"
set additional_sources ""
+ # This option restores naming of aux and dump output files
+ # after input files when multiple input files are named,
+ # instead of getting them combined with the output name.
+ lappend options "additional_flags=-dumpbase \"\""
}
if { $additional_files != "" } then {
regsub -all "^| " $additional_files " [file dirname $source]/" additional_files
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index 27cc7c19625..e8ad3052657 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -308,13 +308,27 @@ proc gcc-dg-test-1 { target_compile prog do_what extra_tool_flags } {
verbose "$target_compile $prog $output_file $compile_type $options" 4
set comp_output [$target_compile "$prog" "$output_file" "$compile_type" $options]
+ global expect_ice
# Look for an internal compiler error, which sometimes masks the fact
# that we didn't get an expected error message. XFAIL an ICE via
# dg-xfail-if and use { dg-prune-output ".*internal compiler error.*" }
# to avoid a second failure for excess errors.
- if [string match "*internal compiler error*" $comp_output] {
+ # "Error reporting routines re-entered" ICE says "Internal" rather than
+ # "internal", so match that too.
+ if [string match {*[Ii]nternal compiler error*} $comp_output] {
upvar 2 name name
- fail "$name (internal compiler error)"
+ if { $expect_ice == 0 } {
+ fail "$name (internal compiler error)"
+ } else {
+ # We expected an ICE and we got it.
+ xfail "$name (internal compiler error)"
+ # Prune the ICE from the output.
+ set comp_output [prune_ices $comp_output]
+ }
+ } elseif { $expect_ice == 1 } {
+ upvar 2 name name
+ # We expected an ICE but we didn't get it.
+ xpass "$name (internal compiler error)"
}
if { $do_what == "repo" } {
@@ -477,7 +491,10 @@ proc dg-set-target-env-var { args } {
error "dg-set-target-env-var: need two arguments"
return
}
- lappend set_target_env_var [list [lindex $args 1] [lindex $args 2]]
+ set var [lindex $args 1]
+ set value [lindex $args 2]
+ verbose "dg-set-target-env-var $var $value" 2
+ lappend set_target_env_var [list $var $value]
}
proc set-target-env-var { } {
@@ -518,6 +535,7 @@ proc dg-set-compiler-env-var { args } {
}
set var [lindex $args 1]
set value [lindex $args 2]
+ verbose "dg-set-compiler-env-var $var $value" 2
if [info exists ::env($var)] {
lappend saved_compiler_env_var [list $var 1 $::env($var)]
} else {
@@ -935,6 +953,7 @@ if { [info procs saved-dg-test] == [list] } {
global additional_prunes
global compiler_conditional_xfail_data
global shouldfail
+ global expect_ice
global testname_with_flags
global set_target_env_var
global set_compiler_env_var
@@ -950,6 +969,7 @@ if { [info procs saved-dg-test] == [list] } {
set additional_sources_used ""
set additional_prunes ""
set shouldfail 0
+ set expect_ice 0
if [info exists set_target_env_var] {
unset set_target_env_var
}
diff --git a/gcc/testsuite/lib/gcov.exp b/gcc/testsuite/lib/gcov.exp
index a2832ec4f05..9276aead06b 100644
--- a/gcc/testsuite/lib/gcov.exp
+++ b/gcc/testsuite/lib/gcov.exp
@@ -39,8 +39,8 @@ proc clean-gcov-file { testcase suffix } {
proc clean-gcov { testcase } {
clean-gcov-file $testcase "gcno"
clean-gcov-file $testcase "gcda"
- clean-gcov-file $testcase "gcov"
clean-gcov-file $testcase "h.gcov"
+ remote_file host delete "$testcase.gcov"
}
#
diff --git a/gcc/testsuite/lib/gdc-utils.exp b/gcc/testsuite/lib/gdc-utils.exp
index 5c17346dbf5..0e4f57c756d 100644
--- a/gcc/testsuite/lib/gdc-utils.exp
+++ b/gcc/testsuite/lib/gdc-utils.exp
@@ -403,6 +403,7 @@ proc gdc-permute-options { options } {
proc gdc-do-test { testcases } {
global dg-do-what-default
+ global subdir
global verbose
# If a testcase doesn't have special options, use these.
@@ -430,27 +431,32 @@ proc gdc-do-test { testcases } {
set saved-dg-do-what-default ${dg-do-what-default}
+ # Create gdc.test link so test names include that subdir.
+ set testdir [file dirname $subdir]
+ catch { file link $testdir . }
+
# Main loop.
# set verbose 1
# set dg-final-code ""
# Find all tests and pass to routine.
foreach test $testcases {
- regexp -- "(.*)/(.+)/(.+)\.(.+)$" $test match base dir name ext
+ regexp -- "(.*)/(.+)/(.+)\.(.+)$" $test match base type name ext
# Convert to DG test.
- set imports [format "-I%s/%s" $base $dir]
+ set imports [format "-I%s/%s" $base $type]
set cleanup_extra_files ""
- set compilable_do_what "assemble"
- set filename "[gdc-convert-test $base $dir/$name.$ext]"
+ set compilable_do_what "assemble"
+ # Include $testdir prefix so test names follow DejaGnu conventions.
+ set filename "$testdir/[gdc-convert-test $base $type/$name.$ext]"
- if { $dir == "runnable" } {
+ if { $type == "runnable" } {
append PERMUTE_ARGS " $SHARED_OPTION"
}
set options [gdc-permute-options [lsort -unique $PERMUTE_ARGS]]
- switch $dir {
+ switch $type {
runnable_cxx -
runnable {
for { set i 0 } { $i<[llength $options] } { incr i } {
diff --git a/gcc/testsuite/lib/options.exp b/gcc/testsuite/lib/options.exp
index 44ea51075bc..c7f7316943e 100644
--- a/gcc/testsuite/lib/options.exp
+++ b/gcc/testsuite/lib/options.exp
@@ -74,7 +74,7 @@ proc check_for_options_with_filter { language gcc_options exclude \
}
}
- # Verify that COMPILER_PATTERRNS appear in gcc output.
+ # Verify that COMPILER_PATTERNS appear in gcc output.
foreach pattern [split $compiler_patterns "\n"] {
if {$pattern != ""} {
if {[regexp -line -- "$pattern" $gcc_output]} {
@@ -89,7 +89,7 @@ proc check_for_options_with_filter { language gcc_options exclude \
}
}
- # Verify that COMPILER_NON_PATTERRNS do not appear in gcc output.
+ # Verify that COMPILER_NON_PATTERNS do not appear in gcc output.
foreach pattern [split $compiler_non_patterns "\n"] {
if {$pattern != ""} {
if {![regexp -line -- "$pattern" $gcc_output result]} {
diff --git a/gcc/testsuite/lib/profopt.exp b/gcc/testsuite/lib/profopt.exp
index 0b853a1559f..d6863439d04 100644
--- a/gcc/testsuite/lib/profopt.exp
+++ b/gcc/testsuite/lib/profopt.exp
@@ -289,8 +289,8 @@ proc auto-profopt-execute { src } {
return
}
set profile_wrapper [profopt-perf-wrapper]
- set profile_option "-g"
- set feedback_option "-fauto-profile"
+ set profile_option "-g -DFOR_AUTOFDO_TESTING"
+ set feedback_option "-fauto-profile -DFOR_AUTOFDO_TESTING"
set run_autofdo 1
profopt-execute $src
unset profile_wrapper
@@ -353,6 +353,10 @@ proc profopt-execute { src } {
set count 0
foreach option $prof_option_list {
+ # We pass -dumpbase-ext ${execext}[123] to the compile&link
+ # commands so as to avoid the combination of the executable
+ # with the source name in the aux outputs.
+ set execext ".x${count}"
set execname1 "${executable}${count}1"
set execname2 "${executable}${count}2"
set execname3 "${executable}${count}3"
@@ -402,7 +406,7 @@ proc profopt-execute { src } {
# Compile for profiling.
set options "$extra_options"
- lappend options "additional_flags=$option $extra_flags $profile_option"
+ lappend options "additional_flags=$option $extra_flags $profile_option -dumpbase-ext ${execext}1"
set optstr "$option $profile_option"
set comp_output [${tool}_target_compile "$src" "$execname1" executable $options]
if ![${tool}_check_compile "$testcase compilation" $optstr $execname1 $comp_output] {
@@ -491,7 +495,7 @@ proc profopt-execute { src } {
# Compile with feedback-directed optimizations.
set options "$extra_options"
- lappend options "additional_flags=$option $extra_flags $feedback_option"
+ lappend options "additional_flags=$option $extra_flags $feedback_option -dumpbase-ext ${execext}2"
set optstr "$option $feedback_option"
if { [string first "-fauto-profile" $options] >= 0} {
set options [regsub -- "-fauto-profile" $options "-fauto-profile=$tmpdir/$bprefix$base.$ext"]
@@ -548,7 +552,7 @@ proc profopt-execute { src } {
# Compile with normal optimizations.
set options "$extra_options"
- lappend options "additional_flags=$option"
+ lappend options "additional_flags=$option -dumpbase-ext ${execext}3"
set optstr "$option"
set comp_output [${tool}_target_compile "$src" "$execname3" "executable" $options]
if ![${tool}_check_compile "$testcase compilation" $optstr $execname3 $comp_output] {
diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp
index eea4bf383a7..190367c44e0 100644
--- a/gcc/testsuite/lib/prune.exp
+++ b/gcc/testsuite/lib/prune.exp
@@ -18,10 +18,16 @@
load_lib multiline.exp
+# Add options to TEST_ALWAYS_FLAGS so that diagnostics have the expected output
+# format. Note: You should not normally need to add more options here. If you
+# have made a change to the default diagnostic output format and are wanting to
+# undo that in the testsuite here, then please update the handling of
+# -fdiagnostics-plain-output in opts-common.c instead.
+
if ![info exists TEST_ALWAYS_FLAGS] {
set TEST_ALWAYS_FLAGS ""
}
-set TEST_ALWAYS_FLAGS "-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers -fdiagnostics-color=never -fdiagnostics-urls=never $TEST_ALWAYS_FLAGS"
+set TEST_ALWAYS_FLAGS "-fdiagnostics-plain-output $TEST_ALWAYS_FLAGS"
proc prune_gcc_output { text } {
global srcdir
@@ -38,8 +44,8 @@ proc prune_gcc_output { text } {
regsub -all "(^|\n)\[^\n\]*: in .constexpr. expansion \[^\n\]*" $text "" text
regsub -all "(^|\n)\[^\n\]*: in requirements \[^\n\]*" $text "" text
regsub -all "(^|\n) inlined from \[^\n\]*" $text "" text
- regsub -all "(^|\n)collect2: error: ld returned \[^\n\]*" $text "" text
- regsub -all "(^|\n)collect: re(compiling|linking)\[^\n\]*" $text "" text
+ regsub -all "(^|\n)\[^\n\]*: error: ld returned \[^\n\]*" $text "" text
+ regsub -all "(^|\n)\[^\n\]*: re(compiling|linking)\[^\n\]*" $text "" text
regsub -all "(^|\n)Please submit.*instructions\[^\n\]*" $text "" text
regsub -all "(^|\n)\[0-9\]\[0-9\]* errors\." $text "" text
regsub -all "(^|\n)(In file included|\[ \]+from)\[^\n\]*" $text "" text
@@ -118,6 +124,15 @@ proc prune_file_path { text } {
return $text
}
+# Prune internal compiler error messages, including the "Please submit..."
+# footnote.
+
+proc prune_ices { text } {
+ regsub -all "(^|\n)\[^\n\]*: internal compiler error:.*for instructions\[^\n\]*" $text "" text
+ regsub -all "(^|\n|')*Internal compiler error:.*for instructions\[^\n\]*" $text "" text
+ return $text
+}
+
# Provide a definition of this if missing (delete after next dejagnu release).
if { [info procs prune_warnings] == "" } then {
diff --git a/gcc/testsuite/lib/scandump.exp b/gcc/testsuite/lib/scandump.exp
index d6ba350acc8..1cf1559cfff 100644
--- a/gcc/testsuite/lib/scandump.exp
+++ b/gcc/testsuite/lib/scandump.exp
@@ -32,6 +32,9 @@ proc dump-suffix { arg } {
proc dump-base { args } {
set src [lindex $args 0]
set dumpbase_suf [lindex $args 1]
+ # The dump basename may vary depending on the output name, on
+ # whether there are multiple sources. We use -dumpbase "" in
+ # gcc-defs to base compilation dumps only on the source basename.
set dumpbase $src
if { [string length $dumpbase_suf] != 0 } {
regsub {[.][^.]*$} $src $dumpbase_suf dumpbase
@@ -39,6 +42,34 @@ proc dump-base { args } {
return $dumpbase
}
+# Expand dump file name pattern to exactly one file.
+# Return a single dump file name or an empty string
+# if the pattern matches no file or more than one file.
+#
+# Argument 0 is the testcase name
+# Argument 1 is the dump file glob pattern
+proc glob-dump-file { args } {
+
+ set pattern [lindex $args 1]
+ set dump_file "[glob -nocomplain $pattern]"
+ set num_files [llength $dump_file]
+
+ if { $num_files != 1 } {
+ set testcase [lindex $args 0]
+ if { $num_files == 0 } {
+ verbose -log "$testcase: dump file does not exist"
+ }
+
+ if { $num_files > 1 } {
+ verbose -log "$testcase: multiple dump files found"
+ }
+
+ return
+ }
+
+ return $dump_file
+}
+
# Utility for scanning compiler result, invoked via dg-final.
# Call pass if pattern is present, otherwise fail.
#
@@ -67,10 +98,10 @@ proc scan-dump { args } {
set testname "$testcase scan-[lindex $args 0]-dump $suf \"$printable_pattern\""
set src [file tail $filename]
set dumpbase [dump-base $src [lindex $args 3]]
- set output_file "[glob -nocomplain $dumpbase.[lindex $args 2]]"
+
+ set pattern "$dumpbase.[lindex $args 2]"
+ set output_file "[glob-dump-file $testcase $pattern]"
if { $output_file == "" } {
- verbose -log "$testcase: dump file does not exist"
- verbose -log "dump file: $dumpbase.$suf"
unresolved "$testname"
return
}
@@ -113,9 +144,10 @@ proc scan-dump-times { args } {
set testname "$testcase scan-[lindex $args 0]-dump-times $suf \"$printable_pattern\" [lindex $args 2]"
set src [file tail $filename]
set dumpbase [dump-base $src [lindex $args 4]]
- set output_file "[glob -nocomplain $dumpbase.[lindex $args 3]]"
+
+ set pattern "$dumpbase.[lindex $args 3]"
+ set output_file "[glob-dump-file $testcase $pattern]"
if { $output_file == "" } {
- verbose -log "$testcase: dump file does not exist"
unresolved "$testname"
return
}
@@ -159,9 +191,10 @@ proc scan-dump-not { args } {
set testname "$testcase scan-[lindex $args 0]-dump-not $suf \"$printable_pattern\""
set src [file tail $filename]
set dumpbase [dump-base $src [lindex $args 3]]
- set output_file "[glob -nocomplain $dumpbase.[lindex $args 2]]"
+
+ set pattern "$dumpbase.[lindex $args 2]"
+ set output_file "[glob-dump-file $testcase $pattern]"
if { $output_file == "" } {
- verbose -log "$testcase: dump file does not exist"
unresolved "$testname"
return
}
@@ -216,9 +249,10 @@ proc scan-dump-dem { args } {
set testname "$testcase scan-[lindex $args 0]-dump-dem $suf \"$printable_pattern\""
set src [file tail $filename]
set dumpbase [dump-base $src [lindex $args 3]]
- set output_file "[glob -nocomplain $dumpbase.[lindex $args 2]]"
+
+ set pattern "$dumpbase.[lindex $args 2]"
+ set output_file "[glob-dump-file $testcase $pattern]"
if { $output_file == "" } {
- verbose -log "$testcase: dump file does not exist"
unresolved "$testname"
return
}
@@ -267,14 +301,15 @@ proc scan-dump-dem-not { args } {
set testcase [testname-for-summary]
# The name might include a list of options; extract the file name.
set filename [lindex $testcase 0]
- set printable_pattern [make_pattern_printable [lindex $args 1]
+ 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 \"$printable_pattern\""
set src [file tail $filename]
set dumpbase [dump-base $src [lindex $args 3]]
- set output_file "[glob -nocomplain $dumpbase.[lindex $args 2]]"
+
+ set pattern "$dumpbase.[lindex $args 2]"
+ set output_file "[glob-dump-file $testcase $pattern]"
if { $output_file == "" } {
- verbose -log "$testcase: dump file does not exist"
unresolved "$testname"
return
}
diff --git a/gcc/testsuite/lib/scanlang.exp b/gcc/testsuite/lib/scanlang.exp
index 2f80f65f569..b85ec681666 100644
--- a/gcc/testsuite/lib/scanlang.exp
+++ b/gcc/testsuite/lib/scanlang.exp
@@ -43,3 +43,54 @@ proc scan-lang-dump { args } {
"\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 1]" ""
}
}
+
+# Call pass if pattern is present given number of times, otherwise fail.
+# Argument 0 is the regexp to match
+# Argument 1 is number of times the regexp must be found
+# Argument 2 is the name of the dumped tree pass
+# Argument 3 handles expected failures and the like
+proc scan-lang-dump-times { args } {
+
+ if { [llength $args] < 3 } {
+ error "scan-lang-dump-times: too few arguments"
+ return
+ }
+ if { [llength $args] > 4 } {
+ error "scan-lang-dump-times: too many arguments"
+ return
+ }
+ if { [llength $args] >= 4 } {
+ scan-dump-times "lang" [lindex $args 0] [lindex $args 1] \
+ "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 2]" "" \
+ [lindex $args 3]
+ } else {
+ scan-dump-times "lang" [lindex $args 0] [lindex $args 1] \
+ "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 2]" ""
+ }
+}
+
+# Utility for scanning compiler result, invoked via dg-final.
+# Call pass if pattern is not present, otherwise fail.
+#
+# Argument 0 is the regexp to match
+# Argument 1 is the name of the dumped lang pass
+# Argument 2 handles expected failures and the like
+proc scan-lang-dump-not { args } {
+
+ if { [llength $args] < 2 } {
+ error "scan-lang-dump-not: too few arguments"
+ return
+ }
+ if { [llength $args] > 3 } {
+ error "scan-lang-dump-not: too many arguments"
+ return
+ }
+ if { [llength $args] >= 3 } {
+ scan-dump-not "lang" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 1]" "" \
+ [lindex $args 2]
+ } else {
+ scan-dump-not "lang" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 1]"
+ }
+}
diff --git a/gcc/testsuite/lib/scanltranstree.exp b/gcc/testsuite/lib/scanltranstree.exp
index cff956b2f9e..6d35bef9091 100644
--- a/gcc/testsuite/lib/scanltranstree.exp
+++ b/gcc/testsuite/lib/scanltranstree.exp
@@ -37,11 +37,11 @@ proc scan-ltrans-tree-dump { args } {
}
if { [llength $args] >= 3 } {
scan-dump "ltrans-tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0" \
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".ltrans0.ltrans" \
[lindex $args 2]
} else {
scan-dump "ltrans-tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0"
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".ltrans0.ltrans"
}
}
@@ -63,10 +63,10 @@ proc scan-ltrans-tree-dump-times { args } {
if { [llength $args] >= 4 } {
scan-dump-times "ltrans-tree" [lindex $args 0] [lindex $args 1] \
"\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 2]" \
- ".exe.ltrans0" [lindex $args 3]
+ ".ltrans0.ltrans" [lindex $args 3]
} else {
scan-dump-times "ltrans-tree" [lindex $args 0] [lindex $args 1] \
- "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 2]" ".exe.ltrans0"
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 2]" ".ltrans0.ltrans"
}
}
@@ -87,11 +87,11 @@ proc scan-ltrans-tree-dump-not { args } {
}
if { [llength $args] >= 3 } {
scan-dump-not "ltrans-tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0" \
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".ltrans0.ltrans" \
[lindex $args 2]
} else {
scan-dump-not "ltrans-tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0"
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".ltrans0.ltrans"
}
}
@@ -113,11 +113,11 @@ proc scan-ltrans-tree-dump-dem { args } {
}
if { [llength $args] >= 3 } {
scan-dump-dem "ltrans-tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0" \
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".ltrans0.ltrans" \
[lindex $args 2]
} else {
scan-dump-dem "ltrans-tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0"
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".ltrans0.ltrans"
}
}
@@ -139,10 +139,10 @@ proc scan-ltrans-tree-dump-dem-not { args } {
if { [llength $args] >= 3 } {
scan-dump-dem-not "ltrans-tree" [lindex $args 0] \
"\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" \
- ".exe.ltrans0" [lindex $args 2]
+ ".ltrans0.ltrans" [lindex $args 2]
} else {
scan-dump-dem-not "ltrans-tree" [lindex $args 0] \
"\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" \
- ".exe.ltrans0"
+ ".ltrans0.ltrans"
}
}
diff --git a/gcc/testsuite/lib/scanoffload.exp b/gcc/testsuite/lib/scanoffload.exp
new file mode 100644
index 00000000000..90717698776
--- /dev/null
+++ b/gcc/testsuite/lib/scanoffload.exp
@@ -0,0 +1,61 @@
+# Copyright (C) 2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Utility for scanning offloading dump output, used by libgomp.exp.
+
+# Format an offload dump suffix given the offload target name in
+# OFFTGT and any suffix, probably empty, in SUFFIX.
+proc scoff-format { offtgt suffix } {
+ return ".x$offtgt.mkoffload$suffix"
+}
+
+# Adjust an offload dump TESTNAME for offload TARGET.
+proc scoff-testname { target testname } {
+ return "$target-$testname"
+}
+
+# Adjust the arglist ARGS, so that argument IDX gets scoff-formatted,
+# and argument 0 (the test name) gets scoff-testnamed.
+proc scoff-adjust { args idx target } {
+ lset args $idx "[scoff-format $target [lindex $args $idx]]"
+ lset args 0 "[scoff-testname $target [lindex $args 0]]"
+ return $args
+}
+
+# Wrapper for scan procs.
+# Argument 0 is the index of the argument to replace when calling
+# argument 1 with the remaining arguments. Use end-1 or end or so.
+proc scoff { args } {
+ set idx [lindex $args 0]
+ set prc [lindex $args 1]
+ set args [lreplace $args 0 1]
+
+ global offload_target
+ if [info exists offload_target] {
+ set target $offload_target
+ if { "$target" != "disable" } {
+ eval $prc [scoff-adjust $args $idx $target]
+ }
+ } else {
+ global offload_targets
+ foreach target [split $offload_targets ","] {
+ # HSA offloading is doing things differently, doesn't use 'mkoffload'.
+ if { "$target" == "hsa" } continue
+
+ eval $prc [scoff-adjust $args $idx $target]
+ }
+ }
+}
diff --git a/gcc/testsuite/lib/scanoffloadrtl.exp b/gcc/testsuite/lib/scanoffloadrtl.exp
index 69e4e7c843c..be457f7b09f 100644
--- a/gcc/testsuite/lib/scanoffloadrtl.exp
+++ b/gcc/testsuite/lib/scanoffloadrtl.exp
@@ -18,6 +18,7 @@
# libgomp.exp.
load_lib scandump.exp
+load_lib scanoffload.exp
# Utility for scanning compiler result, invoked via dg-final.
# Call pass if pattern is present, otherwise fail.
@@ -36,12 +37,12 @@ proc scan-offload-rtl-dump { args } {
return
}
if { [llength $args] >= 3 } {
- scan-dump "offload-rtl" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ".o" \
- [lindex $args 2]
+ scoff end-1 scan-dump "offload-rtl" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" "" \
+ [lindex $args 2]
} else {
- scan-dump "offload-rtl" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ".o"
+ scoff end scan-dump "offload-rtl" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ""
}
}
@@ -61,12 +62,12 @@ proc scan-offload-rtl-dump-times { args } {
return
}
if { [llength $args] >= 4 } {
- scan-dump-times "offload-rtl" [lindex $args 0] [lindex $args 1] \
- "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 2]" ".o" \
+ scoff end-1 scan-dump-times "offload-rtl" [lindex $args 0] \
+ [lindex $args 1] "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 2]" "" \
[lindex $args 3]
} else {
- scan-dump-times "offload-rtl" [lindex $args 0] [lindex $args 1] \
- "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 2]" ".o"
+ scoff end scan-dump-times "offload-rtl" [lindex $args 0] \
+ [lindex $args 1] "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 2]" ""
}
}
@@ -86,12 +87,12 @@ proc scan-offload-rtl-dump-not { args } {
return
}
if { [llength $args] >= 3 } {
- scan-dump-not "offload-rtl" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ".o" \
- [lindex $args 2]
+ scoff end-1 scan-dump-not "offload-rtl" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" "" \
+ [lindex $args 2]
} else {
- scan-dump-not "offload-rtl" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ".o"
+ scoff end scan-dump-not "offload-rtl" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ""
}
}
@@ -112,12 +113,12 @@ proc scan-offload-rtl-dump-dem { args } {
return
}
if { [llength $args] >= 3 } {
- scan-dump-dem "offload-rtl" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ".o" \
- [lindex $args 2]
+ scoff end-1 scan-dump-dem "offload-rtl" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" "" \
+ [lindex $args 2]
} else {
- scan-dump-dem "offload-rtl" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ".o"
+ scoff end scan-dump-dem "offload-rtl" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ""
}
}
@@ -137,11 +138,11 @@ proc scan-offload-rtl-dump-dem-not { args } {
return
}
if { [llength $args] >= 3 } {
- scan-dump-dem-not "offload-rtl" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ".o" \
- [lindex $args 2]
+ scoff end-1 scan-dump-dem-not "offload-rtl" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" "" \
+ [lindex $args 2]
} else {
- scan-dump-dem-not "offload-rtl" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ".o"
+ scoff end scan-dump-dem-not "offload-rtl" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ""
}
}
diff --git a/gcc/testsuite/lib/scanoffloadtree.exp b/gcc/testsuite/lib/scanoffloadtree.exp
index 76a28d036a8..e51085cb47e 100644
--- a/gcc/testsuite/lib/scanoffloadtree.exp
+++ b/gcc/testsuite/lib/scanoffloadtree.exp
@@ -18,6 +18,7 @@
# libgomp.exp.
load_lib scandump.exp
+load_lib scanoffload.exp
# Utility for scanning compiler result, invoked via dg-final.
# Call pass if pattern is present, otherwise fail.
@@ -36,12 +37,12 @@ proc scan-offload-tree-dump { args } {
return
}
if { [llength $args] >= 3 } {
- scan-dump "offload-tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" ".o" \
- [lindex $args 2]
+ scoff end-1 scan-dump "offload-tree" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" "" \
+ [lindex $args 2]
} else {
- scan-dump "offload-tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" ".o"
+ scoff end scan-dump "offload-tree" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" ""
}
}
@@ -61,12 +62,12 @@ proc scan-offload-tree-dump-times { args } {
return
}
if { [llength $args] >= 4 } {
- scan-dump-times "offload-tree" [lindex $args 0] [lindex $args 1] \
- "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 2]" ".o" \
- [lindex $args 3]
+ scoff end-1 scan-dump-times "offload-tree" [lindex $args 0] \
+ [lindex $args 1] "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 2]" "" \
+ [lindex $args 3]
} else {
- scan-dump-times "offload-tree" [lindex $args 0] [lindex $args 1] \
- "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 2]" ".o"
+ scoff end scan-dump-times "offload-tree" [lindex $args 0] \
+ [lindex $args 1] "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 2]" ""
}
}
@@ -86,12 +87,12 @@ proc scan-offload-tree-dump-not { args } {
return
}
if { [llength $args] >= 3 } {
- scan-dump-not "offload-tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" ".o" \
- [lindex $args 2]
+ scoff end-1 scan-dump-not "offload-tree" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" "" \
+ [lindex $args 2]
} else {
- scan-dump-not "offload-tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" ".o"
+ scoff end scan-dump-not "offload-tree" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" ""
}
}
@@ -112,12 +113,12 @@ proc scan-offload-tree-dump-dem { args } {
return
}
if { [llength $args] >= 3 } {
- scan-dump-dem "offload-tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" ".o" \
- [lindex $args 2]
+ scoff end-1 scan-dump-dem "offload-tree" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" "" \
+ [lindex $args 2]
} else {
- scan-dump-dem "offload-tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" ".o"
+ scoff end scan-dump-dem "offload-tree" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" ""
}
}
@@ -137,11 +138,11 @@ proc scan-offload-tree-dump-dem-not { args } {
return
}
if { [llength $args] >= 3 } {
- scan-dump-dem-not "offload-tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" ".o" \
- [lindex $args 2]
+ scoff end-1 scan-dump-dem-not "offload-tree" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" "" \
+ [lindex $args 2]
} else {
- scan-dump-dem-not "offload-tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" ".o"
+ scoff end scan-dump-dem-not "offload-tree" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9]t.[lindex $args 1]" ""
}
}
diff --git a/gcc/testsuite/lib/scanwpaipa.exp b/gcc/testsuite/lib/scanwpaipa.exp
index 2f58823a4f3..c0706ff28d2 100644
--- a/gcc/testsuite/lib/scanwpaipa.exp
+++ b/gcc/testsuite/lib/scanwpaipa.exp
@@ -37,11 +37,11 @@ proc scan-wpa-ipa-dump { args } {
}
if { [llength $args] >= 3 } {
scan-dump "wpa-ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa" \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".wpa" \
[lindex $args 2]
} else {
scan-dump "wpa-ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa"
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".wpa"
}
}
@@ -60,11 +60,11 @@ proc scan-pgo-wpa-ipa-dump { args } {
}
if { [llength $args] >= 3 } {
scan-dump "pgo-wpa-ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".x02.wpa" \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".wpa" \
[lindex $args 2]
} else {
scan-dump "pgo-wpa-ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".x02.wpa"
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".wpa"
}
}
@@ -85,11 +85,11 @@ proc scan-wpa-ipa-dump-times { args } {
}
if { [llength $args] >= 4 } {
scan-dump-times "wpa-ipa" [lindex $args 0] [lindex $args 1] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]" ".exe.wpa" \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]" ".wpa" \
[lindex $args 3]
} else {
scan-dump-times "wpa-ipa" [lindex $args 0] [lindex $args 1] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]" ".exe.wpa"
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]" ".wpa"
}
}
@@ -110,11 +110,11 @@ proc scan-wpa-ipa-dump-not { args } {
}
if { [llength $args] >= 3 } {
scan-dump-not "wpa-ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa" \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".wpa" \
[lindex $args 2]
} else {
scan-dump-not "wpa-ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa"
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".wpa"
}
}
@@ -136,11 +136,11 @@ proc scan-wpa-ipa-dump-dem { args } {
}
if { [llength $args] >= 3 } {
scan-dump-dem "wpa-ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa" \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".wpa" \
[lindex $args 2]
} else {
scan-dump-dem "wpa-ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa"
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".wpa"
}
}
@@ -161,10 +161,10 @@ proc scan-wpa-ipa-dump-dem-not { args } {
}
if { [llength $args] >= 3 } {
scan-dump-dem-not "wpa-ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa" \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".wpa" \
[lindex $args 2]
} else {
scan-dump-dem-not "wpa-ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa"
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".wpa"
}
}
diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp
index 2a21424b890..5bb99f4e8f9 100644
--- a/gcc/testsuite/lib/target-supports-dg.exp
+++ b/gcc/testsuite/lib/target-supports-dg.exp
@@ -495,6 +495,34 @@ proc dg-shouldfail { args } {
}
}
+# Record whether the compiler is expected (at the moment) to ICE.
+# Used for tests that test bugs that have not been fixed yet.
+
+set expect_ice 0
+
+proc dg-ice { args } {
+ # Don't bother if we're already skipping the test.
+ upvar dg-do-what dg-do-what
+ if { [lindex ${dg-do-what} 1] == "N" } {
+ return
+ }
+
+ global expect_ice
+
+ set args [lreplace $args 0 0]
+ if { [llength $args] > 1 } {
+ set selector [list target [lindex $args 1]]
+ if { [dg-process-target-1 $selector] == "S" } {
+ # The target matches, now check the flags.
+ if [check-flags $args] {
+ set expect_ice 1
+ }
+ }
+ } else {
+ set expect_ice 1
+ }
+}
+
# Intercept the call to the DejaGnu version of dg-process-target to
# support use of an effective-target keyword in place of a list of
# target triplets to xfail or skip a test.
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 13761491e63..4e0d45aaae5 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -698,7 +698,6 @@ proc check_profiling_available { test_what } {
|| [istarget avr-*-*]
|| [istarget bfin-*-*]
|| [istarget cris-*-*]
- || [istarget crisv32-*-*]
|| [istarget csky-*-elf]
|| [istarget fido-*-elf]
|| [istarget h8300-*-*]
@@ -998,6 +997,12 @@ proc check_effective_target_fgraphite {} {
} "-O1 -fgraphite"]
}
+# Return 1 if compiled with --enable-offload-targets=
+# This affects host compilation as ENABLE_OFFLOAD then evaluates to true.
+proc check_effective_target_offloading_enabled {} {
+ return [check_configured_with "--enable-offload-targets"]
+}
+
# Return 1 if compilation with -fopenacc is error-free for trivial
# code, 0 otherwise.
@@ -2164,6 +2169,25 @@ proc check_p9vector_hw_available { } {
}]
}
+# Return 1 if the PowerPC target generates PC-relative instructions
+# automatically for targets that support PC-relative instructions.
+proc check_effective_target_powerpc_pcrel { } {
+ return [check_no_messages_and_pattern powerpc_pcrel \
+ {\mpla\M} assembly {
+ static unsigned short s;
+ unsigned short *p_foo (void) { return &s; }
+ } {-O2 -mcpu=power10}]
+}
+
+# Return 1 if the PowerPC target generates prefixed instructions automatically
+# for targets that support prefixed instructions.
+proc check_effective_target_powerpc_prefixed_addr { } {
+ return [check_no_messages_and_pattern powerpc_prefixed_addr \
+ {\mplwz\M} assembly {
+ unsigned int foo (unsigned int *p) { return p[0x12345]; }
+ } {-O2 -mcpu=power10}]
+}
+
# Return 1 if the target supports executing power9 modulo instructions, 0
# otherwise. Cache the result.
@@ -2190,21 +2214,48 @@ proc check_p9modulo_hw_available { } {
}
-# Return 1 if the target supports executing FUTURE instructions, 0 otherwise.
+# Return 1 if the target supports executing power10 instructions, 0 otherwise.
# Cache the result. It is assumed that if a simulator does not support the
-# FUTURE instructions, that it will generate an error and this test will fail.
+# power10 instructions, that it will generate an error and this test will fail.
-proc check_powerpc_future_hw_available { } {
- return [check_cached_effective_target powerpc_future_hw_available {
- check_runtime_nocache powerpc_future_hw_available {
+proc check_power10_hw_available { } {
+ return [check_cached_effective_target power10_hw_available {
+ check_runtime_nocache power10_hw_available {
int main()
{
/* Set e first and use +r to check if pli actually works. */
long e = -1;
asm ("pli %0,%1" : "+r" (e) : "n" (0x12345));
- return (e == 0x12345);
+ if (e == 0x12345)
+ return 0;
+ return 1;
}
- } "-mfuture"
+ } "-mcpu=power10"
+ }]
+}
+
+# Return 1 if the target supports executing MMA instructions, 0 otherwise.
+# Cache the result. It is assumed that if a simulator does not support the
+# MMA instructions, that it will generate an error and this test will fail.
+
+proc check_ppc_mma_hw_available { } {
+ return [check_cached_effective_target ppc_mma_hw_available {
+ check_runtime_nocache ppc_mma_hw_available {
+ #include <altivec.h>
+ typedef double v4sf_t __attribute__ ((vector_size (16)));
+
+ int main()
+ {
+ __vector_quad acc0;
+ v4sf_t result[4];
+ result[0][0] = 1.0;
+ __builtin_mma_xxsetaccz (&acc0);
+ __builtin_mma_disassemble_acc (result, &acc0);
+ if (result[0][0] != 0.0)
+ return 1;
+ return 0;
+ }
+ } "-mcpu=power10"
}]
}
@@ -2646,7 +2697,7 @@ proc check_effective_target_p8 { } {
} ""]
}
-# Return 1 if we're generating code for power9 and future platforms.
+# Return 1 if we're generating code for power9 or later platforms.
proc check_effective_target_p9+ { } {
return [check_no_compiler_messages_nocache p9+ assembly {
@@ -2768,6 +2819,16 @@ proc check_effective_target_large_return_values { } {
}
return 1
}
+# Return 1 if we support 20-bit or larger array and structure sizes
+# using default options, 0 otherwise.
+# This implies at least a 24-bit address space, as no targets have an address
+# space between 20 and 24 bits.
+
+proc check_effective_target_size24plus { } {
+ return [check_no_compiler_messages size24plus object {
+ char dummy[524289L];
+ }]
+}
# Return 1 if we support 24-bit or larger array and structure sizes
# using default options, 0 otherwise.
@@ -2830,6 +2891,24 @@ proc check_effective_target_int_eq_float { } {
}]
}
+# Return 1 if short size is equal to int size,
+# 0 otherwise.
+
+proc check_effective_target_short_eq_int { } {
+ return [check_no_compiler_messages short_eq_int object {
+ int dummy[sizeof (short) == sizeof (int) ? 1 : -1];
+ }]
+}
+
+# Return 1 if pointer size is equal to short size,
+# 0 otherwise.
+
+proc check_effective_target_ptr_eq_short { } {
+ return [check_no_compiler_messages ptr_eq_short object {
+ int dummy[sizeof (void *) == sizeof (short) ? 1 : -1];
+ }]
+}
+
# Return 1 if pointer size is equal to long size,
# 0 otherwise.
@@ -4619,6 +4698,24 @@ proc check_effective_target_arm_cmse_ok {} {
} "-mcmse"];
}
+# Return 1 if the target supports executing MVE instructions, 0
+# otherwise.
+
+proc check_effective_target_arm_mve_hw {} {
+ return [check_runtime arm_mve_hw_available {
+ int
+ main (void)
+ {
+ long long a = 16;
+ int b = 3;
+ asm ("sqrshrl %Q1, %R1, #64, %2"
+ : "=l" (a)
+ : "0" (a), "r" (b));
+ return (a != 2);
+ }
+ } ""]
+}
+
# Return 1 if this is an ARM target where ARMv8-M Security Extensions with
# clearing instructions (clrm, vscclrm, vstr/vldr with FPCXT) is available.
@@ -4751,6 +4848,27 @@ proc check_effective_target_aarch64_bti_hw { } {
} "-O2" ]
}
+# Return 1 if the target supports executing the armv8.3-a FJCVTZS
+# instruction.
+proc check_effective_target_aarch64_fjcvtzs_hw { } {
+ if { ![istarget aarch64*-*-*] } {
+ return 0
+ }
+ return [check_runtime aarch64_fjcvtzs_hw_available {
+ int
+ main (void)
+ {
+ double in = 25.1;
+ int out;
+ asm volatile ("fjcvtzs %w0, %d1"
+ : "=r" (out)
+ : "w" (in)
+ : /* No clobbers. */);
+ return out != 25;
+ }
+ } "-march=armv8.3-a" ]
+}
+
# Return 1 if GCC was configured with --enable-standard-branch-protection
proc check_effective_target_default_branch_protection { } {
return [check_configured_with "enable-standard-branch-protection"]
@@ -5804,19 +5922,19 @@ proc check_effective_target_has_arch_pwr9 { } {
}]
}
-# Return 1 if this is a PowerPC target supporting -mfuture.
-# Limit this to 64-bit linux systems for now until other
-# targets support FUTURE.
+# Return 1 if this is a PowerPC target supporting -mcpu=power10.
+# Limit this to 64-bit linux systems for now until other targets support
+# power10.
-proc check_effective_target_powerpc_future_ok { } {
+proc check_effective_target_power10_ok { } {
if { ([istarget powerpc64*-*-linux*]) } {
- return [check_no_compiler_messages powerpc_future_ok object {
+ return [check_no_compiler_messages power10_ok object {
int main (void) {
long e;
asm ("pli %0,%1" : "=r" (e) : "n" (0x12345));
return e;
}
- } "-mfuture"]
+ } "-mcpu=power10"]
} else {
return 0
}
@@ -7583,7 +7701,7 @@ proc check_effective_target_sync_int_long { } {
|| [istarget hppa*-*linux*]
|| [istarget s390*-*-*]
|| [istarget powerpc*-*-*]
- || [istarget crisv32-*-*] || [istarget cris-*-*]
+ || [istarget cris-*-*]
|| ([istarget sparc*-*-*] && [check_effective_target_sparc_v9])
|| ([istarget arc*-*-*] && [check_effective_target_arc_atomic])
|| [check_effective_target_mips_llsc] }}]
@@ -7606,7 +7724,7 @@ proc check_effective_target_sync_char_short { } {
|| [istarget hppa*-*linux*]
|| [istarget s390*-*-*]
|| [istarget powerpc*-*-*]
- || [istarget crisv32-*-*] || [istarget cris-*-*]
+ || [istarget cris-*-*]
|| ([istarget sparc*-*-*] && [check_effective_target_sparc_v9])
|| ([istarget arc*-*-*] && [check_effective_target_arc_atomic])
|| [check_effective_target_mips_llsc] }}]
@@ -7754,10 +7872,12 @@ proc is-effective-target { arg } {
"p8vector_hw" { set selected [check_p8vector_hw_available] }
"p9vector_hw" { set selected [check_p9vector_hw_available] }
"p9modulo_hw" { set selected [check_p9modulo_hw_available] }
+ "power10_hw" { set selected [check_power10_hw_available] }
"ppc_float128_sw" { set selected [check_ppc_float128_sw_available] }
"ppc_float128_hw" { set selected [check_ppc_float128_hw_available] }
"ppc_recip_hw" { set selected [check_ppc_recip_hw_available] }
"ppc_cpu_supports_hw" { set selected [check_ppc_cpu_supports_hw_available] }
+ "ppc_mma_hw" { set selected [check_ppc_mma_hw_available] }
"dfp_hw" { set selected [check_dfp_hw_available] }
"htm_hw" { set selected [check_htm_hw_available] }
"named_sections" { set selected [check_named_sections_available] }
@@ -7784,9 +7904,11 @@ proc is-effective-target-keyword { arg } {
"p8vector_hw" { return 1 }
"p9vector_hw" { return 1 }
"p9modulo_hw" { return 1 }
+ "power10_hw" { return 1 }
"ppc_float128_sw" { return 1 }
"ppc_float128_hw" { return 1 }
"ppc_recip_hw" { return 1 }
+ "ppc_mma_hw" { return 1 }
"dfp_hw" { return 1 }
"htm_hw" { return 1 }
"named_sections" { return 1 }
@@ -9018,7 +9140,7 @@ proc check_effective_target_c++ { } {
return 0
}
-set cxx_default "c++14"
+set cxx_default "c++17"
# Check whether the current active language standard supports the features
# of C++11/C++14 by checking for the presence of one of the -std flags.
# This assumes that the default for the compiler is $cxx_default, and that
@@ -9134,6 +9256,14 @@ proc check_effective_target_c++2a { } {
return [check_effective_target_c++2a_only]
}
+proc check_effective_target_c++20_only { } {
+ return [check_effective_target_c++2a_only]
+}
+
+proc check_effective_target_c++20 { } {
+ return [check_effective_target_c++2a]
+}
+
# Check for C++ Concepts support, i.e. -fconcepts flag.
proc check_effective_target_concepts { } {
if [check_effective_target_c++2a] {
@@ -9350,7 +9480,7 @@ proc check_effective_target_aarch64_tiny { } {
# various architecture extensions via the .arch_extension pseudo-op.
foreach { aarch64_ext } { "fp" "simd" "crypto" "crc" "lse" "dotprod" "sve"
- "i8mm" "f32mm" "f64mm" "bf16" } {
+ "i8mm" "f32mm" "f64mm" "bf16" "sb" } {
eval [string map [list FUNC $aarch64_ext] {
proc check_effective_target_aarch64_asm_FUNC_ok { } {
if { [istarget aarch64*-*-*] } {
@@ -9482,6 +9612,7 @@ proc check_effective_target_exceptions_enabled {} {
return [check_cached_effective_target exceptions_enabled {
if { [check_effective_target_exceptions] } {
return [check_no_compiler_messages exceptions_enabled assembly {
+ // C++
void foo (void)
{
throw 1;
@@ -9740,15 +9871,15 @@ proc check_effective_target_vect_max_reduc { } {
return 0
}
-# Return 1 if the compiler has been configured with hsa offloading.
+# Return 1 if the compiler has been configured with nvptx offloading.
-proc check_effective_target_offload_hsa { } {
- return [check_no_compiler_messages offload_hsa assembly {
+proc check_effective_target_offload_nvptx { } {
+ return [check_no_compiler_messages offload_nvptx assembly {
int main () {return 0;}
- } "-foffload=hsa" ]
+ } "-foffload=nvptx-none" ]
}
-# Return 1 if the compiler has been configured with hsa offloading.
+# Return 1 if the compiler has been configured with gcn offloading.
proc check_effective_target_offload_gcn { } {
return [check_no_compiler_messages offload_gcn assembly {
@@ -10161,6 +10292,40 @@ proc check_effective_target_arm_v8_3a_bkey_directive { } {
}]
}
+# Return 1 if the target supports executing the Armv8.1-M Mainline Low
+# Overhead Loop, 0 otherwise. The test is valid for ARM.
+
+proc check_effective_target_arm_v8_1_lob_ok { } {
+ if { ![istarget arm*-*-*] } {
+ return 0;
+ } else {
+ return [check_runtime arm_v8_1_lob_hw_available {
+ int
+ main (void)
+ { int i = 0;
+ asm ("movw r3, #10\n\t" /* movs? */
+ "dls lr, r3" : : : "r3", "lr");
+ loop:
+ i++;
+ asm goto ("le lr, %l0" : : : "lr" : loop);
+ return i != 10;
+ }
+ } "-march=armv8.1-m.main" ]
+ }
+}
+
+# Return 1 is this is an ARM target where -mthumb causes Thumb-2 to be
+# used and the target does not support executing the Armv8.1-M
+# Mainline Low Overhead Loop, 0 otherwise. The test is valid for ARM.
+
+proc check_effective_target_arm_thumb2_ok_no_arm_v8_1_lob { } {
+ if { [check_effective_target_arm_thumb2_ok]
+ && ![check_effective_target_arm_v8_1_lob_ok] } {
+ return 1
+ }
+ return 0
+}
+
# Returns 1 if the target is using glibc, 0 otherwise.
proc check_effective_target_glibc { } {
@@ -10226,3 +10391,47 @@ proc check_effective_target_indirect_calls { } {
}
return 1
}
+
+# Return 1 if we can use the -lgccjit option, 0 otherwise.
+
+proc check_effective_target_lgccjit { } {
+ if { [info procs jit_target_compile] == "" } then {
+ global GCC_UNDER_TEST
+ if ![info exists GCC_UNDER_TEST] {
+ set GCC_UNDER_TEST "[find_gcc]"
+ }
+ proc jit_target_compile { source dest type options } [info body gcc_target_compile]
+ }
+ return [check_no_compiler_messages lgccjit executable {
+ int main() { return 0; }
+ } "-lgccjit"]
+}
+
+# Return 1 if the MSP430 small memory model is in use.
+proc check_effective_target_msp430_small {} {
+ return [check_no_compiler_messages msp430_small assembly {
+ #if (!defined __MSP430__ || defined __MSP430X_LARGE__)
+ #error !msp430 || __MSP430X_LARGE__
+ #endif
+ } ""]
+}
+
+# Return 1 if the MSP430 large memory model is in use.
+proc check_effective_target_msp430_large {} {
+ return [check_no_compiler_messages msp430_large assembly {
+ #ifndef __MSP430X_LARGE__
+ #error __MSP430X_LARGE__
+ #endif
+ } ""]
+}
+
+# Return 1 if the target has an efficient means to encode large initializers
+# in the assembly.
+
+proc check_effective_target_large_initializer { } {
+ if { [istarget nvptx*-*-*] } {
+ return 0
+ }
+
+ return 1
+}
diff --git a/gcc/testsuite/lib/ubsan-dg.exp b/gcc/testsuite/lib/ubsan-dg.exp
index 015601cd404..f4ab29e2add 100644
--- a/gcc/testsuite/lib/ubsan-dg.exp
+++ b/gcc/testsuite/lib/ubsan-dg.exp
@@ -17,6 +17,9 @@
# Return 1 if compilation with -fsanitize=undefined is error-free for trivial
# code, 0 otherwise.
+set orig_ubsan_options_saved 0
+set orig_ubsan_options 0
+
proc check_effective_target_fsanitize_undefined {} {
return [check_runtime fsanitize_undefined {
int main (void) { return 0; }
@@ -74,6 +77,17 @@ proc ubsan_init { args } {
global TOOL_OPTIONS
global ubsan_saved_TEST_ALWAYS_FLAGS
global ubsan_saved_ALWAYS_CXXFLAGS
+ global orig_ubsan_options_saved
+ global orig_ubsan_options
+
+ if { $orig_ubsan_options_saved == 0 } {
+ # Save the original environment.
+ if [info exists env(UBSAN_OPTIONS)] {
+ set orig_ubsan_options "$env(UBSAN_OPTIONS)"
+ set orig_ubsan_options_saved 1
+ }
+ }
+ setenv UBSAN_OPTIONS color=never
set link_flags ""
if ![is_remote host] {
@@ -109,6 +123,14 @@ proc ubsan_finish { args } {
global ubsan_saved_ALWAYS_CXXFLAGS
global ubsan_saved_library_path
global ld_library_path
+ global orig_ubsan_options_saved
+ global orig_ubsan_options
+
+ if { $orig_ubsan_options_saved } {
+ setenv UBSAN_OPTIONS "$orig_ubsan_options"
+ } elseif [info exists env(UBSAN_OPTIONS)] {
+ unsetenv UBSAN_OPTIONS
+ }
if [info exists ubsan_saved_ALWAYS_CXXFLAGS ] {
set ALWAYS_CXXFLAGS $ubsan_saved_ALWAYS_CXXFLAGS
diff --git a/gcc/testsuite/obj-c++.dg/attributes/method-nonnull-1.mm b/gcc/testsuite/obj-c++.dg/attributes/method-nonnull-1.mm
index 917416d74a1..83f918c5a3f 100644
--- a/gcc/testsuite/obj-c++.dg/attributes/method-nonnull-1.mm
+++ b/gcc/testsuite/obj-c++.dg/attributes/method-nonnull-1.mm
@@ -39,12 +39,12 @@ typedef __SIZE_TYPE__ my_size_t;
void test (MyArray *object)
{
[object addObject: object];
- [object addObject: nil]; /* { dg-warning "null argument where non-null required" } */
+ [object addObject: nil]; /* { dg-warning "\\\[-Wnonnull" } */
[object insertObject: object atIndex: 4];
- [object insertObject: nil atIndex: 4]; /* { dg-warning "null argument where non-null required" } */
+ [object insertObject: nil atIndex: 4]; /* { dg-warning "\\\[-Wnonnull" } */
[object insertObject: object atIndex: 2 andObject: object atIndex: 3];
- [object insertObject: nil atIndex: 2 andObject: object atIndex: 3]; /* { dg-warning "null argument where non-null required" } */
- [object insertObject: object atIndex: 2 andObject: nil atIndex: 3]; /* { dg-warning "null argument where non-null required" } */
+ [object insertObject: nil atIndex: 2 andObject: object atIndex: 3]; /* { dg-warning "\\\[-Wnonnull" } */
+ [object insertObject: object atIndex: 2 andObject: nil atIndex: 3]; /* { dg-warning "\\\[-Wnonnull" } */
}
diff --git a/gcc/testsuite/obj-c++.dg/property/property-neg-6.mm b/gcc/testsuite/obj-c++.dg/property/property-neg-6.mm
index c4a22eb6d20..1db6f0ba1b8 100644
--- a/gcc/testsuite/obj-c++.dg/property/property-neg-6.mm
+++ b/gcc/testsuite/obj-c++.dg/property/property-neg-6.mm
@@ -6,4 +6,4 @@
int iVar;
}
@property int FooBar /* { dg-error "expected ';' at end of input" } */
- /* { dg-error "expected '@end' at end of input" "" { target *-*-* } .-1 } */
+ /* { dg-error "-:expected '@end' at end of input" "" { target *-*-* } .+1 } */
diff --git a/gcc/testsuite/obj-c++.dg/syntax-error-10.mm b/gcc/testsuite/obj-c++.dg/syntax-error-10.mm
index e45abccfc7d..6fcf96f769e 100644
--- a/gcc/testsuite/obj-c++.dg/syntax-error-10.mm
+++ b/gcc/testsuite/obj-c++.dg/syntax-error-10.mm
@@ -1 +1,2 @@
-@interface /* { dg-error "expected identifier" } */
+@interface
+/* { dg-error "-:expected identifier" "" { target *-*-* } .+1 } */
diff --git a/gcc/testsuite/obj-c++.dg/syntax-error-8.mm b/gcc/testsuite/obj-c++.dg/syntax-error-8.mm
index 731ffda5f5e..f7cfe0e0895 100644
--- a/gcc/testsuite/obj-c++.dg/syntax-error-8.mm
+++ b/gcc/testsuite/obj-c++.dg/syntax-error-8.mm
@@ -1 +1 @@
-@interface A /* { dg-error "expected ..end." } */ \ No newline at end of file
+@interface A /* { dg-error "-:expected ..end." "" { target *-*-* } .+1 } */
diff --git a/gcc/testsuite/obj-c++.dg/syntax-error-9.mm b/gcc/testsuite/obj-c++.dg/syntax-error-9.mm
index 352dd34cf94..ae104e5c140 100644
--- a/gcc/testsuite/obj-c++.dg/syntax-error-9.mm
+++ b/gcc/testsuite/obj-c++.dg/syntax-error-9.mm
@@ -1,3 +1,3 @@
@implementation SaturnDoc /* { dg-warning "cannot find interface declaration" } */
- read: (void*)aStream ggg /* { dg-error "expected .:. at end of input" } */
-/* { dg-error "expected ..end. at end of input" "" { target *-*-* } .-1 } */ \ No newline at end of file
+/* { dg-error "-:expected ..end. at end of input" "" { target *-*-* } .+1 } */
diff --git a/gcc/testsuite/obj-c++.dg/try-catch-9.mm b/gcc/testsuite/obj-c++.dg/try-catch-9.mm
index 73c7c991709..b2dc61b9989 100644
--- a/gcc/testsuite/obj-c++.dg/try-catch-9.mm
+++ b/gcc/testsuite/obj-c++.dg/try-catch-9.mm
@@ -6,7 +6,7 @@
/* { dg-xfail-run-if "PR23616" { *-*-* } { "-fgnu-runtime" } { "-fnext-runtime" } } */
/* { dg-xfail-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" "-fgnu-runtime" } { "" } }
/* { dg-prune-output ".*internal compiler error.*" } */
-/* { dg-options "-fobjc-exceptions -O2" } */
+/* { dg-options "-fobjc-exceptions -O2 -Wno-register" } */
#include "../objc-obj-c++-shared/TestsuiteObject.m"
#include <stdlib.h>
diff --git a/gcc/testsuite/objc.dg/attributes/method-nonnull-1.m b/gcc/testsuite/objc.dg/attributes/method-nonnull-1.m
index e1974aa3cae..fe5f885b2d4 100644
--- a/gcc/testsuite/objc.dg/attributes/method-nonnull-1.m
+++ b/gcc/testsuite/objc.dg/attributes/method-nonnull-1.m
@@ -35,12 +35,12 @@
void test (MyArray *object)
{
[object addObject: object];
- [object addObject: nil]; /* { dg-warning "null argument where non-null required" } */
+ [object addObject: nil]; /* { dg-warning "\\\[-Wnonnull" } */
[object insertObject: object atIndex: 4];
- [object insertObject: nil atIndex: 4]; /* { dg-warning "null argument where non-null required" } */
+ [object insertObject: nil atIndex: 4]; /* { dg-warning "\\\[-Wnonnull" } */
[object insertObject: object atIndex: 2 andObject: object atIndex: 3];
- [object insertObject: nil atIndex: 2 andObject: object atIndex: 3]; /* { dg-warning "null argument where non-null required" } */
- [object insertObject: object atIndex: 2 andObject: nil atIndex: 3]; /* { dg-warning "null argument where non-null required" } */
+ [object insertObject: nil atIndex: 2 andObject: object atIndex: 3]; /* { dg-warning "\\\[-Wnonnull" } */
+ [object insertObject: object atIndex: 2 andObject: nil atIndex: 3]; /* { dg-warning "\\\[-Wnonnull" } */
}
diff --git a/gcc/testsuite/objc/execute/exceptions/matcher-1.m b/gcc/testsuite/objc/execute/exceptions/matcher-1.m
index cbe4365da90..25d6759cc9c 100644
--- a/gcc/testsuite/objc/execute/exceptions/matcher-1.m
+++ b/gcc/testsuite/objc/execute/exceptions/matcher-1.m
@@ -20,7 +20,7 @@ int main(void)
static unsigned int handlerExpected = 0;
-void
+int
my_exception_matcher(Class match_class, id exception)
{
/* Always matches. */