mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Fix C++ code generation in --share-cpp-ast mode (#7605)
Instead of creating a CodeGenerator per CppDomain, and then crashing in lowering when we try to consume the same llvm Module multiple times, create a CodeGenerator for each CppFile within the domain. For now, we mulitplex all of Clang's ASTConsumer output to all code generators, which means that any strong external definitions within a Carbon file (for example, in an inline `Cpp` fragment) will be emitted to all output files in the same `CppDomain`, resulting in link errors due to symbol redefinitions. This will be addressed later. But this should be sufficient for Carbon compilations in which such symbols are not defined. We also don't yet attempt to classify which compilations will need C++ code generation, and instead create a clang `CodeGenerator` for every Carbon file that has C++ imports. For `carbom compile`, only one Carbon file will need code generation, and yet we still build multiple `CodeGenerator` objects in general. Fixing this requires more plumbing from the driver, and this will also be handled in a follow-up. Assisted-by: Gemini via Antigravity
This commit is contained in:
@@ -458,7 +458,7 @@ fn G() {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %"class.Carbon::C" = type { i32, i32 }
|
||||
// CHECK:STDOUT: %"class.Carbon::C.0" = type { i32, i32 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @C.val.loc19_3 = internal constant { i32, i32 } zeroinitializer
|
||||
// CHECK:STDOUT:
|
||||
@@ -468,10 +468,10 @@ fn G() {
|
||||
// CHECK:STDOUT: %c.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %c.addr, align 8, !tbaa !12, !nonnull !15, !align !16
|
||||
// CHECK:STDOUT: %a = getelementptr inbounds nuw %"class.Carbon::C", ptr %0, i32 0, i32 0
|
||||
// CHECK:STDOUT: %a = getelementptr inbounds nuw %"class.Carbon::C.0", ptr %0, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 12, ptr %a, align 4, !tbaa !17
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %c.addr, align 8, !tbaa !12, !nonnull !15, !align !16
|
||||
// CHECK:STDOUT: %b = getelementptr inbounds nuw %"class.Carbon::C", ptr %1, i32 0, i32 1
|
||||
// CHECK:STDOUT: %b = getelementptr inbounds nuw %"class.Carbon::C.0", ptr %1, i32 0, i32 1
|
||||
// CHECK:STDOUT: store i32 34, ptr %b, align 4, !tbaa !19
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -188,14 +188,14 @@ fn CallCallF() { Cpp.CallF(); }
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %"class.Carbon::A" = type {}
|
||||
// CHECK:STDOUT: %"class.Carbon::A.0" = type {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN6Carbon1AD2Ev = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define dso_local noundef i32 @_Z5CallFv() #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ref.tmp = alloca %"class.Carbon::A", align 1
|
||||
// CHECK:STDOUT: %ref.tmp = alloca %"class.Carbon::A.0", align 1
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ref.tmp) #4
|
||||
// CHECK:STDOUT: %call = call noundef i32 @_ZNK6Carbon1A1FEi(ptr noundef nonnull align 1 %ref.tmp, i32 noundef 123)
|
||||
// CHECK:STDOUT: call void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 1 %ref.tmp) #4
|
||||
|
||||
@@ -276,7 +276,7 @@ fn Four() {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %class.C = type { i32, i32 }
|
||||
// CHECK:STDOUT: %class.C.18 = type { i32, i32 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN1CC2Ev = comdat any
|
||||
// CHECK:STDOUT:
|
||||
@@ -321,9 +321,9 @@ fn Four() {
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17
|
||||
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: %x_ = getelementptr inbounds nuw %class.C, ptr %this1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %x_ = getelementptr inbounds nuw %class.C.18, ptr %this1, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 8, ptr %x_, align 4, !tbaa !30
|
||||
// CHECK:STDOUT: %y_ = getelementptr inbounds nuw %class.C, ptr %this1, i32 0, i32 1
|
||||
// CHECK:STDOUT: %y_ = getelementptr inbounds nuw %class.C.18, ptr %this1, i32 0, i32 1
|
||||
// CHECK:STDOUT: store i32 9, ptr %y_, align 4, !tbaa !32
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -184,8 +184,8 @@ fn F(ref r: Cpp.A) {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %struct.A = type <{ %struct.Base, i32, [4 x i8] }>
|
||||
// CHECK:STDOUT: %struct.Base = type { ptr }
|
||||
// CHECK:STDOUT: %struct.A.18 = type <{ %struct.Base.19, i32, [4 x i8] }>
|
||||
// CHECK:STDOUT: %struct.Base.19 = type { ptr }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN1A6by_refEv = comdat any
|
||||
// CHECK:STDOUT:
|
||||
@@ -211,7 +211,7 @@ fn F(ref r: Cpp.A) {
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: %n = getelementptr inbounds nuw %struct.A, ptr %this1, i32 0, i32 1
|
||||
// CHECK:STDOUT: %n = getelementptr inbounds nuw %struct.A.18, ptr %this1, i32 0, i32 1
|
||||
// CHECK:STDOUT: %0 = load i32, ptr %n, align 8, !tbaa !24
|
||||
// CHECK:STDOUT: ret i32 %0
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+2
-2
@@ -528,10 +528,10 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %struct.Y = type { i8 }
|
||||
// CHECK:STDOUT: %struct.Y.26 = type { i8 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @_ZN1X11static_tmplIiEE = external global i32, align 4
|
||||
// CHECK:STDOUT: @_ZN1X11static_tmplI1YEE = external global %struct.Y, align 1
|
||||
// CHECK:STDOUT: @_ZN1X11static_tmplI1YEE = external global %struct.Y.26, align 1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CReadStaticVarTemplate.Main() #0 !dbg !12 {
|
||||
|
||||
+47
-47
@@ -290,7 +290,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %struct.A = type { i32 }
|
||||
// CHECK:STDOUT: %struct.A.62 = type { i32 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Zlt1AS_ = comdat any
|
||||
// CHECK:STDOUT:
|
||||
@@ -313,8 +313,8 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: %x.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %y.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24
|
||||
@@ -323,9 +323,9 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.62, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A.62, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt1AS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %storedv = zext i1 %call to i8
|
||||
@@ -339,8 +339,8 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: %x.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %y.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24
|
||||
@@ -349,9 +349,9 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.62, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A.62, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zle1AS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %storedv = zext i1 %call to i8
|
||||
@@ -365,8 +365,8 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: %x.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %y.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24
|
||||
@@ -375,9 +375,9 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.62, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A.62, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zgt1AS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %storedv = zext i1 %call to i8
|
||||
@@ -391,8 +391,8 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: %x.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %y.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24
|
||||
@@ -401,9 +401,9 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.62, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A.62, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zge1AS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %storedv = zext i1 %call to i8
|
||||
@@ -467,15 +467,15 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zlt1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %x = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.62, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A.62, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4
|
||||
// CHECK:STDOUT: %value = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %value = getelementptr inbounds nuw %struct.A.62, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %0 = load i32, ptr %value, align 4, !tbaa !61
|
||||
// CHECK:STDOUT: %value2 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %value2 = getelementptr inbounds nuw %struct.A.62, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %1 = load i32, ptr %value2, align 4, !tbaa !61
|
||||
// CHECK:STDOUT: %cmp = icmp slt i32 %0, %1
|
||||
// CHECK:STDOUT: ret i1 %cmp
|
||||
@@ -487,19 +487,19 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zle1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp2 = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %x = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %agg.tmp2 = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.62, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A.62, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A.62, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %0 = load i32, ptr %coerce.dive3, align 4
|
||||
// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp2, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A.62, ptr %agg.tmp2, i32 0, i32 0
|
||||
// CHECK:STDOUT: %1 = load i32, ptr %coerce.dive4, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt1AS_(i32 %0, i32 %1)
|
||||
// CHECK:STDOUT: %lnot = xor i1 %call, true
|
||||
@@ -509,19 +509,19 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zgt1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp2 = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %x = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %agg.tmp2 = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.62, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A.62, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A.62, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %0 = load i32, ptr %coerce.dive3, align 4
|
||||
// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp2, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A.62, ptr %agg.tmp2, i32 0, i32 0
|
||||
// CHECK:STDOUT: %1 = load i32, ptr %coerce.dive4, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt1AS_(i32 %0, i32 %1)
|
||||
// CHECK:STDOUT: ret i1 %call
|
||||
@@ -530,19 +530,19 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zge1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp2 = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %x = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %agg.tmp2 = alloca %struct.A.62, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.62, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A.62, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A.62, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %0 = load i32, ptr %coerce.dive3, align 4
|
||||
// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp2, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A.62, ptr %agg.tmp2, i32 0, i32 0
|
||||
// CHECK:STDOUT: %1 = load i32, ptr %coerce.dive4, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt1AS_(i32 %0, i32 %1)
|
||||
// CHECK:STDOUT: %lnot = xor i1 %call, true
|
||||
|
||||
+7
-7
@@ -599,7 +599,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %class.ForceThunk = type { i8 }
|
||||
// CHECK:STDOUT: %class.ForceThunk.23 = type { i8 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !12 {
|
||||
@@ -616,7 +616,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 1 dereferenceable(1) ptr @_Z10ReturnCRef10ForceThunk.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk.23, align 1
|
||||
// CHECK:STDOUT: %call = call noundef nonnull align 1 dereferenceable(1) ptr @_Z10ReturnCRef10ForceThunk()
|
||||
// CHECK:STDOUT: ret ptr %call
|
||||
// CHECK:STDOUT: }
|
||||
@@ -624,7 +624,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 1 dereferenceable(1) ptr @_Z11ReturnCRRef10ForceThunk.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk.23, align 1
|
||||
// CHECK:STDOUT: %call = call noundef nonnull align 1 dereferenceable(1) ptr @_Z11ReturnCRRef10ForceThunk()
|
||||
// CHECK:STDOUT: ret ptr %call
|
||||
// CHECK:STDOUT: }
|
||||
@@ -632,7 +632,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 1 dereferenceable(1) ptr @_Z15ReturnConstCRef10ForceThunk.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk.23, align 1
|
||||
// CHECK:STDOUT: %call = call noundef nonnull align 1 dereferenceable(1) ptr @_Z15ReturnConstCRef10ForceThunk()
|
||||
// CHECK:STDOUT: ret ptr %call
|
||||
// CHECK:STDOUT: }
|
||||
@@ -640,7 +640,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 4 dereferenceable(4) ptr @_Z12ReturnIntRef10ForceThunk.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk.23, align 1
|
||||
// CHECK:STDOUT: %call = call noundef nonnull align 4 dereferenceable(4) ptr @_Z12ReturnIntRef10ForceThunk()
|
||||
// CHECK:STDOUT: ret ptr %call
|
||||
// CHECK:STDOUT: }
|
||||
@@ -648,7 +648,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 4 dereferenceable(4) ptr @_Z13ReturnIntRRef10ForceThunk.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk.23, align 1
|
||||
// CHECK:STDOUT: %call = call noundef nonnull align 4 dereferenceable(4) ptr @_Z13ReturnIntRRef10ForceThunk()
|
||||
// CHECK:STDOUT: ret ptr %call
|
||||
// CHECK:STDOUT: }
|
||||
@@ -656,7 +656,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 4 dereferenceable(4) ptr @_Z17ReturnConstIntRef10ForceThunk.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk.23, align 1
|
||||
// CHECK:STDOUT: %call = call noundef nonnull align 4 dereferenceable(4) ptr @_Z17ReturnConstIntRef10ForceThunk()
|
||||
// CHECK:STDOUT: ret ptr %call
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -0,0 +1,364 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/primitives.carbon
|
||||
// EXTRA-ARGS: --share-cpp-ast
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/share_ast.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/share_ast.carbon
|
||||
|
||||
// --- a.h
|
||||
#ifndef A_H
|
||||
#define A_H
|
||||
struct A {
|
||||
int a, b;
|
||||
};
|
||||
inline A make_a() { return {1, 2}; }
|
||||
#endif
|
||||
|
||||
// --- b.h
|
||||
#ifndef B_H
|
||||
#define B_H
|
||||
struct B {
|
||||
int x, y;
|
||||
};
|
||||
inline B make_b() { return {3, 4}; }
|
||||
#endif
|
||||
|
||||
// --- use_a.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
import Cpp library "a.h";
|
||||
|
||||
fn Test() -> i32 {
|
||||
var a: Cpp.A = Cpp.make_a();
|
||||
return a.b;
|
||||
}
|
||||
|
||||
// --- use_b.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
import Cpp library "b.h";
|
||||
|
||||
fn Test() -> i32 {
|
||||
var b: Cpp.B = Cpp.make_b();
|
||||
return b.x;
|
||||
}
|
||||
|
||||
// --- use_both.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
import Cpp library "a.h";
|
||||
import Cpp library "b.h";
|
||||
|
||||
fn TestA() -> i32 {
|
||||
var a: Cpp.A = Cpp.make_a();
|
||||
return a.b;
|
||||
}
|
||||
|
||||
fn TestB() -> i32 {
|
||||
var b: Cpp.B = Cpp.make_b();
|
||||
return b.x;
|
||||
}
|
||||
|
||||
|
||||
// CHECK:STDOUT: ; ---
|
||||
// CHECK:STDOUT: ; ModuleID = 'use_a.carbon'
|
||||
// CHECK:STDOUT: source_filename = "use_a.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %struct.A = type { i32, i32 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z6make_av = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CTest.Main() #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %a.var = alloca [8 x i8], align 4, !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !16
|
||||
// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %a.var), !dbg !17
|
||||
// CHECK:STDOUT: %.loc6_11.1.b = getelementptr inbounds nuw [8 x i8], ptr %a.var, i32 0, i32 4, !dbg !18
|
||||
// CHECK:STDOUT: %.loc6_11.2 = load i32, ptr %.loc6_11.1.b, align 4, !dbg !18
|
||||
// CHECK:STDOUT: ret i32 %.loc6_11.2, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z6make_av.carbon_thunk.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: %call = call i64 @_Z6make_av()
|
||||
// CHECK:STDOUT: store i64 %call, ptr %0, align 4
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_av() #3 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %retval = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A, ptr %retval, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !23
|
||||
// CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A, ptr %retval, i32 0, i32 1
|
||||
// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !25
|
||||
// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4
|
||||
// CHECK:STDOUT: ret i64 %0
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
||||
// CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!0}
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !5, !6}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !1 = !DIFile(filename: "use_a.carbon", directory: "")
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !7 = !{!8, !9, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"int", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0}
|
||||
// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !1, line: 4, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !13 = !DISubroutineType(types: !14)
|
||||
// CHECK:STDOUT: !14 = !{!15}
|
||||
// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 5, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 5, column: 18, scope: !12)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 6, column: 10, scope: !12)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 6, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !20 = !{!21, !21, i64 0}
|
||||
// CHECK:STDOUT: !21 = !{!"p1 _ZTS1A", !22, i64 0}
|
||||
// CHECK:STDOUT: !22 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !23 = !{!24, !9, i64 0}
|
||||
// CHECK:STDOUT: !24 = !{!"_ZTS1A", !9, i64 0, !9, i64 4}
|
||||
// CHECK:STDOUT: !25 = !{!24, !9, i64 4}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; ---
|
||||
// CHECK:STDOUT: ; ModuleID = 'use_b.carbon'
|
||||
// CHECK:STDOUT: source_filename = "use_b.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %struct.B = type { i32, i32 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z6make_bv = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CTest.Main() #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %b.var = alloca [8 x i8], align 4, !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !16
|
||||
// CHECK:STDOUT: call void @_Z6make_bv.carbon_thunk.(ptr %b.var), !dbg !17
|
||||
// CHECK:STDOUT: %.loc6_11.1.x = getelementptr inbounds nuw [8 x i8], ptr %b.var, i32 0, i32 0, !dbg !18
|
||||
// CHECK:STDOUT: %.loc6_11.2 = load i32, ptr %.loc6_11.1.x, align 4, !dbg !18
|
||||
// CHECK:STDOUT: ret i32 %.loc6_11.2, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z6make_bv.carbon_thunk.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: %call = call i64 @_Z6make_bv()
|
||||
// CHECK:STDOUT: store i64 %call, ptr %0, align 4
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_bv() #3 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %retval = alloca %struct.B, align 4
|
||||
// CHECK:STDOUT: %x = getelementptr inbounds nuw %struct.B, ptr %retval, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 3, ptr %x, align 4, !tbaa !23
|
||||
// CHECK:STDOUT: %y = getelementptr inbounds nuw %struct.B, ptr %retval, i32 0, i32 1
|
||||
// CHECK:STDOUT: store i32 4, ptr %y, align 4, !tbaa !25
|
||||
// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4
|
||||
// CHECK:STDOUT: ret i64 %0
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
||||
// CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!0}
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !5, !6}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !1 = !DIFile(filename: "use_b.carbon", directory: "")
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !7 = !{!8, !9, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"int", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0}
|
||||
// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !1, line: 4, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !13 = !DISubroutineType(types: !14)
|
||||
// CHECK:STDOUT: !14 = !{!15}
|
||||
// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 5, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 5, column: 18, scope: !12)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 6, column: 10, scope: !12)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 6, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !20 = !{!21, !21, i64 0}
|
||||
// CHECK:STDOUT: !21 = !{!"p1 _ZTS1B", !22, i64 0}
|
||||
// CHECK:STDOUT: !22 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !23 = !{!24, !9, i64 0}
|
||||
// CHECK:STDOUT: !24 = !{!"_ZTS1B", !9, i64 0, !9, i64 4}
|
||||
// CHECK:STDOUT: !25 = !{!24, !9, i64 4}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; ---
|
||||
// CHECK:STDOUT: ; ModuleID = 'use_both.carbon'
|
||||
// CHECK:STDOUT: source_filename = "use_both.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %struct.A.32 = type { i32, i32 }
|
||||
// CHECK:STDOUT: %struct.B.33 = type { i32, i32 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z6make_av = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z6make_bv = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CTestA.Main() #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %a.var = alloca [8 x i8], align 4, !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !16
|
||||
// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %a.var), !dbg !17
|
||||
// CHECK:STDOUT: %.loc7_11.1.b = getelementptr inbounds nuw [8 x i8], ptr %a.var, i32 0, i32 4, !dbg !18
|
||||
// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.b, align 4, !dbg !18
|
||||
// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z6make_av.carbon_thunk.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: %call = call i64 @_Z6make_av()
|
||||
// CHECK:STDOUT: store i64 %call, ptr %0, align 4
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CTestB.Main() #0 !dbg !23 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %b.var = alloca [8 x i8], align 4, !dbg !24
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !24
|
||||
// CHECK:STDOUT: call void @_Z6make_bv.carbon_thunk.(ptr %b.var), !dbg !25
|
||||
// CHECK:STDOUT: %.loc12_11.1.x = getelementptr inbounds nuw [8 x i8], ptr %b.var, i32 0, i32 0, !dbg !26
|
||||
// CHECK:STDOUT: %.loc12_11.2 = load i32, ptr %.loc12_11.1.x, align 4, !dbg !26
|
||||
// CHECK:STDOUT: ret i32 %.loc12_11.2, !dbg !27
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z6make_bv.carbon_thunk.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !28
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !28
|
||||
// CHECK:STDOUT: %call = call i64 @_Z6make_bv()
|
||||
// CHECK:STDOUT: store i64 %call, ptr %0, align 4
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_av() #3 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %retval = alloca %struct.A.32, align 4
|
||||
// CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.32, ptr %retval, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !30
|
||||
// CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.32, ptr %retval, i32 0, i32 1
|
||||
// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !32
|
||||
// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4
|
||||
// CHECK:STDOUT: ret i64 %0
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_bv() #3 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %retval = alloca %struct.B.33, align 4
|
||||
// CHECK:STDOUT: %x = getelementptr inbounds nuw %struct.B.33, ptr %retval, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 3, ptr %x, align 4, !tbaa !33
|
||||
// CHECK:STDOUT: %y = getelementptr inbounds nuw %struct.B.33, ptr %retval, i32 0, i32 1
|
||||
// CHECK:STDOUT: store i32 4, ptr %y, align 4, !tbaa !35
|
||||
// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4
|
||||
// CHECK:STDOUT: ret i64 %0
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
||||
// CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!0}
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !5, !6}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !1 = !DIFile(filename: "use_both.carbon", directory: "")
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !7 = !{!8, !9, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"int", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0}
|
||||
// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "TestA", linkageName: "_CTestA.Main", scope: null, file: !1, line: 5, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !13 = !DISubroutineType(types: !14)
|
||||
// CHECK:STDOUT: !14 = !{!15}
|
||||
// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 6, column: 18, scope: !12)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 10, scope: !12)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !20 = !{!21, !21, i64 0}
|
||||
// CHECK:STDOUT: !21 = !{!"p1 _ZTS1A", !22, i64 0}
|
||||
// CHECK:STDOUT: !22 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "TestB", linkageName: "_CTestB.Main", scope: null, file: !1, line: 10, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 11, column: 3, scope: !23)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 11, column: 18, scope: !23)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 12, column: 10, scope: !23)
|
||||
// CHECK:STDOUT: !27 = !DILocation(line: 12, column: 3, scope: !23)
|
||||
// CHECK:STDOUT: !28 = !{!29, !29, i64 0}
|
||||
// CHECK:STDOUT: !29 = !{!"p1 _ZTS1B", !22, i64 0}
|
||||
// CHECK:STDOUT: !30 = !{!31, !9, i64 0}
|
||||
// CHECK:STDOUT: !31 = !{!"_ZTS1A", !9, i64 0, !9, i64 4}
|
||||
// CHECK:STDOUT: !32 = !{!31, !9, i64 4}
|
||||
// CHECK:STDOUT: !33 = !{!34, !9, i64 0}
|
||||
// CHECK:STDOUT: !34 = !{!"_ZTS1B", !9, i64 0, !9, i64 4}
|
||||
// CHECK:STDOUT: !35 = !{!34, !9, i64 4}
|
||||
// CHECK:STDOUT:
|
||||
@@ -368,7 +368,7 @@ fn InitNontrivialDtor() {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %"class.std::initializer_list" = type { ptr, i64 }
|
||||
// CHECK:STDOUT: %"class.std::initializer_list.64" = type { ptr, i64 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN11vector_likeD2Ev = comdat any
|
||||
// CHECK:STDOUT:
|
||||
@@ -442,7 +442,7 @@ fn InitNontrivialDtor() {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %list.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %"class.std::initializer_list", align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %"class.std::initializer_list.64", align 8
|
||||
// CHECK:STDOUT: store ptr %list, ptr %list.addr, align 8, !tbaa !38
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !41
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !41
|
||||
@@ -521,7 +521,7 @@ fn InitNontrivialDtor() {
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN11vector_likeC2ESt16initializer_listIiE(ptr noundef nonnull align 1 dereferenceable(1) %this, ptr %list.coerce0, i64 %list.coerce1) unnamed_addr #2 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %list = alloca %"class.std::initializer_list", align 8
|
||||
// CHECK:STDOUT: %list = alloca %"class.std::initializer_list.64", align 8
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %0 = getelementptr inbounds nuw { ptr, i64 }, ptr %list, i32 0, i32 0
|
||||
// CHECK:STDOUT: store ptr %list.coerce0, ptr %0, align 8
|
||||
|
||||
Reference in New Issue
Block a user