Last active
May 15, 2018 15:27
-
-
Save ramntry/3290e0bea953675b685801f71418da66 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%dag = type { { { i8, { i8 } }, { { i8, { i8 } }, { i8 } } }, { { i8, { i8 } }, { i8 } } } | |
define void @test_const(%dag* %dst) { | |
entry: | |
%updated = insertvalue | |
; Check that we're visiting constants with shared parts | |
; (deduplicated via LLVMContext, forming a proper DAG) correctly: | |
%dag { | |
{ { i8, { i8 } }, { { i8, { i8 } }, { i8 } } } { | |
{ i8, { i8 } } { | |
i8 10, | |
{ i8 } { i8 20 } | |
}, | |
{ { i8, { i8 } }, { i8 } } { | |
{ i8, { i8 } } { | |
i8 10, | |
{ i8 } { i8 20 } | |
}, | |
{ i8 } { i8 20 } | |
} | |
}, | |
{ { i8, { i8 } }, { i8 } } { | |
{ i8, { i8 } } { | |
i8 10, | |
{ i8 } { i8 20 } | |
}, | |
{ i8 } { i8 20 } | |
} | |
}, | |
{ { i8, { i8 } }, { i8 } } { | |
{ i8, { i8 } } { | |
i8 10, | |
{ i8 } { i8 20 } | |
}, | |
{ i8 } { i8 50 } | |
}, | |
0, | |
1 | |
store %dag %updated, %dag* %dst | |
; 10, 20, 10, 20, 50, 10, 20, 20 sequence is expected | |
store | |
; Check that we didn't overwrite a previously seen constant | |
; while processing an insertvalue into it: | |
%dag { | |
{ { i8, { i8 } }, { { i8, { i8 } }, { i8 } } } { | |
{ i8, { i8 } } { | |
i8 10, | |
{ i8 } { i8 20 } | |
}, | |
{ { i8, { i8 } }, { i8 } } { | |
{ i8, { i8 } } { | |
i8 10, | |
{ i8 } { i8 20 } | |
}, | |
{ i8 } { i8 20 } | |
} | |
}, | |
{ { i8, { i8 } }, { i8 } } { | |
{ i8, { i8 } } { | |
i8 10, | |
{ i8 } { i8 20 } | |
}, | |
{ i8 } { i8 20 } | |
} | |
}, | |
%dag* %dst | |
; 10, 20, 10, 20, 20, 10, 20, 20 sequence is expected | |
ret void | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment