A number of test cases assume that an "int" parameter or return value
will be represented in the IR as a plain "i32" type.  This causes the
tests to spuriously fail on platforms where int is not a 32-bit type,
or where the ABI requires attributes like "signext" or "zeroext" to
be used.

This patch adds -triple or -target parameters to force those tests
to use the i386-unknown-unknown target.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166551 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/PR3589-freestanding-libcalls.c b/test/CodeGen/PR3589-freestanding-libcalls.c
index 8b8282f..40e5fb1 100644
--- a/test/CodeGen/PR3589-freestanding-libcalls.c
+++ b/test/CodeGen/PR3589-freestanding-libcalls.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - | grep 'declare i32 @printf' | count 1
-// RUN: %clang_cc1 -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 1
-// RUN: %clang_cc1 -ffreestanding -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 0
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o - | grep 'declare i32 @printf' | count 1
+// RUN: %clang_cc1 -triple i386-unknown-unknown -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 1
+// RUN: %clang_cc1 -triple i386-unknown-unknown -ffreestanding -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 0
 
 int printf(const char *, ...);
 
diff --git a/test/CodeGen/decl-in-prototype.c b/test/CodeGen/decl-in-prototype.c
index 949793d..2c0fc4f 100644
--- a/test/CodeGen/decl-in-prototype.c
+++ b/test/CodeGen/decl-in-prototype.c
@@ -1,4 +1,4 @@
-// RUN: %clang -emit-llvm -S -o - %s | FileCheck %s
+// RUN: %clang -target i386-unknown-unknown -emit-llvm -S -o - %s | FileCheck %s
 
 const int AA = 5;
 
diff --git a/test/CodeGen/extern-inline.c b/test/CodeGen/extern-inline.c
index e3df996..77cb270 100644
--- a/test/CodeGen/extern-inline.c
+++ b/test/CodeGen/extern-inline.c
@@ -1,5 +1,5 @@
-// RUN: %clang -S -emit-llvm -std=gnu89 -o - %s | FileCheck %s
-// RUN: %clang -S -emit-llvm -fgnu89-inline -o - %s | FileCheck %s
+// RUN: %clang -target i386-unknown-unknown -S -emit-llvm -std=gnu89 -o - %s | FileCheck %s
+// RUN: %clang -target i386-unknown-unknown -S -emit-llvm -fgnu89-inline -o - %s | FileCheck %s
 // PR5253
 
 // If an extern inline function is redefined, functions should call the
diff --git a/test/CodeGen/inline.c b/test/CodeGen/inline.c
index 2a01f25..addb30b 100644
--- a/test/CodeGen/inline.c
+++ b/test/CodeGen/inline.c
@@ -1,5 +1,5 @@
 // RUN: echo "GNU89 tests:"
-// RUN: %clang %s -O1 -emit-llvm -S -o %t -std=gnu89
+// RUN: %clang %s -target i386-unknown-unknown -O1 -emit-llvm -S -o %t -std=gnu89
 // RUN: grep "define available_externally i32 @ei()" %t
 // RUN: grep "define i32 @foo()" %t
 // RUN: grep "define i32 @bar()" %t
@@ -21,7 +21,7 @@
 // RUN: grep "define void @testC" %t
 
 // RUN: echo "C99 tests:"
-// RUN: %clang %s -O1 -emit-llvm -S -o %t -std=gnu99
+// RUN: %clang %s -target i386-unknown-unknown -O1 -emit-llvm -S -o %t -std=gnu99
 // RUN: grep "define i32 @ei()" %t
 // RUN: grep "define available_externally i32 @foo()" %t
 // RUN: grep "define i32 @bar()" %t
@@ -43,7 +43,7 @@
 // RUN: grep "define void @testC" %t
 
 // RUN: echo "C++ tests:"
-// RUN: %clang -x c++ %s -O1 -emit-llvm -S -o %t -std=c++98
+// RUN: %clang -x c++ %s -target i386-unknown-unknown -O1 -emit-llvm -S -o %t -std=c++98
 // RUN: grep "define linkonce_odr i32 @_Z2eiv()" %t
 // RUN: grep "define linkonce_odr i32 @_Z3foov()" %t
 // RUN: grep "define i32 @_Z3barv()" %t
diff --git a/test/CodeGen/unwind-attr.c b/test/CodeGen/unwind-attr.c
index c588ca8..7a79cb6 100644
--- a/test/CodeGen/unwind-attr.c
+++ b/test/CodeGen/unwind-attr.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fexceptions -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck -check-prefix NOEXC %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -fexceptions -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix NOEXC %s
 
 int opaque();