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

Unified Diff: test/Transforms/NaCl/strip-tbaa-metadata.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/strip-meta-leaves-debug.ll ('k') | test/lit.cfg » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/Transforms/NaCl/strip-tbaa-metadata.ll
diff --git a/test/Transforms/NaCl/strip-tbaa-metadata.ll b/test/Transforms/NaCl/strip-tbaa-metadata.ll
new file mode 100644
index 0000000000000000000000000000000000000000..c555af67122b35ea6ebb1f011983090f3003d117
--- /dev/null
+++ b/test/Transforms/NaCl/strip-tbaa-metadata.ll
@@ -0,0 +1,36 @@
+; RUN: opt -S -strip-metadata %s | FileCheck %s
+
+; Test that !tbaa is removed from loads/stores.
+; CHECK: @foo
+; CHECK-NOT: !tbaa
+define double @foo(i32* nocapture %ptr1, double* nocapture %ptr2) nounwind readonly {
+ store i32 99999, i32* %ptr1, align 1, !tbaa !0
+ %1 = load double* %ptr2, align 8, !tbaa !3
+ ret double %1
+}
+
+declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
+
+; Test that !tbaa is removed from calls.
+; CHECK: @bar
+; CHECK-NOT: !tbaa
+define void @bar(i8* nocapture %p, i8* nocapture %q,
+ i8* nocapture %s) nounwind {
+ tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %p, i8* %q,
+ i64 16, i32 1, i1 false), !tbaa !4
+ store i8 2, i8* %s, align 1, !tbaa !5
+ tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %q, i8* %p,
+ i64 16, i32 1, i1 false), !tbaa !4
+; CHECK ret void
+ ret void
+}
+
+; Test that the metadata nodes aren't left over.
+; CHECK-NOT: !0 =
+
+!0 = metadata !{metadata !"int", metadata !1}
+!1 = metadata !{metadata !"omnipotent char", metadata !2}
+!2 = metadata !{metadata !"Simple C/C++ TBAA"}
+!3 = metadata !{metadata !"double", metadata !1}
+!4 = metadata !{metadata !"A", metadata !1}
+!5 = metadata !{metadata !"B", metadata !1}
« no previous file with comments | « test/Transforms/NaCl/strip-meta-leaves-debug.ll ('k') | test/lit.cfg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698