diff --git a/src/cgen.c b/src/cgen.c index 8306bb127..3f7600778 100644 --- a/src/cgen.c +++ b/src/cgen.c @@ -181,8 +181,8 @@ static LLVMValueRef llvm_void_cast(LLVMValueRef ptr) static LLVMValueRef llvm_sizeof(LLVMTypeRef type) { - return LLVMBuildIntCast(builder, LLVMSizeOf(type), - LLVMInt32Type(), ""); + LLVMTargetDataRef td = LLVMGetModuleDataLayout(module); + return llvm_int32(LLVMABISizeOfType(td, type)); } static LLVMValueRef llvm_fn(const char *name) diff --git a/test/regress/testlist.txt b/test/regress/testlist.txt index db19e53a2..50bb658e8 100644 --- a/test/regress/testlist.txt +++ b/test/regress/testlist.txt @@ -383,4 +383,4 @@ issue423 normal driver6 normal driver7 fail,gold issue428 normal -protected5 normal,2000 +protected5 normal,2000,!windows diff --git a/test/run_regr.c b/test/run_regr.c index 1cf62bc75..f0ae5a02a 100644 --- a/test/run_regr.c +++ b/test/run_regr.c @@ -56,7 +56,7 @@ #define F_VHPI (1 << 3) #define F_2008 (1 << 4) #define F_2000 (1 << 5) -// Unused (1 << 6) +#define F_NOTWIN (1 << 6) #define F_COVER (1 << 7) #define F_GENERIC (1 << 8) #define F_RELAX (1 << 9) @@ -307,6 +307,8 @@ static bool parse_test_list(int argc, char **argv) test->flags |= F_2000; else if (strcmp(opt, "vhpi") == 0) test->flags |= F_VHPI; + else if (strcmp(opt, "!windows") == 0) + test->flags |= F_NOTWIN; else if (strncmp(opt, "O", 1) == 0) { if (sscanf(opt + 1, "%u", &(test->olevel)) != 1) { fprintf(stderr, "Error on testlist line %d: invalid " @@ -523,15 +525,21 @@ static bool run_test(test_t *test) printf("%15s : ", test->name); + int skip = 0; #ifndef ENABLE_VHPI - if (test->flags & F_VHPI) { + skip |= (test->flags & F_VHPI); +#endif +#if defined __MINGW32__ || defined __CYGWIN__ + skip |= (test->flags & F_NOTWIN); +#endif + + if (skip) { set_attr(ANSI_FG_CYAN); printf("skipped\n"); set_attr(ANSI_RESET); result = true; goto out_chdir; } -#endif if ((test->flags & F_CLEAN) && dir_exists("work")) { if (system("rm -r work") != 0) {