41 lines · c
1// RUN: %clang_cc1 -gkey-instructions -gno-column-info -x c++ %s -debug-info-kind=line-tables-only -emit-llvm -o - -triple x86_64-unknown-linux \2// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank --check-prefixes=CHECK,CHECK-CXX3 4// RUN: %clang_cc1 -gkey-instructions -gno-column-info -x c %s -debug-info-kind=line-tables-only -emit-llvm -o - -triple x86_64-unknown-linux \5// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank --check-prefixes=CHECK,CHECK-C6 7typedef struct {8 void* a;9 void* b;10} Struct;11Struct get();12 13void test() {14// CHECK: %1 = extractvalue { ptr, ptr } %call, 0, !dbg [[G1R2:!.*]]15// CHECK: store ptr %1, ptr {{.*}}, !dbg [[G1R1:!.*]]16// CHECK: %3 = extractvalue { ptr, ptr } %call, 1, !dbg [[G1R2]]17// CHECK: store ptr %3, ptr {{.*}}, !dbg [[G1R1:!.*]]18 Struct s = get();19// CHECK: ret{{.*}}, !dbg [[RET:!.*]]20}21 22typedef struct { int i; } Int;23Int getInt(void);24 25// CHECK-C: @test226// CHECK-CXX: @_Z5test2v27void test2() {28// CHECK: %call = call i32 @{{(_Z6)?}}getInt{{v?}}(), !dbg [[T2_G1R2:!.*]]29// CHECK: [[gep:%.*]] = getelementptr inbounds nuw %struct.Int, ptr %i, i32 0, i32 030// CHECK: store i32 %call, ptr [[gep]]{{.*}}, !dbg [[T2_G1R1:!.*]]31// CHECK: ret{{.*}}, !dbg [[T2_RET:!.*]]32 Int i = getInt();33}34 35// CHECK: [[G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2)36// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)37// CHECK: [[RET]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)38// CHECK: [[T2_G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2)39// CHECK: [[T2_G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)40// CHECK: [[T2_RET]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)41