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

Unified Diff: test/Transforms/NaCl/allocate-data-segment.ll

Issue 29743003: Add passes for applying SFI sandboxing at the LLVM IR level Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Retry upload Created 6 years, 6 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 | « lib/Transforms/Scalar/LowerAtomic.cpp ('k') | test/Transforms/NaCl/allocate-data-segment-size.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/Transforms/NaCl/allocate-data-segment.ll
diff --git a/test/Transforms/NaCl/allocate-data-segment.ll b/test/Transforms/NaCl/allocate-data-segment.ll
new file mode 100644
index 0000000000000000000000000000000000000000..4e1d87e82f9d001e2e507b0eb4f6ad950d41afaf
--- /dev/null
+++ b/test/Transforms/NaCl/allocate-data-segment.ll
@@ -0,0 +1,23 @@
+; RUN: opt %s -allocate-data-segment -S | FileCheck %s
+; RUN: opt %s -allocate-data-segment -S | FileCheck %s -check-prefix=CLEAN
+
+@var1 = global i64 1234
+@var2 = global i32 56
+
+@reloc = global i64* @var1
+@reloc_end = global i32* getelementptr (i32* @var2, i32 1)
+
+
+; CHECK: @__sfi_data_segment = constant %data_template { i64 1234, i32 56, i64* getelementptr (%data_template* inttoptr (i32 65536 to %data_template*), i32 0, i32 0), i32* getelementptr inbounds (i32* getelementptr (%data_template* inttoptr (i32 65536 to %data_template*), i32 0, i32 1), i32 1) }
+
+; CHECK: @__sfi_data_segment_size = constant i32 32
+
+; CLEAN-NOT: @var
+
+
+define i32 @ref_to_var() {
+ %val = load i32* @var2
+ ret i32 %val
+}
+; CHECK: define i32 @ref_to_var() {
+; CHECK-NEXT: %val = load i32* getelementptr (%data_template* inttoptr (i32 65536 to %data_template*), i32 0, i32 1)
« no previous file with comments | « lib/Transforms/Scalar/LowerAtomic.cpp ('k') | test/Transforms/NaCl/allocate-data-segment-size.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698