forked from OSchip/llvm-project
parent
514e743b06
commit
086c90b24a
|
@ -1570,6 +1570,8 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
|
||||||
break;
|
break;
|
||||||
case IK_CXX:
|
case IK_CXX:
|
||||||
case IK_PreprocessedCXX:
|
case IK_PreprocessedCXX:
|
||||||
|
LangStd = LangStandard::lang_gnucxx11; // PTR
|
||||||
|
break;
|
||||||
case IK_ObjCXX:
|
case IK_ObjCXX:
|
||||||
case IK_PreprocessedObjCXX:
|
case IK_PreprocessedObjCXX:
|
||||||
LangStd = LangStandard::lang_gnucxx98;
|
LangStd = LangStandard::lang_gnucxx98;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
// 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 | FileCheck %s
|
||||||
// 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
|
|
||||||
|
|
||||||
// This isn't really testing anything ARM-specific; it's just a convenient
|
// This isn't really testing anything ARM-specific; it's just a convenient
|
||||||
// 32-bit platform.
|
// 32-bit platform.
|
||||||
|
@ -49,8 +48,7 @@ typedef struct {
|
||||||
TEST(struct_1);
|
TEST(struct_1);
|
||||||
// CHECK-LABEL: define {{.*}} @return_struct_1()
|
// CHECK-LABEL: define {{.*}} @return_struct_1()
|
||||||
// CHECK: [[RET:%.*]] = alloca [[REC:%.*]], align 4
|
// CHECK: [[RET:%.*]] = alloca [[REC:%.*]], align 4
|
||||||
// CHECKv03: @llvm.memset
|
// CHECK: @llvm.memset
|
||||||
// CHECKv11: @llvm.memcpy
|
|
||||||
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[RET]] to [[AGG:{ i32, \[2 x i8\], i8, \[1 x i8\], float, float }]]*
|
// 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: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
|
||||||
// CHECK: [[FIRST:%.*]] = load i32, i32* [[T0]], align 4
|
// CHECK: [[FIRST:%.*]] = load i32, i32* [[T0]], align 4
|
||||||
|
|
|
@ -1,15 +1,10 @@
|
||||||
// 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=CHECK1 --input-file=%t %s
|
||||||
// RUN: FileCheck --check-prefix=CHECK2 --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-prefix=CHECK3 --input-file=%t %s
|
||||||
// RUN: FileCheck --check-prefixes=CHECK4,CHECK4v03 --input-file=%t %s
|
// RUN: FileCheck --check-prefix=CHECK4 --input-file=%t %s
|
||||||
// RUN: FileCheck --check-prefixes=CHECK5,CHECK5v03 --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 - -mconstructor-aliases -fcxx-exceptions -fexceptions -O1 -disable-llvm-optzns -std=c++11 > %t2
|
// 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=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=CHECK6 --input-file=%t2 %s
|
||||||
// REQUIRES: asserts
|
// REQUIRES: asserts
|
||||||
|
|
||||||
|
@ -103,12 +98,6 @@ namespace test0 {
|
||||||
// CHECK2: invoke void @_ZN5test04BaseD2Ev
|
// CHECK2: invoke void @_ZN5test04BaseD2Ev
|
||||||
// CHECK2: unwind label [[BASE_UNWIND:%[a-zA-Z0-9.]+]]
|
// 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 {
|
struct B : Base, virtual VBase {
|
||||||
Member M;
|
Member M;
|
||||||
~B();
|
~B();
|
||||||
|
@ -122,10 +111,6 @@ namespace test0 {
|
||||||
// CHECK2: invoke void @_ZN5test04BaseD2Ev
|
// CHECK2: invoke void @_ZN5test04BaseD2Ev
|
||||||
// CHECK2: unwind label [[BASE_UNWIND:%[a-zA-Z0-9.]+]]
|
// 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-LABEL: define void @_ZN5test01BD1Ev(%"struct.test0::B"* %this) unnamed_addr
|
||||||
// CHECK2: invoke void @_ZN5test06MemberD1Ev
|
// CHECK2: invoke void @_ZN5test06MemberD1Ev
|
||||||
// CHECK2: unwind label [[MEM_UNWIND:%[a-zA-Z0-9.]+]]
|
// CHECK2: unwind label [[MEM_UNWIND:%[a-zA-Z0-9.]+]]
|
||||||
|
@ -133,11 +118,6 @@ namespace test0 {
|
||||||
// CHECK2: unwind label [[BASE_UNWIND:%[a-zA-Z0-9.]+]]
|
// CHECK2: unwind label [[BASE_UNWIND:%[a-zA-Z0-9.]+]]
|
||||||
// CHECK2: invoke void @_ZN5test05VBaseD2Ev
|
// CHECK2: invoke void @_ZN5test05VBaseD2Ev
|
||||||
// CHECK2: unwind label [[VBASE_UNWIND:%[a-zA-Z0-9.]+]]
|
// 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.
|
// Test base-class aliasing.
|
||||||
|
@ -209,22 +189,19 @@ namespace test3 {
|
||||||
}
|
}
|
||||||
|
|
||||||
// CHECK4-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD2Ev(%"struct.test3::(anonymous namespace)::C"* %this) unnamed_addr
|
// CHECK4-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD2Ev(%"struct.test3::(anonymous namespace)::C"* %this) unnamed_addr
|
||||||
// CHECK4v03: invoke void @_ZN5test31BD2Ev(
|
// CHECK4: invoke void @_ZN5test31BD2Ev(
|
||||||
// CHECK4v11: call void @_ZN5test31BD2Ev(
|
|
||||||
// CHECK4: call void @_ZN5test31AD2Ev(
|
// CHECK4: call void @_ZN5test31AD2Ev(
|
||||||
// CHECK4: ret void
|
// CHECK4: ret void
|
||||||
|
|
||||||
// CHECK4-LABEL: define internal void @_ZN5test312_GLOBAL__N_11DD0Ev(%"struct.test3::(anonymous namespace)::D"* %this) unnamed_addr
|
// 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*)
|
// CHECK4-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
|
||||||
// CHECK4v03: invoke void {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
|
// CHECK4: invoke void {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
|
||||||
// CHECK4v11: call void {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
|
|
||||||
// CHECK4: call void @_ZdlPv({{.*}}) [[NUW:#[0-9]+]]
|
// CHECK4: call void @_ZdlPv({{.*}}) [[NUW:#[0-9]+]]
|
||||||
// CHECK4: ret void
|
// CHECK4: ret void
|
||||||
// CHECK4v03: landingpad { i8*, i32 }
|
// CHECK4: landingpad { i8*, i32 }
|
||||||
// CHECK4v03-NEXT: cleanup
|
// CHECK4-NEXT: cleanup
|
||||||
// CHECK4v03: call void @_ZdlPv({{.*}}) [[NUW]]
|
// CHECK4: call void @_ZdlPv({{.*}}) [[NUW]]
|
||||||
// CHECK4v03: resume { i8*, i32 }
|
// CHECK4: resume { i8*, i32 }
|
||||||
// CHECK4v11-NOT: landingpad
|
|
||||||
|
|
||||||
// CHECK4-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11DD1Ev(
|
// CHECK4-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11DD1Ev(
|
||||||
// CHECK4: getelementptr inbounds i8, i8* {{.*}}, i64 -8
|
// CHECK4: getelementptr inbounds i8, i8* {{.*}}, i64 -8
|
||||||
|
@ -237,15 +214,14 @@ namespace test3 {
|
||||||
// CHECK4: ret void
|
// CHECK4: ret void
|
||||||
|
|
||||||
// CHECK4-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD0Ev(%"struct.test3::(anonymous namespace)::C"* %this) unnamed_addr
|
// 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*)
|
// CHECK4-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
|
||||||
// CHECK4v03: invoke void @_ZN5test312_GLOBAL__N_11CD2Ev(
|
// CHECK4: invoke void @_ZN5test312_GLOBAL__N_11CD2Ev(
|
||||||
// CHECK4v11: call void @_ZN5test312_GLOBAL__N_11CD2Ev(
|
|
||||||
// CHECK4: call void @_ZdlPv({{.*}}) [[NUW]]
|
// CHECK4: call void @_ZdlPv({{.*}}) [[NUW]]
|
||||||
// CHECK4: ret void
|
// CHECK4: ret void
|
||||||
// CHECK4v03: landingpad { i8*, i32 }
|
// CHECK4: landingpad { i8*, i32 }
|
||||||
// CHECK4v03-NEXT: cleanup
|
// CHECK4-NEXT: cleanup
|
||||||
// CHECK4v03: call void @_ZdlPv({{.*}}) [[NUW]]
|
// CHECK4: call void @_ZdlPv({{.*}}) [[NUW]]
|
||||||
// CHECK4v03: resume { i8*, i32 }
|
// CHECK4: resume { i8*, i32 }
|
||||||
|
|
||||||
// CHECK4-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11CD1Ev(
|
// CHECK4-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11CD1Ev(
|
||||||
// CHECK4: getelementptr inbounds i8, i8* {{.*}}, i64 -8
|
// CHECK4: getelementptr inbounds i8, i8* {{.*}}, i64 -8
|
||||||
|
@ -306,8 +282,8 @@ namespace test5 {
|
||||||
|
|
||||||
// CHECK5-LABEL: define void @_ZN5test53fooEv()
|
// CHECK5-LABEL: define void @_ZN5test53fooEv()
|
||||||
// CHECK5: [[ELEMS:%.*]] = alloca [5 x [[A:%.*]]], align
|
// CHECK5: [[ELEMS:%.*]] = alloca [5 x [[A:%.*]]], align
|
||||||
// CHECK5v03-NEXT: [[EXN:%.*]] = alloca i8*
|
// CHECK5-NEXT: [[EXN:%.*]] = alloca i8*
|
||||||
// CHECK5v03-NEXT: [[SEL:%.*]] = alloca i32
|
// CHECK5-NEXT: [[SEL:%.*]] = alloca i32
|
||||||
// CHECK5-NEXT: [[PELEMS:%.*]] = bitcast [5 x [[A]]]* [[ELEMS]] to i8*
|
// CHECK5-NEXT: [[PELEMS:%.*]] = bitcast [5 x [[A]]]* [[ELEMS]] to i8*
|
||||||
// CHECK5-NEXT: call void @llvm.lifetime.start(i64 5, i8* [[PELEMS]])
|
// 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: [[BEGIN:%.*]] = getelementptr inbounds [5 x [[A]]], [5 x [[A]]]* [[ELEMS]], i32 0, i32 0
|
||||||
|
@ -315,22 +291,19 @@ namespace test5 {
|
||||||
// CHECK5-NEXT: br label
|
// CHECK5-NEXT: br label
|
||||||
// CHECK5: [[POST:%.*]] = phi [[A]]* [ [[END]], {{%.*}} ], [ [[ELT:%.*]], {{%.*}} ]
|
// CHECK5: [[POST:%.*]] = phi [[A]]* [ [[END]], {{%.*}} ], [ [[ELT:%.*]], {{%.*}} ]
|
||||||
// CHECK5-NEXT: [[ELT]] = getelementptr inbounds [[A]], [[A]]* [[POST]], i64 -1
|
// CHECK5-NEXT: [[ELT]] = getelementptr inbounds [[A]], [[A]]* [[POST]], i64 -1
|
||||||
// CHECK5v03-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[ELT]])
|
// CHECK5-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[ELT]])
|
||||||
// CHECK5v11-NEXT: call void @_ZN5test51AD1Ev([[A]]* [[ELT]])
|
|
||||||
// CHECK5: [[T0:%.*]] = icmp eq [[A]]* [[ELT]], [[BEGIN]]
|
// CHECK5: [[T0:%.*]] = icmp eq [[A]]* [[ELT]], [[BEGIN]]
|
||||||
// CHECK5-NEXT: br i1 [[T0]],
|
// CHECK5-NEXT: br i1 [[T0]],
|
||||||
// CHECK5: call void @llvm.lifetime.end
|
// CHECK5: call void @llvm.lifetime.end
|
||||||
// CHECK5-NEXT: ret void
|
// CHECK5-NEXT: ret void
|
||||||
// lpad
|
// lpad
|
||||||
// CHECK5v03: [[EMPTY:%.*]] = icmp eq [[A]]* [[BEGIN]], [[ELT]]
|
// CHECK5: [[EMPTY:%.*]] = icmp eq [[A]]* [[BEGIN]], [[ELT]]
|
||||||
// CHECK5v03-NEXT: br i1 [[EMPTY]]
|
// CHECK5-NEXT: br i1 [[EMPTY]]
|
||||||
// CHECK5v03: [[AFTER:%.*]] = phi [[A]]* [ [[ELT]], {{%.*}} ], [ [[CUR:%.*]], {{%.*}} ]
|
// CHECK5: [[AFTER:%.*]] = phi [[A]]* [ [[ELT]], {{%.*}} ], [ [[CUR:%.*]], {{%.*}} ]
|
||||||
// CHECK5v03-NEXT: [[CUR:%.*]] = getelementptr inbounds [[A]], [[A]]* [[AFTER]], i64 -1
|
// CHECK5-NEXT: [[CUR:%.*]] = getelementptr inbounds [[A]], [[A]]* [[AFTER]], i64 -1
|
||||||
// CHECK5v03-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[CUR]])
|
// CHECK5-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[CUR]])
|
||||||
// CHECK5v03: [[DONE:%.*]] = icmp eq [[A]]* [[CUR]], [[BEGIN]]
|
// CHECK5: [[DONE:%.*]] = icmp eq [[A]]* [[CUR]], [[BEGIN]]
|
||||||
// CHECK5v03-NEXT: br i1 [[DONE]],
|
// CHECK5-NEXT: br i1 [[DONE]],
|
||||||
// CHECK5v11-NOT: landingpad
|
|
||||||
// CHECK5v11: }
|
|
||||||
void foo() {
|
void foo() {
|
||||||
A elems[5];
|
A elems[5];
|
||||||
}
|
}
|
||||||
|
@ -361,34 +334,25 @@ namespace test6 {
|
||||||
C::~C() { opaque(); }
|
C::~C() { opaque(); }
|
||||||
// CHECK5-LABEL: define void @_ZN5test61CD2Ev(%"struct.test6::C"* %this, i8** %vtt) unnamed_addr
|
// CHECK5-LABEL: define void @_ZN5test61CD2Ev(%"struct.test6::C"* %this, i8** %vtt) unnamed_addr
|
||||||
// CHECK5: invoke void @_ZN5test66opaqueEv
|
// CHECK5: invoke void @_ZN5test66opaqueEv
|
||||||
// CHECK5v03: invoke void @_ZN5test61AD1Ev
|
// CHECK5: invoke void @_ZN5test61AD1Ev
|
||||||
// CHECK5v03: invoke void @_ZN5test61AD1Ev
|
// CHECK5: invoke void @_ZN5test61AD1Ev
|
||||||
// CHECK5v03: invoke void @_ZN5test61AD1Ev
|
// CHECK5: invoke void @_ZN5test61AD1Ev
|
||||||
// CHECK5v03: invoke void @_ZN5test61BILj1EED2Ev
|
// CHECK5: invoke void @_ZN5test61BILj1EED2Ev
|
||||||
// CHECK5v11: call void @_ZN5test61AD1Ev
|
|
||||||
// CHECK5v11: call void @_ZN5test61AD1Ev
|
|
||||||
// CHECK5v11: call void @_ZN5test61AD1Ev
|
|
||||||
// CHECK5v11: call void @_ZN5test61BILj1EED2Ev
|
|
||||||
// CHECK5: call void @_ZN5test61BILj0EED2Ev
|
// CHECK5: call void @_ZN5test61BILj0EED2Ev
|
||||||
// CHECK5: ret void
|
// CHECK5: ret void
|
||||||
// CHECK5v03: invoke void @_ZN5test61AD1Ev
|
// CHECK5: invoke void @_ZN5test61AD1Ev
|
||||||
// CHECK5v03: invoke void @_ZN5test61AD1Ev
|
// CHECK5: invoke void @_ZN5test61AD1Ev
|
||||||
// CHECK5v03: invoke void @_ZN5test61AD1Ev
|
// CHECK5: invoke void @_ZN5test61AD1Ev
|
||||||
// CHECK5v03: invoke void @_ZN5test61BILj1EED2Ev
|
// CHECK5: invoke void @_ZN5test61BILj1EED2Ev
|
||||||
// CHECK5v03: invoke void @_ZN5test61BILj0EED2Ev
|
// CHECK5: invoke void @_ZN5test61BILj0EED2Ev
|
||||||
|
|
||||||
// CHECK5-LABEL: define void @_ZN5test61CD1Ev(%"struct.test6::C"* %this) unnamed_addr
|
// CHECK5-LABEL: define void @_ZN5test61CD1Ev(%"struct.test6::C"* %this) unnamed_addr
|
||||||
// CHECK5v03: invoke void @_ZN5test61CD2Ev
|
// CHECK5: invoke void @_ZN5test61CD2Ev
|
||||||
// CHECK5v03: invoke void @_ZN5test61BILj3EED2Ev
|
// CHECK5: invoke void @_ZN5test61BILj3EED2Ev
|
||||||
// CHECK5v03: call void @_ZN5test61BILj2EED2Ev
|
// CHECK5: call void @_ZN5test61BILj2EED2Ev
|
||||||
// CHECK5v03: ret void
|
// CHECK5: ret void
|
||||||
// CHECK5v03: invoke void @_ZN5test61BILj3EED2Ev
|
// CHECK5: invoke void @_ZN5test61BILj3EED2Ev
|
||||||
// CHECK5v03: invoke void @_ZN5test61BILj2EED2Ev
|
// CHECK5: invoke void @_ZN5test61BILj2EED2Ev
|
||||||
|
|
||||||
// CHECK5v11: call void @_ZN5test61CD2Ev
|
|
||||||
// CHECK5v11: call void @_ZN5test61BILj3EED2Ev
|
|
||||||
// CHECK5v11: call void @_ZN5test61BILj2EED2Ev
|
|
||||||
// CHECK5v11: ret void
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PR 9197
|
// PR 9197
|
||||||
|
@ -405,8 +369,7 @@ namespace test7 {
|
||||||
|
|
||||||
// Verify that this doesn't get emitted as an alias
|
// Verify that this doesn't get emitted as an alias
|
||||||
// CHECK5-LABEL: define void @_ZN5test71BD2Ev(
|
// CHECK5-LABEL: define void @_ZN5test71BD2Ev(
|
||||||
// CHECK5v03: invoke void @_ZN5test71DD1Ev(
|
// CHECK5: invoke void @_ZN5test71DD1Ev(
|
||||||
// CHECK5v11: call void @_ZN5test71DD1Ev(
|
|
||||||
// CHECK5: call void @_ZN5test71AD2Ev(
|
// CHECK5: call void @_ZN5test71AD2Ev(
|
||||||
B::~B() {}
|
B::~B() {}
|
||||||
}
|
}
|
||||||
|
@ -431,8 +394,7 @@ namespace test8 {
|
||||||
// CHECK5: call void @_ZN5test81AC1Ev([[A]]* [[X]])
|
// CHECK5: call void @_ZN5test81AC1Ev([[A]]* [[X]])
|
||||||
// CHECK5-NEXT: br label
|
// CHECK5-NEXT: br label
|
||||||
// CHECK5: invoke void @_ZN5test81AC1Ev([[A]]* [[Y]])
|
// CHECK5: invoke void @_ZN5test81AC1Ev([[A]]* [[Y]])
|
||||||
// CHECK5v03: invoke void @_ZN5test81AD1Ev([[A]]* [[Y]])
|
// CHECK5: invoke void @_ZN5test81AD1Ev([[A]]* [[Y]])
|
||||||
// CHECK5v11: call void @_ZN5test81AD1Ev([[A]]* [[Y]])
|
|
||||||
// CHECK5-NOT: switch
|
// CHECK5-NOT: switch
|
||||||
// CHECK5: invoke void @_ZN5test83dieEv()
|
// CHECK5: invoke void @_ZN5test83dieEv()
|
||||||
// CHECK5: unreachable
|
// CHECK5: unreachable
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
// 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 - |FileCheck %s
|
||||||
// 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 - |FileCheck -check-prefix CHECK-NOEXC %s
|
||||||
// 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 \
|
// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm \
|
||||||
// RUN: -momit-leaf-frame-pointer -mdisable-fp-elim %s -o - -std=c++03 \
|
// RUN: -momit-leaf-frame-pointer -mdisable-fp-elim %s -o - \
|
||||||
// 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: | FileCheck -check-prefix CHECK-FP %s
|
// RUN: | FileCheck -check-prefix CHECK-FP %s
|
||||||
|
|
||||||
struct A {
|
struct A {
|
||||||
|
@ -175,8 +170,7 @@ namespace test7 {
|
||||||
const B &b2 = B();
|
const B &b2 = B();
|
||||||
const int b3 = B().n;
|
const int b3 = B().n;
|
||||||
|
|
||||||
// CHECKv03-NOT: @_ZN5test7L2c1E
|
// CHECK-NOT: @_ZN5test7L2c1E
|
||||||
// CHECKv11: @_ZN5test7L2c1E
|
|
||||||
// CHECK: @_ZN5test7L2c2E
|
// CHECK: @_ZN5test7L2c2E
|
||||||
// CHECK-NOT: @_ZN5test7L2c3E
|
// CHECK-NOT: @_ZN5test7L2c3E
|
||||||
// CHECK: @_ZN5test7L2c4E
|
// CHECK: @_ZN5test7L2c4E
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -O1 -o - %s | FileCheck %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 -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 -o - %s | FileCheck --check-prefix=CHECK-EH %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
|
|
||||||
|
|
||||||
// Test code generation for the named return value optimization.
|
// Test code generation for the named return value optimization.
|
||||||
class X {
|
class X {
|
||||||
|
@ -92,18 +91,16 @@ X test2(bool B) {
|
||||||
// -> %eh.cleanup
|
// -> %eh.cleanup
|
||||||
|
|
||||||
// %lpad1: landing pad for return copy ctors, EH cleanup for 'y'
|
// %lpad1: landing pad for return copy ctors, EH cleanup for 'y'
|
||||||
// CHECK-EH-03: invoke {{.*}} @_ZN1XD1Ev
|
// CHECK-EH: invoke {{.*}} @_ZN1XD1Ev
|
||||||
// -> %eh.cleanup, %terminate.lpad
|
// -> %eh.cleanup, %terminate.lpad
|
||||||
// CHECK-EH-11: call {{.*}} @_ZN1XD1Ev
|
|
||||||
|
|
||||||
// %if.end: returning 'y'
|
// %if.end: returning 'y'
|
||||||
// CHECK-EH: invoke {{.*}} @_ZN1XC1ERKS_
|
// CHECK-EH: invoke {{.*}} @_ZN1XC1ERKS_
|
||||||
// -> %cleanup, %lpad1
|
// -> %cleanup, %lpad1
|
||||||
|
|
||||||
// %cleanup: normal cleanup for 'y'
|
// %cleanup: normal cleanup for 'y'
|
||||||
// CHECK-EH-03: invoke {{.*}} @_ZN1XD1Ev
|
// CHECK-EH: invoke {{.*}} @_ZN1XD1Ev
|
||||||
// -> %invoke.cont11, %lpad
|
// -> %invoke.cont11, %lpad
|
||||||
// CHECK-EH-11: call {{.*}} @_ZN1XD1Ev
|
|
||||||
|
|
||||||
// %invoke.cont11: normal cleanup for 'x'
|
// %invoke.cont11: normal cleanup for 'x'
|
||||||
// CHECK-EH: call void @llvm.lifetime.end
|
// CHECK-EH: call void @llvm.lifetime.end
|
||||||
|
@ -112,20 +109,19 @@ X test2(bool B) {
|
||||||
// CHECK-EH-NEXT: ret void
|
// CHECK-EH-NEXT: ret void
|
||||||
|
|
||||||
// %eh.cleanup: EH cleanup for 'x'
|
// %eh.cleanup: EH cleanup for 'x'
|
||||||
// CHECK-EH-03: invoke {{.*}} @_ZN1XD1Ev
|
// CHECK-EH: invoke {{.*}} @_ZN1XD1Ev
|
||||||
// -> %invoke.cont17, %terminate.lpad
|
// -> %invoke.cont17, %terminate.lpad
|
||||||
// CHECK-EH-11: call {{.*}} @_ZN1XD1Ev
|
|
||||||
|
|
||||||
// %invoke.cont17: rethrow block for %eh.cleanup.
|
// %invoke.cont17: rethrow block for %eh.cleanup.
|
||||||
// This really should be elsewhere in the function.
|
// This really should be elsewhere in the function.
|
||||||
// CHECK-EH: resume { i8*, i32 }
|
// CHECK-EH: resume { i8*, i32 }
|
||||||
|
|
||||||
// %terminate.lpad: terminate landing pad.
|
// %terminate.lpad: terminate landing pad.
|
||||||
// CHECK-EH-03: [[T0:%.*]] = landingpad { i8*, i32 }
|
// CHECK-EH: [[T0:%.*]] = landingpad { i8*, i32 }
|
||||||
// CHECK-EH-03-NEXT: catch i8* null
|
// CHECK-EH-NEXT: catch i8* null
|
||||||
// CHECK-EH-03-NEXT: [[T1:%.*]] = extractvalue { i8*, i32 } [[T0]], 0
|
// CHECK-EH-NEXT: [[T1:%.*]] = extractvalue { i8*, i32 } [[T0]], 0
|
||||||
// CHECK-EH-03-NEXT: call void @__clang_call_terminate(i8* [[T1]]) [[NR_NUW:#[0-9]+]]
|
// CHECK-EH-NEXT: call void @__clang_call_terminate(i8* [[T1]]) [[NR_NUW:#[0-9]+]]
|
||||||
// CHECK-EH-03-NEXT: unreachable
|
// CHECK-EH-NEXT: unreachable
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,4 +217,4 @@ Y<int> test9() {
|
||||||
// CHECK-LABEL: define linkonce_odr void @_ZN1YIiE1fEv
|
// CHECK-LABEL: define linkonce_odr void @_ZN1YIiE1fEv
|
||||||
// CHECK: tail call {{.*}} @_ZN1YIiEC1Ev
|
// CHECK: tail call {{.*}} @_ZN1YIiEC1Ev
|
||||||
|
|
||||||
// CHECK-EH-03: attributes [[NR_NUW]] = { noreturn nounwind }
|
// CHECK-EH: attributes [[NR_NUW]] = { noreturn nounwind }
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
// 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 | FileCheck %s
|
||||||
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions -std=c++11 | FileCheck %s -check-prefixes=CHECK,CHECKv11
|
|
||||||
|
|
||||||
// Test IR generation for partial destruction of aggregates.
|
// Test IR generation for partial destruction of aggregates.
|
||||||
|
|
||||||
|
@ -46,8 +45,7 @@ namespace test0 {
|
||||||
// CHECK-NEXT: br label
|
// CHECK-NEXT: br label
|
||||||
// CHECK: [[ED_AFTER:%.*]] = phi [[A]]* [ [[ED_END]], {{%.*}} ], [ [[ED_CUR:%.*]], {{%.*}} ]
|
// CHECK: [[ED_AFTER:%.*]] = phi [[A]]* [ [[ED_END]], {{%.*}} ], [ [[ED_CUR:%.*]], {{%.*}} ]
|
||||||
// CHECK-NEXT: [[ED_CUR]] = getelementptr inbounds [[A]], [[A]]* [[ED_AFTER]], i64 -1
|
// CHECK-NEXT: [[ED_CUR]] = getelementptr inbounds [[A]], [[A]]* [[ED_AFTER]], i64 -1
|
||||||
// CHECKv03-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[ED_CUR]])
|
// CHECK-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[ED_CUR]])
|
||||||
// CHECKv11-NEXT: call void @_ZN5test01AD1Ev([[A]]* [[ED_CUR]])
|
|
||||||
// CHECK: [[T0:%.*]] = icmp eq [[A]]* [[ED_CUR]], [[ED_BEGIN]]
|
// CHECK: [[T0:%.*]] = icmp eq [[A]]* [[ED_CUR]], [[ED_BEGIN]]
|
||||||
// CHECK-NEXT: br i1 [[T0]],
|
// CHECK-NEXT: br i1 [[T0]],
|
||||||
// CHECK: ret void
|
// CHECK: ret void
|
||||||
|
@ -60,8 +58,7 @@ namespace test0 {
|
||||||
// CHECK-NEXT: br i1 [[T0]],
|
// CHECK-NEXT: br i1 [[T0]],
|
||||||
// CHECK: [[E_AFTER:%.*]] = phi [[A]]* [ [[PARTIAL_END]], {{%.*}} ], [ [[E_CUR:%.*]], {{%.*}} ]
|
// CHECK: [[E_AFTER:%.*]] = phi [[A]]* [ [[PARTIAL_END]], {{%.*}} ], [ [[E_CUR:%.*]], {{%.*}} ]
|
||||||
// CHECK-NEXT: [[E_CUR]] = getelementptr inbounds [[A]], [[A]]* [[E_AFTER]], i64 -1
|
// CHECK-NEXT: [[E_CUR]] = getelementptr inbounds [[A]], [[A]]* [[E_AFTER]], i64 -1
|
||||||
// CHECKv03-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[E_CUR]])
|
// CHECK-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[E_CUR]])
|
||||||
// CHECKv11-NEXT: call void @_ZN5test01AD1Ev([[A]]* [[E_CUR]])
|
|
||||||
// CHECK: [[T0:%.*]] = icmp eq [[A]]* [[E_CUR]], [[E_BEGIN]]
|
// CHECK: [[T0:%.*]] = icmp eq [[A]]* [[E_CUR]], [[E_BEGIN]]
|
||||||
// CHECK-NEXT: br i1 [[T0]],
|
// CHECK-NEXT: br i1 [[T0]],
|
||||||
|
|
||||||
|
@ -76,21 +73,20 @@ namespace test0 {
|
||||||
// FIXME: There's some really bad block ordering here which causes
|
// FIXME: There's some really bad block ordering here which causes
|
||||||
// the partial destroy for the primary normal destructor to fall
|
// the partial destroy for the primary normal destructor to fall
|
||||||
// within the primary EH destructor.
|
// within the primary EH destructor.
|
||||||
// CHECKv03: landingpad { i8*, i32 }
|
// CHECK: landingpad { i8*, i32 }
|
||||||
// CHECKv03-NEXT: cleanup
|
// CHECK-NEXT: cleanup
|
||||||
// CHECKv03: [[T0:%.*]] = icmp eq [[A]]* [[ED_BEGIN]], [[ED_CUR]]
|
// CHECK: [[T0:%.*]] = icmp eq [[A]]* [[ED_BEGIN]], [[ED_CUR]]
|
||||||
// CHECKv03-NEXT: br i1 [[T0]]
|
// CHECK-NEXT: br i1 [[T0]]
|
||||||
// CHECKv03: [[EDD_AFTER:%.*]] = phi [[A]]* [ [[ED_CUR]], {{%.*}} ], [ [[EDD_CUR:%.*]], {{%.*}} ]
|
// CHECK: [[EDD_AFTER:%.*]] = phi [[A]]* [ [[ED_CUR]], {{%.*}} ], [ [[EDD_CUR:%.*]], {{%.*}} ]
|
||||||
// CHECKv03-NEXT: [[EDD_CUR]] = getelementptr inbounds [[A]], [[A]]* [[EDD_AFTER]], i64 -1
|
// CHECK-NEXT: [[EDD_CUR]] = getelementptr inbounds [[A]], [[A]]* [[EDD_AFTER]], i64 -1
|
||||||
// CHECKv03-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[EDD_CUR]])
|
// CHECK-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[EDD_CUR]])
|
||||||
// CHECKv03: [[T0:%.*]] = icmp eq [[A]]* [[EDD_CUR]], [[ED_BEGIN]]
|
// CHECK: [[T0:%.*]] = icmp eq [[A]]* [[EDD_CUR]], [[ED_BEGIN]]
|
||||||
// CHECKv03-NEXT: br i1 [[T0]]
|
// CHECK-NEXT: br i1 [[T0]]
|
||||||
|
|
||||||
// Back to the primary EH destructor.
|
// Back to the primary EH destructor.
|
||||||
// CHECK: [[E_AFTER:%.*]] = phi [[A]]* [ [[E_END]], {{%.*}} ], [ [[E_CUR:%.*]], {{%.*}} ]
|
// CHECK: [[E_AFTER:%.*]] = phi [[A]]* [ [[E_END]], {{%.*}} ], [ [[E_CUR:%.*]], {{%.*}} ]
|
||||||
// CHECK-NEXT: [[E_CUR]] = getelementptr inbounds [[A]], [[A]]* [[E_AFTER]], i64 -1
|
// CHECK-NEXT: [[E_CUR]] = getelementptr inbounds [[A]], [[A]]* [[E_AFTER]], i64 -1
|
||||||
// CHECKv03-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[E_CUR]])
|
// CHECK-NEXT: invoke void @_ZN5test01AD1Ev([[A]]* [[E_CUR]])
|
||||||
// CHECKv11-NEXT: call void @_ZN5test01AD1Ev([[A]]* [[E_CUR]])
|
|
||||||
// CHECK: [[T0:%.*]] = icmp eq [[A]]* [[E_CUR]], [[E0]]
|
// CHECK: [[T0:%.*]] = icmp eq [[A]]* [[E_CUR]], [[E0]]
|
||||||
// CHECK-NEXT: br i1 [[T0]],
|
// CHECK-NEXT: br i1 [[T0]],
|
||||||
|
|
||||||
|
@ -124,10 +120,8 @@ namespace test1 {
|
||||||
// CHECK-NEXT: cleanup
|
// CHECK-NEXT: cleanup
|
||||||
// CHECK: landingpad { i8*, i32 }
|
// CHECK: landingpad { i8*, i32 }
|
||||||
// CHECK-NEXT: cleanup
|
// CHECK-NEXT: cleanup
|
||||||
// CHECKv03: invoke void @_ZN5test11AD1Ev([[A]]* [[Y]])
|
// CHECK: invoke void @_ZN5test11AD1Ev([[A]]* [[Y]])
|
||||||
// CHECKv03: invoke void @_ZN5test11AD1Ev([[A]]* [[X]])
|
// CHECK: invoke void @_ZN5test11AD1Ev([[A]]* [[X]])
|
||||||
// CHECKv11: call void @_ZN5test11AD1Ev([[A]]* [[Y]])
|
|
||||||
// CHECKv11: call void @_ZN5test11AD1Ev([[A]]* [[X]])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace test2 {
|
namespace test2 {
|
||||||
|
@ -159,8 +153,7 @@ namespace test2 {
|
||||||
// CHECK-NEXT: br i1 [[EMPTY]],
|
// CHECK-NEXT: br i1 [[EMPTY]],
|
||||||
// CHECK: [[PAST:%.*]] = phi [[A]]* [ [[CUR]], {{%.*}} ], [ [[DEL:%.*]], {{%.*}} ]
|
// CHECK: [[PAST:%.*]] = phi [[A]]* [ [[CUR]], {{%.*}} ], [ [[DEL:%.*]], {{%.*}} ]
|
||||||
// CHECK-NEXT: [[DEL]] = getelementptr inbounds [[A]], [[A]]* [[PAST]], i64 -1
|
// CHECK-NEXT: [[DEL]] = getelementptr inbounds [[A]], [[A]]* [[PAST]], i64 -1
|
||||||
// CHECKv03-NEXT: invoke void @_ZN5test21AD1Ev([[A]]* [[DEL]])
|
// CHECK-NEXT: invoke void @_ZN5test21AD1Ev([[A]]* [[DEL]])
|
||||||
// CHECKv11-NEXT: call void @_ZN5test21AD1Ev([[A]]* [[DEL]])
|
|
||||||
// CHECK: [[T0:%.*]] = icmp eq [[A]]* [[DEL]], [[BEGIN]]
|
// CHECK: [[T0:%.*]] = icmp eq [[A]]* [[DEL]], [[BEGIN]]
|
||||||
// CHECK-NEXT: br i1 [[T0]],
|
// CHECK-NEXT: br i1 [[T0]],
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// 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
|
// 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
|
// f function because all temporary objects in this function are used for the
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
// RUN: %clang_cc1 -pedantic -Wall -Wno-comment -verify -fcxx-exceptions -x c++ -std=c++98 %s
|
// RUN: %clang_cc1 -pedantic -Wall -Wno-comment -verify -fcxx-exceptions -x c++ %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: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -x c++ -std=c++11 %s 2>&1 | FileCheck %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
|
||||||
// RUN: cp %s %t-11
|
// RUN: not %clang_cc1 -pedantic -Wall -Wno-comment -fcxx-exceptions -fixit -x c++ %t
|
||||||
// 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++ %t
|
||||||
// RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -Wno-comment -fcxx-exceptions -x c++ -std=c++11 %t-11
|
|
||||||
|
|
||||||
/* This is a test of the various code modification hints that are
|
/* This is a test of the various code modification hints that are
|
||||||
provided as part of warning or extension diagnostics. All of the
|
provided as part of warning or extension diagnostics. All of the
|
||||||
|
@ -25,10 +21,7 @@ static void C1::g() { } // expected-error{{'static' can only be specified inside
|
||||||
|
|
||||||
template<int Value> struct CT { template<typename> struct Inner; }; // expected-note{{previous use is here}}
|
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}}
|
CT<10 >> 2> ct; // expected-warning{{require parentheses}}
|
||||||
#endif
|
|
||||||
|
|
||||||
class C3 {
|
class C3 {
|
||||||
public:
|
public:
|
||||||
|
@ -48,11 +41,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
class B : public A {
|
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}}
|
A::foo; // expected-warning{{access declarations are deprecated}}
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void f() throw(); // expected-note{{previous}}
|
void f() throw(); // expected-note{{previous}}
|
||||||
|
@ -296,10 +285,8 @@ namespace greatergreater {
|
||||||
void (*p)() = &t<int>;
|
void (*p)() = &t<int>;
|
||||||
(void)(&t<int>==p); // expected-error {{use '> ='}}
|
(void)(&t<int>==p); // expected-error {{use '> ='}}
|
||||||
(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 '> >'}}
|
(void)(&t<S<int>>>=p); // expected-error {{use '> >'}}
|
||||||
(Shr)&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;'
|
// FIXME: We correct this to '&t<int> > >= p;' not '&t<int> >>= p;'
|
||||||
//(Shr)&t<int>>>=p;
|
//(Shr)&t<int>>>=p;
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
// RUN: %clang_cc1 -verify -fopenmp %s
|
// 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() {
|
void foo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
|
||||||
// expected-note@+2 4 {{declared here}}
|
|
||||||
#endif
|
|
||||||
bool foobool(int argc) {
|
bool foobool(int argc) {
|
||||||
return argc;
|
return argc;
|
||||||
}
|
}
|
||||||
|
@ -55,9 +50,6 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
|
||||||
for (int i = ST; i < N; i++)
|
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}}
|
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@+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@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
|
||||||
// expected-error@+2 2 {{expression is not an integral constant expression}}
|
// expected-error@+2 2 {{expression is not an integral constant expression}}
|
||||||
|
@ -70,11 +62,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
|
||||||
for (int i = ST; i < N; i++)
|
for (int i = ST; i < N; i++)
|
||||||
argv[0][i] = argv[0][i] - argv[0][i-ST];
|
argv[0][i] = argv[0][i] - argv[0][i-ST];
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
// expected-error@+2 2 {{expression is not an integral constant expression}}
|
||||||
// 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
|
|
||||||
#pragma omp target
|
#pragma omp target
|
||||||
#pragma omp teams distribute collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
|
#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 = ST; i < N; i++)
|
||||||
|
@ -122,17 +110,11 @@ int main(int argc, char **argv) {
|
||||||
for (int i = 4; i < 12; 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}}
|
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 target
|
||||||
#pragma omp teams distribute collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
|
#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++)
|
for (int i = 4; i < 12; i++)
|
||||||
argv[0][i] = argv[0][i] - argv[0][i-4];
|
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@+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@+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}}
|
// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
|
||||||
|
@ -146,11 +128,7 @@ int main(int argc, char **argv) {
|
||||||
for (int i = 4; i < 12; i++)
|
for (int i = 4; i < 12; i++)
|
||||||
argv[0][i] = argv[0][i] - argv[0][i-4];
|
argv[0][i] = argv[0][i] - argv[0][i-4];
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
// expected-error@+2 {{expression is not an integral constant expression}}
|
||||||
// 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
|
|
||||||
#pragma omp target
|
#pragma omp target
|
||||||
#pragma omp teams distribute collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
|
#pragma omp teams distribute collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
|
||||||
for (int i = 4; i < 12; i++)
|
for (int i = 4; i < 12; i++)
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
// RUN: %clang_cc1 -verify -fopenmp %s
|
// 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() {
|
void foo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
|
||||||
// expected-note@+2 4 {{declared here}}
|
|
||||||
#endif
|
|
||||||
bool foobool(int argc) {
|
bool foobool(int argc) {
|
||||||
return argc;
|
return argc;
|
||||||
}
|
}
|
||||||
|
@ -55,9 +50,6 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
|
||||||
for (int i = ST; i < N; i++)
|
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}}
|
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@+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@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
|
||||||
// expected-error@+2 2 {{expression is not an integral constant expression}}
|
// expected-error@+2 2 {{expression is not an integral constant expression}}
|
||||||
|
@ -70,11 +62,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
|
||||||
for (int i = ST; i < N; i++)
|
for (int i = ST; i < N; i++)
|
||||||
argv[0][i] = argv[0][i] - argv[0][i-ST];
|
argv[0][i] = argv[0][i] - argv[0][i-ST];
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
// expected-error@+2 2 {{expression is not an integral constant expression}}
|
||||||
// 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
|
|
||||||
#pragma omp target
|
#pragma omp target
|
||||||
#pragma omp teams distribute parallel for collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
|
#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 = ST; i < N; i++)
|
||||||
|
@ -122,17 +110,11 @@ int main(int argc, char **argv) {
|
||||||
for (int i = 4; i < 12; 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}}
|
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 target
|
||||||
#pragma omp teams distribute parallel for collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
|
#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++)
|
for (int i = 4; i < 12; i++)
|
||||||
argv[0][i] = argv[0][i] - argv[0][i-4];
|
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@+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@+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}}
|
// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
|
||||||
|
@ -146,11 +128,7 @@ int main(int argc, char **argv) {
|
||||||
for (int i = 4; i < 12; i++)
|
for (int i = 4; i < 12; i++)
|
||||||
argv[0][i] = argv[0][i] - argv[0][i-4];
|
argv[0][i] = argv[0][i] - argv[0][i-4];
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
// expected-error@+2 {{expression is not an integral constant expression}}
|
||||||
// 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
|
|
||||||
#pragma omp target
|
#pragma omp target
|
||||||
#pragma omp teams distribute parallel for collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
|
#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++)
|
for (int i = 4; i < 12; i++)
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
// RUN: %clang_cc1 -verify -fopenmp %s
|
// 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() {
|
void foo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
|
||||||
// expected-note@+2 4 {{declared here}}
|
|
||||||
#endif
|
|
||||||
bool foobool(int argc) {
|
bool foobool(int argc) {
|
||||||
return argc;
|
return argc;
|
||||||
}
|
}
|
||||||
|
@ -55,9 +50,6 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
|
||||||
for (int i = ST; i < N; i++)
|
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}}
|
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@+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@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
|
||||||
// expected-error@+2 2 {{expression is not an integral constant expression}}
|
// expected-error@+2 2 {{expression is not an integral constant expression}}
|
||||||
|
@ -70,11 +62,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
|
||||||
for (int i = ST; i < N; i++)
|
for (int i = ST; i < N; i++)
|
||||||
argv[0][i] = argv[0][i] - argv[0][i-ST];
|
argv[0][i] = argv[0][i] - argv[0][i-ST];
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
// expected-error@+2 2 {{expression is not an integral constant expression}}
|
||||||
// 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
|
|
||||||
#pragma omp target
|
#pragma omp target
|
||||||
#pragma omp teams distribute parallel for simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
|
#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 = ST; i < N; i++)
|
||||||
|
@ -122,17 +110,11 @@ int main(int argc, char **argv) {
|
||||||
for (int i = 4; i < 12; 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}}
|
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 target
|
||||||
#pragma omp teams distribute parallel for simd collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
|
#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++)
|
for (int i = 4; i < 12; i++)
|
||||||
argv[0][i] = argv[0][i] - argv[0][i-4];
|
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@+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@+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}}
|
// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
|
||||||
|
@ -146,11 +128,7 @@ int main(int argc, char **argv) {
|
||||||
for (int i = 4; i < 12; i++)
|
for (int i = 4; i < 12; i++)
|
||||||
argv[0][i] = argv[0][i] - argv[0][i-4];
|
argv[0][i] = argv[0][i] - argv[0][i-4];
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
// expected-error@+2 {{expression is not an integral constant expression}}
|
||||||
// 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
|
|
||||||
#pragma omp target
|
#pragma omp target
|
||||||
#pragma omp teams distribute parallel for simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
|
#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++)
|
for (int i = 4; i < 12; i++)
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
// RUN: %clang_cc1 -verify %s
|
// RUN: %clang_cc1 -verify %s
|
||||||
// RUN: %clang_cc1 -verify %s -std=c++98
|
|
||||||
// RUN: %clang_cc1 -verify %s -std=c++11
|
|
||||||
|
|
||||||
// PR25946
|
// PR25946
|
||||||
// We had an off-by-one error in an assertion when annotating A<int> below. Our
|
// We had an off-by-one error in an assertion when annotating A<int> below. Our
|
||||||
|
@ -12,10 +10,8 @@ template <typename T> class A {};
|
||||||
|
|
||||||
// expected-error@+1 {{expected '{' after base class list}}
|
// expected-error@+1 {{expected '{' after base class list}}
|
||||||
template <typename T> class B : T // not ',' or '{'
|
template <typename T> class B : T // not ',' or '{'
|
||||||
#if __cplusplus < 201103L
|
// expected-error@+3 {{C++ requires a type specifier for all declarations}}
|
||||||
// expected-error@+4 {{expected ';' after top level declarator}}
|
// expected-error@+2 {{expected ';' after top level declarator}}
|
||||||
#endif
|
|
||||||
// expected-error@+2 {{C++ requires a type specifier for all declarations}}
|
|
||||||
// expected-error@+1 {{expected ';' after class}}
|
// expected-error@+1 {{expected ';' after class}}
|
||||||
A<int> {
|
A<int> {
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +1,4 @@
|
||||||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
// 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
|
|
||||||
struct A {
|
struct A {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -14,9 +7,6 @@ struct ConvertibleToA {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ConvertibleToConstA {
|
struct ConvertibleToConstA {
|
||||||
#if __cplusplus >= 201103L
|
|
||||||
// expected-note@+2 {{candidate function}}
|
|
||||||
#endif
|
|
||||||
operator const A();
|
operator const A();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -79,9 +69,6 @@ void test() {
|
||||||
na = a;
|
na = a;
|
||||||
na = constA;
|
na = constA;
|
||||||
na = convertibleToA;
|
na = convertibleToA;
|
||||||
#if __cplusplus >= 201103L
|
|
||||||
// expected-error@+2 {{no viable conversion}}
|
|
||||||
#endif
|
|
||||||
na = convertibleToConstA;
|
na = convertibleToConstA;
|
||||||
na += a; // expected-error{{no viable overloaded '+='}}
|
na += a; // expected-error{{no viable overloaded '+='}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue