Skip to content

Commit

Permalink
disasm-test: Add opaque pointer test cases
Browse files Browse the repository at this point in the history
See #177.
  • Loading branch information
RyanGlScott committed May 4, 2023
1 parent 1b8b25b commit e6be75c
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 0 deletions.
4 changes: 4 additions & 0 deletions disasm-test/tests/opaque-atomicrmw.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
define void @atomicrmw(ptr %a, i32 %i) {
%b = atomicrmw add ptr %a, i32 %i acquire
ret void
}
4 changes: 4 additions & 0 deletions disasm-test/tests/opaque-atomicrmw.pre-llvm15.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SKIP_TEST

This test case requires the use of opaque pointers, which are most easily
usable with LLVM 15 or later.
11 changes: 11 additions & 0 deletions disasm-test/tests/opaque-call.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
define void @f(i32 %x) {
ret void
}

define void @g() {
%p = alloca ptr
store ptr @f, ptr %p
%f = load ptr, ptr %p
call void (i32) %f(i32 42)
ret void
}
4 changes: 4 additions & 0 deletions disasm-test/tests/opaque-call.pre-llvm15.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SKIP_TEST

This test case requires the use of opaque pointers, which are most easily
usable with LLVM 15 or later.
9 changes: 9 additions & 0 deletions disasm-test/tests/opaque-constant-getelementptr.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
%struct.RT = type { i8, [10 x [20 x i32]], i8 }
%struct.ST = type { i32, double, %struct.RT }

@.s = private constant %struct.ST zeroinitializer

define ptr @foo() {
entry:
ret ptr getelementptr inbounds (%struct.ST, ptr @.s, i64 1, i32 2, i32 1, i64 5, i64 13)
}
4 changes: 4 additions & 0 deletions disasm-test/tests/opaque-constant-getelementptr.pre-llvm15.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SKIP_TEST

This test case requires the use of opaque pointers, which are most easily
usable with LLVM 15 or later.
8 changes: 8 additions & 0 deletions disasm-test/tests/opaque-getelementptr.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
%struct.RT = type { i8, [10 x [20 x i32]], i8 }
%struct.ST = type { i32, double, %struct.RT }

define ptr @foo(ptr %s) {
entry:
%arrayidx = getelementptr inbounds %struct.ST, ptr %s, i64 1, i32 2, i32 1, i64 5, i64 13
ret ptr %arrayidx
}
4 changes: 4 additions & 0 deletions disasm-test/tests/opaque-getelementptr.pre-llvm15.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SKIP_TEST

This test case requires the use of opaque pointers, which are most easily
usable with LLVM 15 or later.

0 comments on commit e6be75c

Please sign in to comment.