Index: test/CodeGenCXX/linetable-cleanup.cpp
===================================================================
--- test/CodeGenCXX/linetable-cleanup.cpp
+++ test/CodeGenCXX/linetable-cleanup.cpp
@@ -1,10 +1,12 @@
// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple x86_64-apple-darwin10 -std=c++98 %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple x86_64-apple-darwin10 -std=c++11 %s -o - | FileCheck %s
// Check the line numbers for cleanup code with EH in combination with
// simple return expressions.
// CHECK: define {{.*}}foo
-// CHECK: call void @_ZN1CD1Ev(%class.C* {{.*}}), !dbg ![[RET:[0-9]+]]
+// CHECK: call void @_ZN1CD1Ev(%class.C* {{.*}}){{( #[0-9])?}}, !dbg ![[RET:[0-9]+]]
// CHECK: ret i32 0, !dbg ![[RET]]
// CHECK: define {{.*}}bar
Index: test/CodeGenCXX/lpad-linetable.cpp
===================================================================
--- test/CodeGenCXX/lpad-linetable.cpp
+++ test/CodeGenCXX/lpad-linetable.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -emit-llvm -debug-info-kind=limited -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -emit-llvm -debug-info-kind=limited -triple x86_64-apple-darwin10 -std=c++98 %s -o - | FileCheck %s
// The landing pad should have the line number of the closing brace of the function.
// rdar://problem/13888152
// CHECK: ret i32
Index: test/CodeGenCXX/mangle-unnamed.cpp
===================================================================
--- test/CodeGenCXX/mangle-unnamed.cpp
+++ test/CodeGenCXX/mangle-unnamed.cpp
@@ -48,6 +48,7 @@
return a;
}
+#if __cplusplus <= 199711L
int f6() {
static union {
union {
@@ -56,9 +57,10 @@
int b;
};
- // CHECK: _ZZ2f6vE1b
+ // CXX98: _ZZ2f6vE1b
return b;
}
+#endif
int f7() {
static union {
Index: test/CodeGenCXX/static-init.cpp
===================================================================
--- test/CodeGenCXX/static-init.cpp
+++ test/CodeGenCXX/static-init.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 %s -triple=x86_64-pc-linuxs -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple=x86_64-pc-linuxs -emit-llvm -std=c++98 -o - | FileCheck -check-prefix=CHECK -check-prefix=CHECK98 %s
+// RUN: %clang_cc1 %s -triple=x86_64-pc-linuxs -emit-llvm -std=c++11 -o - | FileCheck -check-prefix=CHECK -check-prefix=CHECK11 %s
// CHECK: @_ZZ1hvE1i = internal global i32 0, align 4
// CHECK: @base_req = global [4 x i8] c"foo\00", align 1
@@ -9,7 +10,8 @@
// CHECK: @_ZZ2h2vE1i = linkonce_odr global i32 0, comdat, align 4
// CHECK: @_ZGVZ2h2vE1i = linkonce_odr global i64 0, comdat, align 8{{$}}
// CHECK: @_ZZN5test1L6getvarEiE3var = internal constant [4 x i32] [i32 1, i32 0, i32 2, i32 4], align 16
-// CHECK: @_ZZN5test414useStaticLocalEvE3obj = linkonce_odr global %"struct.test4::HasVTable" zeroinitializer, comdat, align 8
+// CHECK98: @_ZZN5test414useStaticLocalEvE3obj = linkonce_odr global %"struct.test4::HasVTable" zeroinitializer, comdat, align 8
+// CHECK11: @_ZZN5test414useStaticLocalEvE3obj = linkonce_odr global { i8** } { i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_ZTVN5test49HasVTableE, i32 0, inrange i32 0, i32 2) }, comdat, align 8
struct A {
A();
@@ -169,5 +171,5 @@
useStaticLocal();
}
// CHECK: define linkonce_odr dereferenceable(8) %"struct.test4::HasVTable"* @_ZN5test414useStaticLocalEv()
-// CHECK: ret %"struct.test4::HasVTable"* @_ZZN5test414useStaticLocalEvE3obj
+// CHECK: ret %"struct.test4::HasVTable"*{{.*}} @_ZZN5test414useStaticLocalEvE3obj
}
Index: test/CodeGenCXX/volatile-1.cpp
===================================================================
--- test/CodeGenCXX/volatile-1.cpp
+++ test/CodeGenCXX/volatile-1.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -Wno-unused-value -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -Wno-unused-value -triple %itanium_abi_triple -emit-llvm %s -std=c++98 -o - | FileCheck %s
+// RUN: %clang_cc1 -Wno-unused-value -triple %itanium_abi_triple -emit-llvm %s -std=c++11 -o - | FileCheck -check-prefix=CHECK -check-prefix=CHECK11 %s
// CHECK: @i = global [[INT:i[0-9]+]] 0
volatile int i, j, k;
@@ -22,18 +23,22 @@
asm("nop"); // CHECK: call void asm
- // should not load
+ // should not load in C++98
i;
+ // CHECK11-NEXT: load volatile [[INT]], [[INT]]* @i
(float)(ci);
// CHECK-NEXT: load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 0)
// CHECK-NEXT: load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
// CHECK-NEXT: sitofp [[INT]]
- // These are not uses in C++:
+ // These are not uses in C++98:
// [expr.static.cast]p6:
// The lvalue-to-rvalue . . . conversions are not applied to the expression.
(void)ci;
+ // CHECK11-NEXT: load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 0)
+ // CHECK11-NEXT: load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
+
(void)a;
(void)(ci=ci);
@@ -126,7 +131,8 @@
// CHECK-NEXT: load volatile
// CHECK-NEXT: sitofp
- (void)i;
+ (void)i; // This is now a load in C++11
+ // CHECK11-NEXT: load volatile
i=i;
// CHECK-NEXT: load volatile
@@ -155,13 +161,15 @@
// CHECK-NEXT: br label
// CHECK: phi
- (void)(i,(i=i));
+ (void)(i,(i=i)); // first i is also a load in C++11
+ // CHECK11-NEXT: load volatile
// CHECK-NEXT: load volatile
// CHECK-NEXT: store volatile
- i=i,k;
+ i=i,k; // k is also a load in C++11
// CHECK-NEXT: load volatile [[INT]], [[INT]]* @i
// CHECK-NEXT: store volatile {{.*}}, [[INT]]* @i
+ // CHECK11-NEXT: load volatile [[INT]], [[INT]]* @k
(i=j,k=j);
// CHECK-NEXT: load volatile [[INT]], [[INT]]* @j
@@ -169,11 +177,14 @@
// CHECK-NEXT: load volatile [[INT]], [[INT]]* @j
// CHECK-NEXT: store volatile {{.*}}, [[INT]]* @k
- (i=j,k);
+ (i=j,k); // k is also a load in C++11
// CHECK-NEXT: load volatile [[INT]], [[INT]]* @j
// CHECK-NEXT: store volatile {{.*}}, [[INT]]* @i
+ // CHECK11-NEXT: load volatile [[INT]], [[INT]]* @k
- (i,j);
+ (i,j); // i and j both are loads in C++11
+ // CHECK11-NEXT: load volatile [[INT]], [[INT]]* @i
+ // CHECK11-NEXT: load volatile [[INT]], [[INT]]* @j
// Extra load in C++.
i=c=k;
@@ -190,7 +201,9 @@
// CHECK-NEXT: add nsw [[INT]]
// CHECK-NEXT: store volatile
- ci;
+ ci; // ci is a load in C++11
+ // CHECK11-NEXT: load volatile {{.*}} @ci, i32 0, i32 0
+ // CHECK11-NEXT: load volatile {{.*}} @ci, i32 0, i32 1
asm("nop"); // CHECK-NEXT: call void asm
@@ -338,8 +351,9 @@
// CHECK-NEXT: load volatile
// CHECK-NEXT: add
- (i,j)=k;
+ (i,j)=k; // i is also a load in C++11
// CHECK-NEXT: load volatile [[INT]], [[INT]]* @k
+ // CHECK11-NEXT: load volatile [[INT]], [[INT]]* @i
// CHECK-NEXT: store volatile {{.*}}, [[INT]]* @j
(j=k,i)=i;
Index: test/CodeGenCXX/volatile.cpp
===================================================================
--- test/CodeGenCXX/volatile.cpp
+++ test/CodeGenCXX/volatile.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -std=c++98 -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -std=c++11 -o - | FileCheck -check-prefix=CHECK -check-prefix=CHECK11 %s
// Check that IR gen doesn't try to do an lvalue-to-rvalue conversion
// on a volatile reference result. rdar://problem/8338198
@@ -27,6 +28,7 @@
// CHECK-LABEL: define void @_ZN5test14testEv()
void test() {
// CHECK: [[TMP:%.*]] = load i32*, i32** @_ZN5test11xE, align 8
+ // CHECK11: {{%.*}} = load volatile i32, i32* [[TMP]], align 4
// CHECK-NEXT: ret void
*x;
}
Index: test/Index/comment-cplus-decls.cpp
===================================================================
--- test/Index/comment-cplus-decls.cpp
+++ test/Index/comment-cplus-decls.cpp
@@ -2,9 +2,15 @@
// RUN: mkdir %t
// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 %s > %t/out
// RUN: FileCheck %s < %t/out
+// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 -std=c++98 %s > %t/98
+// RUN: FileCheck %s < %t/98
+// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 -std=c++11 %s > %t/11
+// RUN: FileCheck %s < %t/11
// Ensure that XML we generate is not invalid.
// RUN: FileCheck %s -check-prefix=WRONG < %t/out
+// RUN: FileCheck %s -check-prefix=WRONG < %t/98
+// RUN: FileCheck %s -check-prefix=WRONG < %t/11
// WRONG-NOT: CommentXMLInvalid
// rdar://12378714
@@ -42,7 +48,7 @@
// CHECK: class Test {}
// CHECK: Test() : reserved(new Test::data()) {}
// CHECK: unsigned int getID() const
-// CHECK: ~Test()
+// CHECK: ~Test(){{( noexcept)?}}
// CHECK: Test::data *reserved
Index: test/PCH/macro-undef.cpp
===================================================================
--- test/PCH/macro-undef.cpp
+++ test/PCH/macro-undef.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fsyntax-only -include-pch %t %s -Wuninitialized -verify
-// RUN: %clang_cc1 -fsyntax-only -include-pch %t %s -Wuninitialized -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -std=c++98 -emit-pch -o %t %s
+// RUN: %clang_cc1 -std=c++98 -fsyntax-only -include-pch %t %s -Wuninitialized -verify
+// RUN: %clang_cc1 -std=c++98 -fsyntax-only -include-pch %t %s -Wuninitialized -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s
#ifndef HEADER
#define HEADER