Pointer fixes/improvements.

Allow <, <=, >, >= comparisons of pointers
Allow explicit type-casting of pointers to and from integers
Fix bug in handling expressions of the form "int + ptr" ("ptr + int"
  was fine).
Fix a bug in TypeCastExpr where varying -> uniform typecasts
  would be allowed (leading to a crash later)
This commit is contained in:
Matt Pharr
2011-11-29 13:22:36 -08:00
parent 4ca90272ba
commit e52104ff55
15 changed files with 235 additions and 40 deletions

View File

@@ -0,0 +1,4 @@
// Function can't have both "task" and "export" qualifiers
export task void foo() {
}

View File

@@ -0,0 +1,6 @@
// Pointer type cast of type "int32 * uniform" to integer type "uniform int32" may lose information.
int32 foo(int * uniform x) {
return (int32) x;
}

View File

@@ -0,0 +1,6 @@
// Can't type cast from varying type "int32" to uniform type "uniform int32"
uniform int foo(int x) {
return (uniform int) x;
}