Skip to content

Commit

Permalink
Merge pull request #2178 from sunfishcode/incoming
Browse files Browse the repository at this point in the history
Testsuite cleanups
  • Loading branch information
kripken committed Mar 3, 2014
2 parents ace4517 + c47c5c3 commit aca0e4d
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion tests/cases/aliasbitcast2_noasm.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ target triple = "i386-pc-linux-gnu"
; [#uses=2]
define void @original() {
entry:
%0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
%0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0]
br label %return

return: ; preds = %entry
Expand Down
4 changes: 2 additions & 2 deletions tests/cases/aliasbitcast3_noasm.ll
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ target triple = "i386-pc-linux-gnu"
; [#uses=2]
define void @original() {
entry:
%0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
%0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0]
br label %return

return: ; preds = %entry
Expand All @@ -24,6 +24,6 @@ declare i32 @puts(i8*)
; [#uses=0]
define i32 @main() {
entry:
call void @thriceremoved()
call void @thriceremoved(i32 0)
ret i32 0
}
2 changes: 1 addition & 1 deletion tests/cases/aliasbitcastdollar_noasm.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ target triple = "i386-pc-linux-gnu"
; [#uses=2]
define void @original() {
entry:
%0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
%0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0]
br label %return

return: ; preds = %entry
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/emptystruct.ll
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ entry:
%z = alloca %struct.s, align 4
%0 = bitcast %struct.s* %z to i8*
call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 4, i32 4, i1 false)
%1 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
%1 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0]
ret i32 0
}

Expand Down
4 changes: 2 additions & 2 deletions tests/cases/extendedprecision.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ target triple = "i386-pc-linux-gnu"
; [#uses=2]
define void @"\01_Z5hellov"(x86_fp80 %waka) {
entry:
%0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
%0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0]
br label %return

return: ; preds = %entry
Expand All @@ -23,7 +23,7 @@ entry:
%retval = alloca i32 ; [#uses=2]
%0 = alloca i32 ; [#uses=2]
%"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
call void @"\01_Z5hellov"(x86_fp80 0x00000000000000000000)
call void @"\01_Z5hellov"(x86_fp80 0xK00000000000000000000)
store i32 0, i32* %0, align 4
%1 = load i32* %0, align 4 ; [#uses=1]
store i32 %1, i32* %retval, align 4
Expand Down
9 changes: 7 additions & 2 deletions tests/cases/invokebitcast.ll
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1]

; [#uses=0]
define i32 @main() {
define i32 @main(i32 %p) {
entry:
%retval = alloca i32 ; [#uses=2]
%0 = alloca i32 ; [#uses=2]
Expand All @@ -24,13 +24,15 @@ entry:
store i32 %3, i32* %retval, align 4
br label %return

invoke void bitcast (void (i32*, i32)* @_Z8toStringj to void (i64*, i32)*)(%struct.CPU_Regs* noalias @cpu_regs, i32 %99)
invoke void bitcast (void (i32*, i32)* @_Z8toStringj to void (i64*, i32)*)(i64* bitcast (%struct.CPU_Regs* @cpu_regs to i64*), i32 %p)
to label %invcont33 unwind label %lpad106

invcont33:
ret i32 %retval1

lpad106:
%Z = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
cleanup
ret i32 %retval1

return: ; preds = %entry
Expand All @@ -40,3 +42,6 @@ return: ; preds = %entry

; [#uses=1]
declare i32 @puts(i8*)

declare void @_Z8toStringj(i32*, i32)
declare i32 @__gxx_personality_v0(...)
6 changes: 3 additions & 3 deletions tests/cases/phientryimplicit.ll
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ target triple = "asmjs-unknown-emscripten"
define i32 @main() {
%retval = alloca i32, align 4 ; [#uses=1 type=i32*]
%a16 = trunc i32 1 to i1
br i1 %a16, label %L17, label %L26, !dbg !1269853 ; [debug line = 3920:5]
br i1 %a16, label %L17, label %L26

L17:
%a25 = trunc i32 1 to i1
br label %L26

L26:
%a27 = phi i1 [ false, %1 ], [ %a25, %L17 ] ; [#uses=1 type=i1]
%a27 = phi i1 [ false, %0 ], [ %a25, %L17 ] ; [#uses=1 type=i1]
store i32 0, i32* %retval
%call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) ; [#uses=0 type=i32]
%cal2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), i1 %a27) ; make sure %27 is used
Expand All @@ -27,7 +27,7 @@ L26:
define i32 @main0() {
%retval = alloca i32, align 4 ; [#uses=1 type=i32*]
%a16 = trunc i32 1 to i1
br i1 %a16, label %L17, label %L26, !dbg !1269853 ; [debug line = 3920:5]
br i1 %a16, label %L17, label %L26

L17:
%a25 = trunc i32 1 to i1
Expand Down
11 changes: 6 additions & 5 deletions tests/cases/phinonexist.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ target triple = "i386-pc-linux-gnu"
@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]

define i32 @main() {
entry:
%retval = alloca i32, align 4
%a12 = zext i1 1 to i32
br label %13
br label %label13

; <label>:13 ; preds = %13, %1
%a14 = phi i32 [ %a12, %1 ], [ %a15, %135 ]
label13: ; preds = %13, %1
%a14 = phi i32 [ %a12, %entry ], [ %a15, %135 ]
%call0 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0))
%a15 = add nsw i32 %a14, 2
%a16 = icmp eq i32 %a15, 9
br label %17
br label %label17

; <label>:17 ; preds = %1
label17: ; preds = %1
ret i32 1
}

Expand Down
2 changes: 1 addition & 1 deletion tests/cases/quotedlabel.ll
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ entry:
br label %"finish$$$"

"finish$$$": ; preds = %entry
%0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
%0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0]
ret i32 0
}

6 changes: 3 additions & 3 deletions tests/cases/sillybitcast.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ target triple = "asmjs-unknown-emscripten"
@.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1]

; [#uses=2]
define void @"\01_Z5hellov"() {
define void @"_Z5hellov"() {
entry:
%0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
%0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0]
br label %return

return: ; preds = %entry
Expand All @@ -23,7 +23,7 @@ entry:
%retval = alloca i32 ; [#uses=2]
%0 = alloca i32 ; [#uses=2]
%"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
call void @"\01_Z5hellov"()
call void @"_Z5hellov"()
store i32 0, i32* %0, align 4
%1 = load i32* %0, align 4 ; [#uses=1]
store i32 %1, i32* %retval, align 4
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/structparam.ll
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cond.end: ; preds = %cond.false, %cond.t
%cond = phi { i32, i32 } [ { i32 5, i32 6 }, %entry ], [ zeroinitializer, %cond.null ] ; [#uses=1]
store { i32, i32 } %cond, { i32, i32 }* %comp
%call = call i32 (i32, { i32, i32 })* @doit(i32 1, { i32, i32 } %cond) ;
store { i32, i32 } { i32 ptrtoint (i64* @_dispatchTable to i32), i32 0 }, { i32, i32 }* getelementptr inbounds ([1 x i64]* @_dispatchTable, i32 0, i32 0, i32 1), align 4
store { i32, i32 } { i32 ptrtoint (i64* @_dispatchTable to i32), i32 0 }, { i32, i32 }* bitcast (i64* getelementptr inbounds ([1 x i64]* bitcast (i64* @_dispatchTable to [1 x i64]*), i32 0, i32 0) to { i32, i32 }*), align 4
ret i32 0 ; [debug line = 6:13]
}

Expand Down
4 changes: 2 additions & 2 deletions tests/core/test_sscanf_other_whitespace.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <stdio.h>

int main() {
short int x;
short int y;
int x;
int y;

const char* buffer[] = {
"\t2\t3\t", /* TAB - horizontal tab */
Expand Down
4 changes: 2 additions & 2 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5199,11 +5199,11 @@ def test_cases(self):
shortname = name.replace('.ll', '')
if '' not in shortname: continue
if os.environ.get('EMCC_FAST_COMPILER') != '0' and os.path.basename(shortname) in [
'structparam', 'extendedprecision', 'issue_39', 'emptystruct', 'phinonexist', 'quotedlabel', 'oob_ta2', 'phientryimplicit', 'phiself', 'invokebitcast', 'funcptr', # invalid ir
'structparam', 'extendedprecision', 'issue_39', 'phinonexist', 'oob_ta2', 'phiself', 'invokebitcast', # invalid ir
'structphiparam', 'callwithstructural_ta2', 'callwithstructural64_ta2', 'structinparam', # pnacl limitations in ExpandStructRegs
'2xi40', # pnacl limitations in ExpandGetElementPtr
'quoted', # current fastcomp limitations FIXME
'sillyfuncast2', 'sillybitcast', 'atomicrmw_unaligned' # TODO XXX
'atomicrmw_unaligned' # TODO XXX
]: continue
if '_ta2' in shortname and not Settings.USE_TYPED_ARRAYS == 2:
print self.skip('case "%s" only relevant for ta2' % shortname)
Expand Down

0 comments on commit aca0e4d

Please sign in to comment.