Rebase
[platform/upstream/libffi.git] / testsuite / lib / libffi.exp
similarity index 85%
rename from testsuite/lib/.svn/text-base/libffi-dg.exp.svn-base
rename to testsuite/lib/libffi.exp
index bd5a7c8..82d6652 100644 (file)
@@ -272,6 +272,56 @@ proc dg-xfail-if { args } {
     }
 }
 
+proc check-flags { args } {
+
+    # The args are within another list; pull them out.
+    set args [lindex $args 0]
+
+    # The next two arguments are optional.  If they were not specified,
+    # use the defaults.
+    if { [llength $args] == 2 } {
+       lappend $args [list "*"]
+    }
+    if { [llength $args] == 3 } {
+       lappend $args [list ""]
+    }
+
+    # If the option strings are the defaults, or the same as the
+    # defaults, there is no need to call check_conditional_xfail to
+    # compare them to the actual options.
+    if { [string compare [lindex $args 2] "*"] == 0
+        && [string compare [lindex $args 3] "" ] == 0 } {
+       set result 1    
+    } else {
+       # The target list might be an effective-target keyword, so replace
+       # the original list with "*-*-*", since we already know it matches.
+       set result [check_conditional_xfail [lreplace $args 1 1 "*-*-*"]]
+    }
+
+    return $result
+}
+
+proc dg-skip-if { args } {
+    # Verify the number of arguments.  The last two are optional.
+    set args [lreplace $args 0 0]
+    if { [llength $args] < 2 || [llength $args] > 4 } {
+        error "dg-skip-if 2: need 2, 3, or 4 arguments"
+    }
+
+    # Don't bother if we're already skipping the test.
+    upvar dg-do-what dg-do-what
+    if { [lindex ${dg-do-what} 1] == "N" } {
+      return
+    }
+
+    set selector [list target [lindex $args 1]]
+    if { [dg-process-target $selector] == "S" } {
+        if [check-flags $args] {
+            upvar dg-do-what dg-do-what
+            set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+        }
+    }
+}
 
 # We need to make sure that additional_files and additional_sources
 # are both cleared out after every test.  It is not enough to clear