diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-09 23:04:33 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-09 23:04:33 +0000 |
commit | 5053259bda45e0a837513aa5a1624cb0cfe1e4d9 (patch) | |
tree | 0848a312643aa3db319dcfacfd3dd9e8b0f76e97 /gcc/testsuite/gcc.dg | |
parent | 6529e2f7ce058c55edd27f0c49ab6429ffc99300 (diff) | |
download | gcc-5053259bda45e0a837513aa5a1624cb0cfe1e4d9.tar.gz |
* builtin-types.def (BT_UINT): Rename from BT_UNSIGNED.
(BT_FN_UINT): Rename from BT_FN_UNSIGNED.
(BT_FN_PTR_UINT): Rename from BT_FN_PTR_UNSIGNED.
(BT_ULONG, BT_ULONGLONG, BT_UINTMAX, BT_FN_INT_UINT, BT_FN_INT_ULONG,
BT_FN_INT_ULONGLONG, BT_FN_INT_INTMAX, BT_FN_INT_UINTMAX): New.
* builtins.def (BUILTIN_CLZxxx, BUILTIN_CTXxxx, BUILTIN_PARITYxxx,
BUILTIN_POPCOUNTxxx): Arguments are unsigned.
(BUILTIN_xxxIMAX): New.
* builtins.c (expand_builtin): Handle BUILT_IN_FFSIMAX,
BUILT_IN_CLZIMAX, BUILT_IN_CTZIMAX, BUILT_IN_POPCOUNIMAX, and
BUILT_IN_PARITYIMAX.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84415 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/builtin-protos-1.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/builtin-protos-1.c b/gcc/testsuite/gcc.dg/builtin-protos-1.c new file mode 100644 index 00000000000..c3cdc533fed --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtin-protos-1.c @@ -0,0 +1,68 @@ +/* { dg-do compile } */ +/* { dg-options -Wconversion } */ + +int +test_s (signed int x) +{ + return __builtin_abs (x) /* { dg-bogus "as unsigned due to prototype" } */ + + __builtin_clz (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_ctz (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_ffs (x) /* { dg-bogus "as unsigned due to prototype" } */ + + __builtin_parity (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_popcount (x); /* { dg-warning "as unsigned due to prototype" } */ +} + +int +test_u (unsigned int x) +{ + return __builtin_abs (x) /* { dg-warning "as signed due to prototype" } */ + + __builtin_clz (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_ctz (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_ffs (x) /* { dg-warning "as signed due to prototype" } */ + + __builtin_parity (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_popcount (x); /* { dg-bogus "as signed due to prototype" } */ +} + +int +test_sl (signed long x) +{ + return __builtin_labs (x) /* { dg-bogus "as unsigned due to prototype" } */ + + __builtin_clzl (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_ctzl (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_ffsl (x) /* { dg-bogus "as unsigned due to prototype" } */ + + __builtin_parityl (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_popcountl (x); /* { dg-warning "as unsigned due to prototype" } */ +} + +int +test_ul (unsigned long x) +{ + return __builtin_labs (x) /* { dg-warning "as signed due to prototype" } */ + + __builtin_clzl (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_ctzl (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_ffsl (x) /* { dg-warning "as signed due to prototype" } */ + + __builtin_parityl (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_popcountl (x); /* { dg-bogus "as signed due to prototype" } */ +} + +int +test_sll (signed long long x) +{ + return __builtin_llabs (x) /* { dg-bogus "as unsigned due to prototype" } */ + + __builtin_clzll (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_ctzll (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_ffsll (x) /* { dg-bogus "as unsigned due to prototype" } */ + + __builtin_parityll (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_popcountll (x); /* { dg-warning "as unsigned due to prototype" } */ +} + +int +test_ull (unsigned long long x) +{ + return __builtin_llabs (x) /* { dg-warning "as signed due to prototype" } */ + + __builtin_clzll (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_ctzll (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_ffsll (x) /* { dg-warning "as signed due to prototype" } */ + + __builtin_parityll (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_popcountll (x); /* { dg-bogus "as signed due to prototype" } */ +} |