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

Unified Diff: test/Transforms/NaCl/resolve-aliases.ll

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 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 | « test/Transforms/NaCl/replace-ptrs-with-ints.ll ('k') | test/Transforms/NaCl/resolve-pnacl-intrinsics.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/Transforms/NaCl/resolve-aliases.ll
diff --git a/test/Transforms/NaCl/resolve-aliases.ll b/test/Transforms/NaCl/resolve-aliases.ll
new file mode 100644
index 0000000000000000000000000000000000000000..82ad54d74e9515f6869b131f884178603d18060b
--- /dev/null
+++ b/test/Transforms/NaCl/resolve-aliases.ll
@@ -0,0 +1,36 @@
+; RUN: opt < %s -resolve-aliases -S | FileCheck %s
+
+; CHECK-NOT: @alias
+
+@r1 = internal global i32 zeroinitializer
+@a1 = alias i32* @r1
+define i32* @usea1() {
+; CHECK: ret i32* @r1
+ ret i32* @a1
+}
+
+@funcalias = alias i32* ()* @usea1
+; CHECK: @usefuncalias
+define void @usefuncalias() {
+; CHECK: call i32* @usea1
+ %1 = call i32* @funcalias()
+ ret void
+}
+
+@bc1 = global i8* bitcast (i32* @r1 to i8*)
+@bcalias = alias i8* bitcast (i32* @r1 to i8*)
+
+; CHECK: @usebcalias
+define i8* @usebcalias() {
+; CHECK: ret i8* bitcast (i32* @r1 to i8*)
+ ret i8* @bcalias
+}
+
+
+@fa2 = alias i32* ()* @funcalias
+; CHECK: @usefa2
+define void @usefa2() {
+; CHECK: call i32* @usea1
+ call i32* @fa2()
+ ret void
+}
« no previous file with comments | « test/Transforms/NaCl/replace-ptrs-with-ints.ll ('k') | test/Transforms/NaCl/resolve-pnacl-intrinsics.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698