Skip to content

Commit

Permalink
enable indirectbr tests in fastcomp
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken committed Feb 21, 2014
1 parent 92fb611 commit 9d0d878
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 9 additions & 5 deletions tests/cases/ptrtoint_blockaddr.ll
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
; ModuleID = 'tests/hello_world.bc'
target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
target triple = "le32-unknown-nacl"

@.str = private constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1]

define linkonce_odr i32* @main() align 2 {
%199 = trunc i8 1 to i1 ; [#uses=1]
br i1 %199, label %label555, label %label569
define linkonce_odr i32 @main() align 2 {
%a199 = trunc i8 1 to i1 ; [#uses=1]
br i1 %a199, label %label555, label %label569

label555: ; preds = %353
br label %label569
; No predecessors!
br label %label569

label569: ; preds = %555
%333 = call i32 @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
%a333 = call i32 @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
; this should compile ok
store i32 ptrtoint (i8* blockaddress(@main, %label569) to i32), i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), align 8
store i32 ptrtoint (i8* blockaddress(@main, %label569) to i32), i32* bitcast (i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0) to i32*), align 8
ret i32 0
}

Expand Down
6 changes: 1 addition & 5 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2080,8 +2080,6 @@ def test_bigswitch(self):
''', args=['34962', '26214', '35040'])

def test_indirectbr(self):
if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')

Building.COMPILER_TEST_OPTS = filter(lambda x: x != '-g', Building.COMPILER_TEST_OPTS)

test_path = path_from_root('tests', 'core', 'test_indirectbr')
Expand All @@ -2090,8 +2088,6 @@ def test_indirectbr(self):
self.do_run_from_file(src, output)

def test_indirectbr_many(self):
if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')

if Settings.USE_TYPED_ARRAYS != 2: return self.skip('blockaddr > 255 requires ta2')

test_path = path_from_root('tests', 'core', 'test_indirectbr_many')
Expand Down Expand Up @@ -5133,7 +5129,7 @@ def test_cases(self):
'structparam', 'extendedprecision', 'issue_39', 'emptystruct', 'phinonexist', 'quotedlabel', 'oob_ta2', 'phientryimplicit', 'phiself', 'invokebitcast', 'funcptr', # invalid ir
'structphiparam', 'callwithstructural_ta2', 'callwithstructural64_ta2', 'structinparam', # pnacl limitations in ExpandStructRegs
'2xi40', # pnacl limitations in ExpandGetElementPtr
'indirectbrphi', 'ptrtoint_blockaddr', 'quoted', # current fastcomp limitations FIXME
'quoted', # current fastcomp limitations FIXME
'sillyfuncast2', 'sillybitcast', 'atomicrmw_unaligned' # TODO XXX
]: continue
if '_ta2' in shortname and not Settings.USE_TYPED_ARRAYS == 2:
Expand Down

0 comments on commit 9d0d878

Please sign in to comment.