* merge the tests about implcit & explicit casts in a single file as there was a lot of redundancy. * shuffle the tests to linear/ or optim/ Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- validation/bool-cast-explicit.c | 22 ------------- validation/bool-cast-implicit.c | 25 --------------- validation/linear/bool-cast.c | 32 +++++++++++++++++++ .../{ => linear}/cast-constant-to-float.c | 0 validation/{ => linear}/cast-constants.c | 0 validation/{ => linear}/cast-kinds.c | 0 validation/{ => linear}/fp-vs-ptrcast.c | 0 validation/{ => linear}/fp2i-cast.c | 0 validation/{ => optim}/kill-casts.c | 0 9 files changed, 32 insertions(+), 47 deletions(-) delete mode 100644 validation/bool-cast-explicit.c delete mode 100644 validation/bool-cast-implicit.c create mode 100644 validation/linear/bool-cast.c rename validation/{ => linear}/cast-constant-to-float.c (100%) rename validation/{ => linear}/cast-constants.c (100%) rename validation/{ => linear}/cast-kinds.c (100%) rename validation/{ => linear}/fp-vs-ptrcast.c (100%) rename validation/{ => linear}/fp2i-cast.c (100%) rename validation/{ => optim}/kill-casts.c (100%) diff --git a/validation/bool-cast-explicit.c b/validation/bool-cast-explicit.c deleted file mode 100644 index dbb67cc42..000000000 --- a/validation/bool-cast-explicit.c +++ /dev/null @@ -1,22 +0,0 @@ -typedef unsigned int u32; -typedef int s32; -typedef void *vdp; -typedef int *sip; -typedef double dbl; -typedef unsigned short __attribute__((bitwise)) le16; - -static _Bool fs32(s32 a) { return (_Bool)a; } -static _Bool fu32(u32 a) { return (_Bool)a; } -static _Bool fvdp(vdp a) { return (_Bool)a; } -static _Bool fsip(sip a) { return (_Bool)a; } -static _Bool fdbl(dbl a) { return (_Bool)a; } -static _Bool ffun(void) { return (_Bool)ffun; } - -static _Bool fres(le16 a) { return (_Bool)a; } - -/* - * check-name: bool-cast-explicit - * check-command: test-linearize -m64 $file - * check-output-ignore - * check-output-excludes: cast\\. - */ diff --git a/validation/bool-cast-implicit.c b/validation/bool-cast-implicit.c deleted file mode 100644 index 9d89443b1..000000000 --- a/validation/bool-cast-implicit.c +++ /dev/null @@ -1,25 +0,0 @@ -typedef unsigned int u32; -typedef int s32; -typedef void *vdp; -typedef int *sip; -typedef double dbl; -typedef unsigned short __attribute__((bitwise)) le16; - -static _Bool fs32(s32 a) { return a; } -static _Bool fu32(u32 a) { return a; } -static _Bool fvdp(vdp a) { return a; } -static _Bool fsip(sip a) { return a; } -static _Bool fdbl(dbl a) { return a; } -static _Bool ffun(void) { return ffun; } - -static _Bool fres(le16 a) { return a; } - -/* - * check-name: bool-cast-implicit - * check-command: test-linearize -m64 $file - * check-output-ignore - * check-output-excludes: cast\\. - * - * check-error-start - * check-error-end - */ diff --git a/validation/linear/bool-cast.c b/validation/linear/bool-cast.c new file mode 100644 index 000000000..50d7a14ad --- /dev/null +++ b/validation/linear/bool-cast.c @@ -0,0 +1,32 @@ +extern int fun(void); +typedef unsigned int u32; +typedef int s32; +typedef void *vdp; +typedef int *sip; +typedef double dbl; +typedef unsigned short __attribute__((bitwise)) le16; + +static _Bool fs32_i(s32 a) { return a; } +static _Bool fs32_e(s32 a) { return (_Bool)a; } +static _Bool fu32_i(u32 a) { return a; } +static _Bool fu32_e(u32 a) { return (_Bool)a; } +static _Bool fvdp_i(vdp a) { return a; } +static _Bool fvdp_e(vdp a) { return (_Bool)a; } +static _Bool fsip_i(sip a) { return a; } +static _Bool fsip_e(sip a) { return (_Bool)a; } +static _Bool ffun_i(void) { return fun; } +static _Bool ffun_e(void) { return (_Bool)fun; } +static _Bool fres_i(le16 a) { return a; } +static _Bool fres_e(le16 a) { return (_Bool)a; } +static _Bool fdbl_i(dbl a) { return a; } +static _Bool fdbl_e(dbl a) { return (_Bool)a; } + +/* + * check-name: bool-cast-explicit + * check-command: test-linearize -fdump-ir=linearize $file + * + * check-output-ignore + * check-output-excludes: cast\\. + * check-output-pattern(12): setne\\. + * check-output-pattern(2): fcmpune\\. + */ diff --git a/validation/cast-constant-to-float.c b/validation/linear/cast-constant-to-float.c similarity index 100% rename from validation/cast-constant-to-float.c rename to validation/linear/cast-constant-to-float.c diff --git a/validation/cast-constants.c b/validation/linear/cast-constants.c similarity index 100% rename from validation/cast-constants.c rename to validation/linear/cast-constants.c diff --git a/validation/cast-kinds.c b/validation/linear/cast-kinds.c similarity index 100% rename from validation/cast-kinds.c rename to validation/linear/cast-kinds.c diff --git a/validation/fp-vs-ptrcast.c b/validation/linear/fp-vs-ptrcast.c similarity index 100% rename from validation/fp-vs-ptrcast.c rename to validation/linear/fp-vs-ptrcast.c diff --git a/validation/fp2i-cast.c b/validation/linear/fp2i-cast.c similarity index 100% rename from validation/fp2i-cast.c rename to validation/linear/fp2i-cast.c diff --git a/validation/kill-casts.c b/validation/optim/kill-casts.c similarity index 100% rename from validation/kill-casts.c rename to validation/optim/kill-casts.c -- 2.17.1 -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html