// RUN: %target-swift-frontend -Ounchecked %s -emit-ir | FileCheck %s

// REQUIRES: CPU=x86_64

// We were missing target transform info and not vectorizing the loop below.

// CHECK: xor <2 x i64>

public func f(a: UnsafePointer<Int>, b: UnsafePointer<Int>, count: Int) -> Int {
  var c = 0

  for i in 0..<count {
    c = a[i] ^ b[i] ^ c
  }

  return c
}


// RUN: %target-swift-frontend -Ounchecked %s -emit-ir | FileCheck %s

// REQUIRES: CPU=x86_64

// We were missing target transform info and not vectorizing the loop below.

// CHECK: xor <2 x i64>

func f() -> Int {
  var a : Int = 10
  var b : Int = 15
  var c : Int = 0

  for _ in 0..<100000 {
    for _ in 0..<1000000 {
      c = a ^ b ^ c
    }
  }

  return c
}

var c = f()

--- 
+++ 
@@ -6,18 +6,13 @@
 
 // CHECK: xor <2 x i64>
 
-func f() -> Int {
-  var a : Int = 10
-  var b : Int = 15
-  var c : Int = 0
+public func f(a: UnsafePointer<Int>, b: UnsafePointer<Int>, count: Int) -> Int {
+  var c = 0
 
-  for _ in 0..<100000 {
-    for _ in 0..<1000000 {
-      c = a ^ b ^ c
-    }
+  for i in 0..<count {
+    c = a[i] ^ b[i] ^ c
   }
 
   return c
 }
 
-var c = f()
Make the test more robust so that it passes with stronger optimizations
in the new LLVM

Swift SVN r29693
