Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: wasm-tests/indirect.c

Issue 1876413002: Subzero. WASM. Additional progress. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review feedback and merging with master Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « wasm-tests/hello-write.c ('k') | wasm-tests/write_loop.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: wasm-tests/indirect.c
diff --git a/wasm-tests/indirect.c b/wasm-tests/indirect.c
new file mode 100644
index 0000000000000000000000000000000000000000..2b8753dece37375b4dfbb5e27767eb472cca76da
--- /dev/null
+++ b/wasm-tests/indirect.c
@@ -0,0 +1,13 @@
+int foo() { return 5; }
+
+int bar() { return 6; }
+
+int baz() { return 7; }
+
+int (*TABLE[])() = {foo, baz, bar, baz};
+
+int main(int argc, const char **argv) {
+ int (*f)() = TABLE[argc - 1];
+
+ return f();
+}
« no previous file with comments | « wasm-tests/hello-write.c ('k') | wasm-tests/write_loop.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698