Switch interp tests to opaque pointers

This commit is contained in:
Elliott Sales de Andrade
2023-04-15 16:42:11 -04:00
committed by Ayke
parent 2b1dc4fee5
commit b4c9b579b8
11 changed files with 194 additions and 201 deletions
+15 -15
View File
@@ -4,7 +4,7 @@ target triple = "x86_64--linux"
@main.nonConst1 = local_unnamed_addr global [4 x i64] zeroinitializer
@main.nonConst2 = local_unnamed_addr global i64 0
@main.someArray = global [8 x { i16, i32 }] zeroinitializer
@main.exportedValue = global [1 x i16*] [i16* @main.exposedValue1]
@main.exportedValue = global [1 x ptr] [ptr @main.exposedValue1]
@main.exportedConst = constant i64 42
@main.exposedValue1 = global i16 0
@main.exposedValue2 = local_unnamed_addr global i16 0
@@ -19,17 +19,17 @@ entry:
call void @runtime.printint64(i64 5)
call void @runtime.printnl()
%value1 = call i64 @someValue()
store i64 %value1, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @main.nonConst1, i32 0, i32 0), align 8
%value2 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @main.nonConst1, i32 0, i32 0), align 8
store i64 %value2, i64* @main.nonConst2, align 8
call void @modifyExternal(i32* bitcast (i8* getelementptr inbounds (i8, i8* bitcast ([8 x { i16, i32 }]* @main.someArray to i8*), i32 28) to i32*))
call void @modifyExternal(i32* bitcast ([1 x i16*]* @main.exportedValue to i32*))
store i16 5, i16* @main.exposedValue1, align 2
call void @readExternal(i32* bitcast (i64* @main.exportedConst to i32*))
store i64 %value1, ptr @main.nonConst1, align 8
%value2 = load i64, ptr @main.nonConst1, align 8
store i64 %value2, ptr @main.nonConst2, align 8
call void @modifyExternal(ptr getelementptr inbounds (i8, ptr @main.someArray, i32 28))
call void @modifyExternal(ptr @main.exportedValue)
store i16 5, ptr @main.exposedValue1, align 2
call void @readExternal(ptr @main.exportedConst)
call void @runtime.printint64(i64 42)
call void @modifyExternal(i32* bitcast (void ()* @willModifyGlobal to i32*))
store i16 7, i16* @main.exposedValue2, align 2
call void @modifyExternal(i32* bitcast (void ()* @hasInlineAsm to i32*))
call void @modifyExternal(ptr @willModifyGlobal)
store i16 7, ptr @main.exposedValue2, align 2
call void @modifyExternal(ptr @hasInlineAsm)
call void @runtime.printint64(i64 6)
call void @runtime.printint64(i64 -1)
%agg = call { i8, i32, { float, { i64, i16 } } } @nestedStruct()
@@ -42,7 +42,7 @@ entry:
%agg2.insertvalue2 = insertvalue { i64, i16 } %agg2.agg1, i64 5, 0
%agg2.insertvalue1 = insertvalue { float, { i64, i16 } } %agg2.agg0, { i64, i16 } %agg2.insertvalue2, 1
%agg2.insertvalue0 = insertvalue { i8, i32, { float, { i64, i16 } } } %agg, { float, { i64, i16 } } %agg2.insertvalue1, 2
store { i8, i32, { float, { i64, i16 } } } %agg2.insertvalue0, { i8, i32, { float, { i64, i16 } } }* @main.insertedValue, align 8
store { i8, i32, { float, { i64, i16 } } } %agg2.insertvalue0, ptr @main.insertedValue, align 8
ret void
}
@@ -55,13 +55,13 @@ entry:
declare i64 @someValue() local_unnamed_addr
declare void @modifyExternal(i32*) local_unnamed_addr
declare void @modifyExternal(ptr) local_unnamed_addr
declare void @readExternal(i32*) local_unnamed_addr
declare void @readExternal(ptr) local_unnamed_addr
define void @willModifyGlobal() {
entry:
store i16 8, i16* @main.exposedValue2, align 2
store i16 8, ptr @main.exposedValue2, align 2
ret void
}