]> granicus.if.org Git - clang/commitdiff
A number of test cases assume that an "int" parameter or return value
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Wed, 24 Oct 2012 12:22:56 +0000 (12:22 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Wed, 24 Oct 2012 12:22:56 +0000 (12:22 +0000)
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

20 files changed:
test/CodeGen/PR3589-freestanding-libcalls.c
test/CodeGen/decl-in-prototype.c
test/CodeGen/extern-inline.c
test/CodeGen/inline.c
test/CodeGen/unwind-attr.c
test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp
test/CodeGenCXX/cxx0x-delegating-ctors.cpp
test/CodeGenCXX/cxx0x-initializer-array.cpp
test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp
test/CodeGenCXX/mangle-extern-local.cpp
test/CodeGenCXX/member-init-assignment.cpp
test/CodeGenCXX/nrvo.cpp
test/CodeGenCXX/pr12251.cpp
test/CodeGenCXX/pragma-visibility.cpp
test/CodeGenCXX/switch-case-folding-2.cpp
test/CodeGenCXX/thunk-linkonce-odr.cpp
test/CodeGenCXX/virtual-operator-call.cpp
test/CodeGenCXX/visibility-inlines-hidden.cpp
test/CodeGenObjC/property.m
test/Frontend/ast-codegen.c

index 8b8282fb80b9dc90875904515113e138b946b8af..40e5fb11214b3d64146fcb1345879caea3b028ec 100644 (file)
@@ -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 *, ...);
 
index 949793da445a835057127e77163335dd69c8d92d..2c0fc4fc3b174327c25558426b5f95a4d142141f 100644 (file)
@@ -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;
 
index e3df9968bfd2de9ff9015faa96546d7ed0a202bd..77cb270191a0e17cab51dc2d9b5b1ccb0e977ddf 100644 (file)
@@ -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
index 2a01f255dc01c9f6b8e93958332d22d300692259..addb30bde42a2740f48643cf530eded1d4a03188 100644 (file)
@@ -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
index c588ca8e1b60e50b456dcef37c17427380452b3e..7a79cb6047a1d7fe71fb4cc3f96befa9a8291e20 100644 (file)
@@ -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();
 
index 8361680546f3d8758d274df52a1cc86902402095..7acc07d0c5b8518413435890478cca32e82ddb53 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fexceptions -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -fexceptions -emit-llvm %s -o - | FileCheck %s
 int c(void) __attribute__((const));
 int p(void) __attribute__((pure));
 int t(void);
index ad6492f5bfdcc2210bb6ef021f03d44093dd86dd..338159cd8258a4ac750359dcadb31fe345e6b16f 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -fexceptions -fcxx-exceptions -std=c++11 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -fexceptions -fcxx-exceptions -std=c++11 -o - %s | FileCheck %s
 
 struct non_trivial {
   non_trivial();
index b773178e6b812f3b04a380c1d42f409735bbb51c..df689978a889911b934c27b60ac1072fab5361e3 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -S -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -std=c++11 -S -emit-llvm -o - %s | FileCheck %s
 
 struct A { int a[1]; };
 typedef A x[];
index 634bf84b416d02b757d3417b79a0a03530128a38..ab781da56d08128149c11bcfc5d10c8fa8988b26 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -std=c++11 %s -emit-llvm -o - | FileCheck %s
 
 namespace Test1 {
   struct A {
index ed91da4e2e37ab36246ee8206052d52cc4f018e1..1394c8f2a1329bf56d7e794ded1798a6fc4ed579 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -emit-llvm -o - | FileCheck %s
 
 // CHECK: @var1 = external global i32
 // CHECK: @_ZN1N4var2E = external global i32
index 84c4a36fe2dbad11e923049368eb374c1fed3680..acc7084670021e654435a69c0f40a40cc0f92a9d 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -emit-llvm -o - | FileCheck %s
 // PR7291
 
 struct Foo {
index 2feaf682413cb179f11dd4d969ff9fa9df972d4d..8ff7dd7d090938772d6830a3b65a87f42450e431 100644 (file)
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -emit-llvm -O1 -o - %s | FileCheck %s
-// RUN: %clang_cc1 -emit-llvm -O1 -fcxx-exceptions -fexceptions -o - %s | FileCheck --check-prefix=CHECK-EH %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -O1 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -O1 -fcxx-exceptions -fexceptions -o - %s | FileCheck --check-prefix=CHECK-EH %s
 
 // Test code generation for the named return value optimization.
 class X {
index a9920c073388dc9f87916f15ca14b58d133a0b0f..f3f2ec417e39a494843a9bd798efe1d047d43b31 100644 (file)
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 %s -emit-llvm -O1 -relaxed-aliasing -fstrict-enums -std=c++11 -o - | FileCheck %s
-// RUN: %clang_cc1 %s -emit-llvm -O1 -relaxed-aliasing -std=c++11 -o - | FileCheck --check-prefix=NO-STRICT-ENUMS %s
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -emit-llvm -O1 -relaxed-aliasing -fstrict-enums -std=c++11 -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -emit-llvm -O1 -relaxed-aliasing -std=c++11 -o - | FileCheck --check-prefix=NO-STRICT-ENUMS %s
 
 bool f(bool *x) {
   return *x;
index 11a38c1d5fb961d1ce9eee54801b5eaca90b281f..0640d4244eba27d6098bacdd08d4464209bb3791 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck %s
 
 #pragma GCC visibility push(hidden)
 struct x {
index 7c0283fa2a52956373c4684618871fad18b6244e..930bfeb64d8d7655ed453324e4760b850f6e62f2 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck %s
 // CHECK that we don't crash.
 
 extern int printf(const char*, ...);
index 4f4d61d5a9a8a9c2409cadab5ea420fafbcf96f8..82f2148e0b557acf7788dfb0615aba840e52632e 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -emit-llvm -o - | FileCheck %s
 // <rdar://problem/7929157> & <rdar://problem/8104369>
 
 struct A {
index 42d38e55a04f3f8f85480ab88e74633e4882fc11..72d49c2300939f182fd2ddb432b116baa7945359 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -emit-llvm -o - | FileCheck %s
 
 struct A {
   virtual int operator-() = 0;
index bf18020cc6e84601886d0fea1d877ca29e59d0aa..8519c8ced8950c8a845cc52241238eea140cb405 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fvisibility-inlines-hidden -emit-llvm -o - %s -O2 -disable-llvm-optzns | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -fvisibility-inlines-hidden -emit-llvm -o - %s -O2 -disable-llvm-optzns | FileCheck %s
 
 // The trickery with optimization in the run line is to get IR
 // generation to emit available_externally function bodies, but not
index f72b52b3ebf81d699d1757d47df60c8145e4933f..aab7c73ad069717eab79d2f2d9f7d2cf83e04072 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck %s
 
 // PR13820
 // REQUIRES: LP64
index b5b2157e21aea20014ca85ed52f242fdecc3e431..b85c5dcf508565784c272ded04450bc328cce1ca 100644 (file)
@@ -1,5 +1,5 @@
-// RUN: %clang -emit-ast -o %t.ast %s
-// RUN: %clang -emit-llvm -S -o - %t.ast | FileCheck %s
+// RUN: %clang -target i386-unknown-unknown -emit-ast -o %t.ast %s
+// RUN: %clang -target i386-unknown-unknown -emit-llvm -S -o - %t.ast | FileCheck %s
 
 // CHECK: module asm "foo"
 __asm__("foo");