break;
case IK_CXX:
case IK_PreprocessedCXX:
+ LangStd = LangStandard::lang_gnucxx11; // PTR
+ break;
case IK_ObjCXX:
case IK_PreprocessedObjCXX:
LangStd = LangStandard::lang_gnucxx98;
-// RUN: %clang_cc1 -triple armv7-apple-darwin9 -emit-llvm -o - %s -Wno-return-type-c-linkage -std=c++03 | FileCheck %s -check-prefixes=CHECK,CHECKv03
-// RUN: %clang_cc1 -triple armv7-apple-darwin9 -emit-llvm -o - %s -Wno-return-type-c-linkage -std=c++11 | FileCheck %s -check-prefixes=CHECK,CHECKv11
+// RUN: %clang_cc1 -triple armv7-apple-darwin9 -emit-llvm -o - %s -Wno-return-type-c-linkage | FileCheck %s
// This isn't really testing anything ARM-specific; it's just a convenient
// 32-bit platform.
TEST(struct_1);
// CHECK-LABEL: define {{.*}} @return_struct_1()
// CHECK: [[RET:%.*]] = alloca [[REC:%.*]], align 4
-// CHECKv03: @llvm.memset
-// CHECKv11: @llvm.memcpy
+// CHECK: @llvm.memset
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[RET]] to [[AGG:{ i32, \[2 x i8\], i8, \[1 x i8\], float, float }]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
// CHECK: [[FIRST:%.*]] = load i32, i32* [[T0]], align 4
-// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -emit-llvm -o - -mconstructor-aliases -fcxx-exceptions -fexceptions -O1 -disable-llvm-optzns -std=c++03 > %t
+// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -emit-llvm -o - -mconstructor-aliases -fcxx-exceptions -fexceptions -O1 -disable-llvm-optzns > %t
// RUN: FileCheck --check-prefix=CHECK1 --input-file=%t %s
// RUN: FileCheck --check-prefix=CHECK2 --input-file=%t %s
// RUN: FileCheck --check-prefix=CHECK3 --input-file=%t %s
-// RUN: FileCheck --check-prefixes=CHECK4,CHECK4v03 --input-file=%t %s
-// RUN: FileCheck --check-prefixes=CHECK5,CHECK5v03 --input-file=%t %s
-// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -emit-llvm -o - -mconstructor-aliases -fcxx-exceptions -fexceptions -O1 -disable-llvm-optzns -std=c++11 > %t2
-// RUN: FileCheck --check-prefix=CHECK1 --input-file=%t2 %s
-// RUN: FileCheck --check-prefix=CHECK2v11 --input-file=%t2 %s
-// RUN: FileCheck --check-prefix=CHECK3 --input-file=%t2 %s
-// RUN: FileCheck --check-prefixes=CHECK4,CHECK4v11 --input-file=%t2 %s
-// RUN: FileCheck --check-prefixes=CHECK5,CHECK5v11 --input-file=%t2 %s
-// RUN: FileCheck --check-prefix=CHECK6 --input-file=%t2 %s
+// RUN: FileCheck --check-prefix=CHECK4 --input-file=%t %s
+// RUN: FileCheck --check-prefix=CHECK5 --input-file=%t %s
+// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions -O1 -disable-llvm-optzns -std=c++11 > %t2
+// RUN: FileCheck --check-prefix=CHECK6 --input-file=%t2 %s
// REQUIRES: asserts
struct A {
// CHECK2: invoke void @_ZN5test04BaseD2Ev
// CHECK2: unwind label [[BASE_UNWIND:%[a-zA-Z0-9.]+]]
-// In C++11, the destructors are often known not to throw.
-// CHECK2v11-LABEL: @_ZN5test01AD1Ev = alias {{.*}} @_ZN5test01AD2Ev
-// CHECK2v11-LABEL: define void @_ZN5test01AD2Ev(%"struct.test0::A"* %this) unnamed_addr
-// CHECK2v11: call void @_ZN5test06MemberD1Ev
-// CHECK2v11: call void @_ZN5test04BaseD2Ev
-
struct B : Base, virtual VBase {
Member M;
~B();
// CHECK2: invoke void @_ZN5test04BaseD2Ev
// CHECK2: unwind label [[BASE_UNWIND:%[a-zA-Z0-9.]+]]
-// CHECK2v11-LABEL: define void @_ZN5test01BD2Ev(%"struct.test0::B"* %this, i8** %vtt) unnamed_addr
-// CHECK2v11: call void @_ZN5test06MemberD1Ev
-// CHECK2v11: call void @_ZN5test04BaseD2Ev
-
// CHECK2-LABEL: define void @_ZN5test01BD1Ev(%"struct.test0::B"* %this) unnamed_addr
// CHECK2: invoke void @_ZN5test06MemberD1Ev
// CHECK2: unwind label [[MEM_UNWIND:%[a-zA-Z0-9.]+]]
// CHECK2: unwind label [[BASE_UNWIND:%[a-zA-Z0-9.]+]]
// CHECK2: invoke void @_ZN5test05VBaseD2Ev
// CHECK2: unwind label [[VBASE_UNWIND:%[a-zA-Z0-9.]+]]
-
-// CHECK2v11-LABEL: define void @_ZN5test01BD1Ev(%"struct.test0::B"* %this) unnamed_addr
-// CHECK2v11: call void @_ZN5test06MemberD1Ev
-// CHECK2v11: call void @_ZN5test04BaseD2Ev
-// CHECK2v11: call void @_ZN5test05VBaseD2Ev
}
// Test base-class aliasing.
}
// CHECK4-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD2Ev(%"struct.test3::(anonymous namespace)::C"* %this) unnamed_addr
- // CHECK4v03: invoke void @_ZN5test31BD2Ev(
- // CHECK4v11: call void @_ZN5test31BD2Ev(
+ // CHECK4: invoke void @_ZN5test31BD2Ev(
// CHECK4: call void @_ZN5test31AD2Ev(
// CHECK4: ret void
// CHECK4-LABEL: define internal void @_ZN5test312_GLOBAL__N_11DD0Ev(%"struct.test3::(anonymous namespace)::D"* %this) unnamed_addr
- // CHECK4v03-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
- // CHECK4v03: invoke void {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
- // CHECK4v11: call void {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
+ // CHECK4-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK4: invoke void {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
// CHECK4: call void @_ZdlPv({{.*}}) [[NUW:#[0-9]+]]
// CHECK4: ret void
- // CHECK4v03: landingpad { i8*, i32 }
- // CHECK4v03-NEXT: cleanup
- // CHECK4v03: call void @_ZdlPv({{.*}}) [[NUW]]
- // CHECK4v03: resume { i8*, i32 }
- // CHECK4v11-NOT: landingpad
+ // CHECK4: landingpad { i8*, i32 }
+ // CHECK4-NEXT: cleanup
+ // CHECK4: call void @_ZdlPv({{.*}}) [[NUW]]
+ // CHECK4: resume { i8*, i32 }
// CHECK4-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11DD1Ev(
// CHECK4: getelementptr inbounds i8, i8* {{.*}}, i64 -8
// CHECK4: ret void
// CHECK4-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD0Ev(%"struct.test3::(anonymous namespace)::C"* %this) unnamed_addr
- // CHECK4v03-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
- // CHECK4v03: invoke void @_ZN5test312_GLOBAL__N_11CD2Ev(
- // CHECK4v11: call void @_ZN5test312_GLOBAL__N_11CD2Ev(
+ // CHECK4-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ // CHECK4: invoke void @_ZN5test312_GLOBAL__N_11CD2Ev(
// CHECK4: call void @_ZdlPv({{.*}}) [[NUW]]
// CHECK4: ret void
- // CHECK4v03: landingpad { i8*, i32 }
- // CHECK4v03-NEXT: cleanup
- // CHECK4v03: call void @_ZdlPv({{.*}}) [[NUW]]
- // CHECK4v03: resume { i8*, i32 }
+ // CHECK4: landingpad { i8*, i32 }
+ // CHECK4-NEXT: cleanup
+ // CHECK4: call void @_ZdlPv({{.*}}) [[NUW]]
+ // CHECK4: resume { i8*, i32 }
// CHECK4-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11CD1Ev(
// CHECK4: getelementptr inbounds i8, i8* {{.*}}, i64 -8
// CHECK5-LABEL: define void @_ZN5test53fooEv()
// CHECK5: [[ELEMS:%.*]] = alloca [5 x [[A:%.*]]], align
- // CHECK5v03-NEXT: [[EXN:%.*]] = alloca i8*
- // CHECK5v03-NEXT: [[SEL:%.*]] = alloca i32
+ // CHECK5-NEXT: [[EXN:%.*]] = alloca i8*
+ // CHECK5-NEXT: [[SEL:%.*]] = alloca i32
// CHECK5-NEXT: [[PELEMS:%.*]] = bitcast [5 x [[A]]]* [[ELEMS]] to i8*
// CHECK5-NEXT: call void @llvm.lifetime.start(i64 5, i8* [[PELEMS]])
// CHECK5-NEXT: [[BEGIN:%.*]] = getelementptr inbounds [5 x [[A]]], [5 x [[A]]]* [[ELEMS]], i32 0, i32 0
// CHECK5-NEXT: br label
// CHECK5: [[POST:%.*]] = phi [[A]]* [ [[END]], {{%.*}} ], [ [[ELT:%.*]], {{%.*}} ]
// CHECK5-NEXT: [[ELT]] = getelementptr inbounds [[A]], [[A]]* [[POST]], i64 -1
- // CHECK5v03-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[ELT]])
- // CHECK5v11-NEXT: call void @_ZN5test51AD1Ev([[A]]* [[ELT]])
+ // CHECK5-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[ELT]])
// CHECK5: [[T0:%.*]] = icmp eq [[A]]* [[ELT]], [[BEGIN]]
// CHECK5-NEXT: br i1 [[T0]],
// CHECK5: call void @llvm.lifetime.end
// CHECK5-NEXT: ret void
// lpad
- // CHECK5v03: [[EMPTY:%.*]] = icmp eq [[A]]* [[BEGIN]], [[ELT]]
- // CHECK5v03-NEXT: br i1 [[EMPTY]]
- // CHECK5v03: [[AFTER:%.*]] = phi [[A]]* [ [[ELT]], {{%.*}} ], [ [[CUR:%.*]], {{%.*}} ]
- // CHECK5v03-NEXT: [[CUR:%.*]] = getelementptr inbounds [[A]], [[A]]* [[AFTER]], i64 -1
- // CHECK5v03-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[CUR]])
- // CHECK5v03: [[DONE:%.*]] = icmp eq [[A]]* [[CUR]], [[BEGIN]]
- // CHECK5v03-NEXT: br i1 [[DONE]],
- // CHECK5v11-NOT: landingpad
- // CHECK5v11: }
+ // CHECK5: [[EMPTY:%.*]] = icmp eq [[A]]* [[BEGIN]], [[ELT]]
+ // CHECK5-NEXT: br i1 [[EMPTY]]
+ // CHECK5: [[AFTER:%.*]] = phi [[A]]* [ [[ELT]], {{%.*}} ], [ [[CUR:%.*]], {{%.*}} ]
+ // CHECK5-NEXT: [[CUR:%.*]] = getelementptr inbounds [[A]], [[A]]* [[AFTER]], i64 -1
+ // CHECK5-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[CUR]])
+ // CHECK5: [[DONE:%.*]] = icmp eq [[A]]* [[CUR]], [[BEGIN]]
+ // CHECK5-NEXT: br i1 [[DONE]],
void foo() {
A elems[5];
}
C::~C() { opaque(); }
// CHECK5-LABEL: define void @_ZN5test61CD2Ev(%"struct.test6::C"* %this, i8** %vtt) unnamed_addr
// CHECK5: invoke void @_ZN5test66opaqueEv
- // CHECK5v03: invoke void @_ZN5test61AD1Ev
- // CHECK5v03: invoke void @_ZN5test61AD1Ev
- // CHECK5v03: invoke void @_ZN5test61AD1Ev
- // CHECK5v03: invoke void @_ZN5test61BILj1EED2Ev
- // CHECK5v11: call void @_ZN5test61AD1Ev
- // CHECK5v11: call void @_ZN5test61AD1Ev
- // CHECK5v11: call void @_ZN5test61AD1Ev
- // CHECK5v11: call void @_ZN5test61BILj1EED2Ev
+ // CHECK5: invoke void @_ZN5test61AD1Ev
+ // CHECK5: invoke void @_ZN5test61AD1Ev
+ // CHECK5: invoke void @_ZN5test61AD1Ev
+ // CHECK5: invoke void @_ZN5test61BILj1EED2Ev
// CHECK5: call void @_ZN5test61BILj0EED2Ev
// CHECK5: ret void
- // CHECK5v03: invoke void @_ZN5test61AD1Ev
- // CHECK5v03: invoke void @_ZN5test61AD1Ev
- // CHECK5v03: invoke void @_ZN5test61AD1Ev
- // CHECK5v03: invoke void @_ZN5test61BILj1EED2Ev
- // CHECK5v03: invoke void @_ZN5test61BILj0EED2Ev
+ // CHECK5: invoke void @_ZN5test61AD1Ev
+ // CHECK5: invoke void @_ZN5test61AD1Ev
+ // CHECK5: invoke void @_ZN5test61AD1Ev
+ // CHECK5: invoke void @_ZN5test61BILj1EED2Ev
+ // CHECK5: invoke void @_ZN5test61BILj0EED2Ev
// CHECK5-LABEL: define void @_ZN5test61CD1Ev(%"struct.test6::C"* %this) unnamed_addr
- // CHECK5v03: invoke void @_ZN5test61CD2Ev
- // CHECK5v03: invoke void @_ZN5test61BILj3EED2Ev
- // CHECK5v03: call void @_ZN5test61BILj2EED2Ev
- // CHECK5v03: ret void
- // CHECK5v03: invoke void @_ZN5test61BILj3EED2Ev
- // CHECK5v03: invoke void @_ZN5test61BILj2EED2Ev
-
- // CHECK5v11: call void @_ZN5test61CD2Ev
- // CHECK5v11: call void @_ZN5test61BILj3EED2Ev
- // CHECK5v11: call void @_ZN5test61BILj2EED2Ev
- // CHECK5v11: ret void
+ // CHECK5: invoke void @_ZN5test61CD2Ev
+ // CHECK5: invoke void @_ZN5test61BILj3EED2Ev
+ // CHECK5: call void @_ZN5test61BILj2EED2Ev
+ // CHECK5: ret void
+ // CHECK5: invoke void @_ZN5test61BILj3EED2Ev
+ // CHECK5: invoke void @_ZN5test61BILj2EED2Ev
}
// PR 9197
// Verify that this doesn't get emitted as an alias
// CHECK5-LABEL: define void @_ZN5test71BD2Ev(
- // CHECK5v03: invoke void @_ZN5test71DD1Ev(
- // CHECK5v11: call void @_ZN5test71DD1Ev(
+ // CHECK5: invoke void @_ZN5test71DD1Ev(
// CHECK5: call void @_ZN5test71AD2Ev(
B::~B() {}
}
// CHECK5: call void @_ZN5test81AC1Ev([[A]]* [[X]])
// CHECK5-NEXT: br label
// CHECK5: invoke void @_ZN5test81AC1Ev([[A]]* [[Y]])
- // CHECK5v03: invoke void @_ZN5test81AD1Ev([[A]]* [[Y]])
- // CHECK5v11: call void @_ZN5test81AD1Ev([[A]]* [[Y]])
+ // CHECK5: invoke void @_ZN5test81AD1Ev([[A]]* [[Y]])
// CHECK5-NOT: switch
// CHECK5: invoke void @_ZN5test83dieEv()
// CHECK5: unreachable
-// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm -fexceptions %s -o - -std=c++03 | FileCheck %s -check-prefixes=CHECK,CHECKv03
-// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm -fexceptions %s -o - -std=c++11 | FileCheck %s -check-prefixes=CHECK,CHECKv11
-// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm %s -o - -std=c++03 | FileCheck -check-prefix CHECK-NOEXC %s
-// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm %s -o - -std=c++11 | FileCheck -check-prefix CHECK-NOEXC %s
+// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm -fexceptions %s -o - |FileCheck %s
+// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm %s -o - |FileCheck -check-prefix CHECK-NOEXC %s
// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm \
-// RUN: -momit-leaf-frame-pointer -mdisable-fp-elim %s -o - -std=c++03 \
-// RUN: | FileCheck -check-prefix CHECK-FP %s
-// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm \
-// RUN: -momit-leaf-frame-pointer -mdisable-fp-elim %s -o - -std=c++11 \
+// RUN: -momit-leaf-frame-pointer -mdisable-fp-elim %s -o - \
// RUN: | FileCheck -check-prefix CHECK-FP %s
struct A {
const B &b2 = B();
const int b3 = B().n;
- // CHECKv03-NOT: @_ZN5test7L2c1E
- // CHECKv11: @_ZN5test7L2c1E
+ // CHECK-NOT: @_ZN5test7L2c1E
// CHECK: @_ZN5test7L2c2E
// CHECK-NOT: @_ZN5test7L2c3E
// CHECK: @_ZN5test7L2c4E
// 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 -std=c++03 -o - %s | FileCheck --check-prefixes=CHECK-EH,CHECK-EH-03 %s
-// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -O1 -fcxx-exceptions -fexceptions -std=c++11 -o - %s | FileCheck --check-prefixes=CHECK-EH,CHECK-EH-11 %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 {
// -> %eh.cleanup
// %lpad1: landing pad for return copy ctors, EH cleanup for 'y'
- // CHECK-EH-03: invoke {{.*}} @_ZN1XD1Ev
+ // CHECK-EH: invoke {{.*}} @_ZN1XD1Ev
// -> %eh.cleanup, %terminate.lpad
- // CHECK-EH-11: call {{.*}} @_ZN1XD1Ev
// %if.end: returning 'y'
// CHECK-EH: invoke {{.*}} @_ZN1XC1ERKS_
// -> %cleanup, %lpad1
// %cleanup: normal cleanup for 'y'
- // CHECK-EH-03: invoke {{.*}} @_ZN1XD1Ev
+ // CHECK-EH: invoke {{.*}} @_ZN1XD1Ev
// -> %invoke.cont11, %lpad
- // CHECK-EH-11: call {{.*}} @_ZN1XD1Ev
// %invoke.cont11: normal cleanup for 'x'
// CHECK-EH: call void @llvm.lifetime.end
// CHECK-EH-NEXT: ret void
// %eh.cleanup: EH cleanup for 'x'
- // CHECK-EH-03: invoke {{.*}} @_ZN1XD1Ev
+ // CHECK-EH: invoke {{.*}} @_ZN1XD1Ev
// -> %invoke.cont17, %terminate.lpad
- // CHECK-EH-11: call {{.*}} @_ZN1XD1Ev
// %invoke.cont17: rethrow block for %eh.cleanup.
// This really should be elsewhere in the function.
// CHECK-EH: resume { i8*, i32 }
// %terminate.lpad: terminate landing pad.
- // CHECK-EH-03: [[T0:%.*]] = landingpad { i8*, i32 }
- // CHECK-EH-03-NEXT: catch i8* null
- // CHECK-EH-03-NEXT: [[T1:%.*]] = extractvalue { i8*, i32 } [[T0]], 0
- // CHECK-EH-03-NEXT: call void @__clang_call_terminate(i8* [[T1]]) [[NR_NUW:#[0-9]+]]
- // CHECK-EH-03-NEXT: unreachable
+ // CHECK-EH: [[T0:%.*]] = landingpad { i8*, i32 }
+ // CHECK-EH-NEXT: catch i8* null
+ // CHECK-EH-NEXT: [[T1:%.*]] = extractvalue { i8*, i32 } [[T0]], 0
+ // CHECK-EH-NEXT: call void @__clang_call_terminate(i8* [[T1]]) [[NR_NUW:#[0-9]+]]
+ // CHECK-EH-NEXT: unreachable
}
// CHECK-LABEL: define linkonce_odr void @_ZN1YIiE1fEv
// CHECK: tail call {{.*}} @_ZN1YIiEC1Ev
-// CHECK-EH-03: attributes [[NR_NUW]] = { noreturn nounwind }
+// CHECK-EH: attributes [[NR_NUW]] = { noreturn nounwind }
-// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions -std=c++03 | FileCheck %s -check-prefixes=CHECK,CHECKv03
-// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions -std=c++11 | FileCheck %s -check-prefixes=CHECK,CHECKv11
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions | FileCheck %s
// Test IR generation for partial destruction of aggregates.
// CHECK-NEXT: br label
// CHECK: [[ED_AFTER:%.*]] = phi [[A]]* [ [[ED_END]], {{%.*}} ], [ [[ED_CUR:%.*]], {{%.*}} ]
// CHECK-NEXT: [[ED_CUR]] = getelementptr inbounds [[A]], [[A]]* [[ED_AFTER]], i64 -1
- // CHECKv03-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[ED_CUR]])
- // CHECKv11-NEXT: call void @_ZN5test01AD1Ev([[A]]* [[ED_CUR]])
+ // CHECK-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[ED_CUR]])
// CHECK: [[T0:%.*]] = icmp eq [[A]]* [[ED_CUR]], [[ED_BEGIN]]
// CHECK-NEXT: br i1 [[T0]],
// CHECK: ret void
// CHECK-NEXT: br i1 [[T0]],
// CHECK: [[E_AFTER:%.*]] = phi [[A]]* [ [[PARTIAL_END]], {{%.*}} ], [ [[E_CUR:%.*]], {{%.*}} ]
// CHECK-NEXT: [[E_CUR]] = getelementptr inbounds [[A]], [[A]]* [[E_AFTER]], i64 -1
- // CHECKv03-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[E_CUR]])
- // CHECKv11-NEXT: call void @_ZN5test01AD1Ev([[A]]* [[E_CUR]])
+ // CHECK-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[E_CUR]])
// CHECK: [[T0:%.*]] = icmp eq [[A]]* [[E_CUR]], [[E_BEGIN]]
// CHECK-NEXT: br i1 [[T0]],
// FIXME: There's some really bad block ordering here which causes
// the partial destroy for the primary normal destructor to fall
// within the primary EH destructor.
- // CHECKv03: landingpad { i8*, i32 }
- // CHECKv03-NEXT: cleanup
- // CHECKv03: [[T0:%.*]] = icmp eq [[A]]* [[ED_BEGIN]], [[ED_CUR]]
- // CHECKv03-NEXT: br i1 [[T0]]
- // CHECKv03: [[EDD_AFTER:%.*]] = phi [[A]]* [ [[ED_CUR]], {{%.*}} ], [ [[EDD_CUR:%.*]], {{%.*}} ]
- // CHECKv03-NEXT: [[EDD_CUR]] = getelementptr inbounds [[A]], [[A]]* [[EDD_AFTER]], i64 -1
- // CHECKv03-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[EDD_CUR]])
- // CHECKv03: [[T0:%.*]] = icmp eq [[A]]* [[EDD_CUR]], [[ED_BEGIN]]
- // CHECKv03-NEXT: br i1 [[T0]]
+ // CHECK: landingpad { i8*, i32 }
+ // CHECK-NEXT: cleanup
+ // CHECK: [[T0:%.*]] = icmp eq [[A]]* [[ED_BEGIN]], [[ED_CUR]]
+ // CHECK-NEXT: br i1 [[T0]]
+ // CHECK: [[EDD_AFTER:%.*]] = phi [[A]]* [ [[ED_CUR]], {{%.*}} ], [ [[EDD_CUR:%.*]], {{%.*}} ]
+ // CHECK-NEXT: [[EDD_CUR]] = getelementptr inbounds [[A]], [[A]]* [[EDD_AFTER]], i64 -1
+ // CHECK-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[EDD_CUR]])
+ // CHECK: [[T0:%.*]] = icmp eq [[A]]* [[EDD_CUR]], [[ED_BEGIN]]
+ // CHECK-NEXT: br i1 [[T0]]
// Back to the primary EH destructor.
// CHECK: [[E_AFTER:%.*]] = phi [[A]]* [ [[E_END]], {{%.*}} ], [ [[E_CUR:%.*]], {{%.*}} ]
// CHECK-NEXT: [[E_CUR]] = getelementptr inbounds [[A]], [[A]]* [[E_AFTER]], i64 -1
- // CHECKv03-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[E_CUR]])
- // CHECKv11-NEXT: call void @_ZN5test01AD1Ev([[A]]* [[E_CUR]])
+ // CHECK-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[E_CUR]])
// CHECK: [[T0:%.*]] = icmp eq [[A]]* [[E_CUR]], [[E0]]
// CHECK-NEXT: br i1 [[T0]],
// CHECK-NEXT: cleanup
// CHECK: landingpad { i8*, i32 }
// CHECK-NEXT: cleanup
- // CHECKv03: invoke void @_ZN5test11AD1Ev([[A]]* [[Y]])
- // CHECKv03: invoke void @_ZN5test11AD1Ev([[A]]* [[X]])
- // CHECKv11: call void @_ZN5test11AD1Ev([[A]]* [[Y]])
- // CHECKv11: call void @_ZN5test11AD1Ev([[A]]* [[X]])
+ // CHECK: invoke void @_ZN5test11AD1Ev([[A]]* [[Y]])
+ // CHECK: invoke void @_ZN5test11AD1Ev([[A]]* [[X]])
}
namespace test2 {
// CHECK-NEXT: br i1 [[EMPTY]],
// CHECK: [[PAST:%.*]] = phi [[A]]* [ [[CUR]], {{%.*}} ], [ [[DEL:%.*]], {{%.*}} ]
// CHECK-NEXT: [[DEL]] = getelementptr inbounds [[A]], [[A]]* [[PAST]], i64 -1
- // CHECKv03-NEXT: invoke void @_ZN5test21AD1Ev([[A]]* [[DEL]])
- // CHECKv11-NEXT: call void @_ZN5test21AD1Ev([[A]]* [[DEL]])
+ // CHECK-NEXT: invoke void @_ZN5test21AD1Ev([[A]]* [[DEL]])
// CHECK: [[T0:%.*]] = icmp eq [[A]]* [[DEL]], [[BEGIN]]
// CHECK-NEXT: br i1 [[T0]],
}
-// RUN: %clang_cc1 -triple armv7l-unknown-linux-gnueabihf -emit-llvm -O1 -disable-llvm-optzns -S -std=c++03 %s -o - | FileCheck %s
+// RUN: %clang -S -target armv7l-unknown-linux-gnueabihf -emit-llvm -O1 -mllvm -disable-llvm-optzns -S %s -o - | FileCheck %s
// This test should not to generate llvm.lifetime.start/llvm.lifetime.end for
// f function because all temporary objects in this function are used for the
-// RUN: %clang_cc1 -pedantic -Wall -Wno-comment -verify -fcxx-exceptions -x c++ -std=c++98 %s
-// RUN: cp %s %t-98
-// RUN: not %clang_cc1 -pedantic -Wall -Wno-comment -fcxx-exceptions -fixit -x c++ -std=c++98 %t-98
-// RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -Wno-comment -fcxx-exceptions -x c++ -std=c++98 %t-98
+// RUN: %clang_cc1 -pedantic -Wall -Wno-comment -verify -fcxx-exceptions -x c++ %s
// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -x c++ -std=c++11 %s 2>&1 | FileCheck %s
-// RUN: %clang_cc1 -pedantic -Wall -Wno-comment -verify -fcxx-exceptions -x c++ -std=c++11 %s
-// RUN: cp %s %t-11
-// RUN: not %clang_cc1 -pedantic -Wall -Wno-comment -fcxx-exceptions -fixit -x c++ -std=c++11 %t-11
-// RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -Wno-comment -fcxx-exceptions -x c++ -std=c++11 %t-11
+// RUN: cp %s %t
+// RUN: not %clang_cc1 -pedantic -Wall -Wno-comment -fcxx-exceptions -fixit -x c++ %t
+// RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -Wno-comment -fcxx-exceptions -x c++ %t
/* This is a test of the various code modification hints that are
provided as part of warning or extension diagnostics. All of the
template<int Value> struct CT { template<typename> struct Inner; }; // expected-note{{previous use is here}}
-// In C++11 this gets 'expected unqualified-id' which fixit can't fix.
-#if __cplusplus < 201103L
CT<10 >> 2> ct; // expected-warning{{require parentheses}}
-#endif
class C3 {
public:
};
class B : public A {
-#if __cplusplus >= 201103L
- A::foo; // expected-error{{ISO C++11 does not allow access declarations}}
-#else
A::foo; // expected-warning{{access declarations are deprecated}}
-#endif
};
void f() throw(); // expected-note{{previous}}
void (*p)() = &t<int>;
(void)(&t<int>==p); // expected-error {{use '> ='}}
(void)(&t<int>>=p); // expected-error {{use '> >'}}
-#if __cplusplus < 201103L
(void)(&t<S<int>>>=p); // expected-error {{use '> >'}}
(Shr)&t<S<int>>>>=p; // expected-error {{use '> >'}}
-#endif
// FIXME: We correct this to '&t<int> > >= p;' not '&t<int> >>= p;'
//(Shr)&t<int>>>=p;
// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++98
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++11
void foo() {
}
-#if __cplusplus >= 201103L
-// expected-note@+2 4 {{declared here}}
-#endif
bool foobool(int argc) {
return argc;
}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp teams distribute', but found only 1}}
-#if __cplusplus >= 201103L
-// expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used}}
-#endif
// expected-error@+4 2 {{directive '#pragma omp teams distribute' cannot contain more than one 'collapse' clause}}
// expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
-#if __cplusplus >= 201103L
-// expected-error@+5 2 {{integral constant expression must have integral or unscoped enumeration type}}
-#else
-// expected-error@+3 2 {{expression is not an integral constant expression}}
-#endif
+// expected-error@+2 2 {{expression is not an integral constant expression}}
#pragma omp target
#pragma omp teams distribute collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++)
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp teams distribute', but found only 1}}
-#if __cplusplus >= 201103L
-// expected-note@+3 {{non-constexpr function 'foobool' cannot be used}}
-#endif
#pragma omp target
#pragma omp teams distribute collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
-#if __cplusplus >= 201103L
-// expected-note@+6 {{non-constexpr function 'foobool' cannot be used}}
-#endif
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+3 2 {{directive '#pragma omp teams distribute' cannot contain more than one 'collapse' clause}}
// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
-#if __cplusplus >= 201103L
-// expected-error@+5 {{integral constant expression must have integral or unscoped enumeration type}}
-#else
-// expected-error@+3 {{expression is not an integral constant expression}}
-#endif
+// expected-error@+2 {{expression is not an integral constant expression}}
#pragma omp target
#pragma omp teams distribute collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++)
// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++98
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++11
void foo() {
}
-#if __cplusplus >= 201103L
-// expected-note@+2 4 {{declared here}}
-#endif
bool foobool(int argc) {
return argc;
}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp teams distribute parallel for', but found only 1}}
-#if __cplusplus >= 201103L
-// expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used}}
-#endif
// expected-error@+4 2 {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'collapse' clause}}
// expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
-#if __cplusplus >= 201103L
-// expected-error@+5 2 {{integral constant expression must have integral or unscoped enumeration type}}
-#else
-// expected-error@+3 2 {{expression is not an integral constant expression}}
-#endif
+// expected-error@+2 2 {{expression is not an integral constant expression}}
#pragma omp target
#pragma omp teams distribute parallel for collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++)
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp teams distribute parallel for', but found only 1}}
-#if __cplusplus >= 201103L
-// expected-note@+3 {{non-constexpr function 'foobool' cannot be used}}
-#endif
#pragma omp target
#pragma omp teams distribute parallel for collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
-#if __cplusplus >= 201103L
-// expected-note@+6 {{non-constexpr function 'foobool' cannot be used}}
-#endif
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+3 2 {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'collapse' clause}}
// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
-#if __cplusplus >= 201103L
-// expected-error@+5 {{integral constant expression must have integral or unscoped enumeration type}}
-#else
-// expected-error@+3 {{expression is not an integral constant expression}}
-#endif
+// expected-error@+2 {{expression is not an integral constant expression}}
#pragma omp target
#pragma omp teams distribute parallel for collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++)
// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++98
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++11
void foo() {
}
-#if __cplusplus >= 201103L
-// expected-note@+2 4 {{declared here}}
-#endif
bool foobool(int argc) {
return argc;
}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp teams distribute parallel for simd', but found only 1}}
-#if __cplusplus >= 201103L
-// expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used}}
-#endif
// expected-error@+4 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'collapse' clause}}
// expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
-#if __cplusplus >= 201103L
-// expected-error@+5 2 {{integral constant expression must have integral or unscoped enumeration type}}
-#else
-// expected-error@+3 2 {{expression is not an integral constant expression}}
-#endif
+// expected-error@+2 2 {{expression is not an integral constant expression}}
#pragma omp target
#pragma omp teams distribute parallel for simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++)
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp teams distribute parallel for simd', but found only 1}}
-#if __cplusplus >= 201103L
-// expected-note@+3 {{non-constexpr function 'foobool' cannot be used}}
-#endif
#pragma omp target
#pragma omp teams distribute parallel for simd collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
-#if __cplusplus >= 201103L
-// expected-note@+6 {{non-constexpr function 'foobool' cannot be used}}
-#endif
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+3 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'collapse' clause}}
// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
-#if __cplusplus >= 201103L
-// expected-error@+5 {{integral constant expression must have integral or unscoped enumeration type}}
-#else
-// expected-error@+3 {{expression is not an integral constant expression}}
-#endif
+// expected-error@+2 {{expression is not an integral constant expression}}
#pragma omp target
#pragma omp teams distribute parallel for simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++)
// RUN: %clang_cc1 -verify %s
-// RUN: %clang_cc1 -verify %s -std=c++98
-// RUN: %clang_cc1 -verify %s -std=c++11
// PR25946
// We had an off-by-one error in an assertion when annotating A<int> below. Our
// expected-error@+1 {{expected '{' after base class list}}
template <typename T> class B : T // not ',' or '{'
-#if __cplusplus < 201103L
-// expected-error@+4 {{expected ';' after top level declarator}}
-#endif
-// expected-error@+2 {{C++ requires a type specifier for all declarations}}
+// expected-error@+3 {{C++ requires a type specifier for all declarations}}
+// expected-error@+2 {{expected ';' after top level declarator}}
// expected-error@+1 {{expected ';' after class}}
A<int> {
};
-// RUN: %clang_cc1 -fsyntax-only -verify %s
-// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++98
-// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
-
-#if __cplusplus >= 201103L
-// expected-note@+3 2 {{candidate constructor}}
-// expected-note@+2 {{passing argument to parameter here}}
-#endif
+// RUN: %clang_cc1 -fsyntax-only -verify %s
struct A {
};
};
struct ConvertibleToConstA {
-#if __cplusplus >= 201103L
-// expected-note@+2 {{candidate function}}
-#endif
operator const A();
};
na = a;
na = constA;
na = convertibleToA;
-#if __cplusplus >= 201103L
-// expected-error@+2 {{no viable conversion}}
-#endif
na = convertibleToConstA;
na += a; // expected-error{{no viable overloaded '+='}}