-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
port all tests to LLVM's new ptr syntax
- Loading branch information
1 parent
f95e321
commit 5409b46
Showing
259 changed files
with
1,126 additions
and
1,276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
define i16 @f1(half %x) { | ||
%a = alloca half | ||
store half %x, half* %a | ||
%p = bitcast half* %a to i16* | ||
%i = load i16, i16* %p | ||
store half %x, ptr %a | ||
%i = load i16, ptr %a | ||
ret i16 %i | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
; ERROR: Parameter attributes not refined | ||
|
||
define i32 @src(i8* dereferenceable(4) %p) { | ||
define i32 @src(ptr dereferenceable(4) %p) { | ||
ret i32 0 | ||
} | ||
|
||
define i32 @tgt(i8* dereferenceable(8) %p) { | ||
define i32 @tgt(ptr dereferenceable(8) %p) { | ||
ret i32 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,31 @@ | ||
target datalayout="E-p:64:64:64-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64" | ||
|
||
define i32 @test1({{i32,i8},i32}* %x) { | ||
define i32 @test1(ptr %x) { | ||
; {{ 0xDEADBEEF, 0xBA }, 0xCAFEBABE} | ||
store {{i32,i8},i32} {{i32,i8} { i32 -559038737, i8 186 }, i32 -889275714 }, {{i32,i8},i32}* %x | ||
%y = getelementptr {{i32,i8},i32}, {{i32,i8},i32}* %x, i32 0, i32 0, i32 0 | ||
%r = load i32, i32* %y | ||
store {{i32,i8},i32} {{i32,i8} { i32 -559038737, i8 186 }, i32 -889275714 }, ptr %x | ||
%y = getelementptr {{i32,i8},i32}, ptr %x, i32 0, i32 0, i32 0 | ||
%r = load i32, ptr %y | ||
ret i32 %r | ||
} | ||
|
||
define i8 @test2({{i32,i8},i32}* %x) { | ||
store {{i32,i8},i32} {{i32,i8} { i32 -559038737, i8 186 }, i32 -889275714 }, {{i32,i8},i32}* %x | ||
%y = getelementptr {{i32,i8},i32}, {{i32,i8},i32}* %x, i32 0, i32 0, i32 1 | ||
%r = load i8, i8* %y | ||
define i8 @test2(ptr %x) { | ||
store {{i32,i8},i32} {{i32,i8} { i32 -559038737, i8 186 }, i32 -889275714 }, ptr %x | ||
%y = getelementptr {{i32,i8},i32}, ptr %x, i32 0, i32 0, i32 1 | ||
%r = load i8, ptr %y | ||
ret i8 %r | ||
} | ||
|
||
define i32 @test3({{i32,i8},i32}* %x) { | ||
store {{i32,i8},i32} {{i32,i8} { i32 -559038737, i8 186 }, i32 -889275714 }, {{i32,i8},i32}* %x | ||
%y = getelementptr {{i32,i8},i32}, {{i32,i8},i32}* %x, i32 0, i32 1 | ||
%r = load i32, i32* %y | ||
define i32 @test3(ptr %x) { | ||
store {{i32,i8},i32} {{i32,i8} { i32 -559038737, i8 186 }, i32 -889275714 }, ptr %x | ||
%y = getelementptr {{i32,i8},i32}, ptr %x, i32 0, i32 1 | ||
%r = load i32, ptr %y | ||
ret i32 %r | ||
} | ||
|
||
define i16 @test4({{i32,i8},i32}* %x) { | ||
store {{i32,i8},i32} {{i32,i8} { i32 -559038737, i8 186 }, i32 -889275714 }, {{i32,i8},i32}* %x | ||
%y = getelementptr {{i32,i8},i32}, {{i32,i8},i32}* %x, i32 0, i32 0, i32 0 | ||
%z = bitcast i32* %y to i16* | ||
%w = getelementptr i16, i16* %z, i32 2 | ||
%r = load i16, i16* %w | ||
define i16 @test4(ptr %x) { | ||
store {{i32,i8},i32} {{i32,i8} { i32 -559038737, i8 186 }, i32 -889275714 }, ptr %x | ||
%y = getelementptr {{i32,i8},i32}, ptr %x, i32 0, i32 0, i32 0 | ||
%w = getelementptr i16, ptr %y, i32 2 | ||
%r = load i16, ptr %w | ||
ret i16 %r | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
@g7 = constant {[0 x i32], [0 x i8], {}*} { [0 x i32] undef, [0 x i8] undef, {}* null } | ||
@g7 = constant {[0 x i32], [0 x i8], ptr} { [0 x i32] poison, [0 x i8] poison, ptr null } | ||
|
||
define i64* @test_leading_zero_size_elems() { | ||
%v = load i64*, i64** bitcast ({[0 x i32], [0 x i8], {}*}* @g7 to i64**) | ||
ret i64* %v | ||
define ptr @test_leading_zero_size_elems() { | ||
%v = load ptr, ptr @g7 | ||
ret ptr %v | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@g7 = constant {[0 x i32], [0 x i8], {}*} { [0 x i32] undef, [0 x i8] undef, {}* null } | ||
@g7 = constant {[0 x i32], [0 x i8], ptr} { [0 x i32] poison, [0 x i8] poison, ptr null } | ||
|
||
define i64* @test_leading_zero_size_elems() { | ||
ret i64* null | ||
define ptr @test_leading_zero_size_elems() { | ||
ret ptr null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
target datalayout="e-p:64:64:64-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64" | ||
|
||
define i32 @test1({{i32,i8},i32}* %x) { | ||
define i32 @test1(ptr %x) { | ||
; {{ 0xDEADBEEF, 0xBA }, 0xCAFEBABE} | ||
store {{i32,i8},i32} {{i32,i8} { i32 -559038737, i8 186 }, i32 -889275714 }, {{i32,i8},i32}* %x | ||
store {{i32,i8},i32} {{i32,i8} { i32 -559038737, i8 186 }, i32 -889275714 }, ptr %x | ||
ret i32 -889275714 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
target datalayout="e-p:64:64:64-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64" | ||
|
||
define i8 @test2({{i32,i8},i32}* %x) { | ||
store {{i32,i8},i32} {{i32,i8} { i32 -559038737, i8 186 }, i32 -889275714 }, {{i32,i8},i32}* %x | ||
define i8 @test2(ptr %x) { | ||
store {{i32,i8},i32} {{i32,i8} { i32 -559038737, i8 186 }, i32 -889275714 }, ptr %x | ||
ret i8 187 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
target datalayout="e-p:64:64:64-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64" | ||
|
||
define i32 @test3({{i32,i8},i32}* %x) { | ||
store {{i32,i8},i32} {{i32,i8} { i32 -559038737, i8 186 }, i32 -889275714 }, {{i32,i8},i32}* %x | ||
define i32 @test3(ptr %x) { | ||
store {{i32,i8},i32} {{i32,i8} { i32 -559038737, i8 186 }, i32 -889275714 }, ptr %x | ||
ret i32 -559038737 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
define i2 @f({i2, i2}* %x) { | ||
store {i2, i2} {i2 1, i2 2}, {i2, i2}* %x | ||
%y = load {i2, i2}, {i2, i2}* %x | ||
define i2 @f(ptr %x) { | ||
store {i2, i2} {i2 1, i2 2}, ptr %x | ||
%y = load {i2, i2}, ptr %x | ||
%w1 = extractvalue {i2, i2} %y, 0 | ||
%w2 = extractvalue {i2, i2} %y, 1 | ||
%t = add i2 %w1, %w2 | ||
ret i2 %t | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
define i2 @f({i2, i2}* %x) { | ||
store {i2, i2} {i2 1, i2 2}, {i2, i2}* %x | ||
define i2 @f(ptr %x) { | ||
store {i2, i2} {i2 1, i2 2}, ptr %x | ||
ret i2 3 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
@glb = global {i8, i32} undef, align 4 | ||
@glb = global {i8, i32} poison, align 4 | ||
|
||
define i8 @src() { | ||
%p = bitcast {i8, i32}* @glb to i32* | ||
store i32 0, i32* %p, align 4 ; fill padding with 0 | ||
store i32 0, ptr @glb, align 4 ; fill padding with 0 | ||
|
||
%v = load {i8, i32}, {i8, i32}* @glb ;padding should be poison | ||
store {i8, i32} %v, {i8, i32}* @glb, align 4 | ||
%v = load {i8, i32}, ptr @glb ;padding should be poison | ||
store {i8, i32} %v, ptr @glb, align 4 | ||
|
||
%p2 = bitcast {i8, i32}* @glb to i8* | ||
%p3 = getelementptr i8, i8* %p2, i64 1 | ||
%padding = load i8, i8* %p3 | ||
%p3 = getelementptr i8, ptr @glb, i64 1 | ||
%padding = load i8, ptr %p3 | ||
ret i8 %padding | ||
} | ||
|
||
define i8 @tgt() { | ||
%p = bitcast {i8, i32}* @glb to i32* | ||
store i32 0, i32* %p, align 4 | ||
|
||
ret i8 undef | ||
store i32 0, ptr @glb, align 4 | ||
ret i8 poison | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
; ERROR: Value mismatch | ||
|
||
define i32 @src(i32* align(4) %p) { | ||
call void @g(i32* align(2) %p) | ||
%v = load i32, i32* %p, align 4 | ||
define i32 @src(ptr align(4) %p) { | ||
call void @g(ptr align(2) %p) | ||
%v = load i32, ptr %p, align 4 | ||
ret i32 %v | ||
} | ||
|
||
define i32 @tgt(i32* align(4) %p) { | ||
call void @g(i32* align(2) %p) | ||
%v = load i32, i32* %p, align 4 | ||
define i32 @tgt(ptr align(4) %p) { | ||
call void @g(ptr align(2) %p) | ||
%v = load i32, ptr %p, align 4 | ||
ret i32 0 | ||
} | ||
|
||
declare void @g(i32*) | ||
declare void @g(ptr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
; ERROR: Value mismatch | ||
|
||
define i16 @src(i16* align(4) %p) { | ||
%a = load i16, i16* %p, align 1 | ||
%p2 = getelementptr i16, i16* %p, i32 1 | ||
%b = load i16, i16* %p2, align 1 | ||
define i16 @src(ptr align(4) %p) { | ||
%a = load i16, ptr %p, align 1 | ||
%p2 = getelementptr i16, ptr %p, i32 1 | ||
%b = load i16, ptr %p2, align 1 | ||
%x = xor i16 %a, %b | ||
ret i16 %x | ||
} | ||
|
||
define i16 @tgt(i16* align(4) %p) { | ||
define i16 @tgt(ptr align(4) %p) { | ||
ret i16 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.