Created
December 4, 2016 13:44
-
-
Save yohhoy/ccade95cdbb345611bce8dcfc20847e7 to your computer and use it in GitHub Desktop.
gcc 7.0(HEAD) -std=c++1z -03
This file contains 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
#include <cstdio> | |
#include <string> | |
int main() { | |
using namespace std::literals::string_view_literals; | |
for (char c: "Hello"sv) { | |
std::printf("(%d)", c); | |
} | |
} |
This file contains 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
.LC0: | |
.string "Hello" | |
.LC1: | |
.string "(%d)" | |
main: | |
pushq %rbp | |
pushq %rbx | |
movl $.LC0+5, %ebp | |
movl $.LC0, %ebx | |
subq $8, %rsp | |
.L2: | |
movsbl (%rbx), %esi | |
xorl %eax, %eax | |
movl $.LC1, %edi | |
addq $1, %rbx | |
call printf | |
cmpq %rbx, %rbp | |
jne .L2 | |
addq $8, %rsp | |
xorl %eax, %eax | |
popq %rbx | |
popq %rbp | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://d.hatena.ne.jp/yohhoy/20161204/p1 (ja)