| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <title>Compiler Explorer</title> |
| <link href="ext/bootstrap/css/bootstrap.css" rel="stylesheet"> |
| <link href="ext/codemirror/codemirror.css" rel="stylesheet"> |
| <link href="gcc.css" rel="stylesheet"> |
| <script src="client-options.js"></script> |
| <script src="ext/codemirror/codemirror.js"></script> |
| <script src="asm.js"></script> |
| <script src="asm-mode.js"></script> |
| <script src="ext/jquery/jquery-1.7.1.min.js"></script> |
| <script src="compiler.js"></script> |
| <script src="gcc.js"></script> |
| <script src="ext/bootstrap/js/bootstrap.js"></script> |
| <script src="ext/lz-string/lz-string-1.3.3-min.js"></script> |
| <script type="text/javascript"> |
| var _gaq = _gaq || []; |
| _gaq.push(['_setAccount', OPTIONS.google_analytics_account]); |
| _gaq.push(['_trackPageview']); |
| |
| (function () { |
| "use strict"; |
| function create_script_element(id, url) { |
| var el = document.createElement('script'); |
| el.type = 'text/javascript'; |
| el.async = true; |
| el.id = id; |
| el.src = url; |
| var s = document.getElementsByTagName('script')[0]; |
| s.parentNode.insertBefore(el, s); |
| } |
| |
| create_script_element('urlshortener', 'urlshorten-' + OPTIONS.urlshortener + ".js"); |
| if (OPTIONS.google_analytics_enabled) |
| create_script_element('ga', ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'); |
| if (OPTIONS.sharing_enabled) { |
| create_script_element('gp', 'https://apis.google.com/js/plusone.js'); |
| create_script_element('twitter-wjs', '//platform.twitter.com/widgets.js'); |
| (function (document, script, id) { |
| var js, r = document.getElementsByTagName(script)[0], protocol = /^http:/.test(document.location) ? 'http' : 'https'; |
| if (!document.getElementById(id)) { |
| js = document.createElement(script); |
| js.id = id; |
| js.src = protocol + '://widgets.changetip.com/public/js/widgets.js'; |
| r.parentNode.insertBefore(js, r) |
| } |
| }(document, 'script', 'changetip_w_0')); |
| } |
| })() |
| </script> |
| </head> |
| <body> |
| <div class="navbar navbar-fixed-top"> |
| <div class="navbar-inner"> |
| <div class="container-fluid"> |
| <a class="brand" href="#">Interactive compiler - <span class="language-name"></span></a> |
| <ul class="nav pull-right"> |
| <li id="changetip_tipme_button" data-bid="MzRgCSeSnVWvAP9SVRoYFC" data-uid="Qy46jQ356qex2GD2JGaHaK" style=""></li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" id="share" data-toggle="dropdown">Share<b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li class="social"><g:plusone annotation="inline" width="150"></g:plusone></li> |
| <li class="social"><a href="https://twitter.com/share" class="twitter-share-button" data-via="mattgodbolt">Tweet</a></li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">About<b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li><a href="https://plus.google.com/112384289668860490877" rel="publisher">Google+ page</a></li> |
| <li><a href="https://plus.google.com/105166465490735292917" rel="author">About Matt</a></li> |
| <li><a href="mailto:matt@godbolt.org">Contact Matt</a></li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| |
| <section id="main" class="container-fluid"> |
| <div class="row-fluid"> |
| <div class="span6"> |
| <form class="well form-inline files"> |
| <div> |
| <label>Source: <select class="source" style="width:3m"></select></label> |
| <label>Name: <select class="filename"></select></label> |
| </div> |
| <div class="btn-group"> |
| <button class="btn load">Load</button> |
| <button class="btn save">Save</button> |
| <button class="btn saveas">Save as...</button> |
| <button class="btn permalink">Permalink</button> |
| </div> |
| <div class="collapse permalink-collapse"> |
| <label>Permalink: <input class="input-medium input-uneditable" type="text" placeholder="Loading" readonly id="permalink"></input></label> |
| </div> |
| </form> |
| </div> |
| <div class="span6"> |
| <form class="well form-inline"> |
| <label>Compiler: <select class="compiler"></select></label> |
| <label>Compiler options: <input class="compiler_options" style="width: 30em;" type="text" value=""></label> |
| <table><tbody><tr><td>Filter: </td> |
| <td> |
| <div class="btn-group filter"> |
| <button class="btn active" type="button" value="labels">Unused labels</button> |
| <button class="btn active" type="button" value="directives">Directives</button> |
| <button class="btn active" type="button" value="commentOnly">Comment-only lines</button> |
| <button class="btn" type="button" value="intel">Intel syntax</button> |
| <button class="btn" type="button" value="colouriseAsm">Colourise</button> |
| </div> |
| </td></table> |
| </form> |
| </div> |
| </div> |
| <div class="row-fluid"> |
| <div class="span6 editor"> |
| <div class="topbar indented">Code editor</div> |
| <textarea>// Type your code here, or load an example.</textarea> |
| </div> |
| <div class="span6 asm"> |
| <div class="topbar indented">Assembly output</div> |
| <textarea>Awaiting</textarea> |
| </div> |
| </div> |
| <div class="row-fluid result"> |
| <div class="topbar">Compiler output — <span class="compilerVersion"></span></div> |
| <div class="output"> |
| <p class="template"></p> |
| </div> |
| </div> |
| </section> |
| |
| <div class="modal hide" id="saveDialog"> |
| <div class="modal-header"> |
| <button class="close" data-dismiss="modal">×</button> |
| <h3>Save as...</h3> |
| </div> |
| <div class="modal-body"> |
| <label>Filename: <input class="save-filename" style="width: 30em;" type="text"></label> |
| </div> |
| <div class="modal-footer"> |
| <a href="#" data-dismiss="modal" class="btn">Cancel</a> |
| <a href="#" class="btn btn-primary save">Save</a> |
| </div> |
| </div> |
| |
| <div class="template lang c">// Type your code here, or load an example. |
| int square(int num) { |
| return num * num; |
| }</div> |
| <div class="template lang rust">// Type your code here, or load an example. |
| pub fn square(num: i32) -> i32 { |
| return num * num; |
| }</div> |
| <div class="template lang go">// Type your code here, or load an example. |
| // Your function name should start with a capital letter. |
| package main |
| |
| func Square(x int) int { |
| return x * x |
| } |
| |
| func main() {} |
| </div> |
| <div class="template lang d">// Type your code here, or load an example.</div> |
| |
| <map name="ghm"> |
| <area shape="poly" coords="16,0,149,133,149,0" href="https://github.com/mattgodbolt/gcc-explorer"> |
| </map> |
| <script type="text/javascript"> |
| (function () { |
| if (!OPTIONS.sharing_enabled) |
| $('#share').remove(); |
| |
| if (OPTIONS.github_ribbon_enabled) { |
| $(document.createElement('img')) |
| .css({ |
| position: "absolute", |
| top: "40px", |
| right: 0, |
| border: 0 |
| }) |
| .attr('src', 'https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png') |
| .attr('alt', 'Fork me on GitHub') |
| .attr('useMap', '#ghm') |
| .appendTo(document.body) |
| } |
| })(); |
| </script> |
| </body> |
| </html> |
| |