about summary refs log tree commit diff homepage
path: root/test/Feature
diff options
context:
space:
mode:
authorJulian Büning <julian.buening@rwth-aachen.de>2020-02-09 20:14:35 +0100
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2020-06-25 16:30:10 +0100
commit248be605d192abf425eae6d14fc206e507b48380 (patch)
tree6cd8cf95dacf2e41ec78af28b2a673ae9758fbf0 /test/Feature
parent21d2134dbd4ffe9f4252becf575969b78a43e1b8 (diff)
downloadklee-248be605d192abf425eae6d14fc206e507b48380.tar.gz
fix Executor: initializeGlobalAliases
Diffstat (limited to 'test/Feature')
-rw-r--r--test/Feature/Alias.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/Feature/Alias.c b/test/Feature/Alias.c
index 29cc08d7..e1f58901 100644
--- a/test/Feature/Alias.c
+++ b/test/Feature/Alias.c
@@ -6,6 +6,10 @@
 
 #include <assert.h>
 
+// alias with bitcast
+// NOTE: this does not have to be before b is known
+extern short d __attribute__((alias("b")));
+
 // alias for global
 int b = 52;
 extern int a __attribute__((alias("b")));
@@ -18,13 +22,26 @@ extern int foo2() __attribute__((alias("foo")));
 int __foo() { return 52; }
 extern int foo() __attribute__((alias("__foo")));
 
+// alias without bitcast
+extern int foo3(void) __attribute__((alias("__foo")));
+
 int *c = &a;
 
 int main() {
   assert(a == 52);
+  assert(*c == 52);
+  assert((int)d == 52);
+
+  assert(c == &b);
+  assert((int*)&d != &b);
+
   assert(foo() == 52);
   assert(foo2() == 52);
-  assert(*c == 52);
+  assert(foo3() == 52);
+
+  assert(foo != __foo);
+  assert(foo2 != __foo);
+  assert(foo3 == __foo);
 
   return 0;
 }