<commit_before>"""Test that anonymous structs/unions are transparent to member access"""

import os, time
import unittest2
import lldb
from lldbtest import *
import lldbutil

class AnonymousTestCase(TestBase):

    mydir = TestBase.compute_mydir(__file__)

    @dsym_test
    def test_expr_nest_with_dsym(self):
        self.buildDsym()
        self.expr_nest()

    @dsym_test
    def test_expr_child_with_dsym(self):
        self.buildDsym()
        self.expr_child()

    @dsym_test
    def test_expr_grandchild_with_dsym(self):
        self.buildDsym()
        self.expr_grandchild()

    @dsym_test
    def test_expr_parent_with_dsym(self):
        self.buildDsym()
        self.expr_parent()

    @dsym_test
    def test_expr_null_with_dsym(self):
        self.buildDsym()
        self.expr_null()

    @dsym_test
    def test_child_by_name_with_dsym(self):
        self.buildDsym()
        self.child_by_name()

    @skipIfIcc # llvm.org/pr15036: LLDB generates an incorrect AST layout for an anonymous struct when DWARF is generated by ICC
    @dwarf_test
    def test_expr_nest_with_dwarf(self):
        self.buildDwarf()
        self.expr_nest()

    @dwarf_test
    def test_expr_child_with_dwarf(self):
        self.buildDwarf()
        self.expr_child()

    @skipIfIcc # llvm.org/pr15036: This particular regression was introduced by r181498
    @dwarf_test
    def test_expr_grandchild_with_dwarf(self):
        self.buildDwarf()
        self.expr_grandchild()

    @dwarf_test
    def test_expr_parent_with_dwarf(self):
        self.buildDwarf()
        self.expr_parent()

    @expectedFailureFreeBSD('llvm.org/pr21550')
    @expectedFailureWindows('llvm.org/pr21550')
    @dwarf_test
    def test_expr_null_with_dwarf(self):
        self.buildDwarf()
        self.expr_null()

    @dwarf_test
    def test_child_by_name_with_dwarf(self):
        self.buildDwarf()
        self.child_by_name()

    def setUp(self):
        # Call super's setUp().
        TestBase.setUp(self)
        # Find the line numbers to break in main.c.
        self.source = 'main.c'
        self.line0 = line_number(self.source, '// Set breakpoint 0 here.')
        self.line1 = line_number(self.source, '// Set breakpoint 1 here.')
        self.line2 = line_number(self.source, '// Set breakpoint 2 here.')

    def common_setup(self, line):
        
        # Set debugger into synchronous mode
        self.dbg.SetAsync(False)

        # Create a target
        exe = os.path.join(os.getcwd(), "a.out")
        target = self.dbg.CreateTarget(exe)<commit_msg>Remove expectedFailureFreeBSD from passing test_expr_null_with_dwarf<commit_after>"""Test that anonymous structs/unions are transparent to member access"""

import os, time
import unittest2
import lldb
from lldbtest import *
import lldbutil

class AnonymousTestCase(TestBase):

    mydir = TestBase.compute_mydir(__file__)

    @dsym_test
    def test_expr_nest_with_dsym(self):
        self.buildDsym()
        self.expr_nest()

    @dsym_test
    def test_expr_child_with_dsym(self):
        self.buildDsym()
        self.expr_child()

    @dsym_test
    def test_expr_grandchild_with_dsym(self):
        self.buildDsym()
        self.expr_grandchild()

    @dsym_test
    def test_expr_parent_with_dsym(self):
        self.buildDsym()
        self.expr_parent()

    @dsym_test
    def test_expr_null_with_dsym(self):
        self.buildDsym()
        self.expr_null()

    @dsym_test
    def test_child_by_name_with_dsym(self):
        self.buildDsym()
        self.child_by_name()

    @skipIfIcc # llvm.org/pr15036: LLDB generates an incorrect AST layout for an anonymous struct when DWARF is generated by ICC
    @dwarf_test
    def test_expr_nest_with_dwarf(self):
        self.buildDwarf()
        self.expr_nest()

    @dwarf_test
    def test_expr_child_with_dwarf(self):
        self.buildDwarf()
        self.expr_child()

    @skipIfIcc # llvm.org/pr15036: This particular regression was introduced by r181498
    @dwarf_test
    def test_expr_grandchild_with_dwarf(self):
        self.buildDwarf()
        self.expr_grandchild()

    @dwarf_test
    def test_expr_parent_with_dwarf(self):
        self.buildDwarf()
        self.expr_parent()

    @expectedFailureWindows('llvm.org/pr21550')
    @dwarf_test
    def test_expr_null_with_dwarf(self):
        self.buildDwarf()
        self.expr_null()

    @dwarf_test
    def test_child_by_name_with_dwarf(self):
        self.buildDwarf()
        self.child_by_name()

    def setUp(self):
        # Call super's setUp().
        TestBase.setUp(self)
        # Find the line numbers to break in main.c.
        self.source = 'main.c'
        self.line0 = line_number(self.source, '// Set breakpoint 0 here.')
        self.line1 = line_number(self.source, '// Set breakpoint 1 here.')
        self.line2 = line_number(self.source, '// Set breakpoint 2 here.')

    def common_setup(self, line):
        
        # Set debugger into synchronous mode
        self.dbg.SetAsync(False)

        # Create a target
        exe = os.path.join(os.getcwd(), "a.out")
        target = self.dbg.CreateTarget(exe)
{'fraction_non_alphanumeric': 0.09321868282196599, 'fraction_numerical': 0.011921047488762947, 'mean_word_length': 2.7521994134897363, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3817490', 'n_tokens_mistral': 1784, 'n_tokens_neox': 1695, 'n_words': 332}