diff options
Diffstat (limited to 'test/CodeGenCXX')
-rw-r--r-- | test/CodeGenCXX/amdgcn-automatic-variable.cpp | 33 | ||||
-rw-r--r-- | test/CodeGenCXX/debug-info-anon-namespace.cpp | 4 | ||||
-rw-r--r-- | test/CodeGenCXX/debug-info-namespace.cpp | 8 | ||||
-rw-r--r-- | test/CodeGenCXX/implicit-exception-spec.cpp | 2 |
4 files changed, 34 insertions, 13 deletions
diff --git a/test/CodeGenCXX/amdgcn-automatic-variable.cpp b/test/CodeGenCXX/amdgcn-automatic-variable.cpp index a82275206c6d9..9830a7845e5b1 100644 --- a/test/CodeGenCXX/amdgcn-automatic-variable.cpp +++ b/test/CodeGenCXX/amdgcn-automatic-variable.cpp @@ -13,31 +13,32 @@ void func1(int *x) { // CHECK-LABEL: define void @_Z5func2v() void func2(void) { // CHECK: %lv1 = alloca i32, align 4, addrspace(5) + // CHECK: %[[r0:.*]] = addrspacecast i32 addrspace(5)* %lv1 to i32* // CHECK: %lv2 = alloca i32, align 4, addrspace(5) + // CHECK: %[[r1:.*]] = addrspacecast i32 addrspace(5)* %lv2 to i32* // CHECK: %la = alloca [100 x i32], align 4, addrspace(5) + // CHECK: %[[r2:.*]] = addrspacecast [100 x i32] addrspace(5)* %la to [100 x i32]* // CHECK: %lp1 = alloca i32*, align 8, addrspace(5) + // CHECK: %[[r3:.*]] = addrspacecast i32* addrspace(5)* %lp1 to i32** // CHECK: %lp2 = alloca i32*, align 8, addrspace(5) + // CHECK: %[[r4:.*]] = addrspacecast i32* addrspace(5)* %lp2 to i32** // CHECK: %lvc = alloca i32, align 4, addrspace(5) + // CHECK: %[[r5:.*]] = addrspacecast i32 addrspace(5)* %lvc to i32* - // CHECK: %[[r0:.*]] = addrspacecast i32 addrspace(5)* %lv1 to i32* // CHECK: store i32 1, i32* %[[r0]] int lv1; lv1 = 1; - // CHECK: %[[r1:.*]] = addrspacecast i32 addrspace(5)* %lv2 to i32* // CHECK: store i32 2, i32* %[[r1]] int lv2 = 2; - // CHECK: %[[r2:.*]] = addrspacecast [100 x i32] addrspace(5)* %la to [100 x i32]* // CHECK: %[[arrayidx:.*]] = getelementptr inbounds [100 x i32], [100 x i32]* %[[r2]], i64 0, i64 0 // CHECK: store i32 3, i32* %[[arrayidx]], align 4 int la[100]; la[0] = 3; - // CHECK: %[[r3:.*]] = addrspacecast i32* addrspace(5)* %lp1 to i32** // CHECK: store i32* %[[r0]], i32** %[[r3]], align 8 int *lp1 = &lv1; - // CHECK: %[[r4:.*]] = addrspacecast i32* addrspace(5)* %lp2 to i32** // CHECK: %[[arraydecay:.*]] = getelementptr inbounds [100 x i32], [100 x i32]* %[[r2]], i32 0, i32 0 // CHECK: store i32* %[[arraydecay]], i32** %[[r4]], align 8 int *lp2 = la; @@ -45,7 +46,6 @@ void func2(void) { // CHECK: call void @_Z5func1Pi(i32* %[[r0]]) func1(&lv1); - // CHECK: %[[r5:.*]] = addrspacecast i32 addrspace(5)* %lvc to i32* // CHECK: store i32 4, i32* %[[r5]] // CHECK: store i32 4, i32* %[[r0]] const int lvc = 4; @@ -81,4 +81,25 @@ void func4(int x) { func1(&x); } +// CHECK-LABEL: define void @_Z5func5v +void func5() { + return; + int x = 0; +} + +// CHECK-LABEL: define void @_Z5func6v +void func6() { + return; + int x; +} + +// CHECK-LABEL: define void @_Z5func7v +extern void use(int *); +void func7() { + goto later; + int x; +later: + use(&x); +} + // CHECK-NOT: !opencl.ocl.version diff --git a/test/CodeGenCXX/debug-info-anon-namespace.cpp b/test/CodeGenCXX/debug-info-anon-namespace.cpp index 79298deaf8b16..3f4ef2a383606 100644 --- a/test/CodeGenCXX/debug-info-anon-namespace.cpp +++ b/test/CodeGenCXX/debug-info-anon-namespace.cpp @@ -21,7 +21,7 @@ int *b2 = &a2; // PS4: [[NS:![0-9]+]] = !DINamespace // PS4: [[CU:![0-9]+]] = distinct !DICompileUnit // PS4: [[NS2:![0-9]+]] = !DINamespace -// PS4: !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[CU]], entity: [[NS]]) -// PS4: !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[NS]], entity: [[NS2]], line: {{[0-9]+}}) +// PS4: !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[CU]], entity: [[NS]], file: {{![0-9]+}}) +// PS4: !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[NS]], entity: [[NS2]], file: {{![0-9]+}}, line: {{[0-9]+}}) // NON-PS4-NOT: !DIImportedEntity diff --git a/test/CodeGenCXX/debug-info-namespace.cpp b/test/CodeGenCXX/debug-info-namespace.cpp index 95857e339085d..296c99efc8eb2 100644 --- a/test/CodeGenCXX/debug-info-namespace.cpp +++ b/test/CodeGenCXX/debug-info-namespace.cpp @@ -81,17 +81,17 @@ void C::c() {} // CHECK: [[CU:![0-9]+]] = distinct !DICompileUnit( // CHECK-SAME: imports: [[MODULES:![0-9]*]] // CHECK: [[MODULES]] = !{[[M1:![0-9]+]], [[M2:![0-9]+]], [[M3:![0-9]+]], [[M4:![0-9]+]], [[M5:![0-9]+]], [[M6:![0-9]+]], [[M7:![0-9]+]], [[M8:![0-9]+]], [[M9:![0-9]+]], [[M10:![0-9]+]], [[M11:![0-9]+]], [[M12:![0-9]+]], [[M13:![0-9]+]], [[M14:![0-9]+]], [[M15:![0-9]+]], [[M16:![0-9]+]], [[M17:![0-9]+]] -// CHECK: [[M1]] = !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[CTXT]], entity: [[NS]], line: 15) +// CHECK: [[M1]] = !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[CTXT]], entity: [[NS]], file: [[FOOCPP]], line: 15) // CHECK: [[M2]] = !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[CU]], entity: [[CTXT]], -// CHECK: [[M3]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, name: "E", scope: [[CU]], entity: [[CTXT]], line: 19) -// CHECK: [[M4]] = !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[LEX2:![0-9]+]], entity: [[NS]], line: 23) +// CHECK: [[M3]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, name: "E", scope: [[CU]], entity: [[CTXT]], file: [[FOOCPP]], line: 19) +// CHECK: [[M4]] = !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[LEX2:![0-9]+]], entity: [[NS]], file: [[FOOCPP]], line: 23) // CHECK: [[LEX2]] = distinct !DILexicalBlock(scope: [[LEX1:![0-9]+]], file: [[FOOCPP]], // CHECK: [[LEX1]] = distinct !DILexicalBlock(scope: [[FUNC:![0-9]+]], file: [[FOOCPP]], // CHECK: [[FUNC:![0-9]+]] = distinct !DISubprogram(name: "func",{{.*}} isDefinition: true // CHECK: [[M5]] = !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[FUNC]], entity: [[CTXT:![0-9]+]], -// CHECK: [[M6]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[FOO:![0-9]+]], line: 27) +// CHECK: [[M6]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[FOO:![0-9]+]], file: [[FOOCPP]], line: 27) // CHECK: [[FOO]] = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", // CHECK-SAME: line: 5 // CHECK-SAME: DIFlagFwdDecl diff --git a/test/CodeGenCXX/implicit-exception-spec.cpp b/test/CodeGenCXX/implicit-exception-spec.cpp index cf363bd685add..e1a969ab277fc 100644 --- a/test/CodeGenCXX/implicit-exception-spec.cpp +++ b/test/CodeGenCXX/implicit-exception-spec.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -emit-llvm -std=c++11 -o - -fcxx-exceptions -fexceptions | FileCheck -check-prefix=CHECK %s +// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -emit-llvm -std=c++11 -o - -fcxx-exceptions -fexceptions | FileCheck %s struct A { A(); |