Index: test/Transforms/NaCl/allocate-data-segment-size.ll |
diff --git a/test/Transforms/NaCl/allocate-data-segment-size.ll b/test/Transforms/NaCl/allocate-data-segment-size.ll |
new file mode 100644 |
index 0000000000000000000000000000000000000000..df8f67a52aaefcc6934bf198a5f7df716bce9178 |
--- /dev/null |
+++ b/test/Transforms/NaCl/allocate-data-segment-size.ll |
@@ -0,0 +1,10 @@ |
+; RUN: opt %s -allocate-data-segment -S | FileCheck %s |
+ |
+@var1 = global i32 11 |
+@var2 = global i32 22 |
+ |
+; Check for a bug in which we got the following, which FlattenGlobals |
+; doesn't handle: |
+; @__sfi_data_segment_size = constant i64 mul nuw (i64 ptrtoint (i32* getelementptr (i32* null, i32 1) to i64), i64 2) |
+ |
+; CHECK: @__sfi_data_segment_size = constant i32 8 |